/* BG-002 direction A "밤바다 등불" — phone skin over app.css / games / live.css (loaded last). Tokens in tokens.css. */
:root, :root:root {
  --bg: #071331; --bg2: #040A1C; --ink: var(--foam); --ink2: var(--mist); --card: #12285C; --line: rgba(160, 190, 255, .22);
  --primary: var(--gold-400); --primary-ink: var(--gold-ink); --accent: var(--gold-400); --good: #37D6BE; --bad: var(--miss);
  --radius: var(--r-lg); --shadow: 0 18px 40px -12px rgba(0, 4, 20, .75), 0 4px 10px rgba(0, 4, 20, .4);
  --font: var(--font-ui); color-scheme: dark;
}
html { background: var(--abyss); }
body { background: transparent; color: var(--foam); font-family: var(--font-ui); font-weight: 600; }
body > .scene { z-index: 0; }
.app { position: relative; z-index: 1; }
button { font-family: var(--font-ui); }

/* top bar + icon buttons */
.topbar { background: linear-gradient(180deg, rgba(4, 10, 28, .85), rgba(4, 10, 28, .4)); }
.topbar-title { font-weight: 800; color: var(--foam); }
.btn-icon { background: rgba(18, 40, 92, .75); color: var(--gold-200); box-shadow: 0 0 0 1px var(--glass-line) inset, 0 6px 14px rgba(0, 4, 20, .5); }
.btn-icon.is-off { color: var(--mist); } .btn-icon.ghost { background: none; box-shadow: none; }

