/* 교실이 운동장 — 교실 TV 에서 뒷자리까지 읽히게: 큰 글자, 비 오는 하늘색 바탕, 우비 노랑 강조 */
@font-face {
  font-family: "Jua";
  src: url("./fonts/jua-ksx.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --sky: #DCE6F0;        /* 비 오는 날 하늘 */
  --sky-deep: #C7D6E6;
  --panel: #F6F9FC;
  --ink: #1D2940;        /* 우비 단추 남색 */
  --mist: #56708D;       /* 빗줄기 회청색(보조 글자) */
  --line: #C3D2E2;
  --coat: #FFC629;       /* 우비 노랑 */
  --coat-ink: #1D2940;
  --boot: #D9363B;       /* 장화 빨강 */
  --glow: #14A89A;       /* 쓰는 근육 · 쉬는 시간 */
  --warm: #7C93AE;       /* 준비운동 */
  --mat: #F2F6FB;        /* 3D 바닥 매트 */
  --rain: rgba(40, 70, 110, .16);
  --shadow: 0 1px 2px rgba(29, 41, 64, .06), 0 8px 24px rgba(29, 41, 64, .08);
  --display: "Jua", "Pretendard Variable", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --body: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --sky: #111A27; --sky-deep: #0C141F; --panel: #1A2535; --ink: #EAF1F8; --mist: #9FB3CA;
    --line: #2B3A4F; --coat: #FFC629; --coat-ink: #1D2940; --boot: #FF6A6E; --glow: #3AD1C1; --warm: #8FA6C2;
    --mat: #243247; --rain: rgba(170, 200, 235, .10); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --sky: #111A27; --sky-deep: #0C141F; --panel: #1A2535; --ink: #EAF1F8; --mist: #9FB3CA;
  --line: #2B3A4F; --coat: #FFC629; --coat-ink: #1D2940; --boot: #FF6A6E; --glow: #3AD1C1; --warm: #8FA6C2;
  --mat: #243247; --rain: rgba(170, 200, 235, .10); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--sky);
  color: var(--ink);
  font: 16px/1.55 var(--body);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

/* ── 머리띠 ── */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px clamp(16px, 2.4vw, 32px);
}
.brand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drop { width: 18px; height: 24px; background: var(--coat); border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; box-shadow: inset 0 0 0 2px var(--coat-ink); }
.bar h1 { font: 400 clamp(20px, 2vw, 26px)/1.2 var(--display); letter-spacing: -.01em; }
.tag { font-size: 13px; color: var(--mist); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.bar-right { display: flex; align-items: center; gap: 14px; }
.bar-link { color: var(--mist); font-size: 14px; text-decoration: none; }
.bar-link:hover { color: var(--ink); text-decoration: underline; }

/* 공통 조각: 둥근 단추 모음 */
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); flex-wrap: wrap; }
.seg button, .views button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.seg button[aria-pressed="true"], .views button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }
.seg.small button { padding: 4px 10px; font-size: 13px; }
.btn { border: 0; border-radius: 14px; padding: 12px 16px; cursor: pointer; font-weight: 700; font-size: 16px; white-space: nowrap; }
.btn.primary { background: var(--coat); color: var(--coat-ink); box-shadow: 0 2px 0 color-mix(in srgb, var(--coat) 60%, #000); }
.btn.primary:hover { filter: brightness(1.04); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--mist); }
.btn.wide { width: 100%; }
.link-btn { border: 0; background: none; padding: 0; color: var(--mist); text-decoration: underline; cursor: pointer; font-size: 14px; }

/* ── 한 화면 앱: 무대 | 옆 판 ── */
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(330px, 30vw, 440px);
  gap: clamp(12px, 1.4vw, 20px);
  padding: 0 clamp(16px, 2.4vw, 32px) clamp(16px, 2vw, 24px);
  height: calc(100dvh - 58px);
  min-height: 660px;
}
.stage-wrap { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; min-width: 0; }
.stage {
  position: relative; overflow: hidden; border-radius: 22px;
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--panel) 70%, transparent), transparent 70%),
    linear-gradient(180deg, var(--sky-deep), var(--sky) 72%);
  box-shadow: inset 0 0 0 1px var(--line);
}
.rain {
  position: absolute; inset: -40px; pointer-events: none;
  background-image: repeating-linear-gradient(104deg, transparent 0 22px, var(--rain) 22px 23px, transparent 23px 61px);
  animation: rain 1.1s linear infinite;
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 80%);
}
@keyframes rain { to { transform: translate(-14px, 58px); } }
#gl, #loop { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#loop { object-fit: contain; background: transparent; }
.stage-msg { position: absolute; inset: auto 0 45% 0; text-align: center; color: var(--mist); font-size: 18px; }
.stage-top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mode-pill, .muscle-pill, .paused-pill, .name-pill {
  font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 88%, transparent); box-shadow: inset 0 0 0 1px var(--line);
}
.muscle-pill { display: inline-flex; align-items: center; gap: 6px; }
.muscle-pill i { width: 10px; height: 10px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 0 4px color-mix(in srgb, var(--glow) 25%, transparent); }
.paused-pill { background: var(--ink); color: var(--panel); box-shadow: none; }
.name-pill { font: 400 15px/1.2 var(--display); padding: 4px 12px; background: var(--coat); color: var(--coat-ink); box-shadow: none; }
.stage-bottom {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap;
}
.views, .pause-btn, .stage-btn {
  background: color-mix(in srgb, var(--panel) 92%, transparent); box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
.views { display: flex; padding: 4px; gap: 4px; border-radius: 999px; }
.views button { padding: 8px 16px; font-size: 15px; }
.views button:disabled { opacity: .4; cursor: default; }
.pause-btn, .stage-btn { border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap; }
.stage-btn { font-weight: 600; }
#musicBtn[aria-pressed="false"] { color: var(--mist); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.pause-btn[aria-pressed="true"] { background: var(--coat); color: var(--coat-ink); }
.fallback-note {
  position: absolute; left: 14px; right: 14px; bottom: 76px; margin: auto; max-width: 520px;
  background: var(--panel); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 15px; text-align: center;
}
.fallback-note button { border: 0; background: none; color: var(--ink); text-decoration: underline; cursor: pointer; font-weight: 700; }

/* ── 동작 고르기: 묶음 단추 + 한 줄 목록 ── */
.picker { display: grid; gap: 8px; }
.pick-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pick-tabs button {
  border: 0; cursor: pointer; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--mist);
}
.pick-tabs button[aria-selected="true"] { background: var(--ink); color: var(--panel); box-shadow: none; }
.pick-tabs small { font-weight: 600; opacity: .75; margin-left: 4px; }
.pick-list { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px; min-height: 46px; }
.pick {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  border: 0; cursor: pointer; padding: 4px 10px 4px 4px; border-radius: 12px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line);
}
.pick img { width: 34px; height: 34px; object-fit: contain; border-radius: 9px; background: var(--sky); }
.pick .duo-mini { display: flex; width: 44px; height: 34px; border-radius: 9px; background: var(--sky); overflow: hidden; }
.pick .duo-mini img { width: 22px; height: 34px; border-radius: 0; background: none; }
.pick b { font: 400 16px/1.2 var(--display); white-space: nowrap; }
.pick[aria-selected="true"] { box-shadow: inset 0 0 0 3px var(--coat), var(--shadow); }
.pick:disabled { cursor: default; opacity: .5; }
.flip { transform: scaleX(-1); }

