:root {
  --paper: #EDE8DD; --app: #FBF9F4; --ink: #232838; --muted: #5C6170; --icon: #9297A6;
  --line: #E5E0D4; --card: #FFFFFF; --card-line: #E9E4D9;
  --accent: #C43A31; --accent-soft: #F7E5E3;
  --b: #2B6CB0; --i: #C43A31; --n: #4A5568; --g: #2F7D52; --o: #C0871B;
  --good-bg: #E7F1EA; --good-ink: #24603F; --gold-bg: #FBF0DC; --gold-ink: #8A5B12;
  --shadow: rgba(35,40,56,0.14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1117; --app: #16181F; --ink: #E9E7DF; --muted: #A3A7B3; --icon: #6E7486;
    --line: #2E3140; --card: #1D2029; --card-line: #323648;
    --accent: #E06055; --accent-soft: #3A2523;
    --b: #6FA8DC; --i: #E06055; --n: #9AA3B5; --g: #6FBF92; --o: #DCA843;
    --good-bg: #1E2F26; --good-ink: #8FCFAA; --gold-bg: #332A18; --gold-ink: #E0B96A;
    --shadow: rgba(0,0,0,0.5);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--app); color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 16px; line-height: 1.5;
}
#app { max-width: 460px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; }
.brand .logo { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; box-shadow: inset -2px -3px 0 rgba(0,0,0,0.18); }
.topbar .right { display: flex; align-items: center; gap: 10px; }
.chip { background: var(--accent-soft); color: var(--accent); padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; border: none; cursor: pointer; }

.screen { flex: 1; padding: 16px; }
.hidden { display: none !important; }
h2 { font-size: 20px; margin: 6px 0 10px; }
.sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 12px; padding: 13px 16px; font-size: 15px; font-weight: 600; cursor: pointer; width: 100%; background: var(--accent); color: #fff; }
.bi { width: 18px; height: 18px; flex: 0 0 auto; }
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--card-line); }
.btn.small { width: auto; padding: 9px 14px; font-size: 13px; border-radius: 10px; }
.btn.gold { background: var(--gold-ink); color: var(--app); }
.row { display: flex; gap: 8px; }
/* Caller controls (Voice / Fun caller / Repeat last): compact pill buttons that
   wrap, instead of full-width thirds that look like oversized panels. */
