/* 몸으로 말해요 — 예능 자막 스튜디오. 토큰은 review/design.md */
:root {
  --studio: #2337d9;   /* 스튜디오 크로마 파랑 */
  --studio-d: #1a28a8;
  --navy: #0b1552;     /* 자막 외곽선·잉크 */
  --cap: #ffe135;      /* 자막 노랑 = 정답 */
  --pink: #ff4f8b;     /* 패스 */
  --mint: #2ee6b6;
  --orange: #ff8a2a;
  --paper: #fffbea;
  --sky: #b9c6ff;      /* 파랑 위 보조 글자 */
  --display: 'Bagel Fat One', 'Black Han Sans', 'Apple SD Gothic Neo', sans-serif;
  --ui: 'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  --team: var(--cap);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body {
  margin: 0; background: var(--studio); color: var(--paper);
  font: 500 15px/1.5 var(--ui); word-break: keep-all; overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--cap); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 예능 자막: 굵은 외곽선 + 딱딱한 그림자 */
.cap {
  font-family: var(--display); font-weight: 400; color: var(--c, var(--cap));
  -webkit-text-stroke: var(--sw, .12em) var(--navy); paint-order: stroke fill;
  text-shadow: .045em .07em 0 var(--navy); letter-spacing: -.01em; line-height: 1.08;
}

/* ───────── 설정 화면 ───────── */
.setup { position: relative; min-height: 100svh; display: grid; grid-template-rows: auto auto 1fr; }
.top {
  position: absolute; z-index: 5; top: calc(env(safe-area-inset-top) + 12px); left: 16px; right: 16px;
  display: flex; justify-content: space-between; align-items: center; pointer-events: none;
}
.logo {
  pointer-events: auto; text-decoration: none; color: var(--navy); background: var(--cap);
  font: 400 17px/1 var(--display); padding: 7px 9px 6px; border: 2.5px solid var(--navy); border-radius: 4px;
  box-shadow: 2px 3px 0 var(--navy);
}
.sound {
  pointer-events: auto; height: 32px; padding: 0 11px; border-radius: 4px; border: 2px solid var(--navy);
  background: var(--studio-d); color: var(--paper); font-size: 12.5px; font-weight: 700;
}
.sound[aria-pressed="false"] { color: var(--sky); text-decoration: line-through; }