/* ── 옆 판 ── */
.panel {
  display: flex; flex-direction: column; gap: 14px; min-width: 0; overflow: auto;
  background: var(--panel); border-radius: 22px; padding: clamp(16px, 2vw, 22px); box-shadow: var(--shadow);
}
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--sky); }
.tabs button { border: 0; background: transparent; padding: 9px 6px; white-space: nowrap; border-radius: 10px; font-weight: 700; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--panel); box-shadow: var(--shadow); }
.pane { display: flex; flex-direction: column; gap: 12px; }
.kicker { font-size: 14px; letter-spacing: .05em; color: var(--mist); font-weight: 700; }
.act-name { font: 400 clamp(38px, 4vw, 58px)/1.05 var(--display); letter-spacing: -.01em; text-wrap: balance; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.chips li.fit { background: var(--coat); color: var(--coat-ink); box-shadow: none; }

.cue { border-radius: 16px; padding: 12px 16px; background: var(--sky); }
.cue-label { font-size: 13px; color: var(--mist); font-weight: 700; letter-spacing: .04em; }
.cue-text { font: 400 clamp(22px, 2vw, 28px)/1.3 var(--display); min-height: 2.6em; text-wrap: balance; }

.reps { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 10px; }
.reps-num { font: 400 56px/1 var(--display); font-variant-numeric: tabular-nums; grid-row: span 2; }
.reps-label { font-weight: 700; }
.reps-hint { font-size: 13px; color: var(--mist); }

/* 세트 만들기 */
.field { display: grid; gap: 6px; }
.field-name { font-weight: 700; font-size: 15px; }
.toggle { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 700; font-size: 15px; }
.toggle input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.toggle small { display: block; font-weight: 500; color: var(--mist); font-size: 13px; }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 38vh; overflow: auto; }
.plan li {
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 6px 8px 6px 0; border-radius: 12px;
}
.plan li::before { content: ""; align-self: stretch; border-radius: 4px; background: var(--c, var(--coat)); }
.plan li[data-phase="준비"] { --c: var(--warm); }
.plan li[data-phase="정리"] { --c: var(--glow); }
.plan .p-name { font-weight: 700; }
.plan .p-name small { display: block; font-weight: 500; color: var(--mist); font-size: 12px; }
.plan .p-time { font-size: 13px; color: var(--mist); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan button { border: 0; background: var(--sky); border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }

/* 세트 진행 */
.progress { height: 8px; border-radius: 999px; background: var(--sky); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--coat); border-radius: inherit; transition: width .4s linear; }
.timer { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 8px 16px; align-items: center; }
.ring { grid-row: 1; grid-column: 1; width: 124px; height: 124px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--coat); stroke-width: 10; stroke-linecap: round; transition: stroke .3s; }
.timer[data-kind="rest"] .ring-fg { stroke: var(--glow); }
.timer[data-kind="prep"] .ring-fg { stroke: var(--warm); }
.timer-read { grid-row: 1; grid-column: 1; text-align: center; }
.timer-num { font: 400 46px/1 var(--display); font-variant-numeric: tabular-nums; }
.timer-label { font-size: 13px; color: var(--mist); font-weight: 600; }
.next { grid-row: 1; grid-column: 2; display: grid; gap: 2px; }
.next-label { font-size: 13px; color: var(--mist); font-weight: 700; }
.next-name { font: 400 24px/1.2 var(--display); }
.next-left { font-size: 13px; color: var(--mist); font-variant-numeric: tabular-nums; }
.run-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.run-actions .primary { flex: 1 1 auto; }