/* cards: navy glass with a hairline */
.card { background: var(--glass); color: var(--foam); box-shadow: var(--sh-card); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.card-kicker, .card-meta { color: var(--mist); } .card-title { color: var(--foam); }
.card-truth { color: var(--gold-100); opacity: .9; }
.week-no { background: var(--gold-fill); color: var(--gold-ink); box-shadow: var(--glow-gold-s); }
.mini-stars .star { color: rgba(160, 190, 255, .3); } .mini-stars .star.on, .star.on { color: var(--gold-400); text-shadow: 0 0 10px rgba(255, 190, 61, .6); }
.card-game::before { height: 4px; background: var(--game, var(--gold-400)); opacity: .9; }
.game-icon { box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 18px rgba(0, 4, 20, .5); }
.card-level { box-shadow: inset 6px 0 0 #37D6BE, var(--sh-card); } .card-level.level-adult { box-shadow: inset 6px 0 0 var(--gold-400), var(--sh-card); }
@media (hover: hover) { .card:not(:disabled):hover { box-shadow: var(--sh-lift), 0 0 0 1px rgba(255, 211, 107, .35) inset; } }
.section-title { color: var(--gold-200); font-weight: 800; }
.hero-kicker { color: var(--gold-300); } .hero-title { font-family: var(--font-display); font-weight: 400; font-size: 28px; letter-spacing: .01em; } .hero-sub { color: var(--mist); }
.hero-scene { border-radius: var(--r-xl); box-shadow: var(--sh-lift); }

/* truth / reflect cards */
.truth-card, .reflect-card { background: var(--glass-strong); box-shadow: var(--sh-card), 0 0 0 1px rgba(255, 211, 107, .25) inset; }
.truth-kicker, .reflect-kicker { color: var(--gold-300); opacity: 1; }
.truth-text { color: var(--foam); }

/* Bible quote: parchment + GowunBatang (the one scripture face) */
.bq { background: linear-gradient(180deg, #FFF6DC, #F5E3B5); color: #3A2300; border-left: 0; border-radius: 10px; padding: 12px 16px; box-shadow: inset 6px 0 0 #C99A44, 0 12px 26px -10px rgba(0, 4, 20, .8); }
.bq-text { font-family: var(--font-verse); font-weight: 700; font-size: 17px; line-height: 1.65; }
.bq-ref { color: #9A5A06; font-family: var(--font-ui); font-weight: 800; }

/* buttons: one family. primary = lantern gold with a hard 6px edge; secondary = glass */
.btn { background: var(--glass-strong); color: var(--foam); box-shadow: 0 0 0 1px var(--glass-line) inset, 0 5px 0 #06112E, 0 12px 24px -8px rgba(0, 4, 20, .7); border-radius: var(--r-lg); font-weight: 800; }
.btn:active { transform: translateY(5px); box-shadow: 0 0 0 1px var(--glass-line) inset, 0 0 0 #06112E; }
.btn-primary, .btn-start { background: var(--gold-fill); color: var(--gold-ink); font-weight: 900; box-shadow: 0 2px 0 rgba(255, 255, 255, .6) inset, 0 -3px 0 rgba(160, 80, 0, .35) inset, 0 6px 0 #9A5A06, 0 16px 30px -6px rgba(242, 154, 30, .55); }
.btn-primary:active, .btn-start:active { transform: translateY(6px); box-shadow: 0 2px 0 rgba(255, 255, 255, .6) inset, 0 -3px 0 rgba(160, 80, 0, .35) inset, 0 0 0 #9A5A06, 0 6px 14px -4px rgba(242, 154, 30, .5); }
.btn-more { color: var(--gold-300); background: transparent; box-shadow: none; }
.btn-scoreboard { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: min(100%, 320px); color: var(--foam); text-decoration: none; }
.btn-scoreboard .ico { width: 24px; height: 24px; }
.card-meta .ico { width: 14px; height: 14px; vertical-align: -2px; }

/* title screen */
.title-scene { border-radius: 0 0 var(--r-xl) var(--r-xl); box-shadow: var(--sh-lift); position: relative; }
.title-scene::after { content: ''; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(180deg, rgba(4, 10, 28, 0), rgba(4, 10, 28, .55)); pointer-events: none; }
.title-scene .tw { animation: twinkle 4s ease-in-out var(--dl, 0s) infinite; }
.title-scene .bolt { animation: bolt 5s linear infinite; } @keyframes bolt { 0%, 86%, 100% { opacity: 0; } 88%, 92% { opacity: 1; } 90% { opacity: .2; } }
.title-scene .fish-swim { animation: fish 12s ease-in-out infinite; }
.title-kicker { color: var(--gold-300); letter-spacing: .12em; }
.title-logo { font-family: var(--font-display); font-weight: 400; color: var(--gold-300); letter-spacing: .01em; }
.title-ch { text-shadow: 0 0 18px rgba(255, 200, 90, .55), 0 3px 0 rgba(90, 50, 0, .45); }
.title-month, .title-foot { color: var(--mist); }
.btn-start { border-radius: var(--r-lg); font-size: 22px; }

/* end screen + review */
.end-title { font-family: var(--font-display); font-weight: 400; color: var(--gold-300); text-shadow: var(--text-glow); }
.end-score { color: var(--gold-200); } .end-line { color: var(--mist); }
.review-item, .tq-card { background: var(--glass); color: var(--foam); box-shadow: var(--sh-card); }
.review-a { color: #5CF0D0; } .review-chip { background: #12857A; }
.tq-kicker { background: rgba(255, 211, 107, .18); color: var(--gold-200); }
.tq-choice.is-right { background: var(--gold-fill); color: var(--gold-ink); box-shadow: 0 5px 0 #9A5A06, var(--glow-gold-s); }
.tq-choice.is-wrong { background: rgba(255, 107, 125, .18); color: var(--mist); }
.tq-say { color: var(--gold-300); }
.rotate-note { background: var(--abyss); color: var(--foam); }

/* ==========================================================================
   Live round (phone overlay)
   ========================================================================== */
.live-layer { background: radial-gradient(120% 70% at 50% 0%, rgba(27, 55, 117, .92), rgba(4, 10, 28, .97) 70%); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); align-items: flex-start; padding: calc(18px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom)); }
.live-card { background: transparent; color: var(--foam); box-shadow: none; padding: 4px 4px 60px; gap: 14px; margin: auto 0; animation: rise .5s var(--ease-out); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.live-layer[data-live="join"] .live-card, .live-layer[data-live="pending"] .live-card, .live-layer[data-live="lobby"] .live-card, .live-layer[data-live="ended"] .live-card {
  background: var(--glass-strong); box-shadow: var(--sh-lift), 0 0 0 1px rgba(255, 211, 107, .25) inset; padding: 22px 20px; border-radius: var(--r-xl); }
.live-card h2 { font-size: 22px; line-height: 1.4; font-weight: 800; }
.live-layer[data-live="join"] h2, .live-layer[data-live="pending"] h2, .live-layer[data-live="lobby"] h2, .live-layer[data-live="ended"] h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; color: var(--gold-300); text-shadow: var(--text-glow); }
.live-input { background: rgba(4, 10, 28, .6); color: var(--foam); border: 2px solid rgba(160, 190, 255, .3); border-radius: var(--r-md); font: 700 20px var(--font-ui); }
.live-input:focus { outline: none; border-color: var(--gold-400); box-shadow: 0 0 0 4px rgba(255, 190, 61, .25); }
.live-input::placeholder { color: var(--mist); }
.live-err { color: var(--miss); }
.live-big-name { font-family: var(--font-display); font-weight: 400; font-size: 34px; color: var(--foam); }
.live-kicker { display: flex; align-items: center; gap: 10px; color: var(--mist); font-weight: 800; font-size: 16px; }
.live-secs { margin-left: auto; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font: 400 24px/1 var(--font-display); color: var(--gold-200);
  background: radial-gradient(closest-side, rgba(11, 28, 68, .95) 76%, transparent 79%), conic-gradient(var(--gold-400) 0 100%); box-shadow: 0 0 16px rgba(255, 190, 61, .35); }
.live-secs.is-low { color: #fff; background: radial-gradient(closest-side, rgba(120, 30, 10, .95) 76%, transparent 79%), conic-gradient(var(--ember) 0 100%); animation: ember .9s ease-in-out infinite; }
.live-secs.is-end { font-size: 18px; color: var(--mist); background: radial-gradient(closest-side, rgba(11, 28, 68, .95) 76%, transparent 79%), conic-gradient(rgba(42, 76, 147, .7) 0 100%); box-shadow: none; }
@keyframes ember { 50% { transform: scale(1.1); } }
.live-q-text { background: var(--glass-strong); border-radius: var(--r-xl); padding: 20px 18px; text-align: center; font-size: 22px !important; box-shadow: var(--sh-card); text-wrap: balance; }
.live-pline { align-self: center; display: inline-flex; margin: -6px 0 0; padding: 4px 12px; border-radius: var(--r-pill); font-size: 16px; font-weight: 700; color: var(--gold-200); opacity: 1; background: rgba(255, 211, 107, .14); box-shadow: 0 0 0 1px rgba(255, 211, 107, .45) inset; }
.live-timer { height: 8px; background: rgba(42, 76, 147, .45); border-radius: var(--r-pill); }
.live-timer i { background: linear-gradient(90deg, var(--ember), var(--gold-400)); border-radius: inherit; box-shadow: 0 0 10px rgba(255, 190, 61, .6); }
.live-choices { gap: 12px; }
/* each choice: own muted tint + thick left accent bar + shape tile (colour never alone) */
.live-choice, .live-choice.c-red, .live-choice.c-blue, .live-choice.c-green, .live-choice.c-yellow {
  min-height: 72px; padding: 12px 14px 12px 12px; gap: 14px; border: 0; border-radius: var(--r-lg); color: var(--foam); font: 800 20px/1.3 var(--font-ui); text-align: left;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 24%, #12285C), color-mix(in srgb, var(--cc) 10%, #0B1C44));
  box-shadow: inset 7px 0 0 var(--cc), 0 0 0 1px rgba(160, 190, 255, .16) inset, 0 5px 0 #06112E, 0 14px 26px -10px rgba(0, 4, 20, .8);
  transition: transform var(--d-fast) var(--ease-spring), box-shadow var(--d-fast), opacity var(--d-base); }
.c-red { --cc: var(--c-circle); --ccd: var(--c-circle-d); } .c-blue { --cc: var(--c-tri); --ccd: var(--c-tri-d); } .c-green { --cc: var(--c-square); --ccd: var(--c-square-d); } .c-yellow { --cc: #FFC24A; --ccd: #B86E0E; }
.live-choice:active:not(:disabled) { transform: translateY(5px); box-shadow: inset 7px 0 0 var(--cc), 0 0 0 1px rgba(160, 190, 255, .16) inset, 0 0 0 #06112E; }
.live-shape { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 100%, #fff 15%), var(--ccd)); box-shadow: 0 4px 0 color-mix(in srgb, var(--ccd) 70%, #000), 0 0 0 1px rgba(255, 255, 255, .25) inset; }
.live-shape .ico { width: 26px; height: 26px; }
.live-ctext { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.live-pick-ico { display: none; width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: var(--gold-fill); color: var(--gold-ink); }
.live-choice.is-picked::after { content: none; }
.live-choice.is-picked, .live-choice.c-red.is-picked, .live-choice.c-blue.is-picked, .live-choice.c-green.is-picked, .live-choice.c-yellow.is-picked {
  transform: scale(1.03); background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 34%, #1B3775), color-mix(in srgb, var(--cc) 16%, #12285C)); box-shadow: inset 7px 0 0 var(--cc), var(--glow-gold); animation: pick .45s var(--ease-spring); }
.live-choice.is-picked .live-pick-ico { display: block; animation: pop .4s var(--ease-spring) .1s both; }
@keyframes pick { 0% { transform: scale(.96); } 60% { transform: scale(1.05); } 100% { transform: scale(1.03); } }
@keyframes pop { from { transform: scale(0); } }
.live-choices.has-pick .live-choice:not(.is-picked) { opacity: .32; }
.live-choice:disabled { opacity: 1; cursor: default; }
.live-choices.has-pick .live-choice:disabled:not(.is-picked) { opacity: .32; }
.live-choice.is-answer { transform: none; background: linear-gradient(180deg, rgba(255, 211, 107, .3), rgba(242, 154, 30, .14)); box-shadow: inset 7px 0 0 var(--gold-400), var(--glow-gold); font-size: 24px; }
.live-status { text-align: center; color: var(--gold-200); font-weight: 800; }
.live-status[data-status="timeup"] { color: var(--mist); }
.live-ok { color: var(--gold-300) !important; font-family: var(--font-display); font-weight: 400 !important; font-size: 34px !important; text-align: center; text-shadow: var(--text-glow); }
.live-no { color: var(--foam) !important; font-family: var(--font-display); font-weight: 400 !important; font-size: 28px !important; text-align: center; }
.live-layer[data-result="ok"] .live-ok { animation: pop .6s var(--ease-spring); position: relative; }
.live-layer[data-result="ok"] .live-card::before { content: ''; position: fixed; left: 50%; top: 22%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 -90px 0 2px #FFD36B, 64px -64px 0 1px #FFE7A6, 90px 0 0 2px #FFBE3D, 64px 64px 0 1px #FFE7A6, 0 90px 0 2px #FFD36B, -64px 64px 0 1px #37D6BE, -90px 0 0 2px #FFBE3D, -64px -64px 0 1px #9A93FF;
  animation: spark .9s var(--ease-out) both; }
@keyframes spark { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.live-layer[data-result="no"] .live-no, .live-layer[data-result="no"] .live-choice.is-answer { animation: shake .45s var(--ease-out); }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.live-points { font-family: var(--font-display); font-weight: 400; font-size: 40px; text-align: center; color: var(--gold-300); text-shadow: var(--text-glow); }
.live-rank { text-align: center; color: var(--mist); }
.live-cheer { color: var(--gold-200); text-align: center; font-size: 17px; }
.live-best { color: var(--gold-300); text-align: center; }
.live-count { font: 400 120px/1 var(--font-display); color: #fff; text-shadow: 0 0 40px rgba(255, 200, 90, .7); animation: tick 1s var(--ease-out) infinite; }
@keyframes tick { 0% { transform: scale(1.2); } 30% { transform: scale(1); } }
.live-drum { font-family: var(--font-display); font-weight: 400; color: var(--gold-300); font-size: 40px !important; text-shadow: var(--text-glow); }
.live-layer .bq { margin-top: 2px; }
.live-chip { background: rgba(18, 40, 92, .9); color: var(--foam); box-shadow: 0 0 0 1px var(--glass-line) inset, 0 6px 14px rgba(0, 4, 20, .5); font-weight: 700; }
.live-st-approved { color: #5CF0D0; } .live-st-pending { color: var(--gold-300); } .live-q { color: var(--miss); }
.live-banner { top: auto; bottom: calc(52px + env(safe-area-inset-bottom)); background: var(--gold-fill); color: var(--gold-ink); box-shadow: 0 5px 0 #9A5A06, 0 12px 30px rgba(0, 4, 20, .6); }   /* bottom: never over the topbar back button; above the name chip */
.btn-scoreboard .ico, .btn-icon .ico-line { color: var(--gold-300); }
.title-scene .scene-art, .hero-scene .scene-art { width: 100%; height: 100%; }
.title-scene .scene-art svg, .hero-scene .scene-art svg { display: block; width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) { .live-layer[data-result="ok"] .live-card::before { display: none; } }

/* ==========================================================================
   Solo games (storm / puzzle / order / duel): light panels -> navy glass, parchment stays for scripture-like pieces
   ========================================================================== */
.game-storm .st-panel { background: var(--glass-strong); color: var(--foam); box-shadow: var(--sh-card); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.game-storm .st-panel .bq { background: linear-gradient(180deg, #FFF6DC, #F5E3B5); }
.game-storm .st-qno { background: var(--gold-fill); color: var(--gold-ink); }
.game-storm .st-verdict b { color: var(--gold-200); }
.game-storm .st-truth { background: rgba(4, 10, 28, .5); box-shadow: 0 0 0 1px rgba(255, 211, 107, .3) inset; }
.game-storm .st-truth-kicker { color: var(--gold-300); } .game-storm .st-truth-text { color: var(--foam); }
.game-storm .st-explain { color: var(--mist); }
.game-storm .st-overlay { background: rgba(4, 10, 28, .45); }
.game-storm .st-card { background: var(--glass-strong); color: var(--foam); box-shadow: var(--sh-lift), 0 0 0 1px rgba(255, 211, 107, .25) inset; }
.game-storm .st-prog { background: rgba(18, 40, 92, .85); box-shadow: 0 0 0 1px var(--glass-line) inset; }
.game-storm .st-badge.good { background: #12857A; } .game-storm .st-badge.bad { background: #5148C2; }
.game-storm .st-wrap { box-shadow: var(--sh-lift), 0 0 0 1px var(--glass-line) inset; }
.game-puzzle .pz-sea { background: linear-gradient(180deg, #1D3C86 0%, #14306E 55%, #0A1838 100%); box-shadow: inset 0 4px 12px rgba(0, 4, 20, .5), 0 0 0 1px var(--glass-line) inset; }
.game-puzzle .pz-board { background: linear-gradient(180deg, #FFF6DC, #F5E3B5); color: #3A2300; border-color: #C99A44; }
.game-order .og-map { background: linear-gradient(180deg, #1D3C86 0%, #12285C 100%); box-shadow: inset 0 0 0 2px rgba(160, 190, 255, .25), var(--shadow); }
.game-order .og-stop-ring { fill: #12285C; stroke: var(--gold-400); }
.game-order .og-banner { background: var(--gold-fill); color: var(--gold-ink); }
.game-order .og-card-art { background: #0B1C44; }
.game-order .og-hintbox { background: var(--glass-strong); color: var(--foam); }
.game-order .og-reveal-god { background: linear-gradient(180deg, rgba(255, 211, 107, .2), var(--card) 60%); }
.game-order .og-finale-truth, .game-duel .duel-truth { background: var(--glass-strong); box-shadow: 0 0 0 1px rgba(255, 211, 107, .3) inset; }
.game-duel .duel-lockbar { background: var(--gold-300); }

/* polish: rising lanterns stay in the side margins (never behind the title/logo or cards) */
body > .scene .sc-lanterns svg:nth-child(odd) { left: calc(1% + var(--i) * 1.2%) !important; right: auto; }
body > .scene .sc-lanterns svg:nth-child(even) { left: auto !important; right: calc(1% + var(--i) * 1.2%); }
body > .scene .sc-lanterns svg { width: 22px; opacity: .55; }

/* ==========================================================================
   V3 (panel2 codex): restraint + one style
   ========================================================================== */
/* 2: one flat shadow set for every button */
.btn, .btn-primary, .btn-start, .btn-icon, .tq-choice, .live-choice, .live-choice.c-red, .live-choice.c-blue, .live-choice.c-green, .live-choice.c-yellow { border: 0; }
.btn, .btn-icon { box-shadow: 0 8px 20px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .28); }
.btn-primary, .btn-start, .btn-gold, .live-banner { background: linear-gradient(180deg, #FFD670, #F7B53A); box-shadow: 0 8px 20px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .28); }
.btn:active, .btn-primary:active, .btn-start:active, .btn-icon:active { transform: translateY(2px); box-shadow: 0 4px 10px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .28); }
.live-choice, .live-choice.c-red, .live-choice.c-blue, .live-choice.c-green, .live-choice.c-yellow { box-shadow: inset 6px 0 0 var(--cc), 0 8px 20px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .28); }
.live-choice:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 6px 0 0 var(--cc), 0 4px 10px rgba(0, 0, 0, .28); }
.live-shape { box-shadow: inset 0 1px rgba(255, 255, 255, .28); }
.tq-choice.is-right { background: linear-gradient(180deg, #FFD670, #F7B53A); box-shadow: 0 8px 20px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .28), 0 0 0 2px var(--gold-300); }
.btn-start { animation: none; }
/* 3: gold glow only on countdown number, picked/correct answer, final 1st */
.title-ch, .title-logo, .end-title, .live-points, .live-drum, .live-layer h2, .hero-title, .star.on, .mini-stars .star.on { text-shadow: none !important; }
.title-ch { text-shadow: 0 2px 0 rgba(0, 0, 0, .35) !important; }
.live-secs { box-shadow: none; }
.week-no { box-shadow: none; }
.live-timer i { box-shadow: none; }
.live-pline { box-shadow: 0 0 0 1px rgba(255, 211, 107, .35) inset; }
/* 5% faded unpicked answers stay readable (panel: 'too dark') */
.live-choices.has-pick .live-choice:not(.is-picked), .live-choices.has-pick .live-choice:disabled:not(.is-picked) { opacity: .55; }
/* 6: scripture card in the UI face: simple parchment, 4px gold mark, 16px corners */
.bq { background: linear-gradient(180deg, #FBF5E6, #F6EEDA); border-radius: 16px; box-shadow: inset 4px 0 0 #D9A53A; padding: 14px 16px 14px 20px; }
.bq-text { font-family: var(--font-ui); font-weight: 500; font-size: 17px; line-height: 1.6; color: #2E2108; }
/* 7: empty/waiting cards: smaller, a little above centre, one faint boat watermark */
.live-layer[data-live="pending"] .live-card, .live-layer[data-live="lobby"] .live-card, .live-layer[data-live="ended"] .live-card { margin: auto 0; transform: translateY(-5vh); position: relative; overflow: hidden; }
.live-layer[data-live="pending"] .live-card::after, .live-layer[data-live="lobby"] .live-card::after, .live-layer[data-live="ended"] .live-card::after {
  content: ''; position: absolute; right: -10px; bottom: -6px; width: 150px; height: 120px; opacity: .15; pointer-events: none; background: no-repeat center/contain var(--boat-wm); }
:root { --boat-wm: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 64'%3E%3Cpath d='M38 4V46' stroke='%23EAF1FF' stroke-width='2.4'/%3E%3Cpath d='M40 6L64 42H40Z' fill='%23EAF1FF'/%3E%3Cpath d='M36 12L18 42H36Z' fill='%23EAF1FF'/%3E%3Cpath d='M6 46H74L64 58H16Z' fill='%23EAF1FF'/%3E%3C/svg%3E"); }
.live-layer[data-live="pending"] p, .live-layer[data-live="lobby"] p { font-size: 20px; color: rgba(255, 255, 255, .82); }
/* 8: solo start/intro cards: one opaque layer, safe header, readable help text; no floating lanterns over a game */
.topbar { padding-top: max(24px, env(safe-area-inset-top)); min-height: 72px; }
.game-storm .st-overlay { background: none; }
.game-storm .st-card, .game-puzzle .pz-card { background: #12285C; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 8px 20px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .28); border-radius: 20px; }
.game-storm .st-card-text, .game-puzzle .pz-help, .game-puzzle .pz-sub, .card-meta, .hero-sub, .title-month, .title-foot { color: rgba(255, 255, 255, .78); }
body:has([data-screen="play"]) > .scene .sc-lanterns, body:has([data-screen="play"]) > .scene .moon { display: none; }

.game-storm .st-wrap:has(.st-overlay:not([hidden])) .st-panel { visibility: hidden; }
.game-storm .st-card .st-truth { background: none; box-shadow: none; padding: 4px 0 0; }

/* ==========================================================================
   V3b (panel2 gemini, where not in conflict with codex)
   ========================================================================== */
/* watermark always behind the card's content (never over a button) */
.live-layer .live-card > * { position: relative; z-index: 1; }
.live-layer[data-live="pending"] .live-card::after, .live-layer[data-live="lobby"] .live-card::after, .live-layer[data-live="ended"] .live-card::after { z-index: 0; right: -18px; bottom: auto; top: -10px; opacity: .1; }
/* accent bar as a straight left border (no curved inset sliver) */
.live-choice, .live-choice.c-red, .live-choice.c-blue, .live-choice.c-green, .live-choice.c-yellow { border-left: 6px solid var(--cc); box-shadow: 0 8px 20px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .2); }
.live-choice.is-picked, .live-choice.c-red.is-picked, .live-choice.c-blue.is-picked, .live-choice.c-green.is-picked, .live-choice.c-yellow.is-picked { box-shadow: 0 0 0 2px var(--gold-300), 0 0 22px rgba(255, 190, 61, .4); }
/* right answer: navy lit by gold (no olive mix) */
.live-choice.is-answer { background: linear-gradient(180deg, #2C4688, #1B3070); border-left: 6px solid var(--gold-400); box-shadow: 0 0 0 2px var(--gold-300), 0 0 26px rgba(255, 190, 61, .4); color: var(--gold-100); }
.live-choices.has-pick .live-choice:not(.is-picked), .live-choices.has-pick .live-choice:disabled:not(.is-picked) { opacity: .6; }
/* solo storm: the start card dims the canvas behind it (one dark veil, no blur) */
.game-storm .st-overlay { background: rgba(4, 10, 28, .72); }
/* title footer clear of the name chip */
.screen-title { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.screen-title .title-foot { padding-right: 96px; padding-left: 96px; }

/* V3c: a small '정답' tag above the answer card on the phone result (UI word only) */
.live-layer[data-live="reveal"] .live-choices::before { content: '정답'; align-self: flex-start; padding: 4px 12px; border-radius: 999px; font: 800 15px/1.2 var(--font-ui); color: var(--gold-ink); background: linear-gradient(180deg, #FFD670, #F7B53A); margin-bottom: -4px; }
/* title footer never under the name chip: room below for the chip */
.screen-title .title-foot { padding: 0 8px; margin-bottom: 56px; }
.screen-title .title-foot { padding: 0 92px; margin-bottom: 64px; }

/* V4 (panel3 gemini): accent bar painted as a background strip, clipped by the rounded corner (no bend) */
.live-choice, .live-choice.c-red, .live-choice.c-blue, .live-choice.c-green, .live-choice.c-yellow { border-left: 0; padding-left: 18px;
  background: linear-gradient(90deg, var(--cc) 0 6px, transparent 6px), linear-gradient(180deg, color-mix(in srgb, var(--cc) 24%, #12285C), color-mix(in srgb, var(--cc) 10%, #0B1C44)); }
.live-choice.is-picked, .live-choice.c-red.is-picked, .live-choice.c-blue.is-picked, .live-choice.c-green.is-picked, .live-choice.c-yellow.is-picked {
  background: linear-gradient(90deg, var(--cc) 0 6px, transparent 6px), linear-gradient(180deg, color-mix(in srgb, var(--cc) 34%, #1B3775), color-mix(in srgb, var(--cc) 16%, #12285C)); }
.live-choice.is-answer { border-left: 0; background: linear-gradient(90deg, var(--gold-400) 0 6px, transparent 6px), linear-gradient(180deg, #2C4688, #1B3070); }
/* storm/games: the play frame ends above the name chip */
.screen-play { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

/* V5: join / waiting / lobby / ended cards: centred block, one illustration on top (no watermark) */
.live-layer[data-live="join"], .live-layer[data-live="pending"], .live-layer[data-live="lobby"], .live-layer[data-live="ended"] { align-items: center; }
.live-layer[data-live="join"] .live-card, .live-layer[data-live="pending"] .live-card, .live-layer[data-live="lobby"] .live-card, .live-layer[data-live="ended"] .live-card { transform: none; margin: auto 0; text-align: center; }
.live-layer[data-live="join"] .live-card::after, .live-layer[data-live="pending"] .live-card::after, .live-layer[data-live="lobby"] .live-card::after, .live-layer[data-live="ended"] .live-card::after {
  content: ''; order: -1; position: static; align-self: center; width: 132px; height: 99px; opacity: 1; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 90'%3E%3Ccircle cx='60' cy='44' r='40' fill='%23FFBE3D' opacity='.12'/%3E%3Cpath d='M58 12V60' stroke='%23C99A44' stroke-width='3'/%3E%3Cpath d='M61 14L88 56H61Z' fill='%23EDE3C8'/%3E%3Cpath d='M55 22L36 56H55Z' fill='%23DCD0B0'/%3E%3Crect x='64' y='34' width='7' height='8' rx='1.5' fill='%23FFE7A6'/%3E%3Cpath d='M24 62H96L86 76H34Z' fill='%23233F86'/%3E%3Cpath d='M8 80Q30 72 60 80T112 80' fill='none' stroke='%238FB0FF' stroke-opacity='.5' stroke-width='2'/%3E%3C/svg%3E"); }
.live-layer[data-live] .live-card h2 { text-align: center; }

/* owner findings: pending note above the name chip; toast when the queue reaches the board */
.live-note { position: fixed; left: 12px; right: 12px; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 58; padding: 10px 14px; border-radius: 14px; text-align: center;
  font: 700 16px/1.4 var(--font-ui); color: var(--gold-100); background: rgba(11, 28, 68, .94); box-shadow: 0 0 0 1px rgba(255, 211, 107, .45) inset, 0 8px 20px rgba(0, 0, 0, .35); }
.live-note[hidden], .live-toast[hidden] { display: none; }
.live-toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); z-index: 70; transform: translateX(-50%); padding: 12px 22px; border-radius: 999px; white-space: nowrap;
  font: 800 18px/1.2 var(--font-ui); color: var(--gold-ink); background: linear-gradient(180deg, #FFD670, #F7B53A); box-shadow: 0 8px 20px rgba(0, 0, 0, .35); }
.live-toast.is-in { animation: toast-in .45s var(--ease-spring); }
@keyframes toast-in { from { transform: translate(-50%, -30px); opacity: 0; } }
.screen { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }

/* owner: 점수판 standing on the end screen */
.end-board { margin: 8px auto 0; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; font: 800 18px/1.3 var(--font-ui); color: var(--gold-100); background: rgba(11, 28, 68, .9); box-shadow: 0 0 0 1px rgba(255, 211, 107, .45) inset; animation: rise .4s var(--ease-out); }
.end-board[data-state="sending"] { color: var(--mist); }
.end-board[data-state="done"] { box-shadow: 0 0 0 2px var(--gold-300), 0 0 22px rgba(255, 190, 61, .35); }
.end-new { padding: 2px 10px; border-radius: 999px; font-size: 15px; color: var(--gold-ink); background: linear-gradient(180deg, #FFD670, #F7B53A); }

/* owner 08:1x: one in-flow waiting line (never floating over content); small name chip */
.live-note-inline { margin: 4px 0 0; padding: 10px 14px; border-radius: 14px; text-align: center; font: 700 16px/1.45 var(--font-ui); color: var(--gold-100);
  background: rgba(11, 28, 68, .9); box-shadow: 0 0 0 1px rgba(255, 211, 107, .45) inset; }
.live-note { display: none !important; }
.live-chip { padding: 3px 10px; font-size: 13px; gap: 5px; opacity: .92; right: 6px; bottom: calc(6px + env(safe-area-inset-bottom)); }
.live-chip .live-st { font-weight: 900; }
.end-board { max-width: 100%; text-wrap: balance; }

/* panel4 codex #1: header title never clipped (safe-area padding, centred, wraps instead of cutting) */
.topbar { grid-template-columns: 44px minmax(0, 1fr) 44px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.topbar-title { min-width: 0; text-align: center; overflow: visible; overflow-wrap: anywhere; word-break: keep-all; font-size: clamp(16px, 4.6vw, 20px); line-height: 1.25; }
/* #2: storm start card smaller, the boat and sea stay visible around it */
.game-storm .st-card { max-width: min(330px, 82vw); max-height: 72vh; overflow: auto; padding: 16px 18px; }
.game-storm .st-card-icon { width: 52px; height: 52px; margin-bottom: 4px; }
.game-storm .st-card-title { font-size: 21px; }
.game-storm .st-card-text { font-size: 16px; line-height: 1.42; margin: 8px 0 12px; }
.game-storm .st-card .st-truth-text { font-size: 17px; }

/* 0853 check: the toast sits below the top bar, opaque, never over the title */
.live-toast { top: calc(84px + env(safe-area-inset-top)); background: #F7B53A; box-shadow: 0 8px 20px rgba(0, 0, 0, .45); }

/* master 10:0x: name chip in the top bar next to the sound button (never position: fixed over content); hidden on the quiz layer and screens without a bar */
.live-chip[data-off="1"] { display: none !important; }
.live-chip.in-bar { position: static; right: auto; bottom: auto; z-index: auto; opacity: 1; max-width: 9.5em; padding: 4px 10px; font-size: 13px; line-height: 1.2; align-self: center; justify-self: end; }
.live-chip.in-bar .live-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar:has(> .live-chip.in-bar) { grid-template-columns: 44px minmax(0, 1fr) auto 44px; }
.title-top:has(> .live-chip.in-bar) { display: flex; align-items: center; gap: 8px; }
.title-top:has(> .live-chip.in-bar) > .ghost { display: none; }
.topbar { background: rgba(5, 12, 32, .97); }   /* content scrolling under the sticky bar no longer shows through behind the title and the name chip */
.screen-title > .live-note-inline { margin-top: calc(64px + env(safe-area-inset-top)); }   /* the waiting line starts below the title's top row (name chip + sound button) */
.live-net { position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 90; max-width: calc(100% - 24px); padding: 10px 18px; border-radius: 14px; text-align: center;
  font: 800 16px/1.35 var(--font-ui); color: #fff; background: #B3261E; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); }
.live-net[hidden] { display: none; }
