/* 말씀 조각 (puzzle) — scoped under .game-puzzle */
.game-puzzle .pz-wrap { position: relative; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.game-puzzle .pz-hidden { display: none !important; }
.game-puzzle .pz-ic { display: inline-block; width: 20px; height: 20px; flex: none; }
.game-puzzle .pz-ic svg { display: block; width: 100%; height: 100%; }

/* HUD: numbered scroll markers + streak pill */
.game-puzzle .pz-hud { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; }
.game-puzzle .pz-marks { display: flex; gap: 4px; }
.game-puzzle .pz-mark { width: 34px; height: 30px; display: block; transition: transform .3s; }
.game-puzzle .pz-mark svg { width: 100%; height: 100%; display: block; }
.game-puzzle .pz-sc-paper { fill: var(--card); stroke: var(--line); stroke-width: 1.5; }
.game-puzzle .pz-sc-rod { fill: #d9c6a0; }
.game-puzzle .pz-sc-n { font: 900 16px var(--font); fill: var(--ink2); }
.game-puzzle .pz-mark.now { transform: scale(1.12); }
.game-puzzle .pz-mark.now .pz-sc-paper { stroke: #e0a24f; stroke-width: 2.2; }
.game-puzzle .pz-mark.done .pz-sc-paper { fill: #ffe2b0; stroke: #c98a3a; }
.game-puzzle .pz-mark.done .pz-sc-rod { fill: #a86b2c; }
.game-puzzle .pz-mark.done .pz-sc-n { fill: #6b3a0c; }
.game-puzzle .pz-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 5px 12px 5px 9px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-weight: 800; font-size: 16px; white-space: nowrap; color: var(--ink2); }
.game-puzzle .pz-chip.hot { color: #c25e00; }
.game-puzzle .pz-chip.pop { animation: pz-pop .35s ease-out; }

/* timer (adult) */
.game-puzzle .pz-timer-row { display: flex; align-items: center; gap: 8px; }
.game-puzzle .pz-timer { flex: 1; height: 10px; border-radius: 99px; background: var(--card); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.12); }
.game-puzzle .pz-timer-fill { display: block; height: 100%; background: linear-gradient(90deg, #2a9d8f, #8ecae6); transform-origin: left; }
.game-puzzle .pz-timer-row.late .pz-timer-fill { background: #f4a261; }

.game-puzzle .pz-play { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.game-puzzle .pz-play.pz-in { animation: pz-rise .35s ease-out; }
.game-puzzle .pz-prompt { margin: 0; min-height: 30px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px; text-align: center; font-weight: 700; color: var(--ink2); font-size: 16px; overflow-wrap: anywhere; }
.game-puzzle .pz-prompt.tip { color: #0b6e99; animation: pz-pop .3s ease-out; }
.game-puzzle .pz-ref { display: inline-block; font-weight: 900; color: var(--ink); background: var(--card); border-radius: 99px; padding: 2px 10px; margin-right: 2px; box-shadow: var(--shadow); }

/* board: one flowing line of compact slots on parchment */
.game-puzzle .pz-board { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 6px 5px; padding: 10px 8px;
  background: #fff8e6; border-radius: 16px; border: 2px solid #e8d3a2; box-shadow: var(--shadow); transition: box-shadow .3s; }
.game-puzzle .pz-board.pz-glow { box-shadow: 0 0 0 4px #ffb703, 0 0 28px rgba(255,183,3,.7); }
.game-puzzle .pz-slot { min-height: 36px; width: calc(var(--n, 2) * 1em + 18px); max-width: 100%; padding: 3px 8px; border-radius: 9px;
  border: 2px dashed #d4b77a; background: rgba(224,162,79,.07); font-size: 16px; font-weight: 800; color: #4a2a0a; display: inline-flex; align-items: center; justify-content: center; text-align: center; overflow-wrap: anywhere; line-height: 1.2; }
.game-puzzle .pz-board.pz-many .pz-slot { font-size: 16px; min-height: 34px; padding: 2px 6px; width: calc(var(--n, 2) * 1em + 14px); }
.game-puzzle .pz-slot.next { border-color: #e0a24f; border-style: solid; background: rgba(255,183,3,.2); animation: pz-blink 1.2s ease-in-out infinite; }
.game-puzzle .pz-slot.filled { border: 0; border-bottom: 3px solid #a86b2c; background: linear-gradient(180deg, #ffe2b0, #ebb46a); box-shadow: 0 2px 4px rgba(90,50,10,.25); animation: none; }
.game-puzzle .pz-slot.pre { opacity: .85; }
.game-puzzle .pz-slot.snap { animation: pz-snap .3s cubic-bezier(.3,1.6,.5,1); }

/* sea with floating wooden blocks */
.game-puzzle .pz-sea { position: relative; overflow: hidden; flex: 1; display: flex; flex-direction: column; justify-content: center; border-radius: 22px; padding: 14px 8px 18px;
  background: linear-gradient(180deg, #8ecae6 0%, #3fa7d0 55%, #1d7fa8 100%); box-shadow: inset 0 4px 12px rgba(0,40,70,.25); }
.game-puzzle .pz-wave { position: absolute; left: -10%; right: -10%; bottom: -16px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.18); pointer-events: none; animation: pz-drift 6s ease-in-out infinite alternate; }
.game-puzzle .pz-tray { position: relative; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 12px 9px; }
.game-puzzle .pz-tile { position: relative; min-height: 48px; min-width: 52px; max-width: 100%; padding: 7px 13px; border: 0; border-radius: 12px;
  background: repeating-linear-gradient(8deg, rgba(150,90,30,0) 0 7px, rgba(150,90,30,.12) 7px 9px), linear-gradient(180deg, #ffe2b0, #e0a24f);
  border-bottom: 5px solid #9a5b1e; box-shadow: 0 6px 10px rgba(0,40,70,.35); color: #3e2207; font-size: 19px; font-weight: 900; line-height: 1.2; text-align: center;
  overflow-wrap: anywhere; word-break: keep-all; touch-action: manipulation; transform: rotate(var(--r, 0deg)); animation: pz-bob 2.6s ease-in-out var(--d, 0s) infinite;
  user-select: none; -webkit-user-select: none; }
.game-puzzle .pz-tray.pz-small { gap: 9px 7px; }
.game-puzzle .pz-tray.pz-small .pz-tile { font-size: 16px; min-height: 45px; padding: 5px 10px; border-bottom-width: 4px; }
.game-puzzle .pz-tile-t { pointer-events: none; }
.game-puzzle .pz-tile.used { visibility: hidden; animation: none; pointer-events: none; }
.game-puzzle .pz-tile.bounce { animation: pz-bounce .5s ease-out; }
.game-puzzle .pz-tile.hint { box-shadow: 0 0 0 3px #fff6c9, 0 0 18px 6px rgba(255,214,90,.95); animation: pz-hint 1.1s ease-in-out infinite; z-index: 1; }
.game-puzzle .pz-ghost { position: fixed; z-index: 30; pointer-events: none; display: flex; align-items: center; justify-content: center; border-radius: 12px; padding: 7px 13px; box-sizing: border-box; white-space: nowrap; transform-origin: center;
  background: linear-gradient(180deg, #ffe2b0, #e0a24f); border-bottom: 5px solid #9a5b1e; color: #3e2207; font-weight: 900; font-size: 19px; line-height: 1.2; box-shadow: 0 8px 14px rgba(0,40,70,.3); }
.game-puzzle .pz-ghost.pz-small { font-size: 16px; padding: 5px 10px; border-bottom-width: 4px; }

/* cards: intro / reveal / closing */
.game-puzzle .pz-card { display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; padding: 22px 16px 18px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
.game-puzzle .pz-card.pz-rise { animation: pz-rise .4s cubic-bezier(.3,1.4,.5,1); }
.game-puzzle .pz-kicker { font-size: 16px; font-weight: 800; color: var(--primary); }
.game-puzzle .pz-truth { margin: -6px 0 0; font-size: 22px; font-weight: 900; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; word-break: keep-all; }
.game-puzzle .pz-help { margin: 0; color: var(--ink2); font-size: 16px; overflow-wrap: anywhere; word-break: keep-all; }
.game-puzzle .pz-praise { margin: 0; font-size: 26px; font-weight: 900; color: #fb8500; overflow-wrap: anywhere; word-break: keep-all; }
.game-puzzle .pz-sub { margin: -6px 0 0; color: var(--ink2); font-weight: 700; font-size: 16px; }
.game-puzzle .pz-god { margin: 0; align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px 5px 10px; border-radius: 999px; background: linear-gradient(180deg, #fff1c2, #ffd36b); color: #6b4300; font-weight: 900; font-size: 16px; box-shadow: 0 2px 0 #d9a300; }
.game-puzzle .pz-card .bq { text-align: left; }
.game-puzzle .pz-card .bq-text { font-size: 19px; }
.game-puzzle .pz-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

@keyframes pz-bob { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-5px) rotate(calc(var(--r, 0deg) * -1)); } }
@keyframes pz-bounce { 0% { transform: translateX(0); } 20% { transform: translate(-9px, -6px) rotate(-5deg); } 45% { transform: translate(8px, 2px) rotate(4deg); } 70% { transform: translate(-4px, 0) rotate(-2deg); } 100% { transform: rotate(var(--r, 0deg)); } }
@keyframes pz-hint { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07) translateY(-3px); } }
@keyframes pz-snap { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes pz-blink { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,183,3,0); } 50% { box-shadow: 0 0 0 4px rgba(255,183,3,.35); } }
@keyframes pz-pop { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes pz-rise { 0% { opacity: 0; transform: translateY(16px) scale(.97); } 100% { opacity: 1; transform: none; } }
@keyframes pz-drift { 0% { transform: translateX(-4%); } 100% { transform: translateX(4%); } }

@media (min-width: 900px) {
  .game-puzzle .pz-tile { font-size: 21px; min-height: 54px; padding: 9px 16px; }
  .game-puzzle .pz-ghost { font-size: 21px; padding: 9px 16px; }
  .game-puzzle .pz-slot { font-size: 18px; min-height: 42px; }
  .game-puzzle .pz-sea { padding: 26px 14px 30px; flex: 0 1 auto; min-height: 320px; }
  .game-puzzle .pz-tray.pz-small .pz-tile, .game-puzzle .pz-ghost.pz-small { font-size: 19px; min-height: 50px; padding: 8px 14px; }
}

/* BG-FIX-1a (2026-11-19): short phones — trim the sea's padding and the tray gaps so the question screen fits (tiles stay >= 45px, text >= 16px) */
@media (max-height: 700px) and (max-width: 899px) {
  .game-puzzle .pz-sea { padding: 8px 6px 10px; }
  .game-puzzle .pz-tray.pz-small { gap: 7px 6px; }
}