/* 설정 */
.settings { border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.settings summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; }
.settings summary::-webkit-details-marker { display: none; }
.settings summary::after { content: "펼치기"; color: var(--mist); font-weight: 600; font-size: 13px; }
.settings[open] summary::after { content: "접기"; }
.settings[open] { display: grid; gap: 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.set-name { font-weight: 700; font-size: 15px; }
.voice { display: grid; gap: 8px; border-top: 1px dashed var(--line); padding-top: 12px; }
.voice select { width: 100%; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }
.voice-note { font-size: 13px; color: var(--mist); }
.slider { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.slider input { width: 100%; accent-color: var(--ink); }

/* ── 인쇄 카드 ── */
.cards { padding: clamp(24px, 4vw, 48px) clamp(16px, 2.4vw, 32px); display: grid; gap: 18px; }
.cards-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.cards-head h2 { font: 400 28px/1.2 var(--display); }
.cards-head p { color: var(--mist); max-width: 60ch; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.pcard { background: var(--panel); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 8px; align-content: start; break-inside: avoid; }
.pcard img { width: 100%; aspect-ratio: 900 / 1140; max-height: 260px; object-fit: contain; background: var(--sky); border-radius: 14px; }
.pcard h3 { font: 400 24px/1.2 var(--display); }
.pcard ol { margin: 0; padding-left: 1.2em; display: grid; gap: 3px; }
.pcard .safe { font-size: 14px; color: var(--boot); font-weight: 700; }
.pcard .meta { font-size: 13px; color: var(--mist); }
.foot { padding: 0 clamp(16px, 2.4vw, 32px) 32px; color: var(--mist); font-size: 13px; }

/* ── 좁은 화면(폰·태블릿): 한 줄로 쌓기 ── */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .stage { height: min(68vh, 540px); }
  .tag { display: none; }
  .pick-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .plan { max-height: none; }
}

/* ── 전체 화면(F): 머리띠·카드·바닥글을 숨기고 무대와 옆 판만 화면 가득 ── */
html.full .bar, html.full .cards, html.full .foot { display: none; }
html.full .app { height: 100dvh; min-height: 0; padding-top: clamp(12px, 1.4vw, 20px); }
html.full .stage-top .name-pill { font-size: 18px; padding: 5px 14px; }
@media (max-width: 900px) { html.full .app { height: auto; } }

@media (prefers-reduced-motion: reduce) {
  .rain { animation: none; }
  .progress i { transition: none; }
}

/* ── 인쇄: 카드만 — A4 한 쪽에 3×3 = 9장, 모든 쪽이 같은 모양(제목은 인쇄하지 않음) ── */
@media print {
  :root { --sky: #fff; --panel: #fff; --ink: #111; --mist: #444; --line: #bbb; }
  body { background: #fff; }
  .bar, .app, .cards-head, .card-filter, .foot { display: none !important; }
  .cards { padding: 0; gap: 0; }
  .card-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 86mm; gap: 5mm; }
  .pcard { height: 86mm; overflow: hidden; box-shadow: none; border: 0.4mm solid #bbb; border-radius: 4mm; padding: 3.5mm; gap: 1.2mm; break-inside: avoid; page-break-inside: avoid; }
  .pcard img, .pcard .gicon { height: 36mm; max-height: 36mm; width: 100%; aspect-ratio: auto; object-fit: contain; background: #F1F5F9; border-radius: 3mm; }
  .pcard .gicon svg { width: 22mm; }
  .pcard .kind { font-size: 7pt; }
  .pcard h3 { font-size: 15pt; line-height: 1.15; }
  .pcard .meta { font-size: 7.5pt; line-height: 1.3; }
  .pcard ol { font-size: 8.8pt; line-height: 1.3; gap: 0.3mm; }
  .pcard .safe { font-size: 8.5pt; }
  @page { size: A4 portrait; margin: 10mm; }
}

/* ── 2·3단계 ─────────────────────────────────────────────────────────── */
.cam-pill { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--glow); color: #fff; }
.stage-scores {
  position: absolute; top: 50px; right: 14px; margin: 0; padding: 8px 10px; list-style: none; display: grid; gap: 4px;
  background: color-mix(in srgb, var(--panel) 92%, transparent); border-radius: 14px; box-shadow: var(--shadow);
  font-variant-numeric: tabular-nums; min-width: 150px;
}
.stage-scores li { display: flex; justify-content: space-between; gap: 14px; font-weight: 700; }
.stage-scores b { font: 400 22px/1 var(--display); }
.callout {
  position: absolute; left: 50%; top: 7%; transform: translateX(-50%);
  font: 400 clamp(34px, 4.6vw, 72px)/1.1 var(--display); text-align: center; color: var(--ink);
  text-shadow: 0 2px 0 var(--panel), 0 0 18px var(--panel); pointer-events: none; width: 92%; text-wrap: balance;
}
.callout.pop { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }

/* 비구름 걷어 내기: 진행(--p: 0~1)에 따라 구름이 걷히고 해·무지개가 나온다 */
.sky { position: absolute; inset: 0; pointer-events: none; --p: 0; }
.sky .cloud {
  position: absolute; border-radius: 999px; background: color-mix(in srgb, var(--mist) 55%, var(--panel));
  opacity: calc(.95 - var(--p) * .95); transition: transform .6s ease, opacity .6s ease;
  box-shadow: 40px -18px 0 8px color-mix(in srgb, var(--mist) 55%, var(--panel)), -34px -8px 0 2px color-mix(in srgb, var(--mist) 55%, var(--panel));
}
.sky .c1 { width: 180px; height: 70px; left: 8%; top: 12%; transform: translateX(calc(var(--p) * -60vw)); }
.sky .c2 { width: 220px; height: 80px; left: 38%; top: 6%; transform: translateY(calc(var(--p) * -40vh)); }
.sky .c3 { width: 170px; height: 64px; right: 10%; top: 16%; transform: translateX(calc(var(--p) * 60vw)); }
.sky .c4 { width: 140px; height: 56px; left: 60%; top: 26%; transform: translateX(calc(var(--p) * 50vw)); }
.sky .sun {
  position: absolute; right: 12%; top: 10%; width: 90px; height: 90px; border-radius: 50%; background: var(--coat);
  box-shadow: 0 0 0 14px color-mix(in srgb, var(--coat) 30%, transparent), 0 0 60px var(--coat);
  opacity: var(--p); transform: scale(calc(.5 + var(--p) * .5));
}
.sky .rainbow { position: absolute; left: 50%; top: 4%; width: min(70%, 520px); transform: translateX(-50%); opacity: 0; transition: opacity 1.2s; }
.sky.done .rainbow { opacity: .85; }
.stage.clearing .rain { opacity: calc(1 - var(--p, 0)); }

/* 놀이 */
.game-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.game-btn {
  display: grid; gap: 4px; text-align: left; border: 0; cursor: pointer; padding: 12px; border-radius: 16px;
  background: var(--sky); color: var(--ink);
}
.game-btn:hover { box-shadow: inset 0 0 0 2px var(--coat); }
.game-btn svg { width: 34px; height: 34px; }
.game-btn b { font: 400 19px/1.2 var(--display); }
.game-btn span { font-size: 12px; color: var(--mist); }
.game-view { display: grid; gap: 12px; }
.game-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.game-title { font: 400 30px/1.1 var(--display); }
.game-big { font: 400 clamp(34px, 3.4vw, 50px)/1.15 var(--display); text-align: center; padding: 10px; border-radius: 16px; background: var(--sky); min-height: 1.4em; text-wrap: balance; }
.game-sub { text-align: center; color: var(--mist); font-weight: 600; }
.game-rules { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; color: var(--ink); }
.game-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.game-row .btn { flex: 1 1 auto; }
.die { width: 96px; height: 96px; margin: 0 auto; border-radius: 22px; background: var(--panel); box-shadow: inset 0 0 0 3px var(--ink), var(--shadow); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 12px; }
.die i { width: 16px; height: 16px; border-radius: 50%; background: var(--ink); place-self: center; visibility: hidden; }
.die i.on { visibility: visible; }
.die.roll { animation: shake .12s linear infinite; }
@keyframes shake { 50% { transform: rotate(8deg) scale(.96); } }
.meter { height: 22px; border-radius: 999px; background: var(--sky); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--glow), var(--coat)); border-radius: inherit; transition: width .3s; }
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.team { background: var(--sky); border-radius: 14px; padding: 10px; display: grid; gap: 6px; justify-items: center; }
.team input { width: 100%; text-align: center; font-weight: 700; border: 0; background: transparent; color: var(--ink); font-size: 15px; padding: 2px; border-radius: 6px; }
.team input:focus { background: var(--panel); outline: 2px solid var(--coat); }
.team b { font: 400 40px/1 var(--display); font-variant-numeric: tabular-nums; }
.team .game-row button { border: 0; border-radius: 10px; padding: 6px 12px; font-weight: 800; cursor: pointer; background: var(--panel); }
.team .game-row button.plus { background: var(--coat); color: var(--coat-ink); }
.pair-steps { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-weight: 600; }

/* 카드 묶음 · 짝 · 놀이 그림 */
.card-filter { width: fit-content; }
.pcard .duo { display: flex; justify-content: center; background: var(--sky); border-radius: 14px; max-height: 260px; aspect-ratio: 900 / 1140; overflow: hidden; }
.pcard .duo img { width: 50%; max-height: none; background: none; border-radius: 0; aspect-ratio: auto; object-fit: contain; }
.pcard .gicon { display: grid; place-items: center; background: var(--sky); border-radius: 14px; aspect-ratio: 900 / 1140; max-height: 260px; }
.pcard .gicon svg { width: 46%; height: auto; }
.pcard .kind { font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--mist); }
.offline { margin-top: 6px; }

/* 선생님이 말하면: 진행 점(진짜 = 초록, 속임수 = 빨강) */
.dots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
.dots i.real { background: var(--glow); }
.dots i.fake { background: var(--boot); }
/* 무대 큰 글자 색: 따라 해요(초록) · 속임수(남색) · 멈춰요(빨강) · 얼음(파랑) */
.callout[data-tone="go"] { color: var(--glow); }
.callout[data-tone="stop"] { color: var(--boot); }
.callout[data-tone="freeze"] { color: #3E8EF7; }
.credits { margin-top: 4px; }
.credits a { color: inherit; }
.legal { margin-top: 6px; }
.legal a { color: var(--ink); font-weight: 600; }
.callout.small { font-size: clamp(24px, 2.8vw, 42px); top: 60px; }   /* 왼쪽 위 이름표·근육 알림 아래로 */
