/* Punchline styles. Black prompt cards, white answer cards, sticker buttons. */
:root {
  --font-display: "Chalkboard SE", "Bradley Hand", "Segoe Print", "Comic Neue", "Marker Felt", "Comic Sans MS", cursive;
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-card: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --bg1: #2c2c40; --bg2: #0e0e16; --dot: rgba(255,255,255,.06);
  --acc: #ff5d8f; --acc-hi: #ffa3bf; --acc-lo: #c0305f; --stk: #3a0a1c;
  --gold: #ffd23f; --gold-hi: #ffe58a;
  --paper: #fffdf7; --paper-2: #efe9d8; --pink: #ff5d8f; --mint: #46d6a4; --sky: #5bb5ff; --red: #ff5d5d;
  --ink: #f6f4ff; --ink-dim: #b4b2cf; --pen: #14141c; --pen-dim: #6b6880; --black: #101015;
  --panel: #1a1a28; --panel-2: #24243a; --good: #6be3a6; --bad: #ff8a8a;
  --fs-xs: 11px; --fs-sm: 13px; --fs-md: 15px; --fs-lg: 18px; --fs-xl: 24px; --fs-2xl: 36px;
}
html[data-table="midnight"] { --bg1: #1f3a78; --bg2: #0a1230; --panel: #121a3c; --panel-2: #1b2552; }
html[data-table="forest"] { --bg1: #1f6b45; --bg2: #08261a; --panel: #0f2e21; --panel-2: #173f2d; }
html[data-table="wine"] { --bg1: #7a1f45; --bg2: #2a0814; --panel: #3a0f21; --panel-2: #4d1830; --ink-dim: #e9bdd0; }
html[data-table="sand"] { --bg1: #6b5a3c; --bg2: #231d12; --panel: #302817; --panel-2: #43391f; --ink-dim: #dccfb0; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg2); overscroll-behavior: none; }
body { font-family: var(--font-ui); color: var(--ink); touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; color: inherit; }
.hidden { display: none !important; }
.play { position: fixed; inset: 0; max-width: 640px; margin: 0 auto; overflow: hidden; background: radial-gradient(circle at 1px 1px, var(--dot) 1.4px, transparent 1.6px) 0 0 / 22px 22px, radial-gradient(ellipse at 50% -10%, var(--bg1), var(--bg2) 75%); }
body.tv .play { max-width: none; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* ---------- buttons ---------- */
.primary {
  font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg); letter-spacing: .01em; color: var(--stk); border: 2.5px solid var(--stk); border-radius: 16px; padding: 14px 18px;
  background: linear-gradient(var(--acc-hi), var(--acc)); cursor: pointer; box-shadow: 0 5px 0 var(--stk); transition: transform .08s, box-shadow .08s; min-height: 52px;
}
.primary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--stk); }
.primary:disabled { filter: grayscale(.85) brightness(.7); }
.primary.gold { background: linear-gradient(var(--gold-hi), var(--gold)); color: #3a2800; border-color: #3a2800; box-shadow: 0 5px 0 #3a2800; }
.primary.mint { background: linear-gradient(#8ff0cb, var(--mint)); color: #053b28; border-color: #053b28; box-shadow: 0 5px 0 #053b28; }
.ghost { font-weight: 700; font-size: var(--fs-md); color: var(--ink); background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.28); border-radius: 14px; padding: 12px 16px; cursor: pointer; min-height: 46px; }
.ghost:active { background: rgba(255,255,255,.16); transform: scale(.98); }
.chip-btn { font-size: var(--fs-sm); font-weight: 700; background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.25); border-radius: 12px; padding: 8px 12px; cursor: pointer; min-height: 38px; }
.chip-btn:active { transform: translateY(1px); }
.chip-btn:disabled { opacity: .35; }
.linkish { background: none; border: 0; color: var(--acc-hi); text-decoration: underline; font-size: var(--fs-md); cursor: pointer; }

/* ---------- title ---------- */
.title { align-items: center; justify-content: center; text-align: center; padding: max(18px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom)); overflow-y: auto; }
.title > .inner { margin: auto; width: min(360px, 100%); display: grid; gap: 12px; justify-items: center; }
.mascot { width: 168px; height: 168px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.4)); animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(2deg); } }
.logo { margin: 0; font-family: var(--font-display); font-size: clamp(38px, 12vw, 52px); line-height: .95; font-weight: 800; color: var(--acc); text-shadow: 0 3px 0 var(--stk), 0 6px 0 rgba(0,0,0,.25); transform: rotate(-2deg); }
.logo small { display: block; margin-top: 12px; font-family: var(--font-ui); font-size: 14px; font-weight: 500; color: var(--ink-dim); text-shadow: none; transform: rotate(2deg); line-height: 1.35; }
.menu-col { display: grid; gap: 12px; width: 100%; margin-top: 6px; }
.menu-row { display: flex; gap: 10px; }
.menu-row > * { flex: 1; }
.join-inline { display: flex; gap: 8px; }
.join-inline input, .join-row input, .field {
  flex: 1; min-width: 0; font: inherit; font-size: 20px; letter-spacing: .18em; text-transform: uppercase; text-align: center; color: var(--ink); background: rgba(0,0,0,.28);
  border: 2px solid rgba(255,255,255,.28); border-radius: 14px; padding: 11px; -webkit-user-select: text; user-select: text; outline: none;
}
.join-inline input:focus, .join-row input:focus, .field:focus { border-color: var(--acc); }
.fineprint { color: var(--ink-dim); font-size: 12px; margin: 4px 0 0; line-height: 1.45; }
.fineprint a { color: var(--acc-hi); }
.back-link { color: var(--ink-dim); text-decoration: none; font-size: var(--fs-md); padding: 4px 0; text-align: center; }

