/* Meme Battle styles. Meme pictures with impact-font captions, caption 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: #3b2a78; --bg2: #120c2e; --dot: rgba(255,255,255,.06);
  --acc: #ffcf1f; --acc-hi: #ffe680; --acc-lo: #c89a00; --stk: #2b1d00;
  --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: #1d1642; --panel-2: #2a2060; --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="grape"] { --bg1: #3b2a78; --bg2: #120c2e; }
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: see the Meme Battle section at the end ---------- */
.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: 34px; height: 34px; border-radius: 17px; border: 0; background: rgba(20,16,40,.55); color: #fff; font-size: 14px; cursor: pointer; opacity: .9; z-index: 3; }

/* ---------- 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.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.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 .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(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .mascot, .wait .big, .tray, .hand .capcard, .winner-banner { animation: none !important; } }
.stage > .tv-lobby, .stage > .wait { margin-block: auto; }
@keyframes bobtilt { 50% { transform: translateY(-6px) rotate(2deg); } }

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; }

/* =====================  Meme Battle  ===================== */
:root { --impact: Impact, "Haettenschweiler", "Arial Narrow Bold", "Arial Black", "Helvetica Neue", Arial, sans-serif; --cyan: #2ee6d6; --cyan-hi: #8ff5ec; }
.primary.gold { background: linear-gradient(var(--cyan-hi), var(--cyan)); color: #043a36; border-color: #043a36; box-shadow: 0 5px 0 #043a36; }
.logo { color: var(--acc); font-family: var(--impact); letter-spacing: .02em; text-transform: uppercase; text-shadow: 0 3px 0 var(--stk), 0 6px 0 rgba(0,0,0,.25); }

/* the picture, with an impact-font caption laid over it */
.meme { position: relative; margin: 0; border-radius: 18px; overflow: hidden; background: #0c0820; border: 3px solid #fff; box-shadow: 0 6px 0 rgba(0,0,0,.45), 0 16px 30px rgba(0,0,0,.4); container-type: inline-size; }
.meme-pic { aspect-ratio: 4 / 3; background: #0c0820; display: grid; place-items: center; }
.meme.compact .meme-pic { aspect-ratio: 16 / 10; }
.meme-pic img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
.meme-wait { color: var(--ink-dim); font-size: 14px; }
.cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 4cqw 3.4cqw; text-align: center; pointer-events: none; font-family: var(--impact); text-transform: uppercase; color: #fff; line-height: 1.04; letter-spacing: .01em; overflow-wrap: anywhere;
  background: linear-gradient(transparent, rgba(0,0,0,.42) 70%); padding-top: 9cqw; animation: pop-cap .25s ease-out; }
.cap span { -webkit-text-stroke: .9cqw #000; paint-order: stroke fill; text-shadow: 0 .5cqw 0 #000, .5cqw 0 0 #000, -.5cqw 0 0 #000; }
.cap.c1 { font-size: 9.2cqw; } .cap.c2 { font-size: 7.2cqw; } .cap.c3 { font-size: 6cqw; } .cap.c4 { font-size: 5cqw; }
@keyframes pop-cap { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.meme .flagbtn { top: 8px; right: 8px; }

/* caption cards (the hand and the judging list) */
.hand { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 6px 2px 4px; }
.capcard { position: relative; display: block; width: 100%; text-align: left; font: 700 15px/1.2 var(--font-card); color: var(--pen); background: var(--paper); border: 2.5px solid transparent; border-radius: 14px; padding: 12px 12px 12px; min-height: 84px; box-shadow: 0 4px 0 rgba(0,0,0,.3), 0 10px 18px rgba(0,0,0,.25); cursor: pointer; overflow-wrap: anywhere; transition: transform .12s, box-shadow .12s; }
button.capcard:active { transform: scale(.97); }
.capcard.sel { border-color: var(--acc); box-shadow: 0 0 0 4px rgba(255,207,31,.5), 0 10px 18px rgba(0,0,0,.3); transform: translateY(-3px); background: #fffbe6; }
.capcard.sel::after { content: "✓"; position: absolute; top: -9px; right: -7px; width: 28px; height: 28px; border-radius: 50%; background: var(--acc); color: var(--stk); border: 2.5px solid var(--stk); display: grid; place-items: center; font-weight: 900; }
.hand .capcard { animation: dealin .45s cubic-bezier(.2,.9,.3,1.15) backwards; }
.hand.still .capcard { animation: none; }
.hand .capcard:nth-child(2) { animation-delay: .04s; } .hand .capcard:nth-child(3) { animation-delay: .08s; } .hand .capcard:nth-child(4) { animation-delay: .12s; } .hand .capcard:nth-child(5) { animation-delay: .16s; } .hand .capcard:nth-child(6) { animation-delay: .2s; } .hand .capcard:nth-child(7) { animation-delay: .24s; }
@keyframes dealin { from { opacity: 0; transform: translateY(26px) scale(.94) rotate(-3deg); } }
.capcard.free { grid-column: 1 / -1; background: rgba(255,255,255,.08); color: var(--ink); border: 2.5px dashed rgba(255,255,255,.4); box-shadow: none; cursor: default; min-height: 60px; }
.capcard.free.sel { background: rgba(255,207,31,.12); border-style: solid; border-color: var(--acc); transform: none; }
.capcard.free.sel::after { content: none; }
.capcard .free-open { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; font: 700 15px var(--font-ui); width: 100%; min-height: 36px; }
.capcard.free textarea { width: 100%; margin-top: 8px; font: 600 17px/1.25 var(--font-ui); color: var(--ink); background: rgba(0,0,0,.35); border: 2px solid rgba(255,255,255,.3); border-radius: 12px; padding: 10px; resize: none; -webkit-user-select: text; user-select: text; outline: none; }
.capcard.free textarea:focus { border-color: var(--acc); }
.capcard.free small { display: block; text-align: right; color: var(--ink-dim); margin-top: 4px; }
.capcard.flat { cursor: default; min-height: 0; padding: 12px 14px 12px 42px; font-size: 16px; box-shadow: 0 3px 0 rgba(0,0,0,.28); }
.capcard.flat .no { position: absolute; left: 10px; top: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--panel-2); color: var(--ink); font: 800 13px var(--font-ui); display: grid; place-items: center; }
.capcard.back { background: repeating-linear-gradient(135deg, #1b1740 0 9px, #231d52 9px 18px); border: 2px dashed rgba(255,255,255,.2); color: rgba(255,255,255,.35); min-height: 60px; display: grid; place-items: center; font-size: 28px; text-align: center; box-shadow: none; }
.own-tag { margin-left: 6px; font-style: normal; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; color: #7a5a00; border: 1px solid #c89a00; border-radius: 6px; padding: 1px 5px; vertical-align: middle; }
.tray .capcard .flagbtn { top: 6px; right: 6px; background: rgba(60,50,90,.28); color: #333; }
.tray.cur { border-color: var(--acc); background: rgba(255,207,31,.12); }
.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); }
.wait.slim { padding: 6px 8px; } .wait.slim .big { font-size: 40px; } .wait.slim h2 { font-size: 22px; }

/* host screens */
.switch-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 2px; margin-top: 6px; cursor: pointer; font-size: 14px; }
.switch-row small { display: block; color: var(--ink-dim); font-size: 12px; margin-top: 2px; }
.switch-row.tight { padding: 4px 0; font-size: 13px; align-items: center; }
.pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 10px 0; }
.pic { display: grid; gap: 6px; padding: 8px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,255,255,.14); font-size: 13px; }
.pic b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pic-img { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #0c0820; display: grid; place-items: center; }
.pic-img img { width: 100%; height: 100%; object-fit: cover; }
.file-btn { display: block; text-align: center; cursor: pointer; }

/* TV: the picture gets the big side of the screen */
body.tv .tv-table { grid-template-columns: minmax(0, 58%) 1fr; gap: 3vw; align-items: start; }
body.tv .meme { border-width: 4px; border-radius: 22px; }
body.tv .meme-pic, body.tv .meme.compact .meme-pic { aspect-ratio: 4 / 3; }
body.tv .subs { grid-template-columns: 1fr; gap: 12px; }
body.tv .capcard.flat { font-size: clamp(18px, 1.9vw, 30px); padding: 14px 16px 14px 56px; }
body.tv .capcard.flat .no { width: 32px; height: 32px; font-size: 16px; left: 14px; top: 14px; }
body.tv .tray .owner { font-size: 20px; }
@media (max-width: 520px) { body.tv .tv-table { grid-template-columns: 1fr; } }
@media (min-width: 640px) { .hand { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .cap { animation: none; } }
.stage > * { flex-shrink: 0; }
body.tv .tv-table .meme { width: min(100%, calc((100vh - 330px) * 4 / 3)); }