.stage {
  position: relative; height: clamp(230px, 36svh, 330px); overflow: hidden;
  background: radial-gradient(60% 70% at 50% 58%, #3a52ff 0%, var(--studio) 62%, var(--studio-d) 100%);
  border-bottom: 3px solid var(--navy);
}
.dots {
  position: absolute; inset: 0; opacity: .5;
  background: radial-gradient(circle, rgba(255, 255, 255, .22) 1.5px, transparent 2px) 0 0 / 13px 13px;
  -webkit-mask: radial-gradient(70% 80% at 50% 55%, #000 30%, transparent 85%); mask: radial-gradient(70% 80% at 50% 55%, #000 30%, transparent 85%);
}
.flood { position: absolute; inset: 0; background: var(--cap); clip-path: circle(0 at 50% 56%); }
.stage.down .flood { animation: flood .5s cubic-bezier(.2, .8, .2, 1) forwards; }
.stage.up .flood { background: var(--pink); animation: swipe .42s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes flood { to { clip-path: circle(120% at 50% 56%); } }
@keyframes swipe { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
.rig { position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%); perspective: 640px; }
.phone {
  width: 236px; height: 124px; padding: 9px; border-radius: 22px; background: var(--navy);
  box-shadow: 0 16px 0 -6px rgba(11, 21, 82, .55); transform-origin: 50% 50%;
  transition: transform .42s cubic-bezier(.3, 1.4, .5, 1);
}
.phone-face {
  height: 100%; border-radius: 14px; background: var(--studio-d); display: grid; place-items: center; overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08);
}
.phone-face { position: relative; }
.demo-hud { position: absolute; top: 7px; left: 10px; right: 10px; display: flex; justify-content: space-between; font-size: 10px; font-weight: 800; color: var(--sky); }
.demo-hud i { font-style: normal; color: var(--cap); }
.demo-word { font-size: 46px; --sw: .1em; white-space: nowrap; transition: transform .25s; }
.stage.down .phone { transform: rotateX(-42deg) translateY(10px); }
.stage.up .phone { transform: rotateX(42deg) translateY(-6px); }
.stage.swap .demo-word { transform: scale(.2); }
.burst {
  position: absolute; left: 50%; top: 13%; margin: 0; font-size: 68px; --c: var(--paper);
  transform: translateX(-50%) scale(0) rotate(-8deg); white-space: nowrap; pointer-events: none;
}
.stage.down .burst, .stage.up .burst { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes pop { 0% { transform: translateX(-50%) scale(0) rotate(-14deg); } 100% { transform: translateX(-50%) scale(1) rotate(-6deg); } }
.demo-hint {
  position: absolute; left: 0; right: 0; bottom: 10px; margin: 0; display: flex; justify-content: center; gap: 18px;
  font-size: 13px; font-weight: 800; color: var(--sky);
}
.demo-hint span { padding: 3px 8px; border-radius: 4px; transition: background .2s, color .2s; }
.stage.down .demo-hint, .stage.up .demo-hint { color: rgba(11, 21, 82, .55); }
.stage.down .hint-down { background: var(--navy); color: var(--cap); }
.stage.up .hint-up { background: var(--navy); color: var(--pink); }

.panel { width: 100%; max-width: 560px; margin: 0 auto; padding: 18px 16px 0; }
.title { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.title .cap { font-size: 42px; }
.title small { font: 800 16px/1 var(--ui); color: var(--sky); }
.lede { margin: 8px 0 16px; color: var(--sky); font-size: 14.5px; line-height: 1.55; }
.group { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
.group legend { padding: 0; margin-bottom: 7px; font-size: 14px; font-weight: 800; color: var(--paper); }
.sub { font-size: 12.5px; font-weight: 500; color: var(--sky); margin-left: 4px; }

.topics { display: flex; flex-wrap: wrap; gap: 7px; }
.topic {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 7px 11px 8px; min-height: 40px;
  border: 2.5px solid var(--navy); border-radius: 9px; background: #2f47ee; color: var(--paper);
  font-size: 15px; font-weight: 800; box-shadow: 0 4px 0 var(--navy); transition: transform .08s, box-shadow .08s;
}
.topic small { font-size: 11.5px; font-weight: 700; color: var(--sky); }
.topic[aria-pressed="true"] { background: var(--cap); color: var(--navy); }
.topic[aria-pressed="true"] small { color: var(--navy); opacity: .7; }
.topic:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--navy); }
.topic.dashed { border-style: dashed; background: transparent; box-shadow: none; }
.topic.dashed[aria-pressed="true"] { background: var(--paper); border-style: solid; box-shadow: 0 4px 0 var(--navy); }
.custom { margin-top: 10px; }
.custom textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; resize: vertical; min-height: 96px;
  border: 2.5px solid var(--navy); border-radius: 9px; background: var(--paper); color: var(--navy); font-weight: 600; line-height: 1.45;
}
.custom-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.mini {
  border: 2px solid var(--navy); background: var(--studio-d); color: var(--paper); border-radius: 7px;
  padding: 5px 10px; font-size: 13px; font-weight: 700;
}

.teams { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.team {
  display: flex; align-items: center; height: 42px; padding: 0 4px 0 10px; border: 2.5px solid var(--navy); border-radius: 9px;
  background: var(--tc); box-shadow: 0 4px 0 var(--navy);
}
.team input {
  width: 4.6em; border: 0; background: transparent; color: var(--navy); font-weight: 800; font-size: 15px; padding: 0;
}
.team input:focus { outline: none; }
.team:focus-within { outline: 3px solid var(--paper); outline-offset: 2px; }
.step {
  width: 40px; height: 42px; border: 2.5px solid var(--navy); border-radius: 9px; background: var(--studio-d);
  color: var(--paper); font: 400 22px/1 var(--display); box-shadow: 0 4px 0 var(--navy);
}
.step:disabled { opacity: .35; cursor: default; }

.pair { display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 2.5px solid var(--navy); border-radius: 10px; overflow: hidden; background: #2f47ee; box-shadow: 0 4px 0 var(--navy); }
.seg button { border: 0; background: transparent; color: var(--paper); min-height: 42px; padding: 6px 4px; font-weight: 800; font-size: 15px; }
.seg button + button { border-left: 2.5px solid var(--navy); }
.seg button[aria-checked="true"] { background: var(--cap); color: var(--navy); }
.seg.wide button { display: grid; gap: 1px; text-align: left; padding: 8px 12px; }
.seg.wide b { font-size: 15.5px; }
.seg.wide span { font-size: 12px; font-weight: 600; opacity: .78; }

.start-bar {
  position: sticky; bottom: 0; z-index: 4; margin: 6px -16px 0; padding: 14px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(35, 55, 217, 0), var(--studio) 28%);
}
.go {
  display: block; width: 100%; height: 60px; border: 3px solid var(--navy); border-radius: 14px; background: var(--cap);
  color: var(--navy); font: 400 26px/1 var(--display); box-shadow: 0 6px 0 var(--navy); transition: transform .08s, box-shadow .08s;
}
.go:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--navy); }
.start-note { margin: 8px 0 0; min-height: 0; font-size: 13px; font-weight: 700; color: var(--cap); text-align: center; }
.start-note:empty { display: none; }
.list-link { display: block; text-align: center; padding: 6px 0 28px; color: var(--sky); font-size: 13.5px; font-weight: 700; text-underline-offset: 3px; }
.ghost {
  display: block; width: 100%; height: 50px; border: 2.5px solid var(--navy); border-radius: 12px; background: var(--paper);
  color: var(--navy); font-weight: 800; font-size: 16px; box-shadow: 0 4px 0 var(--navy);
}
.link { border: 0; background: none; color: inherit; font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; padding: 10px; opacity: .85; }

@media (min-width: 980px) {
  .setup { grid-template-columns: minmax(0, 1.25fr) minmax(440px, 1fr); grid-template-rows: 1fr; min-height: 100vh; }
  .stage { height: 100vh; position: sticky; top: 0; border-bottom: 0; border-right: 3px solid var(--navy); }
  .phone { width: 380px; height: 196px; padding: 13px; border-radius: 34px; }
  .phone-face { border-radius: 22px; }
  .demo-word { font-size: 76px; }
  .demo-hud { top: 12px; left: 18px; right: 18px; font-size: 15px; }
  .burst { font-size: 120px; top: 14%; }
  .demo-hint { bottom: 28px; font-size: 15px; }
  .panel { padding: 72px 36px 0; max-width: 600px; margin: 0; }
  .title .cap { font-size: 54px; }
  .start-bar { margin: 6px -36px 0; padding-left: 36px; padding-right: 36px; }
}

/* ───────── 게임 화면 공통 ───────── */
body:not([data-screen="setup"]) { overflow: hidden; }
body:not([data-screen="setup"]) .setup, body:not([data-screen="setup"]) .guide { display: none; }
.screen {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 16px); text-align: center;
  background: var(--team);
  background-image: radial-gradient(circle, rgba(11, 21, 82, .12) 1.5px, transparent 2px); background-size: 13px 13px;
  color: var(--navy); overflow: hidden;
}
.round-tag {
  margin: 0 0 8px; display: inline-block; padding: 4px 10px; border-radius: 4px; background: var(--navy); color: var(--paper);
  font-size: 13px; font-weight: 800;
}
.team-cap { --c: var(--paper); margin: 0; font-size: clamp(44px, 12vw, 110px); }
.ready-head { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 26px 0 26px; max-width: 30em; }
.ready-text { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.55; }
.ready .go, .place .go { max-width: 420px; }
.ready-sub { margin: 12px 0 0; font-size: 13.5px; font-weight: 700; min-height: 1.5em; }
.mini-phone {
  width: 112px; height: 60px; border-radius: 12px; background: var(--navy); padding: 6px; position: relative;
  animation: nod 2.4s ease-in-out infinite; transform-origin: 50% 80%;
}
.mini-phone i { display: grid; place-items: center; height: 100%; border-radius: 7px; background: var(--cap); font: 400 15px/1 var(--display); font-style: normal; color: var(--navy); }
.mini-phone.big i { font-size: 24px; }
.mini-phone.big { width: 170px; height: 92px; border-radius: 18px; padding: 9px; }
.mini-phone.big i { border-radius: 10px; }
@keyframes nod { 0%, 100% { transform: perspective(300px) rotateX(0); } 30% { transform: perspective(300px) rotateX(-34deg); } 60% { transform: perspective(300px) rotateX(28deg); } }
body[data-mode="tv"] .mini-phone { display: none; }

