/* 像素作品頁：整頁像素風（淺藍點陣底、像素視窗、俐方體） */
.pixel-page {
  --ink: #3d2c1c; --ink-soft: #6e5a46;
  --paper: #fbf7ea; --paper-2: #f3ecda;
  --blue: #8fc1d6; --blue-d: #4f86a3;
  --rose: #e8968e; --rose-d: #b9605a;
  --yellow: #efd27a; --yellow-d: #b8913a;
  --pink: #e06c7d; --peach: #f7d6b0;
  color: var(--ink);
  background-color: #cfe7ef;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 2px, transparent 2px);
  background-size: 32px 32px;
}

.pmain { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.phead { padding: 64px 0 24px; }
.phead h1 { font: 44px/1.1 var(--pixel); margin: 0 0 14px; }
.phead p { margin: 0; font: 17px/1.8 var(--pixel); color: var(--ink-soft); }
.pjump { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.block { padding: 48px 0; }
.sec-title { font: 30px/1.2 var(--pixel); margin: 0 0 10px; display: flex; align-items: center; gap: 14px; }
.sec-title b { font: 15px/1 var(--pixel); color: #fff; background: var(--ink); padding: 8px 9px; }
.sec-sub { font: 16px/1.8 var(--pixel); color: var(--ink-soft); margin: 0 0 22px; }

/* 像素視窗 */
.win {
  --frame: var(--blue); --frame-d: var(--blue-d);
  background: var(--frame); border: 4px solid var(--frame-d);
  box-shadow: 6px 6px 0 rgba(61, 44, 28, 0.2); padding: 0 8px 8px;
}
.win-rose { --frame: var(--rose); --frame-d: var(--rose-d); }
.win-yellow { --frame: var(--yellow); --frame-d: var(--yellow-d); }
.win-bar { display: flex; align-items: center; gap: 6px; height: 38px; color: #fff; font: 15px/1 var(--pixel); text-shadow: 2px 2px 0 var(--frame-d); }
.win-bar span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.win-bar i { width: 18px; height: 18px; background: var(--paper); border: 3px solid var(--frame-d); }
.win-body { background: var(--paper); border: 4px solid var(--frame-d); }

.pbtn {
  display: inline-block; font: 15px/1 var(--pixel); color: var(--ink); text-decoration: none;
  background: var(--paper); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  padding: 10px 14px; cursor: pointer;
}
.pbtn:hover { background: var(--peach); }
.pbtn:active { transform: translate(3px, 3px); box-shadow: none; }
.pbtn.is-on { background: var(--ink); color: var(--paper); }

/* 像素 V 皮短片 */
.vskins { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.vskin .win-body { aspect-ratio: 1 / 1; overflow: hidden; }
.vskin video { width: 100%; height: 100%; display: block; object-fit: cover; }

/* 房間作品牆 */
.filters { display: flex; gap: 10px; margin-bottom: 20px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.card {
  display: flex; flex-direction: column; text-align: left;
  background: var(--paper); border: 4px solid var(--ink); box-shadow: 5px 5px 0 rgba(61, 44, 28, 0.2);
  padding: 12px; cursor: zoom-in; font: inherit; color: inherit;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 rgba(61, 44, 28, 0.24); }
/* 所有房間用同一個像素比例：以 360×312 畫布裡最寬的 313 像素為一格的寬 */
.card .thumb { aspect-ratio: 313 / 312; display: flex; align-items: center; justify-content: center; }
.card .thumb .room-wrap { position: relative; display: block; }
.card .thumb .room-wrap > img:first-child { display: block; width: 100%; height: auto; max-width: none; max-height: none; }
.card.wide { grid-column: span 2; }
.card.wide .thumb { aspect-ratio: 626 / 312; }
@media (max-width: 600px) { .card.wide { grid-column: auto; } .card.wide .thumb { aspect-ratio: 313 / 312; } }
.card img { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.card .cap { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.card .cap b { font: 15px/1.2 var(--pixel); font-weight: 400; }
.card .cap small { font: 12px/1 var(--pixel); color: var(--ink-soft); white-space: nowrap; }

/* 角色走路圖：直接用遊戲的 player.png（4 方向 × 3 步），四個方向輪流走 */
.walker { display: flex; align-items: center; justify-content: center; }
.walker span {
  width: 128px; height: 128px; image-rendering: pixelated;
  background: url("../assets/room/player.png") 0 0 / 512px 384px no-repeat;
  animation: walkSteps 0.6s steps(1) infinite, walkDirs 4.8s steps(1) infinite;
}
@keyframes walkSteps { 0% { background-position-y: -128px; } 25% { background-position-y: 0; } 50% { background-position-y: -256px; } 75% { background-position-y: 0; } }
@keyframes walkDirs { 0% { background-position-x: 0; } 25% { background-position-x: -128px; } 50% { background-position-x: -384px; } 75% { background-position-x: -256px; } }
@media (prefers-reduced-motion: reduce) { .walker span { animation: none; } }

/* 委託價格 */
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: stretch; }
.price-win { display: flex; flex-direction: column; }
.price-win .win-body { flex: 1; display: flex; flex-direction: column; }
.price-win .addons { margin-top: 0; }
.price-body { padding: 20px 22px 22px; font-family: var(--pixel); }
.price-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 3px dashed #c9b896; }
.price-name { margin: 0 0 6px; font: 18px/1.3 var(--pixel); }
.price-num { margin: 0; font: 44px/1 var(--pixel); color: var(--pink); }
.price-num small { font-size: 18px; margin-right: 4px; color: var(--ink); }
.emo-vid { width: 150px; height: 150px; flex: none; border: 0; background: transparent; object-fit: contain; }
.price-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.price-body dl { margin: 0 0 14px; }
.price-body dt { display: inline-block; font: 15px/1 var(--pixel); color: #fff; background: var(--ink); padding: 6px 8px; margin-bottom: 8px; }
.price-body dd { margin: 0 0 6px; font: 14px/1.6 var(--pixel); color: var(--ink-soft); }
.price-body dd em { font-style: normal; color: var(--pink); }
.addon-note { margin: auto 0 6px; font: 13px/1.4 var(--pixel); color: var(--pink); }
.addons { list-style: none; margin: 0; padding: 0; border-top: 3px solid var(--ink); }
.addons li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px; border-bottom: 2px dashed #c9b896; font: 15px/1.4 var(--pixel); }
.addons b { font-weight: 400; color: var(--pink); white-space: nowrap; }
.try { margin-top: 16px; }
.price-more { margin: 22px 0 0; font: 15px var(--pixel); color: var(--ink-soft); }
.price-more a { color: var(--pink); }
@media (max-width: 960px) { .prices { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .price-cols { grid-template-columns: 1fr; } .emo-vid { width: 110px; height: 110px; } .price-num { font-size: 36px; } }

.room-note { background: var(--paper); border: 4px solid var(--ink); box-shadow: 6px 6px 0 rgba(61, 44, 28, 0.2); padding: 20px 24px; }
.room-note h3 { font: 20px/1.3 var(--pixel); margin: 0 0 8px; }

/* 最後的聯絡區：像素視窗 */
.pixel-page .page-contact { max-width: 1000px; margin: 24px auto 64px; padding: 40px 24px 44px; background: var(--paper); border: 4px solid var(--ink); box-shadow: 8px 8px 0 rgba(61, 44, 28, 0.2); }
.pixel-page .page-contact h2 { font: 30px/1.2 var(--pixel); }
.pixel-page .page-contact p { font: 15px/1.8 var(--pixel); color: var(--ink-soft); }
.pixel-page .contact-links a { border-radius: 0; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); font-family: var(--pixel); }
.pixel-page .contact-links a:hover { background: var(--peach); }
.pixel-page .contact-links .ico { border-radius: 0; --ico-bg: var(--pink); background: var(--pink); }
.pixel-page .contact-links b { font-weight: 400; }
.pixel-page .flow-link a { color: var(--pink); }

/* 大圖 */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(30, 24, 16, 0.88); }
.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 48px 64px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); width: auto; height: auto; background: var(--paper); border: 4px solid var(--paper); }
.lightbox figcaption { font: 17px var(--pixel); color: #fff; }
.lb-btn, .lb-close { position: fixed; font: 20px var(--pixel); color: var(--ink); background: var(--paper); border: 3px solid var(--ink); width: 46px; height: 46px; cursor: pointer; }
.lb-prev { left: 14px; top: 50%; } .lb-next { right: 14px; top: 50%; } .lb-close { right: 14px; top: 14px; }

@media (max-width: 960px) {
}
@media (max-width: 560px) {
  .pmain { padding: 0 16px; }
  .phead h1 { font-size: 34px; }
  .sec-title { font-size: 24px; }
  .lightbox figure { padding: 56px 12px; }
}

/* 小遊戲黃、V 皮藍 */
.pixel-page .band-room { margin: 0; padding: 32px; border: 4px solid var(--yellow-d); box-shadow: 8px 8px 0 rgba(61, 44, 28, 0.18); }
.sec-yellow b { background: var(--yellow-d); }
.sec-blue b { background: var(--blue-d); }
.pbtn-yellow { background: var(--yellow) !important; }
.pbtn-blue { background: var(--blue) !important; color: #fff !important; }
@media (max-width: 760px) { .pixel-page .band-room { padding: 16px; } }

/* V 皮主介紹 */
.vskin-hero {
  display: grid; grid-template-columns: minmax(0, 520px) 1fr; gap: 36px; align-items: center; margin: 0 0 40px; padding: 32px;
  background-color: #a9d3e6;
  background-image: linear-gradient(rgba(255, 255, 255, 0.35) 2px, transparent 2px), linear-gradient(90deg, rgba(255, 255, 255, 0.35) 2px, transparent 2px);
  background-size: 32px 32px; border: 4px solid var(--blue-d); box-shadow: 8px 8px 0 rgba(61, 44, 28, 0.18);
}
.vh-stage { position: relative; aspect-ratio: 798 / 846; overflow: hidden; filter: drop-shadow(6px 6px 0 rgba(61, 44, 28, 0.2)); }
.vh-room { display: block; width: 100%; height: auto; }
/* 角色：預設站在左下地毯旁的空地（房間原始像素 266×282 換算） */
.vh-char { position: absolute; left: 18%; top: 72.5%; width: 20.2%; aspect-ratio: 330 / 314; background: no-repeat 0 0 / 900% 800%; image-rendering: pixelated; cursor: grab; touch-action: none; user-select: none; }
.vh-char.is-drag { cursor: grabbing; filter: drop-shadow(2px 4px 0 rgba(61, 44, 28, 0.25)); }
.vh-info h3 { font: 28px/1.3 var(--pixel); margin: 0 0 12px; }
.vh-info p { margin: 0 0 18px; }
.vh-tag { display: inline-block; font: 14px/1 var(--pixel); color: #fff; background: var(--blue-d); padding: 7px 10px; margin: 0 0 14px !important; }
.vh-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.vh-btns .pbtn.is-on { background: var(--blue) !important; color: #fff; }
@media (max-width: 760px) { .vskin-hero { grid-template-columns: 1fr; gap: 20px; padding: 16px; } }
/* BIPU 待機：模型本身動作小，整隻再加一點左右晃、上下彈 */
.vh-char { animation: vhIdle 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
.vh-char.is-drag { animation-play-state: paused; }
@keyframes vhIdle {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-3%, -4%) rotate(-3deg); }
  50% { transform: translate(0, 0) rotate(0deg); }
  75% { transform: translate(3%, -4%) rotate(3deg); }
}