/* ---------- sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(5,5,25,.66); animation: fade .2s; }
body.tv .sheet { align-items: center; }
@keyframes fade { from { opacity: 0; } }
.sheet-body { width: 100%; max-width: 640px; max-height: 90dvh; display: flex; flex-direction: column; border-radius: 26px 26px 0 0; padding-bottom: env(safe-area-inset-bottom); background: var(--panel); border-top: 3px solid var(--acc); box-shadow: 0 -10px 40px rgba(0,0,0,.5); animation: rise .3s cubic-bezier(.2,.9,.3,1.1); }
body.tv .sheet-body { border-radius: 26px; border: 3px solid var(--acc); }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } }
.sheet-body::before { content: ""; display: block; width: 44px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 18px 6px; min-height: 48px; }
.sheet-head h2 { margin: 0; font-family: var(--font-display); font-size: var(--fs-xl); color: var(--acc); }
.sheet-content { overflow: auto; padding: 4px 18px 20px; }
.sheet-actions { display: grid; gap: 10px; margin-top: 16px; position: sticky; bottom: -2px; padding-top: 12px; background: linear-gradient(transparent, var(--panel) 28%); }
.leader { text-align: center; color: var(--ink-dim); margin: 12px 0 0; font-size: var(--fs-md); }
.err { color: var(--bad); font-size: var(--fs-sm); min-height: 1.2em; text-align: center; margin: 8px 0 0; }
.rules h3, h3.sec { margin: 16px 0 6px; color: var(--acc); font-size: var(--fs-md); font-family: var(--font-display); }
.rules p, .rules li { font-size: 14px; line-height: 1.5; color: #e9e6ff; margin: 0 0 6px; }
.rules ul { margin: 0; padding-left: 18px; }
.howtip { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0; }
.howtip .n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--acc); color: var(--stk); font-weight: 900; display: grid; place-items: center; font-family: var(--font-display); }
.code-big { text-align: center; font-family: var(--font-display); font-size: 52px; letter-spacing: .16em; margin: 2px 0; color: var(--acc); text-shadow: 0 3px 0 var(--stk); }
.seat-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid rgba(255,255,255,.09); }
.seat-row .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); flex: none; box-shadow: 0 0 8px var(--good); }
.seat-row .dot.off { background: #777; box-shadow: none; }
.seat-row .nm { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-row .tag { font-size: var(--fs-xs); color: var(--acc); letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.seat-row .avatar { width: 34px; height: 34px; margin: 0; border-width: 2px; }
.join-row { display: flex; gap: 8px; }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; font-size: 14px; }
.mini-row small { color: var(--ink-dim); }
.mini-row select { font: inherit; color: var(--ink); background: rgba(0,0,0,.3); border: 1.5px solid rgba(255,255,255,.25); border-radius: 10px; padding: 8px 10px; max-width: 55%; }
.chk { width: 24px; height: 24px; accent-color: var(--acc); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip { font-size: 13px; font-weight: 700; color: var(--ink); background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,255,255,.22); border-radius: 999px; padding: 9px 13px; cursor: pointer; }
.chip.on { background: var(--acc); border-color: var(--acc); color: var(--stk); }
.lobby-note { color: var(--ink-dim); font-size: 12px; margin: 4px 0 0; }
textarea.field { letter-spacing: 0; text-transform: none; text-align: left; font-size: 15px; width: 100%; min-height: 96px; resize: vertical; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.swatch { display: grid; gap: 6px; justify-items: center; padding: 10px 4px; border-radius: 14px; background: rgba(255,255,255,.05); border: 2px solid transparent; cursor: pointer; font-size: 13px; font-weight: 700; }
.swatch.on { border-color: var(--acc); }
.swatch i { width: 54px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--f1), var(--f3)); border: 2px solid rgba(255,255,255,.3); }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid rgba(255,255,255,.09); }
.rank-row.me { background: rgba(255,207,63,.12); border-radius: 12px; }
.rank-row .n { width: 30px; font-weight: 800; color: var(--acc); font-size: var(--fs-lg); font-family: var(--font-display); }
.rank-row .nm { flex: 1; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .d { font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.rank-row .s { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 800; min-width: 48px; text-align: right; }
.avatar { position: relative; width: 44px; height: 44px; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle at 35% 28%, var(--c1), var(--c2)); border: 2.5px solid rgba(255,255,255,.9); box-shadow: 0 3px 7px rgba(0,0,0,.45); flex: none; }
.avatar .av-svg { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; max-width: 90%; padding: 10px 16px; border-radius: 14px; background: #0c0d2e; border: 1.5px solid var(--acc); color: var(--ink); font-size: var(--fs-sm); text-align: center; animation: bub 3.6s ease-out forwards; }
@keyframes bub { 0%, 90% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- game frame ---------- */
.game { padding-top: env(safe-area-inset-top); }
.topbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px 6px; }
.round-info { flex: 1; text-align: center; min-width: 0; line-height: 1.15; }
.round-info strong { display: block; font-family: var(--font-display); font-size: 18px; color: var(--acc); }
.round-info span { font-size: 12px; color: var(--ink-dim); }
.clock { min-width: 50px; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 20px; padding: 4px 10px; border-radius: 12px; background: rgba(0,0,0,.3); border: 2px solid rgba(255,255,255,.2); font-variant-numeric: tabular-nums; }
.clock.low { background: var(--red); border-color: #ffb0b0; color: #fff; animation: tt .8s infinite; }
@keyframes tt { 50% { transform: scale(1.1); } }
.timebar { height: 6px; background: rgba(0,0,0,.3); margin: 0 12px; border-radius: 3px; overflow: hidden; }
.timebar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--acc), var(--red)); background-size: 300% 100%; transition: width .25s linear; }
.players { display: flex; gap: 8px; padding: 8px 12px 4px; overflow-x: auto; scrollbar-width: none; justify-content: safe center; min-height: 66px; }
.players::-webkit-scrollbar { display: none; }
.pl { display: grid; justify-items: center; gap: 2px; width: 52px; flex: none; position: relative; font-size: 10px; color: var(--ink-dim); }
.pl .avatar { width: 38px; height: 38px; }
.pl.me .avatar { box-shadow: 0 0 0 3px var(--acc), 0 3px 7px rgba(0,0,0,.45); }
.pl.off { opacity: .45; }
.pl span { max-width: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .badge { position: absolute; top: -3px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--mint); color: #053b28; font-style: normal; font-size: 11px; font-weight: 900; display: grid; place-items: center; border: 2px solid var(--bg2); animation: popin .35s ease-out; }
@keyframes popin { from { transform: scale(0); } 70% { transform: scale(1.3); } }
.stage { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 14px 16px; display: flex; flex-direction: column; gap: 12px; -webkit-overflow-scrolling: touch; }
.dock { padding: 8px 14px max(12px, env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.dock:empty { display: none; }
.react-row { display: flex; gap: 6px; justify-content: center; }
.react-row button { font-size: 22px; width: 46px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.2); cursor: pointer; }
.react-row button:active { transform: scale(.9); }
.floaters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.floater { position: absolute; bottom: 90px; font-size: 38px; animation: floatup 2.4s ease-out forwards; text-align: center; }
.floater small { display: block; font-size: 11px; color: var(--ink); background: rgba(0,0,0,.55); border-radius: 8px; padding: 1px 6px; }
@keyframes floatup { to { transform: translateY(-340px) rotate(var(--r, 8deg)); opacity: 0; } }

/* ---------- cards ---------- */
.bcard, .wcard { position: relative; font-family: var(--font-card); font-weight: 800; letter-spacing: -.012em; overflow-wrap: anywhere; }
.bcard { background: var(--black); color: #fff; border-radius: 16px; padding: 18px 18px 46px; font-size: clamp(20px, 5.8vw, 27px); line-height: 1.14; border: 2px solid rgba(255,255,255,.16); box-shadow: 0 5px 0 rgba(0,0,0,.5), 0 14px 26px rgba(0,0,0,.4); }
.bcard.compact { padding: 12px 14px 36px; font-size: clamp(16px, 4.6vw, 20px); border-radius: 14px; }
.bcard .mark, .wcard .mark { position: absolute; left: 14px; bottom: 11px; right: 14px; display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: .06em; font-weight: 800; text-transform: uppercase; opacity: .6; }
.bcard .mark i, .wcard .mark i { font-style: normal; display: inline-flex; gap: 4px; align-items: center; }
.bcard .mark i::before, .wcard .mark i::before { content: ""; width: 11px; height: 14px; border-radius: 2px; background: currentColor; transform: rotate(-12deg); }
.bcard .pickn { position: absolute; right: 12px; bottom: 9px; font-size: 11px; background: #fff; color: #000; border-radius: 999px; padding: 3px 10px 3px 9px; font-weight: 900; letter-spacing: .02em; }
.bcard .mark { opacity: .5; right: 90px; }
.blank { display: inline-block; min-width: 2.4em; border-bottom: .12em solid currentColor; margin: 0 .1em; transform: translateY(.06em); }
.fill { color: var(--acc-hi); border-bottom: .1em solid var(--acc); }
.bcard .own { display: block; margin-top: .5em; color: var(--acc-hi); }
.wcard { background: var(--paper); color: var(--pen); border-radius: 14px; padding: 14px 14px 36px; font-size: clamp(16px, 4.5vw, 19px); line-height: 1.15; min-height: 118px; text-align: left; border: 2.5px solid transparent; box-shadow: 0 4px 0 rgba(0,0,0,.28), 0 10px 18px rgba(0,0,0,.3); }
button.wcard { cursor: pointer; font-family: var(--font-card); width: 100%; transition: transform .12s, box-shadow .12s; }
button.wcard:active { transform: scale(.97); }
.wcard.sel { border-color: var(--acc); box-shadow: 0 0 0 4px rgba(255,93,143,.4), 0 10px 18px rgba(0,0,0,.3); transform: translateY(-3px); }
.wcard .num { position: absolute; top: -9px; right: -7px; min-width: 30px; height: 30px; border-radius: 15px; background: var(--acc); color: var(--stk); border: 2.5px solid var(--stk); font-weight: 900; font-size: 15px; display: grid; place-items: center; animation: popin .3s ease-out; font-family: var(--font-display); }
.wcard.back { background: repeating-linear-gradient(135deg, #1b1b27 0 9px, #20202e 9px 18px); border: 2px dashed rgba(255,255,255,.2); color: rgba(255,255,255,.35); display: grid; place-items: center; font-size: 34px; text-align: center; padding: 14px; box-shadow: none; }
.wcard.sm { min-height: 0; padding: 11px 12px 30px; font-size: clamp(15px, 4vw, 17px); }
.hand { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 6px 2px 4px; }
.hand .wcard { animation: dealin .45s cubic-bezier(.2,.9,.3,1.15) backwards; }
.hand .wcard:nth-child(2) { animation-delay: .04s; } .hand .wcard:nth-child(3) { animation-delay: .08s; } .hand .wcard:nth-child(4) { animation-delay: .12s; } .hand .wcard:nth-child(5) { animation-delay: .16s; } .hand .wcard:nth-child(6) { animation-delay: .2s; } .hand .wcard:nth-child(7) { animation-delay: .24s; }
@keyframes dealin { from { opacity: 0; transform: translateY(26px) scale(.94) rotate(-3deg); } }
@keyframes flipin { from { opacity: 0; transform: perspective(600px) rotateY(80deg) scale(.9); } }
.stick { position: sticky; top: -8px; z-index: 5; padding-top: 8px; margin-top: -8px; background: linear-gradient(var(--bg2) 55%, transparent); }
.flagbtn { position: absolute; top: 6px; right: 8px; width: 30px; height: 30px; border-radius: 15px; border: 0; background: rgba(120,120,140,.22); color: inherit; font-size: 14px; cursor: pointer; opacity: .8; }
.bcard .flagbtn { background: rgba(255,255,255,.14); }

/* ---------- screens inside the stage ---------- */
.hero { text-align: center; padding: 6px 0 0; }
.hero h2 { margin: 0; font-family: var(--font-display); font-size: 30px; color: var(--acc); text-shadow: 0 3px 0 var(--stk); }
.hero p { margin: 6px 0 0; color: var(--ink-dim); font-size: 14px; }
.hint-line { text-align: center; color: var(--ink-dim); font-size: 14px; margin: 2px 0; }
.wait { text-align: center; padding: 16px 8px; }
.wait .big { font-size: 52px; line-height: 1; margin-bottom: 6px; animation: bob 2.4s ease-in-out infinite; }
.wait h2 { font-family: var(--font-display); margin: 4px 0; color: var(--acc); font-size: 26px; }
.wait p { color: var(--ink-dim); margin: 4px 0; }
.notice { text-align: center; font-size: 13px; font-weight: 700; color: var(--gold); background: rgba(255,210,63,.1); border: 1.5px dashed rgba(255,210,63,.45); border-radius: 12px; padding: 8px 12px; }
.paused { text-align: center; padding: 8px 12px; border-radius: 12px; background: rgba(91,181,255,.14); border: 2px solid var(--sky); color: #bfe0ff; font-weight: 800; }
.roleline { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--gold); letter-spacing: .08em; text-transform: uppercase; }
.roleline .avatar { width: 30px; height: 30px; margin: 0; }
.progress { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.progress i { width: 26px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.18); }
.progress i.on { background: var(--mint); }

/* ---------- judging ---------- */
.subs { display: grid; gap: 12px; }
.tray { position: relative; display: grid; gap: 8px; padding: 10px; border-radius: 18px; background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.12); animation: flipin .5s cubic-bezier(.2,.9,.3,1.1) backwards; transform-origin: center; }
.tray .wcard { min-height: 0; padding-bottom: 30px; }
.tray.pickable { cursor: pointer; }
.tray.pickable:active { transform: scale(.985); }
.tray.sel { border-color: var(--acc); background: rgba(255,93,143,.16); box-shadow: 0 0 0 3px rgba(255,93,143,.35); }
.tray.win { border-color: var(--gold); background: rgba(255,210,63,.16); box-shadow: 0 0 0 4px rgba(255,210,63,.4), 0 0 38px rgba(255,210,63,.25); }
.tray.lose { opacity: .72; }
.tray .owner { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--ink); padding: 0 2px; }
.tray .owner .avatar { width: 28px; height: 28px; margin: 0; border-width: 2px; }
.tray .crown { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 30px; animation: popin .5s ease-out; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.tray .wcard .flagbtn { top: 5px; right: 6px; }
.tray.sel::after { content: "Your pick"; position: absolute; right: 12px; top: -11px; background: var(--acc); color: var(--stk); font-size: 11px; font-weight: 900; border-radius: 999px; padding: 2px 10px; border: 2px solid var(--stk); }
.winner-banner { text-align: center; padding: 12px; border-radius: 16px; background: rgba(255,210,63,.14); border: 2.5px solid var(--gold); animation: dealin .5s backwards; }
.winner-banner h3 { margin: 0; font-family: var(--font-display); font-size: 26px; color: var(--gold); }
.winner-banner p { margin: 4px 0 0; color: var(--ink); font-size: 14px; }
.winner-banner .avatar { width: 54px; height: 54px; margin-bottom: 6px; }

/* ---------- lobby, settings, sheets ---------- */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg-b { font: inherit; font-size: 13px; color: var(--ink); background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.2); border-radius: 12px; padding: 10px 4px; cursor: pointer; min-height: 46px; line-height: 1.15; }
.seg-b.on { background: var(--acc); border-color: var(--stk); color: var(--stk); }
.chip.ex.on { background: rgba(255,138,138,.16); border-color: var(--bad); color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.menu-row.wrap { flex-wrap: wrap; }
.menu-row.wrap > * { flex: 1 1 28%; }
.ghost small { opacity: .7; font-weight: 600; }
.lobby-note.warn { color: var(--gold); }
h3.sec small { color: var(--ink-dim); font-family: var(--font-ui); font-weight: 500; }
.pk-group { border: 1.5px solid rgba(255,255,255,.14); border-radius: 12px; margin: 8px 0; background: rgba(255,255,255,.04); }
.pk-group summary { display: flex; justify-content: space-between; gap: 8px; padding: 11px 12px; cursor: pointer; font-weight: 800; font-size: 14px; }
.pk-group summary small { color: var(--ink-dim); }
.pk-actions { padding: 0 12px 4px; text-align: right; }
.pk-actions .linkish { font-size: 12px; }
.pk-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid rgba(255,255,255,.08); font-size: 14px; cursor: pointer; }
.pk-row.dim { opacity: .45; }
.pk-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pk-n { color: var(--ink-dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.pk-tag { font-style: normal; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; color: var(--gold); border: 1px solid rgba(255,210,63,.5); border-radius: 6px; padding: 1px 5px; margin-left: 4px; }
.hid-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.09); }
.hid-t { flex: 1; font-size: 14px; overflow-wrap: anywhere; }
.flag-actions { display: grid; gap: 10px; }
.flag-card { margin-bottom: 14px; }
.hostgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.hostgrid .ghost.danger { border-color: var(--bad); color: var(--bad); }
.rank-row .s { color: var(--gold); }
.rank-row .kick { margin-left: 6px; }
.players .pl.judge .avatar { box-shadow: 0 0 0 3px var(--gold), 0 3px 7px rgba(0,0,0,.45); }
.pl .jtag { position: absolute; top: -6px; left: 0; font-size: 14px; }
.pl em { font-style: normal; font-weight: 900; color: var(--gold); font-size: 12px; }
canvas.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 25; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 6px 0; }
.pod { display: grid; justify-items: center; gap: 4px; width: 92px; font-weight: 800; font-size: 13px; text-align: center; }
.pod .avatar { width: 54px; height: 54px; }
.pod .bar { width: 100%; border-radius: 12px 12px 0 0; display: grid; place-items: start center; padding-top: 6px; font-family: var(--font-display); font-size: 30px; color: #3a2800; background: linear-gradient(var(--gold-hi), var(--gold)); border: 2.5px solid #3a2800; border-bottom: 0; }
.pod.p2 .bar { background: linear-gradient(#f2f4f8, #aab4c6); } .pod.p3 .bar { background: linear-gradient(#f4c9a2, #c98750); }
.pod span.sc { color: var(--ink-dim); font-weight: 700; }

/* ---------- TV ---------- */
body.tv .stage { padding: 12px 3vw 20px; }
body.tv .topbar, body.tv .players { padding-left: 3vw; padding-right: 3vw; }
body.tv .timebar { margin: 0 3vw; }
body.tv .round-info strong { font-size: 30px; } body.tv .round-info span { font-size: 17px; }
body.tv .clock { font-size: 34px; padding: 6px 18px; }
body.tv .pl { width: 92px; font-size: 14px; } body.tv .pl .avatar { width: 60px; height: 60px; } body.tv .pl span { max-width: 92px; } body.tv .pl em { font-size: 20px; }
body.tv .tv-table { display: grid; grid-template-columns: minmax(300px, 34%) 1fr; gap: 3vw; align-items: start; width: 100%; margin-block: auto; }
body.tv .tv-table.solo { grid-template-columns: minmax(300px, 50%); justify-content: center; }
body.tv .bcard { font-size: clamp(26px, 2.9vw, 46px); padding: 28px 28px 64px; border-radius: 22px; }
body.tv .bcard .pickn { font-size: 16px; padding: 5px 16px; right: 20px; bottom: 18px; }
body.tv .bcard .mark { left: 28px; bottom: 22px; font-size: 14px; }
body.tv .wcard { font-size: clamp(20px, 2.2vw, 34px); padding: 20px 20px 46px; min-height: 0; }
body.tv .subs { grid-template-columns: repeat(auto-fit, minmax(clamp(230px, 22vw, 360px), 1fr)); gap: 20px; align-items: start; }
body.tv .tray .owner { font-size: 20px; } body.tv .tray .owner .avatar { width: 40px; height: 40px; }
body.tv .hero h2 { font-size: 52px; } body.tv .wait h2 { font-size: 48px; } body.tv .wait p { font-size: 22px; }
body.tv .winner-banner h3 { font-size: 42px; } body.tv .winner-banner p { font-size: 20px; }
body.tv .code-big { font-size: 110px; }
body.tv .tv-lobby { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; margin-block: auto; }
.tv-seats { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.tv-seat { display: grid; justify-items: center; gap: 4px; width: 100px; font-weight: 800; animation: popin .4s backwards; }
.tv-seat .avatar { width: 68px; height: 68px; }
.tv-banner { text-align: center; }
.tv-banner .url { font-family: var(--font-display); font-size: 34px; color: var(--ink); }
.tv-banner .qr { width: min(220px, 22vw); margin: 14px auto 0; background: #fff; padding: 10px; border-radius: 14px; }
.tv-banner .qr svg { display: block; width: 100%; height: auto; }
@media (max-width: 520px) { body.tv .tv-lobby { grid-template-columns: 1fr; } body.tv .tv-table { grid-template-columns: 1fr; } }
@media (min-width: 560px) and (max-width: 900px) { .hand { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .mascot, .wait .big, .tray, .hand .wcard, .winner-banner { animation: none !important; } }
.stage > .tv-lobby, .stage > .wait { margin-block: auto; }
@keyframes bobtilt { 50% { transform: translateY(-6px) rotate(2deg); } }

.hand.still .wcard { animation: none; }
button.wcard { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; }
body.tv .bcard { font-size: clamp(24px, min(3.3vw, 5.4vh), 56px); }
body.tv .winner-banner { padding: 10px 14px; } body.tv .winner-banner .avatar { display: none; } body.tv .winner-banner h3 { font-size: clamp(24px, 2.8vw, 40px); }
body.tv .tv-table { grid-template-columns: minmax(340px, 38%) 1fr; }