.place { background: var(--studio); color: var(--paper); }
.place-cap { font-size: clamp(40px, 10vw, 90px); margin: 28px 0 8px; }
.place-sub { margin: 0 0 20px; font-weight: 700; color: var(--sky); }
.place.steady .mini-phone { animation: none; }
.place.steady .place-cap { --c: var(--mint); }

.count { background: var(--studio); }
.count-num { margin: 0; font-size: min(52vw, 70vh); font-size: min(52cqw, 70cqh); line-height: 1; }
.count-num.tick { animation: tick .9s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes tick { 0% { transform: scale(2.2); opacity: 0; } 25% { opacity: 1; } 100% { transform: scale(1); } }

/* ───────── 플레이 ───────── */
.play {
  background: var(--studio); color: var(--paper); justify-content: stretch; align-items: stretch; padding: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .1) 1.5px, transparent 2px); background-size: 15px 15px;
}
.hud {
  display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 10px) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  font-weight: 800;
}
.hud-team { background: var(--team); color: var(--navy); border: 2.5px solid var(--navy); border-radius: 6px; padding: 4px 10px; font-size: 15px; }
.hud-score { font: 400 30px/1 var(--display); color: var(--cap); -webkit-text-stroke: 4px var(--navy); paint-order: stroke fill; }
.hud-board { flex: 1; display: flex; gap: 6px; min-width: 0; overflow: hidden; }
.hud-board .chip { flex-shrink: 0; background: var(--tc); color: var(--navy); border: 2px solid var(--navy); border-radius: 5px; padding: 3px 7px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.hud-board .chip b { font: 400 1.15em/1 var(--display); }
.hud-time {
  min-width: 74px; height: 46px; border: 2.5px solid var(--navy); border-radius: 10px; background: var(--studio-d); color: var(--paper);
  font: 400 30px/1 var(--display); padding: 0 10px; font-variant-numeric: tabular-nums;
}
.play.hurry .hud-time { background: var(--pink); color: var(--navy); animation: beat 1s infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } }
.play.hurry::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 10px var(--pink); animation: rim 1s infinite; }
@keyframes rim { 50% { box-shadow: inset 0 0 0 3px var(--pink); } }
.word-box { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 max(4vw, env(safe-area-inset-right)) 0 max(4vw, env(safe-area-inset-left)); overflow: hidden; }
.word { margin: 0; text-align: center; font-size: 80px; --sw: .1em; max-width: 100%; }
.word.in { animation: wordIn .32s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes wordIn { from { transform: scale(.55) rotate(-3deg); opacity: 0; } to { transform: none; opacity: 1; } }
.controls {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 max(14px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 14px) max(14px, env(safe-area-inset-left));
}
.ctl {
  display: grid; place-items: center; gap: 1px; min-width: 96px; height: 58px; padding: 0 16px; border: 3px solid var(--navy); border-radius: 12px;
  color: var(--navy); box-shadow: 0 5px 0 var(--navy); font-weight: 800;
}
.ctl b { font: 400 22px/1 var(--display); }
.ctl .key { font-size: 11px; opacity: .7; }
.ctl.pass { background: var(--pink); }
.ctl.ok { background: var(--cap); }
.ctl:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--navy); }
body[data-mode="head"]:not(.nosensor) .ctl { opacity: .55; min-width: 78px; height: 48px; }
body[data-mode="head"] .ctl .key { display: none; }
.tilt-hint { margin: 0; font-size: 14px; font-weight: 800; color: var(--sky); }
.timebar { height: 10px; background: var(--studio-d); border-top: 2.5px solid var(--navy); }
.timebar i { display: block; height: 100%; width: 100%; background: var(--cap); transform-origin: 0 50%; }
.play.hurry .timebar i { background: var(--pink); }

