/* =====================================================================
   독도 수비대 — 미니게임 화면
   ===================================================================== */
#gameRoot { flex: 1; display: flex; flex-direction: column; }
.game { position: relative; display: flex; flex-direction: column; gap: 10px; width: min(980px, 100%); margin: 0 auto; flex: 1; }
.g-hud { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-height: 46px; }
.g-pill { font-family: var(--head); font-size: 24px; background: rgba(255,255,255,.94); color: var(--sea-dark); padding: 6px 16px; border-radius: 999px; box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.g-pill.bump { animation: pop .3s; }
.g-time.hurry { background: #ffe0dc; color: var(--bad); animation: pop .5s infinite; }
.g-hearts { letter-spacing: 2px; }
.g-combo { font-family: var(--head); font-size: 30px; color: #fff; text-shadow: 0 3px 0 #e05a00, 0 0 12px rgba(255,120,0,.8); }
.g-combo.pop { animation: comboPop .45s; }
@keyframes comboPop { 0% { transform: scale(.4) rotate(-8deg); } 60% { transform: scale(1.3) rotate(4deg); } 100% { transform: scale(1); } }

.g-banner { min-height: 56px; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-size: calc(var(--fs) + 4px); text-align: center; padding: 10px 16px; border-radius: 16px; border: 4px solid #fff; background: var(--paper); color: var(--ink); animation: pop .3s; word-break: keep-all; }
.g-banner.off { visibility: hidden; animation: none; }
.g-banner.ask { background: #fff1c7; color: var(--wood-dark); }
.g-banner.good { background: #dcf6e6; color: #145c33; }
.g-banner.bad { background: #ffe3e0; color: #9b1f16; }
.g-banner.fact { background: #e3f1ff; color: var(--sea-dark); font-size: calc(var(--fs) + 1px); }

.g-stage { position: relative; height: clamp(250px, calc(var(--vh) - 390px), 560px); border-radius: 24px; border: 5px solid #fff; overflow: hidden; box-shadow: 0 8px 0 rgba(0,0,0,.2); background: #2f9be8; user-select: none; -webkit-user-select: none; }
.g-stage canvas { display: block; touch-action: none; -webkit-user-select: none; user-select: none; }
.game { -webkit-touch-callout: none; }
.g-stage.shake { animation: shake .35s; }
.g-controls { display: flex; justify-content: center; gap: 18px; }
.g-controls:empty { display: none; }
.g-dir { min-width: 140px; min-height: 76px; font-size: 36px; touch-action: none; }

.g-pop { position: absolute; transform: translate(-50%, -50%); font-family: var(--head); font-size: 28px; color: #fff; pointer-events: none; text-shadow: 0 2px 0 rgba(0,0,0,.4); animation: rise .95s ease-out forwards; white-space: nowrap; z-index: 5; }
.g-pop.gold { color: #ffe066; text-shadow: 0 2px 0 #b06d00, 0 0 10px rgba(255,200,0,.7); }
.g-pop.bad { color: #fff; background: var(--bad); padding: 2px 12px; border-radius: 999px; font-size: 22px; }
@keyframes rise { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -170%) scale(1); } }

.g-overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(5,40,80,.45); border-radius: 24px; padding: 12px; }
.g-overlay.hidden { display: none; }
.g-overlay.full { position: fixed; z-index: 60; border-radius: 0; background: rgba(5,40,80,.6); }
.g-overlay.full .g-card { max-height: calc(var(--vh) - 24px); }
.g-card { position: relative; background: var(--paper); border: 5px solid var(--wood); border-radius: 28px; padding: 24px 26px; width: min(600px, 100%); text-align: center; box-shadow: 0 8px 0 rgba(0,0,0,.25); animation: pop .35s; max-height: 100%; overflow: auto; }
.g-card h2 { font-family: var(--head); font-weight: 400; font-size: 36px; margin: 0 0 8px; color: var(--sea-dark); }
.g-card p { margin: 6px 0; line-height: 1.5; word-break: keep-all; }
.g-how { font-size: calc(var(--fs) - 1px); }
.g-card .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.g-card .big-stars { font-size: 64px; }
.g-final b { font-family: var(--head); font-size: 1.4em; color: var(--sun-dark); }
.g-count { font-family: var(--head); font-size: 140px; color: #fff; text-shadow: 0 8px 0 var(--sea-dark), 0 0 30px rgba(255,255,255,.6); }
.g-count.pop { animation: comboPop .45s; }

/* 2장 카드 짝 맞추기 */
.g-memory { display: grid; place-items: center; padding: 14px; background: linear-gradient(rgba(8,70,125,.55), rgba(8,70,125,.7)), url(assets/img/chapter/ch2.jpg) center / cover; }
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; height: 100%; }
.mem-card { perspective: 800px; border: 0; background: none; padding: 0; min-height: 0; font-family: var(--head); }
.mem-in { position: relative; display: block; width: 100%; height: 100%; transition: transform .4s; transform-style: preserve-3d; }
.mem-card.open .mem-in, .mem-card.matched .mem-in { transform: rotateY(180deg); }
.mem-back, .mem-front { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 16px; border: 4px solid #fff; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 5px 0 rgba(0,0,0,.2); }
.mem-back { background: repeating-linear-gradient(45deg, #c08a4e 0 12px, #a8743f 12px 24px); font-size: 40px; }
.mem-front { transform: rotateY(180deg); background: var(--paper); color: var(--ink); font-size: calc(var(--fs) + 2px); padding: 6px; line-height: 1.25; word-break: keep-all; }
.mem-grid.many .mem-front { font-size: calc(var(--fs) - 2px); }
.mem-card.matched .mem-front { background: #c9f2d8; border-color: #ffe066; }
.mem-card.matched { animation: pop .4s; }

/* 4장 쓰레기 줍기 */
.g-cleanup { background: linear-gradient(rgba(10,80,160,.62), rgba(6,47,87,.72)), url(assets/img/chapter/ch4.jpg) center / cover; }
.bubbles { position: absolute; inset: 0; background: radial-gradient(circle at 20% 80%, rgba(255,255,255,.25) 0 6px, transparent 7px), radial-gradient(circle at 70% 60%, rgba(255,255,255,.2) 0 4px, transparent 5px), radial-gradient(circle at 45% 30%, rgba(255,255,255,.18) 0 5px, transparent 6px); background-size: 220px 220px; animation: bubbleUp 6s linear infinite; }
@keyframes bubbleUp { to { background-position: 0 -220px; } }
.cl-item { position: absolute; width: 80px; height: 80px; border-radius: 50%; border: 4px solid #fff; background: radial-gradient(circle at 35% 30%, #ffffff, #dff1ff); box-shadow: 0 5px 0 rgba(0,0,0,.28); font-size: 46px; line-height: 1; display: grid; place-items: center; animation: bob 1s ease-in-out infinite alternate, appear .2s; touch-action: none; }
.cl-item.got { animation: gotIt .35s forwards; }
.cl-item.ouch { background: rgba(226,70,59,.6); animation: shake .35s; }
.cl-item.bye { opacity: 0; transition: opacity .3s; }
@keyframes bob { from { transform: translateY(-4px) rotate(-6deg); } to { transform: translateY(5px) rotate(6deg); } }
@keyframes appear { from { transform: scale(0); } }
@keyframes gotIt { to { transform: scale(1.6) rotate(25deg); opacity: 0; } }
.dex { margin-top: 10px; }
.dex h3 { font-family: var(--head); font-weight: 400; margin: 6px 0; color: var(--ok); font-size: 24px; }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.dex-card { background: #fff; border: 3px solid #cfe8d6; border-radius: 14px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; animation: pop .4s backwards; }
.dex-card:nth-child(2) { animation-delay: .1s; }
.dex-card:nth-child(3) { animation-delay: .2s; }
.dex-card:nth-child(4) { animation-delay: .3s; }
.dex-card:nth-child(5) { animation-delay: .4s; }
.dex-ic { font-size: 34px; }
.dex-card b { font-family: var(--head); font-weight: 400; font-size: 17px; }
.dex-card small { font-size: 13px; color: #555; line-height: 1.3; word-break: keep-all; }

/* 5장 지도 · 6장 연표: 끌어다 놓기 */
.g-map, .g-timeline { height: auto; min-height: clamp(280px, calc(var(--vh) - 390px), 560px); background: #e8f6ff; padding: 10px; display: flex; flex-direction: column; gap: 10px; overflow: visible; }
.g-timeline { background: linear-gradient(rgba(255,250,240,.82), rgba(255,250,240,.9)), url(assets/img/chapter/ch6.jpg) center / cover; }
.map-wrap { position: relative; width: min(100%, 860px, calc((var(--vh) - 360px) * 1.6)); min-width: min(100%, 420px); margin: 0 auto; aspect-ratio: 8 / 5; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 16px; }
.slot { border: 3px dashed #fff; background: rgba(255,255,255,.35); border-radius: 12px; transition: background .15s, transform .15s; cursor: pointer; }
.slot.over { background: rgba(255,224,102,.85); transform: scale(1.08); }
.slot.nope { animation: shake .35s; background: rgba(226,70,59,.6); }
.slot.filled { border: 3px solid #fff; background: var(--ok); color: #fff; cursor: default; animation: pop .35s; }
.map-slot { position: absolute; transform: translate(-50%, -50%); width: 14%; min-height: 9%; display: grid; place-items: center; font-family: var(--head); font-size: clamp(13px, 2.1vw, 20px); padding: 2px 4px; text-align: center; }
.map-slot.over { transform: translate(-50%, -50%) scale(1.08); }
.map-slot.nope { animation: none; background: rgba(226,70,59,.75); }
.tray { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; min-height: 64px; padding: 6px; }
.chip { font-size: calc(var(--fs) + 2px); padding: 10px 18px; min-height: 58px; border-radius: 16px; border: 4px solid #fff; background: linear-gradient(#ffd25a, #f39a10); color: #4a2a00; box-shadow: 0 5px 0 rgba(0,0,0,.2); touch-action: none; cursor: grab; display: inline-flex; align-items: center; gap: 6px; }
.chip.sel { outline: 5px solid var(--sea); transform: translateY(-4px) scale(1.05); }
.chip.dragging { opacity: .3; }
.chip.nope { animation: shake .35s; }
.chip.ghost { position: fixed; z-index: 300; pointer-events: none; transform: translate(-50%, -50%) scale(1.1) rotate(-3deg); box-shadow: 0 12px 20px rgba(0,0,0,.3); }
.chip .ic { font-size: 1.2em; }


/* 7장 리듬 O/X */
.g-rhythm { background: linear-gradient(rgba(10,10,40,.15), rgba(10,10,40,.35)), url(assets/img/game/stage.jpg) center / cover; }
.g-rhythm.beat::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.08); animation: flash .3s forwards; pointer-events: none; }
@keyframes flash { to { opacity: 0; } }
.rh-line { position: absolute; left: 4%; right: 4%; top: 78%; height: 10px; border-radius: 5px; background: #ffe066; box-shadow: 0 0 18px #ffe066, 0 0 40px rgba(255,224,102,.6); }
.rh-note { position: absolute; left: 50%; width: min(80%, 620px); transform: translate(-50%, -50%); background: #fff; color: #2b1f5e; border-radius: 20px; border: 5px solid #b9a6ff; padding: 14px 18px; text-align: center; font-family: var(--head); font-size: calc(var(--fs) + 4px); word-break: keep-all; box-shadow: 0 6px 0 rgba(0,0,0,.3); }
.rh-note.near { border-color: #ffe066; box-shadow: 0 0 0 6px rgba(255,224,102,.5), 0 6px 0 rgba(0,0,0,.3); }
.rh-note.hit { animation: noteHit .4s forwards; }
.rh-note.wrong { background: #ffd2cd; border-color: var(--bad); opacity: .85; }
@keyframes noteHit { to { transform: translate(-50%, -50%) scale(1.3); opacity: 0; } }
.rh-judge { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); font-family: var(--head); font-size: 46px; color: #fff; opacity: 0; pointer-events: none; white-space: nowrap; text-shadow: 0 4px 0 rgba(0,0,0,.35); z-index: 3; }
.rh-judge.show { animation: judge .7s forwards; }
.rh-judge.perfect { color: #ffe066; text-shadow: 0 0 20px #ffb800, 0 4px 0 #a86a00; }
.rh-judge.great { color: #7be3a4; }
.rh-judge.good { color: #9fd8ff; }
.rh-judge.miss { color: #ff9b91; font-size: 34px; }
@keyframes judge { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -90%) scale(1); } }
.rh-btn { flex: 1; max-width: 300px; min-height: 96px; font-size: 54px; border-radius: 24px; border: 5px solid #fff; box-shadow: 0 8px 0 rgba(0,0,0,.3); touch-action: none; }
.rh-btn.o { background: linear-gradient(#5cb6ff, #1a62c6); }
.rh-btn.x { background: linear-gradient(#ff8a7e, #d93a2f); }
.rh-btn.hit { animation: press .2s; }
@keyframes press { 50% { transform: translateY(6px) scale(.96); box-shadow: 0 2px 0 rgba(0,0,0,.3); } }

/* 결과 화면의 게임/문제 별 */
.split { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 4px 0 8px; font-family: var(--head); }
.split span { background: #fff; border-radius: 999px; padding: 4px 14px; }
.split small { font-family: var(--body); }
.streak { font-style: normal; color: #e05a00; animation: comboPop .45s; display: inline-block; }

/* 답지 안의 게임 정답 */
.k-sub { font-family: var(--head); font-weight: 400; margin: 6px 18px 4px; color: var(--sea-dark); font-size: 20px; }
.k-game { margin: 0 18px 8px 32px; padding: 0; font-size: 16px; }
.k-game li { padding: 3px 0; }

/* 팡! 터지는 조각 */
.burst { position: fixed; z-index: 210; pointer-events: none; width: 0; height: 0; }
.burst i { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; animation: burstOut .7s cubic-bezier(.1,.8,.3,1) forwards; }
@keyframes burstOut { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

/* 게임 안내 카드: 챕터 그림 띠 */
.g-card .g-hero { width: calc(100% + 52px); margin: -24px -26px 10px; height: clamp(70px, calc(var(--vh) * .16), 170px); object-fit: cover; border-radius: 22px 22px 0 0; }

/* 폭죽 */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti i { position: absolute; top: -24px; width: 11px; height: 17px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(900deg); } }

/* 세로 태블릿: 게임판을 세로로 더 길게 */
@media (orientation: portrait) and (min-width: 600px) {
  .g-stage { height: clamp(300px, calc(var(--vh) - 440px), 860px); }
  .g-map, .g-timeline { height: auto; }
}
@media (max-width: 680px) {
  .g-stage { height: clamp(300px, 56vh, 520px); }
  .g-pill { font-size: 19px; padding: 4px 12px; }
  .g-dir { min-width: 110px; }
  .mem-grid { gap: 7px; }
  .mem-grid.many { grid-template-columns: repeat(3, 1fr); }
  .chip { font-size: 18px; padding: 8px 12px; min-height: 50px; }
  .cl-item { width: 64px; height: 64px; font-size: 38px; }
  .rh-btn { min-height: 80px; font-size: 44px; }
  .g-count { font-size: 100px; }
}

/* =====================================================================
   업그레이드: 피버 타임 · 진행 막대 · 바다 청소 · 카드 대결
   ===================================================================== */
.g-prog { display: inline-flex; align-items: center; gap: 8px; flex: 1; min-width: 150px; max-width: 360px; }
.g-prog .pi { font-size: 22px; }
.g-prog .bar { flex: 1; height: 16px; border-radius: 999px; background: #dce8f3; overflow: hidden; }
.g-prog .bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #5ed68f, #22a05a); transition: width .25s; }
.game.fever .g-prog .bar i { background: linear-gradient(90deg, #ffd34d, #ff6b5b); }

.g-fever { font-family: var(--head); font-size: 22px; color: #fff; padding: 6px 16px; border-radius: 999px; background: linear-gradient(90deg, #ff6b5b, #ffb43b); box-shadow: 0 3px 0 rgba(0,0,0,.2); animation: feverBlink .35s ease-in-out infinite alternate; }
@keyframes feverBlink { to { transform: scale(1.08); filter: brightness(1.15); } }
.game.fever .g-stage { border-color: #ffd34d; animation: feverGlow .45s ease-in-out infinite alternate; }
@keyframes feverGlow { from { box-shadow: 0 0 0 4px rgba(255,211,77,.8), 0 0 26px 6px rgba(255,170,0,.65); } to { box-shadow: 0 0 0 4px rgba(255,107,91,.8), 0 0 38px 12px rgba(255,90,140,.6); } }
.g-banner.fever { background: linear-gradient(90deg, #ff6b5b, #ffb43b); color: #fff; animation: comboPop .45s; }

/* 4장: 흐린 바다가 치울수록 맑아짐 */
.murk { position: absolute; inset: 0; z-index: 0; pointer-events: none; transition: opacity .5s; background: radial-gradient(circle at 30% 40%, rgba(90,80,40,.35), transparent 60%), radial-gradient(circle at 70% 70%, rgba(60,70,40,.4), transparent 55%), rgba(70,85,60,.55); }
.cl-item { z-index: 1; }
.cl-item.gold { background: radial-gradient(circle, #fff6b0 0%, #ffc531 70%); box-shadow: 0 0 0 4px #fff, 0 0 24px 6px rgba(255,200,0,.8); }

/* 6장: 더 옛날? 더 나중? 카드 대결 */
.g-timeline { overflow: hidden; background: linear-gradient(rgba(255,250,240,.78), rgba(255,250,240,.88)), url(assets/img/chapter/ch6.jpg) center / cover; }
.hl { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 100%; padding: 8px; }
.hl-cards { display: flex; align-items: center; gap: 14px; }
.hl-card {
  width: clamp(150px, 26vw, 250px); height: clamp(170px, calc(var(--vh) * .3), 290px);
  border: 5px solid #fff; border-radius: 22px; box-shadow: 0 8px 0 rgba(0,0,0,.18), 0 10px 22px rgba(6,47,87,.2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center;
}
.hl-card.ref { background: linear-gradient(#ffffff, #dff0ff); }
.hl-card.new { background: linear-gradient(#fffbea, #ffe39a); }
.hl-card.deal { animation: deal .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes deal { from { transform: translateX(140px) rotate(14deg); opacity: 0; } }
.hl-card.ok { border-color: var(--ok); box-shadow: 0 0 0 6px rgba(34,160,90,.4), 0 8px 0 rgba(0,0,0,.18); animation: pop .35s; }
.hl-card.no { border-color: var(--bad); box-shadow: 0 0 0 6px rgba(226,70,59,.4), 0 8px 0 rgba(0,0,0,.18); animation: shake .4s; }
.hl-ic { font-size: clamp(40px, 6vw, 64px); line-height: 1; }
.hl-card b { font-family: var(--head); font-weight: 400; font-size: calc(var(--fs) + 1px); line-height: 1.25; word-break: keep-all; color: var(--ink); }
.hl-year { font-family: var(--head); font-size: 26px; color: #fff; background: var(--sea-dark); border-radius: 999px; padding: 2px 16px; letter-spacing: 1px; min-width: 110px; }
.hl-year.secret { background: #b9a57a; }
.hl-vs { flex: none; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-family: var(--head); font-size: 28px; color: #fff; background: var(--coral); border: 4px solid #fff; box-shadow: 0 4px 0 rgba(0,0,0,.2); animation: feverBlink .6s ease-in-out infinite alternate; }
.hl-q { font-family: var(--head); font-size: calc(var(--fs) + 1px); color: var(--wood-dark); background: rgba(255,255,255,.9); padding: 4px 18px; border-radius: 999px; }
.hl-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; max-width: 100%; }
.hl-dot { display: flex; flex-direction: column; align-items: center; background: #fff; border-radius: 12px; padding: 3px 8px; box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.hl-dot i { font-style: normal; font-size: 22px; line-height: 1.1; }
.hl-dot small { font-family: var(--head); font-size: 13px; color: var(--sea-dark); white-space: nowrap; }
.hl-dot.new { outline: 3px solid var(--sun); animation: pop .4s; }
.hl-line { width: 10px; height: 4px; background: var(--wood); border-radius: 2px; }
.hl-strip.end { margin: 8px 0; }
.hl-btn { flex: 1; max-width: 320px; }

@media (max-width: 680px) {
  .hl-cards { gap: 8px; }
  .hl-vs { width: 44px; height: 44px; font-size: 20px; }
  .hl-year { font-size: 20px; min-width: 80px; }
}

/* =====================================================================
   6장: 독도 사진 퍼즐
   ===================================================================== */
.g-puzzle { height: auto; min-height: clamp(280px, calc(var(--vh) - 390px), 560px); padding: 10px; overflow: visible;
  background: linear-gradient(rgba(255,250,240,.82), rgba(255,250,240,.9)), url(assets/img/chapter/ch6.jpg) center / cover; }
.pz { display: flex; gap: 14px; align-items: flex-start; justify-content: center; }
.pz-board { position: relative; flex: none; width: min(62%, calc((var(--vh) - 420px) * 1.765)); min-width: 280px; aspect-ratio: 962 / 545;
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr);
  border: 5px solid #fff; border-radius: 16px; overflow: hidden; background: #cfe9ff; box-shadow: 0 6px 0 rgba(0,0,0,.18), 0 10px 24px rgba(6,47,87,.2); }
.pz-ghost { position: absolute; inset: 0; background: center / cover; filter: grayscale(.4); pointer-events: none; transition: opacity .6s; }
.pz.low .pz-ghost { opacity: .35; }
.pz.high .pz-ghost { opacity: .2; }
.pz-cell { position: relative; z-index: 1; border: 1px dashed rgba(255,255,255,.85); border-radius: 0; background: transparent; min-height: 0; }
.pz-cell.over { background: rgba(255,224,102,.55); transform: none; box-shadow: inset 0 0 0 3px #ffd34d; }
.pz-cell.nope { background: rgba(226,70,59,.5); animation: none; }
.pz-cell.hint { z-index: 3; background: rgba(255,224,102,.6); box-shadow: inset 0 0 0 4px #ffd34d, 0 0 18px #ffd34d; animation: hintBlink .4s ease-in-out 4 alternate; }
@keyframes hintBlink { to { background: rgba(255,224,102,.15); } }
.pz-cell.filled { border: 0; background: none; cursor: default; animation: pzIn .35s cubic-bezier(.2,1.5,.4,1); }
@keyframes pzIn { from { transform: scale(1.25); filter: brightness(1.4); } }
.pz-pc { display: block; width: 100%; height: 100%; background-repeat: no-repeat; }
.pz-tray { flex: 1; display: grid; grid-template-columns: repeat(var(--tc, 4), 1fr); gap: 8px; align-content: start; min-height: 0; padding: 6px; }
.pz.low .pz-tray { --tc: 3; }
.pz.high .pz-tray { --tc: 4; }
.pz-tray .chip { padding: 0; min-height: 0; border: 3px solid #fff; border-radius: 8px; background: #cfe9ff; overflow: hidden; display: block; }
.pz-tray .chip.sel { outline: 4px solid var(--sea); transform: scale(1.06); }
.chip.ghost:has(.pz-pc) { width: 130px; padding: 0; border-radius: 8px; overflow: hidden; display: block; }
.pz.done { justify-content: center; }
.pz.done .pz-tray { display: none; }
.pz.done .pz-board { width: min(100%, 760px, calc((var(--vh) - 400px) * 1.765)); transition: width .5s; }
.pz-board.done { border-color: #ffd34d; box-shadow: 0 0 0 5px rgba(255,211,77,.6), 0 0 40px rgba(255,200,0,.7); }
.pz-board.done .pz-ghost { opacity: 0; }
.pz-shine { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.75) 50%, transparent 65%); transform: translateX(-120%); }
.pz-board.done .pz-shine { animation: pzShine 1.4s ease-out .2s 2; }
@keyframes pzShine { to { transform: translateX(120%); } }
.pz-final { width: 100%; max-width: 460px; border-radius: 14px; border: 4px solid #fff; box-shadow: 0 6px 18px rgba(0,0,0,.2); margin: 4px auto 6px; display: block; }

/* 세로 화면·좁은 화면: 사진 위, 조각 아래 */
@media (orientation: portrait), (max-width: 760px) {
  .pz { flex-direction: column; align-items: center; }
  .pz-board { width: min(100%, 720px, calc((var(--vh) - 670px) * 1.765)); }
  .pz-tray { width: 100%; }
  .pz.low .pz-tray { --tc: 5; }
  .pz.high .pz-tray { --tc: 7; }
}