.callctrls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.callctrls .btn.small { flex: 0 0 auto; padding: 6px 11px; font-size: 12px; border-radius: 999px; gap: 5px; background: var(--card); }
#scSignin input:not([type="checkbox"]) { max-width: 280px; width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--card-line); background: var(--card); color: var(--ink); font-size: 15px; }
.sep { color: var(--muted); font-size: 13px; margin: 6px 0 2px; }
.row > * { flex: 1; }
.stack > * + * { margin-top: 10px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input, .field select { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--card-line); background: var(--app); color: var(--ink); font-size: 15px; }
.switch { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; font-size: 14px; }
/* Native checkboxes rendered as toggle switches (applies app-wide). */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  position: relative; flex: 0 0 auto; box-sizing: border-box; margin: 0;
  width: 44px; height: 26px; border-radius: 999px;
  background: var(--card-line); cursor: pointer; vertical-align: middle;
  transition: background 0.18s ease;
}
input[type="checkbox"]::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.18s ease;
}
input[type="checkbox"]:checked { background: var(--accent); }
input[type="checkbox"]:checked::after { transform: translateX(18px); }
input[type="checkbox"]:disabled { opacity: 0.5; cursor: not-allowed; }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card { background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; padding: 14px; }
.roomcard { background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; padding: 13px 14px; margin: 0 0 10px; cursor: pointer; position: relative; }
#roomList .roomcard { padding-right: 38px; }
#roomList .roomcard:hover { border-color: var(--accent); }
#roomList .roomcard:active { background: var(--paper); transform: scale(0.995); }
.roomchev { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--accent); }
.roomcard h3 { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.rmeta { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; color: var(--muted); font-size: 12.5px; }
.rmeta .l { display: flex; align-items: center; gap: 8px; }
.rmeta b { color: var(--ink); font-weight: 600; }
.mi { width: 13px; height: 13px; flex: 0 0 auto; color: var(--icon); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 0; background: transparent; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.badge.live { color: var(--accent); }
.badge.sched, .badge.lock { color: var(--o); }
.badge.lobby { color: var(--b); }
.badge.done { color: var(--g); }
.badge.cx { color: var(--muted); }
.badge.daily { color: #9333ea; }
/* Sponsored: a punchy, high-contrast gold pill. Fixed bright gold + dark bold
   text (not theme vars) so it pops the same in light and dark; no leading dot. */
.badge.sponsored { color: #000; background: #f2b418; padding: 3px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.03em; vertical-align: middle; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.badge.sponsored::before { display: none; }
/* Featured room card: a soft pulsing gold glow to draw the eye. */
.roomcard.featured { border-color: var(--gold-ink); box-shadow: 0 0 0 1px var(--gold-ink), 0 0 16px -3px var(--gold-ink); animation: featGlow 2.4s ease-in-out infinite; }
@keyframes featGlow {
  0%, 100% { box-shadow: 0 0 0 1px var(--gold-ink), 0 0 9px -3px var(--gold-ink); }
  50% { box-shadow: 0 0 0 1px var(--gold-ink), 0 0 20px 0 var(--gold-ink); }
}
@media (prefers-reduced-motion: reduce) { .roomcard.featured { animation: none; } }
/* Admin pin/unpin control on a room card (does not open the room). */
.pinbtn { flex: 0 0 auto; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--card-line); background: var(--card); color: var(--ink); cursor: pointer; }
.pinbtn:active { transform: scale(0.96); }
.pres { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--icon); margin-right: 6px; vertical-align: middle; flex: 0 0 auto; }
.pres.on { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,0.22); }
.onlinechip { font-size: 12px; font-weight: 700; color: #16a34a; letter-spacing: 0.02em; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.infocard .line { display: flex; justify-content: space-between; font-size: 13.5px; margin: 5px 0; gap: 10px; }
.infocard .line span:first-child { color: var(--muted); }
.infocard .line b { text-align: right; }

.stepper { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 12px 0; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--card-line); background: var(--card); color: var(--ink); font-size: 22px; cursor: pointer; }
.stepper .count { font-weight: 800; font-size: 26px; min-width: 34px; text-align: center; }

/* Two cards per row on a phone; minmax(0,1fr) lets the tracks (and the cells
   below) shrink so a card never overflows its column. Wider screens fit more. */
.cards-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; justify-content: center; padding: 4px 0 10px; }
@media (min-width: 560px) { .cards-wrap { grid-template-columns: repeat(auto-fill, minmax(160px, 210px)); } }
.bcard { background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; padding: 8px; min-width: 0; }
/* Watermark for upcoming (not-yet-in-play) cards, e.g. next-round cards. */
.bcard.wmcard { position: relative; }
.bcard.wmcard .bgrid { opacity: 0.42; }
.bcard.wmcard::after {
  content: attr(data-wm);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; text-align: center;
  transform: rotate(-16deg);
  font-weight: 900; font-size: 14px; letter-spacing: 0.06em; line-height: 1.25;
  color: var(--accent); text-shadow: 0 1px 3px rgba(0,0,0,0.55);
  pointer-events: none; padding: 0 12px;
}
.bgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; min-width: 0; }
.bgrid .h { aspect-ratio: 1 / 0.62; border-radius: 6px; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.bgrid .c { aspect-ratio: 1; border-radius: 6px; border: 1px solid var(--card-line); display: flex; align-items: center; justify-content: center; font-size: 14px; font-variant-numeric: tabular-nums; background: var(--app); cursor: default; }
.bgrid .c.hit { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.bgrid .c.free { font-size: 9px; color: var(--muted); }
.bgrid .c.tap { cursor: pointer; }
/* Pattern progress: cells that count toward the (near) winning shape. Covered ones
   glow solid brand red (stronger than the soft-red normal daub, so they still
   stand out); still-needed ones show a red dashed outline, so a bingo builds up
   visibly. */
.bgrid .c.pat.hit { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 800; box-shadow: 0 0 7px -1px var(--accent); }
.bgrid .c.pat:not(.hit) { border: 2px dashed var(--accent); color: var(--accent); }

.caller { display: flex; align-items: center; gap: 16px; }
.bigball { width: 90px; height: 90px; border-radius: 50%; background: var(--muted); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: inset -4px -6px 0 rgba(0,0,0,0.2); flex: none; }
.bigball .l { font-weight: 800; font-size: 15px; }
.bigball .n { font-weight: 900; font-size: 34px; line-height: 1; }
.potbar { display: flex; justify-content: space-between; background: var(--gold-bg); color: var(--gold-ink); border-radius: 10px; padding: 8px 12px; margin: 10px 0; font-size: 13px; }
.potbar b { font-size: 16px; }
.board { background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; padding: 8px; margin: 8px 0; overflow-x: auto; }
.brow { display: flex; gap: 3px; align-items: center; margin: 2px 0; }
.brow .lbl { width: 20px; height: 20px; border-radius: 50%; flex: none; color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.brow .bn { width: 20px; height: 20px; border-radius: 4px; flex: none; background: var(--app); border: 1px solid var(--card-line); font-size: 8.5px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.brow .bn.called { color: #fff; border-color: transparent; }
.brow .bn.tap { cursor: pointer; }
.bingo { background: var(--accent); color: #fff; border: none; border-radius: 14px; width: 100%; padding: 16px; font-weight: 900; font-size: 22px; letter-spacing: 0.04em; cursor: pointer; margin-top: 8px; opacity: 0.4; pointer-events: none; }
.bingo.ready { opacity: 1; pointer-events: auto; animation: bingopulse 0.9s ease-in-out infinite; }
@keyframes bingopulse {
  0%   { box-shadow: 0 0 0 0 rgba(196,58,49,0.7); transform: scale(1); }
  50%  { box-shadow: 0 0 24px 10px rgba(196,58,49,0.55); transform: scale(1.045); }
  100% { box-shadow: 0 0 0 0 rgba(196,58,49,0); transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .bingo.ready { animation: none; box-shadow: 0 0 16px 4px rgba(196,58,49,0.45); }
}
/* Tells players they must tap BINGO! to win; emphasized when their card completes. */
.bingohint { text-align: center; font-size: 13px; color: var(--muted); margin: 6px 0 0; min-height: 16px; }
.bingohint.ready { color: var(--accent); font-weight: 800; font-size: 15px; animation: hintbounce 0.9s ease-in-out infinite; }
@keyframes hintbounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .bingohint.ready { animation: none; } }

.chatlist { background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; padding: 8px; height: clamp(200px, 40vh, 380px); overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
/* "Hide messages" toggles the hidden attribute; the display:flex above would
   otherwise override it, so collapse it explicitly. */
.chatlist[hidden] { display: none; }
.chatlist .m { font-size: 12.5px; } .chatlist .m b { font-weight: 700; }
.chatlist .chatt { color: var(--muted); font-size: 10.5px; margin-left: 2px; white-space: nowrap; }
.chatinput { display: flex; gap: 6px; }
.chatinput input { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--card-line); background: var(--card); color: var(--ink); }
.chatinput button { border: none; background: var(--accent); color: #fff; border-radius: 10px; padding: 0 16px; font-weight: 600; }
/* Voice messages: mic button, the recording bar, and the in-chat audio player. */
.chatinput .micbtn { flex: 0 0 auto; background: transparent; color: var(--accent); border: 1px solid var(--card-line); padding: 0 11px; display: flex; align-items: center; justify-content: center; }
.chatinput .micbtn .bi { width: 20px; height: 20px; }
.recbar { display: flex; align-items: center; gap: 8px; padding: 7px 4px; }
.recbar .recdot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; animation: recpulse 1s ease-in-out infinite; }
.recbar .rectime { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; }
.recbar .reclbl { flex: 1; color: var(--muted); font-size: 12.5px; }
@keyframes recpulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .recbar .recdot { animation: none; } }
/* Compact in-chat voice player: round play button + progress bar + duration.
   Kept short so it does not hog vertical space in the chat. */
.vplayer { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; background: var(--app); border: 1px solid var(--card-line); border-radius: 999px; padding: 1px 10px 1px 1px; max-width: 200px; }
.vplayer .vplay { flex: 0 0 auto; width: 21px; height: 21px; border-radius: 50%; border: none; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.vplayer .vplay .bi { width: 12px; height: 12px; }
.vplayer .vbar { flex: 1; height: 3px; min-width: 50px; background: var(--card-line); border-radius: 2px; overflow: hidden; }
.vplayer .vbar .vfill { display: block; height: 100%; width: 0%; background: var(--accent); border-radius: 2px; }
.vplayer .vdur { flex: 0 0 auto; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.reacts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.reacts button { border: 1px solid var(--card-line); background: var(--card); border-radius: 99px; padding: 5px 10px; font-size: 15px; cursor: pointer; }
/* Floating chat: when the live message list is hidden, new messages briefly float
   over the screen (non-blocking) so play is not crowded but chat is still visible. */
#chatFloat { position: fixed; left: 12px; right: 12px; bottom: 120px; z-index: 40; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; pointer-events: none; }
.floatmsg { max-width: 92%; background: rgba(20,22,28,0.82); color: #fff; border-radius: 12px; padding: 7px 12px; font-size: 13.5px; line-height: 1.35; box-shadow: 0 4px 14px rgba(0,0,0,0.3); opacity: 1; transform: translateY(0); transition: opacity .5s ease, transform .5s ease; }
.floatmsg.out { opacity: 0; transform: translateY(-6px); }
.floatmsg b { font-weight: 700; }
/* Live chat: keep input + quick reactions visible, collapse only the message list. */
.chathead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.chatlbl { font-weight: 600; font-size: 13px; }
.chathead .btn.small { padding: 4px 10px; }
/* Per-message + announcement reaction strips (0040). */
.chatlist .m { display: block; line-height: 1.55; }
.chatlist .m .mtext { display: inline; }
/* Chat reactions sit INLINE right after the message text and are compact (small "+"). */
.chatlist .m .mreacts { display: inline-flex; overflow: visible; vertical-align: middle; margin-left: 5px; gap: 3px; }
.chatlist .m .mreacts .rchip { font-size: 11px; padding: 0 6px; line-height: 1.7; }
.chatlist .m .mreacts .rpal { gap: 3px; }
/* Reaction strips stay on ONE row and scroll sideways instead of wrapping down. */
.reactstrip, .mreacts { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.reactstrip::-webkit-scrollbar, .mreacts::-webkit-scrollbar { display: none; }
.rchip { flex: 0 0 auto; }
.mreacts:empty { display: none; }
.rchip { border: 1px solid var(--card-line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 2px 8px; font-size: 13px; line-height: 1.5; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.rchip span { color: var(--muted); font-weight: 600; margin-left: 2px; }
.rchip.on { border-color: var(--accent); background: var(--accent-soft); }
.rchip.on span { color: var(--accent); }
.rchip.radd { color: var(--muted); font-weight: 700; padding: 2px 9px; }
.rpal { display: inline-flex; flex-wrap: nowrap; gap: 4px; }
/* Small 5x5 preview of the pattern to complete, shown in the room. */
.patminiwrap { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; vertical-align: middle; }
.patmini { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; width: 72px; }
.patmini span { aspect-ratio: 1; border-radius: 3px; background: var(--app); border: 1px solid var(--card-line); }
.patmini span.on { background: var(--accent); border-color: var(--accent); }
.patminihint { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
/* Round-intro popup: a larger pattern grid, and non-blocking so play is not interrupted. */
#patIntroModal { pointer-events: none; }
#patIntroModal .patmini { width: 150px; gap: 3px; }
#patIntroModal .patmini span { border-radius: 5px; }
#patIntroModal .patminihint { font-size: 11px; margin-top: 3px; }
/* Popover listing who reacted (long-press on touch, hover on desktop). */
.reactpop { position: fixed; z-index: 9998; background: var(--card); color: var(--ink);
  border: 1px solid var(--card-line); border-radius: 10px; padding: 8px 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.28); max-width: 220px; font-size: 13px; }
.reactpop .rh { font-weight: 700; margin-bottom: 4px; }
.reactpop .rn div { padding: 1px 0; color: var(--muted); }
/* The "+" toggles the palette via the hidden attribute; the display rule above
   would otherwise override it, so the palette must explicitly collapse when hidden. */
.rpal[hidden] { display: none; }

.prow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: none; }
.prow .who { flex: 1; min-width: 0; }
.prow .who small { display: block; color: var(--muted); font-size: 11.5px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.pill { display: inline-block; white-space: nowrap; vertical-align: middle; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 99px; background: var(--good-bg); color: var(--good-ink); }
.pill.pending { background: transparent; color: var(--muted); border: 1px solid var(--card-line); }
.winlist { display: flex; flex-direction: column; gap: 9px; margin-top: 11px; }
.winrow { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.winrow .wl { font-size: 13px; min-width: 0; line-height: 1.45; }
.winrow .wl .pill { margin: 1px 0; }
.winrow .wl b { font-weight: 700; }
.winrow .wl small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.uname { color: var(--muted); font-weight: 600; font-size: 0.86em; }
.markbtn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--card-line); color: var(--ink); background: transparent; border-radius: 10px; padding: 7px 11px; font-size: 12px; font-weight: 700; cursor: pointer; flex: 0 0 auto; }
.markbtn .mi { color: currentColor; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; padding: 10px 12px; }
.stat .v { font-weight: 800; font-size: 20px; } .stat .k { font-size: 11px; color: var(--muted); }

.peditor { display: grid; grid-template-columns: repeat(5, 46px); gap: 4px; justify-content: center; }
.pcell { width: 46px; height: 46px; border-radius: 8px; background: var(--app); border: 1px solid var(--card-line); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 9px; color: var(--muted); }
.pcell.on { background: var(--accent); border-color: var(--accent); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--app); padding: 11px 18px; border-radius: 10px; font-size: 14px; opacity: 0; transition: all 0.3s; z-index: 100; max-width: 90%; text-align: center; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; padding: 24px; z-index: 60; }
.overlay.show { display: flex; }
/* Win popup: live list of who got BINGO during the claim window (scoped to
   #winList so it does not affect the history screen's .winlist/.winrow). */
#winList { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; text-align: left; }
#winList .winrow { display: flex; justify-content: flex-start; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; padding: 8px 12px; border: 1px solid var(--card-line); border-radius: 12px; background: var(--app); }
#winList .winrow svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--g); }
.modal { background: var(--card); border-radius: 18px; padding: 22px; width: 100%; max-width: 380px; max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal .actions { display: flex; gap: 10px; }
.modal .actions .btn { width: auto; flex: 1; }
.win { text-align: center; }
.win .big { font-weight: 900; font-size: 34px; color: var(--accent); }
.prize { background: var(--good-bg); color: var(--good-ink); padding: 10px; border-radius: 10px; font-size: 13px; margin: 12px 0; }

.center { min-height: 80dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 24px; }
/* Finished screen: the winners-by-round list reads as a left-aligned, full-width
   list (name left, paid badge/button right) instead of centered + ragged. */
.finwinners { text-align: left; width: 100%; max-width: 440px; margin: 6px auto 0; }
.finwinners .spread { width: 100%; }
.balls { display: flex; gap: 8px; }
.balls div { width: 40px; height: 40px; border-radius: 50%; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: inset -3px -4px 0 rgba(0,0,0,0.18); }