.flash { position: absolute; inset: 0; display: grid; place-content: center; gap: 2vh; pointer-events: none; background: var(--cap); clip-path: circle(0 at 50% 50%); }
.flash.ok { animation: flashOk .78s cubic-bezier(.2, .8, .2, 1) forwards; }
.flash.no { background: var(--pink); animation: flashNo .62s cubic-bezier(.2, .8, .2, 1) forwards; }
.flash.end { background: var(--navy); clip-path: none; animation: none; }
@keyframes flashOk { 0% { clip-path: circle(0 at 50% 50%); } 30% { clip-path: circle(110% at 50% 50%); } 82% { clip-path: circle(110% at 50% 50%); opacity: 1; } 100% { clip-path: circle(110% at 50% 50%); opacity: 0; } }
@keyframes flashNo { 0% { clip-path: inset(0 0 0 100%); } 30% { clip-path: inset(0 0 0 0); } 78% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 100% 0 0); } }
.play, .count { container-type: size; }
.flash-cap { margin: 0; font-size: min(30vw, 46vh); font-size: min(30cqw, 46cqh); --c: var(--paper); transform: rotate(-5deg); }
.flash.ok .flash-cap, .flash.no .flash-cap, .flash.end .flash-cap { animation: pop2 .5s cubic-bezier(.3, 1.7, .5, 1); }
@keyframes pop2 { from { transform: scale(.2) rotate(-16deg); } to { transform: scale(1) rotate(-5deg); } }
.flash-word { margin: 0; font-size: clamp(18px, 4.4vw, 40px); font-weight: 900; color: var(--navy); }
.flash.end .flash-word { color: var(--sky); }
.pause { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(11, 21, 82, .92); }
.pause .cap { margin: 0; font-size: 64px; }
.pause .go { max-width: 320px; }

/* 큰 화면(TV): 소파에서도 읽히게 화면 폭 기준으로 키운다 */
@media (min-width: 900px) {
  body[data-mode="tv"] .hud { padding: 2.2vh 2.2vw 0; gap: 1.2vw; }
  body[data-mode="tv"] .hud-team, body[data-mode="tv"] .hud-board .chip { font-size: clamp(20px, 1.8vw, 40px); padding: .2em .5em; border-width: 3px; }
  body[data-mode="tv"] .hud-board { gap: .8vw; }
  body[data-mode="tv"] .hud-score { font-size: clamp(40px, 3.6vw, 80px); -webkit-text-stroke-width: 6px; }
  body[data-mode="tv"] .hud-time { min-width: 7vw; height: clamp(60px, 6vw, 120px); font-size: clamp(40px, 3.8vw, 84px); }
  body[data-mode="tv"] .controls { padding: 0 2.2vw 2.6vh; }
  body[data-mode="tv"] .tilt-hint { font-size: clamp(16px, 1.3vw, 28px); }
  body[data-mode="tv"] .ctl { min-width: 9vw; height: clamp(60px, 5.6vw, 110px); }
  body[data-mode="tv"] .ctl b { font-size: clamp(22px, 1.9vw, 42px); }
  body[data-mode="tv"] .timebar { height: 1.4vh; }
}
/* 회전 잠금 아이폰: 폰은 가로인데 화면이 세로면 게임 화면을 90° 돌린다 */
body[data-side] #place, body[data-side] #count, body[data-side] #play {
  inset: auto; left: 50%; top: 50%; width: var(--vh, 100vh); height: var(--vw, 100vw); transform: translate(-50%, -50%) rotate(-90deg);
}
body[data-side="l"] #place, body[data-side="l"] #count, body[data-side="l"] #play { transform: translate(-50%, -50%) rotate(90deg); }
/* TV 모드 데모: 폰 대신 TV, 기울이지 않고 키로 */
body[data-mode="tv"] .phone { border-radius: 10px; transform: none !important; }
body[data-mode="tv"] .phone-face { border-radius: 4px; }
body[data-mode="tv"] .phone::after { content: ''; position: absolute; left: 50%; bottom: -26px; width: 30%; height: 14px; transform: translateX(-50%); background: var(--navy); border-radius: 0 0 6px 6px; }
body[data-mode="tv"] .phone { position: relative; }
@media (orientation: landscape) and (max-height: 500px) {
  .hud { padding-top: calc(env(safe-area-inset-top) + 6px); }
  .hud-time { height: 38px; font-size: 24px; }
  .controls { padding-bottom: calc(env(safe-area-inset-bottom) + 8px); }
  .ctl { height: 46px; }
  .team-cap { font-size: 52px; }
  .ready-head { flex-direction: row; margin: 14px 0; text-align: left; }
  .place-cap { margin-top: 12px; }
}

/* ───────── 차례 끝·결과 ───────── */
.turnend, .final { justify-content: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.turn-head { padding-top: 20px; }
.turn-sub { margin: 10px 0 0; font-size: 14px; font-weight: 700; }
.turn-words { list-style: none; margin: 18px auto 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 760px; }
.turn-words button {
  border: 2.5px solid var(--navy); border-radius: 9px; padding: 7px 12px; background: var(--paper); color: var(--navy);
  font-weight: 800; font-size: 16px; box-shadow: 0 3px 0 var(--navy);
}
.turn-words button::before { content: '맞힘'; font-size: 11px; margin-right: 6px; padding: 1px 4px; border-radius: 3px; background: var(--navy); color: var(--cap); vertical-align: 2px; }
.turn-words button.no { background: transparent; box-shadow: none; text-decoration: line-through; text-decoration-thickness: 2px; opacity: .72; }
.turn-words button.no::before { content: '패스'; background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.turn-words .empty { font-weight: 700; }
.board { list-style: none; margin: 22px auto 0; padding: 0; width: 100%; max-width: 520px; display: grid; gap: 8px; }
.board li { display: grid; grid-template-columns: 6.2em 1fr 3.4em; align-items: center; gap: 10px; font-weight: 800; text-align: left; }
.board .bar { height: 22px; border: 2.5px solid var(--navy); border-radius: 6px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.board .bar i { display: block; height: 100%; background: var(--tc); border-right: 2.5px solid var(--navy); width: 0; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.board .n { font: 400 22px/1 var(--display); text-align: right; }
.board.big li { font-size: 17px; }
.turn-actions, .final-actions { width: 100%; max-width: 420px; margin: 24px auto 0; display: grid; gap: 12px; padding-bottom: 12px; }
.turnend > * { flex-shrink: 0; }
.turn-actions { position: sticky; bottom: 0; z-index: 2; max-width: none; padding: 14px max(16px, calc(50% - 210px)) calc(14px + env(safe-area-inset-bottom)); margin-left: -16px; margin-right: -16px; width: calc(100% + 32px); background: linear-gradient(rgba(0, 0, 0, 0), var(--team) 22%); }
@media (orientation: landscape) and (max-height: 500px) { .turn-actions { grid-template-columns: 1fr 1fr; } }
.turnend .board .bar { background: rgba(11, 21, 82, .82); }

.final { background: var(--studio); color: var(--paper); }
.final .board li { color: var(--paper); }
.final .board .bar { background: var(--studio-d); }
.final-in { position: relative; z-index: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding-top: 14px; }
.fast { margin: 14px 0 0; font-weight: 700; color: var(--sky); }
.fast b { color: var(--cap); }
.card-wrap { margin: 22px auto 0; width: min(78vw, 360px); }
.card-wrap img { display: block; width: 100%; height: auto; border: 3px solid var(--navy); border-radius: 6px; box-shadow: 6px 8px 0 var(--navy); transform: rotate(-1.6deg); background: var(--studio-d); }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
@media (min-width: 900px) {
  .final-in { display: grid; grid-template-columns: 1fr 380px; grid-template-areas: 'top card' 'act card'; column-gap: 48px; align-items: start; text-align: left; padding-top: 40px; }
  .final-top { grid-area: top; }
  .card-wrap { grid-area: card; margin: 0; width: 100%; }
  .final-actions { grid-area: act; margin: 26px 0 0; grid-template-columns: 1fr 1fr; max-width: none; }
  .final-actions .go { grid-column: 1 / -1; }
  .final .board { margin-left: 0; }
}

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); z-index: 90; transform: translate(-50%, 20px);
  padding: 10px 16px; border: 2.5px solid var(--navy); border-radius: 10px; background: var(--paper); color: var(--navy);
  font-weight: 800; font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ───────── 아래 설명 본문 ───────── */
.guide { position: relative; background: var(--paper); color: var(--navy); border-top: 3px solid var(--navy); content-visibility: auto; contain-intrinsic-size: auto 2400px; }
.guide-in { max-width: 860px; margin: 0 auto; padding: 44px 16px calc(56px + env(safe-area-inset-bottom)); }
.guide h2 { margin: 0; font: 400 27px/1.25 var(--display); letter-spacing: -.01em; max-width: 20em; }
.guide h3 { margin: 0 0 14px; font: 400 21px/1.25 var(--display); }
.guide h4 { margin: 0 0 8px; font-size: 16px; font-weight: 800; }
.guide h4 small { font-size: 12.5px; font-weight: 600; opacity: .6; margin-left: 4px; }
.guide-lede, .guide-note { margin: 14px 0 0; max-width: 38em; font-size: 16px; line-height: 1.75; }
.guide-note { margin: -4px 0 18px; font-size: 15px; opacity: .8; }
.guide section, .guide-more { margin-top: 44px; padding-top: 22px; border-top: 2px solid rgba(11, 21, 82, .14); }
.guide b { display: block; font-weight: 800; font-size: 16.5px; margin-bottom: 2px; }
.guide-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: s; }
.guide-steps li { counter-increment: s; position: relative; padding-left: 52px; line-height: 1.7; }
.guide-steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--cap); border: 2.5px solid var(--navy); border-radius: 8px; font: 400 20px/1 var(--display); box-shadow: 2px 3px 0 var(--navy);
}
.wl { margin-top: 22px; }
.wl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.wl-list li { padding: 3px 9px; border: 1.5px solid rgba(11, 21, 82, .22); border-radius: 6px; font-size: 14.5px; line-height: 1.5; background: #fff; }
.wl-list.long li { font-size: 14px; }
.guide-faq dl { margin: 0; display: grid; gap: 18px; }
.guide-faq dt { font-weight: 800; font-size: 16.5px; }
.guide-faq dd { margin: 4px 0 0; line-height: 1.75; }
.guide-use ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; line-height: 1.7; }
.guide-more ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.guide-more a { display: block; color: var(--navy); text-decoration: none; padding: 12px 14px; border: 2px solid var(--navy); border-radius: 10px; background: #fff; line-height: 1.5; }
.guide-more a:hover { background: var(--cap); }
.guide-more a b { font-size: 16px; }
.site-foot { margin-top: 40px; padding-top: 18px; border-top: 2px solid rgba(11, 21, 82, .14); font-size: 13.5px; display: flex; gap: 8px; }
.site-foot a { color: var(--navy); }
.fallback { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 99; margin: 0; padding: 12px; background: var(--paper); color: var(--navy); border: 2px solid var(--navy); }

@media (prefers-reduced-motion: reduce) {
  .phone, .demo-word { transition: none; }
  .mini-phone, .play.hurry::after, .play.hurry .hud-time { animation: none; }
  .word.in, .count-num.tick { animation-duration: .01s; }
}
