/* GameNex — dark premium theme, mobile first */
:root {
  --bg: #0b0d12;
  --bg-2: #10131a;
  --surface: #151922;
  --surface-2: #1b2030;
  --line: #262c3d;
  --text: #e9ecf2;
  --muted: #8b93a7;
  --gold: #e6b54a;
  --gold-2: #f3cf72;
  --teal: #3fd0c9;
  --win: #4ade80;
  --lose: #f87171;
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", "Noto Sans Lao", "Noto Sans SC", "PingFang SC", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(230, 181, 74, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(63, 208, 201, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, select { font: inherit; color: inherit; }
.muted { color: var(--muted); margin: 0; font-size: 14px; }

/* Tones used by beads, rings, bet buttons and results */
.tone-red { --tone: #ef4444; }
.tone-blue { --tone: #3b82f6; }
.tone-green { --tone: #22c55e; }
.tone-gold { --tone: #e6b54a; }
.tone-silver { --tone: #aeb7c7; }
.tone-dark { --tone: #4b5263; }
.tone-purple { --tone: #a855f7; }
.tone-pink { --tone: #ec4899; }
.tone-gray { --tone: #5b6375; }
.tone-c-yellow { --tone: #facc15; }
.tone-c-white { --tone: #f1f5f9; }
.tone-c-pink { --tone: #f472b6; }
.tone-c-blue { --tone: #3b82f6; }
.tone-c-red { --tone: #ef4444; }
.tone-c-green { --tone: #22c55e; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: rgba(11, 13, 18, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.brand-name { font-weight: 700; letter-spacing: 0.02em; font-size: 18px; }
.brand-name b { color: var(--gold); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.api-link { height: 38px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 12px; border: 1px solid rgba(230, 181, 74, 0.5); color: var(--gold-2, #f3cf72); font-weight: 700; font-size: 13px; text-decoration: none; background: var(--surface); }
.conn { display: none; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn[data-state="live"] .dot { background: var(--win); box-shadow: 0 0 8px var(--win); }
.conn[data-state="reconnecting"] .dot { background: var(--gold); }
.balance {
  display: flex; flex-direction: column; align-items: flex-end;
  padding: 4px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
}
.balance-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.balance-value { font-weight: 700; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.balance-value.bump { animation: bump 0.5s ease; }
@keyframes bump { 40% { transform: scale(1.12); color: var(--win); } }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; cursor: pointer; background: var(--surface); border: 1px solid var(--line); }
.icon-btn[aria-pressed="true"] .sound-off, .icon-btn[aria-pressed="false"] .sound-on { display: none; }
.lang select { height: 38px; padding: 0 10px; border-radius: 12px; cursor: pointer; background: var(--surface); border: 1px solid var(--line); }
.notice { margin: 0; padding: 8px 16px; font-size: 12px; text-align: center; color: var(--muted); background: var(--bg-2); border-bottom: 1px solid var(--line); }

/* Shared bits */
.phase {
  font-size: 12px; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted);
}
.phase.small { font-size: 11px; padding: 2px 8px; }
.phase[data-phase="betting"] { color: var(--win); border-color: rgba(74, 222, 128, 0.4); }
.phase[data-phase="drawing"] { color: var(--gold); border-color: rgba(230, 181, 74, 0.4); }
.phase[data-phase="result"] { color: var(--teal); border-color: rgba(63, 208, 201, 0.4); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.speed-fast { color: #fda4af; border-color: rgba(253, 164, 175, 0.35); }
.badge.tier-high { color: var(--gold-2); border-color: rgba(230, 181, 74, 0.4); }
.badge.tier-vip { color: #1b1404; background: linear-gradient(90deg, var(--gold-2), var(--gold)); border-color: transparent; font-weight: 700; }
.round-no { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 5px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--gold)); transition: width 0.25s linear; }
.label { font-size: 12px; color: var(--muted); }
.link { background: none; border: 0; padding: 0; color: var(--teal); cursor: pointer; font-family: ui-monospace, monospace; font-size: 12px; }

/* Lobby */
.lobby, .table-view { max-width: 1200px; margin: 0 auto; padding: 18px 16px 48px; }
.lobby-head h1 { margin: 0; font-size: 26px; }
.tagline { margin: 2px 0 14px; color: var(--muted); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: thin; }
.filter {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); white-space: nowrap;
}
.filter small { color: var(--muted); font-variant-numeric: tabular-nums; }
.filter[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-2); background: rgba(230, 181, 74, 0.1); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; color: var(--text); text-decoration: none;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  transition: border-color 0.2s ease, transform 0.1s ease;
}
.tile:hover { border-color: var(--gold); }
.tile:active { transform: scale(0.98); }
.tile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.tile-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.tile-meta { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); }
.tile-people { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tile-beads { display: flex; gap: 3px; min-height: 18px; flex-wrap: nowrap; overflow: hidden; }
.tile-foot { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* Beads and rings */
.bead {
  position: relative; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--tone, #5b6375); color: #fff; font-size: 11px; font-weight: 700; cursor: pointer;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35); flex: 0 0 auto;
}
.bead.small { width: 16px; height: 16px; font-size: 9px; cursor: inherit; }
.bead.tone-c-white, .bead.tone-c-yellow { color: #1b1404; text-shadow: none; }
.bead.tri { background: var(--bg-2); border: 1px solid var(--line); display: inline-flex; gap: 1px; padding: 3px; }
.bead.tri i { flex: 1; height: 100%; border-radius: 2px; background: var(--tone); }
.bead .mark { position: absolute; width: 6px; height: 6px; border-radius: 50%; border: 1px solid #fff; }
.bead .mark.bankerPair { top: -1px; left: -1px; background: #ef4444; }
.bead .mark.playerPair { bottom: -1px; right: -1px; background: #3b82f6; }

/* Table view */
.tv-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.back { color: var(--teal); text-decoration: none; font-size: 14px; width: fit-content; }
.tv-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tv-title h1 { margin: 0; font-size: 24px; }
.tv-desc { margin: 0; color: var(--muted); font-size: 14px; }
.tv-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.panel {
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); min-width: 0;
}
.panel h2 { margin: 0; font-size: 18px; }
.panel h3 { margin: 4px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.status-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.people { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.people-item { display: inline-flex; gap: 4px; align-items: center; font-variant-numeric: tabular-nums; }
.timer-text { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.result-line { margin: 0; min-height: 1.5em; font-weight: 600; text-align: center; }
.result-line.win { color: var(--win); }
.result-line.lose { color: var(--lose); }

/* Stage */
.stage {
  min-height: 150px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px;
  padding: 14px; border-radius: 14px; background: radial-gradient(circle at 50% 40%, #12382f, #0b1f1b 70%); border: 1px solid #1c4a3f;
  perspective: 800px;
}
.hand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--tone) 50%, transparent); background: rgba(0, 0, 0, 0.2); }
.hand-head { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.hand-name { color: var(--tone); font-weight: 700; }
.hand-total { font-size: 20px; font-weight: 800; }
.cards { display: flex; gap: 6px; }
.card {
  width: 44px; height: 62px; border-radius: 6px; background: #f8fafc; color: #111827;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); animation: deal 0.35s ease both;
}
.card:nth-child(2) { animation-delay: 0.15s; }
.card:nth-child(3) { animation-delay: 0.3s; transform: rotate(90deg); }
.card.red { color: #dc2626; }
.card .rank { font-weight: 800; font-size: 18px; }
.card .suit { font-size: 18px; }
.card.back { background: repeating-linear-gradient(45deg, #7c2d12, #7c2d12 4px, #9a3412 4px, #9a3412 8px); border: 2px solid #f8fafc; animation: none; }
.stage.drawing .card.back { animation: pulse 0.8s ease-in-out infinite; }
@keyframes deal { from { opacity: 0; transform: translateY(-30px) rotateY(90deg); } }
@keyframes pulse { 50% { transform: translateY(-4px); } }

.dice-row { display: flex; gap: 12px; }
.die {
  width: 52px; height: 52px; border-radius: 10px; background: #f8fafc; padding: 7px;
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.die .pip { width: 9px; height: 9px; margin: auto; border-radius: 50%; background: #111827; opacity: 0; }
.die[data-v="1"] .pip:nth-child(5) { opacity: 1; background: #dc2626; width: 12px; height: 12px; }
.die[data-v="2"] .pip:is(:nth-child(1), :nth-child(9)),
.die[data-v="3"] .pip:is(:nth-child(1), :nth-child(5), :nth-child(9)),
.die[data-v="4"] .pip:is(:nth-child(1), :nth-child(3), :nth-child(7), :nth-child(9)),
.die[data-v="5"] .pip:is(:nth-child(1), :nth-child(3), :nth-child(5), :nth-child(7), :nth-child(9)),
.die[data-v="6"] .pip:is(:nth-child(1), :nth-child(3), :nth-child(4), :nth-child(6), :nth-child(7), :nth-child(9)) { opacity: 1; }
.die.rolling, .color-die.rolling { animation: roll 0.35s linear infinite; }
@keyframes roll { 0% { transform: rotate(0) translateY(0); } 50% { transform: rotate(180deg) translateY(-6px); } 100% { transform: rotate(360deg) translateY(0); } }
.big-total { font-size: 32px; font-weight: 800; color: var(--gold-2); }
.color-die { width: 52px; height: 52px; border-radius: 10px; background: var(--tone, #334155); border: 3px solid rgba(255, 255, 255, 0.8); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); }

.ball, .wheel {
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  font-size: 34px; font-weight: 800; color: #fff; background: var(--tone, #334155);
  border: 4px solid rgba(255, 255, 255, 0.85); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.wheel { border-style: dashed; }
.ball.spinning, .wheel.spinning { animation: spin2d 0.6s linear infinite; background: conic-gradient(#ef4444 0 25%, #111827 0 50%, #ef4444 0 75%, #111827 0); }
.wheel.spinning { background: conic-gradient(#e6b54a 0 16%, #3b82f6 0 33%, #a855f7 0 50%, #22c55e 0 66%, #ef4444 0 83%, #ec4899 0); }
@keyframes spin2d { to { transform: rotate(360deg); } }
.fantan { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.coin {
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 40px;
}
.coin .face { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; }
.coin .heads { background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold-2) 30%, var(--gold) 60%, #9b6b16); color: #6b4708; }
.coin .tails { background: radial-gradient(circle at 35% 30%, #ffffff, #cfd6e2 30%, #8e98ab 65%, #4a5263); color: #2b3140; }
.coin.spinning { animation: flip 0.45s linear infinite; }
@keyframes flip { to { transform: rotateY(360deg); } }

/* Bet board */
.board { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); }
.board[data-game="baccarat"] { grid-template-columns: repeat(2, 1fr); }
.board[data-game="baccarat"] .bet:nth-child(3) { grid-column: span 2; }
.board[data-game="sicbo"], .board[data-game="roulette"], .board[data-game="moneywheel"], .board[data-game="colorgame"], .board[data-game="fantan"] { grid-template-columns: repeat(3, 1fr); }
.board[data-game="dragontiger"], .board[data-game="hilo"] { grid-template-columns: repeat(3, 1fr); }
.bet {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 64px;
  padding: 8px 6px; border-radius: 12px; cursor: pointer; text-align: center;
  background: color-mix(in srgb, var(--tone, #5b6375) 12%, var(--bg-2)); border: 1px solid color-mix(in srgb, var(--tone, #5b6375) 45%, transparent);
  transition: transform 0.08s ease, background 0.2s ease;
}
.bet:hover:not(:disabled) { background: color-mix(in srgb, var(--tone, #5b6375) 22%, var(--bg-2)); }
.bet:active:not(:disabled) { transform: scale(0.97); }
.bet:disabled { cursor: not-allowed; opacity: 0.6; }
.bet.winner { opacity: 1; box-shadow: 0 0 0 2px var(--teal), 0 0 18px rgba(63, 208, 201, 0.35); }
.bet-name { font-weight: 700; font-size: 14px; line-height: 1.25; }
.bet-odds { font-size: 11px; color: var(--muted); }
.bet-total { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bet-mine {
  position: absolute; top: -8px; right: -6px; min-width: 26px; padding: 1px 6px; border-radius: 999px;
  background: var(--gold); color: #1b1404; font-size: 11px; font-weight: 800;
}

.amounts { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; }
.chip {
  flex: 0 0 auto; min-width: 52px; height: 36px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  background: var(--bg-2); border: 1px dashed var(--line); font-weight: 600; font-variant-numeric: tabular-nums;
}
.chip[aria-checked="true"] { border: 1px solid var(--gold); color: var(--gold-2); background: rgba(230, 181, 74, 0.1); }
.mine { display: flex; flex-direction: column; gap: 4px; }
.mine-list { font-size: 14px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

/* Scoreboard */
.stats { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; }
.stats-title { width: 100%; color: var(--muted); font-size: 12px; }
.stat { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.stat .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tone); }
.road {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(6, 24px);
  grid-template-columns: repeat(var(--cols, 12), 24px); gap: 2px; padding: 6px;
  background: #f8fafc0d; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; justify-content: start;
}
.big-road { grid-template-rows: repeat(6, 18px); grid-template-columns: repeat(var(--cols, 24), 18px); grid-auto-flow: row; }
.ring { position: relative; width: 16px; height: 16px; margin: auto; border-radius: 50%; border: 3px solid var(--tone); }
.ring .tie-mark {
  position: absolute; inset: -3px; display: grid; place-items: center; font-size: 9px; font-style: normal; font-weight: 800; color: #22c55e;
  background: linear-gradient(135deg, transparent 45%, #22c55e 45% 55%, transparent 55%);
}
.history-list { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow-y: auto; }
.history-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; border-radius: 10px; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line); font-size: 13px;
}
.verify-link { color: var(--teal); font-size: 12px; }

/* Verify dialog */
dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 0; }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.verify { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.verify h2 { margin: 0; }
.verdict { margin: 0; font-weight: 700; }
.verdict.ok { color: var(--win); }
.verdict.bad { color: var(--lose); }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.checks li { display: flex; gap: 8px; }
.checks .mark { flex: 0 0 auto; font-weight: 700; }
.checks .pass { color: var(--win); }
.checks .fail { color: var(--lose); }
.checks .skip { color: var(--muted); }
.fields { margin: 0; display: grid; gap: 8px; font-size: 12px; }
.fields dt { color: var(--muted); }
.fields dd { margin: 0; font-family: ui-monospace, monospace; word-break: break-all; }
.btn { align-self: flex-end; height: 40px; padding: 0 18px; border-radius: 12px; cursor: pointer; background: var(--gold); color: #1b1404; border: 0; font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; max-width: calc(100vw - 32px);
  padding: 10px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.toast.error { border-color: rgba(248, 113, 113, 0.5); }

@media (max-width: 519px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar-right { gap: 6px; }
  .brand-name { font-size: 16px; }
  .balance { padding: 4px 10px; }
  .balance-label { display: none; }
  .lang select { max-width: 92px; padding: 0 6px; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .board[data-game="sicbo"], .board[data-game="roulette"] { grid-template-columns: repeat(3, 1fr); }
  .bet-name { font-size: 13px; }
}
@media (max-width: 419px) {
  .brand-name { display: none; }
  .api-link { padding: 0 8px; }
}
@media (min-width: 720px) { .conn { display: flex; } }
@media (min-width: 980px) {
  .tv-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
  .scoreboard { position: sticky; top: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== Thrill effects ===== */
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 40; }
.fx-flash { position: fixed; inset: 0; pointer-events: none; z-index: 39; animation: fx-flash 0.7s ease-out forwards; }
.fx-flash.gold { background: radial-gradient(circle at 50% 45%, rgba(255, 233, 160, 0.75), rgba(230, 181, 74, 0.25) 45%, transparent 75%); }
.fx-flash.white { background: rgba(255, 255, 255, 0.55); }
.fx-flash.red { background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(239, 68, 68, 0.45)); }
@keyframes fx-flash { from { opacity: 1; } to { opacity: 0; } }

.fx-text {
  position: fixed; left: 50%; top: 42%; z-index: 41; pointer-events: none; white-space: nowrap;
  transform: translate(-50%, -50%); font-weight: 900; letter-spacing: 0.02em; text-align: center;
  animation: fx-text 2.2s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}
.fx-text.win { font-size: clamp(34px, 9vw, 72px); color: #fff3c4; text-shadow: 0 0 18px #e6b54a, 0 0 42px #e6b54a, 0 4px 0 #9b6b16; }
.fx-text.bigwin {
  font-size: clamp(46px, 13vw, 120px); background: linear-gradient(180deg, #fff7d6, #f3cf72 45%, #c8922a 55%, #fff3c4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 20px rgba(243, 207, 114, 0.9)) drop-shadow(0 6px 0 #7a5410);
  animation-duration: 3.2s;
}
.fx-text.amount {
  top: 60%; z-index: 60; font-size: clamp(52px, 15vw, 120px); font-variant-numeric: tabular-nums; color: #7cffb0;
  text-shadow: 0 0 18px rgba(74, 222, 128, 0.95), 0 0 48px rgba(74, 222, 128, 0.6), 0 5px 0 #14532d;
  animation: fx-amount 3s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}
.fx-text.amount.big { font-size: clamp(60px, 19vw, 160px); color: #fff3c4; text-shadow: 0 0 22px #f3cf72, 0 0 60px #e6b54a, 0 6px 0 #9b6b16; animation-duration: 4.2s; }
@keyframes fx-amount {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  22% { transform: translate(-50%, -50%) scale(1); }
  85% { opacity: 1; transform: translate(-50%, -52%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(0.95); }
}
.fx-text.lose { font-size: clamp(26px, 6vw, 44px); color: #fca5a5; text-shadow: 0 0 14px rgba(248, 113, 113, 0.6); animation-duration: 1.6s; }
.fx-text.push { font-size: clamp(26px, 6vw, 44px); color: #e9ecf2; text-shadow: 0 0 14px rgba(255, 255, 255, 0.5); animation-duration: 1.6s; }
@keyframes fx-text {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(-6deg); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.25) rotate(2deg); }
  30% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  80% { opacity: 1; transform: translate(-50%, -58%) scale(1.02); }
  100% { opacity: 0; transform: translate(-50%, -75%) scale(0.95); }
}

.shake-1 { animation: shake 0.35s linear; }
.shake-2 { animation: shake 0.5s linear; --s: 7px; }
.shake-3 { animation: shake 0.65s linear; --s: 12px; }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(calc(var(--s, 4px) * -1), calc(var(--s, 4px) * 0.5)); }
  30% { transform: translate(var(--s, 4px), calc(var(--s, 4px) * -0.5)); }
  45% { transform: translate(calc(var(--s, 4px) * -0.8), calc(var(--s, 4px) * -0.6)); }
  60% { transform: translate(calc(var(--s, 4px) * 0.7), calc(var(--s, 4px) * 0.4)); }
  80% { transform: translate(calc(var(--s, 4px) * -0.3), 0); }
}

/* Stage tension */
.stage-wrap { position: relative; }
.stage-count {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-size: 96px; font-weight: 900; color: rgba(255, 255, 255, 0.92); text-shadow: 0 0 24px #ef4444, 0 0 60px #ef4444;
  opacity: 0;
}
.stage-count.beat { animation: beat 0.9s ease-out; }
@keyframes beat { 0% { opacity: 0; transform: scale(2.2); } 20% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0.85); } }
.stage-banner {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  padding: 3px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; opacity: 0;
  background: rgba(239, 68, 68, 0.9); color: #fff; box-shadow: 0 0 18px rgba(239, 68, 68, 0.7);
}
.stage-wrap.urgent .stage-banner { opacity: 1; animation: blink 0.5s steps(2) infinite; }
.stage-wrap.drawing .stage-banner { opacity: 1; background: rgba(230, 181, 74, 0.95); color: #1b1404; box-shadow: 0 0 18px rgba(230, 181, 74, 0.8); animation: none; }
@keyframes blink { 50% { opacity: 0.35; } }
.stage-wrap.urgent .stage { animation: urgent 1s ease-in-out infinite; }
@keyframes urgent {
  0%, 100% { box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.6), 0 0 18px rgba(239, 68, 68, 0.35), inset 0 0 30px rgba(239, 68, 68, 0.15); }
  50% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 1), 0 0 42px rgba(239, 68, 68, 0.75), inset 0 0 60px rgba(239, 68, 68, 0.3); }
}
.stage.drawing { position: relative; overflow: hidden; box-shadow: 0 0 0 2px rgba(230, 181, 74, 0.8), 0 0 40px rgba(230, 181, 74, 0.45); }
.stage.drawing::after {
  content: ''; position: absolute; inset: -40%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(255, 233, 160, 0.28) 80%, transparent 90%);
  animation: spin2d 1.1s linear infinite;
}
.stage.reveal-pop { animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes pop { 0% { transform: scale(0.96); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* Card-by-card reveal */
.cards .card:nth-child(3) { --rot: rotate(90deg); }
.card.reveal { animation: flip-in 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
@keyframes flip-in {
  0% { opacity: 0; transform: translateY(-50px) rotateY(180deg) scale(1.4); }
  60% { opacity: 1; transform: rotateY(0) scale(1.15); box-shadow: 0 0 26px rgba(255, 233, 160, 0.9); }
  100% { opacity: 1; transform: var(--rot, none); }
}
.reveal-total { animation: total-in 0.5s ease both; }
@keyframes total-in { 0% { opacity: 0; transform: scale(2.4); } 100% { opacity: 1; transform: scale(1); } }
.coin.landing { animation: land 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
@keyframes land { 0% { transform: translateY(-60px) rotateY(720deg) scale(1.4); } 100% { transform: none; } }

/* Winning bet and lobby tile flash */
.bet.winner { animation: winner 0.9s ease-in-out infinite; }
@keyframes winner {
  0%, 100% { box-shadow: 0 0 0 2px var(--teal), 0 0 14px rgba(63, 208, 201, 0.35); }
  50% { box-shadow: 0 0 0 3px #fff3c4, 0 0 30px rgba(243, 207, 114, 0.85); }
}
.tile.fresh { animation: tile-flash 1.2s ease-out; }
@keyframes tile-flash { 0% { box-shadow: 0 0 0 2px var(--gold), 0 0 26px rgba(230, 181, 74, 0.7); } 100% { box-shadow: none; } }
.balance-value.bump { animation: bump-big 0.9s ease; }
@keyframes bump-big { 30% { transform: scale(1.35); color: var(--win); text-shadow: 0 0 14px var(--win); } }
.icon-btn[data-level="normal"] .sound-on::after { content: '·'; }

/* ===== Categories & themed games ===== */
.tone-teal { --tone: #14b8a6; }
.tone-orange { --tone: #f97316; }

.lobby-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.search {
  flex: 1; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); max-width: 420px;
}
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; }
.search:focus-within { border-color: var(--gold); }
.filters.categories { margin-bottom: 8px; }
.filters.categories .filter { height: 40px; font-weight: 600; }
.filter-icon { font-size: 18px; line-height: 1; }
.filters.subfilters { margin-bottom: 14px; }
.filters.subfilters .filter { height: 32px; padding: 0 12px; font-size: 13px; }
.filters.subfilters .filter[aria-pressed="true"] { border-color: var(--accent, var(--gold)); color: var(--text); background: color-mix(in srgb, var(--accent, var(--gold)) 22%, transparent); }
.category-head { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 8px; }
.category-head h2 { margin: 0; font-size: 20px; }
.cat-icon { font-size: 24px; }

.tile { min-width: 0; }
.stage { padding-top: 42px; }
.tile.themed { border-top: 3px solid var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, var(--surface-2)), var(--surface)); }
.tile.themed:hover { border-color: var(--accent); }
.tile-pics { font-size: 20px; letter-spacing: 2px; white-space: nowrap; overflow: hidden; text-overflow: clip; line-height: 1.2; }
.badge.table-id { font-family: ui-monospace, monospace; }
.bead.pic { background: color-mix(in srgb, var(--tone) 35%, var(--bg-2)); border: 2px solid var(--tone); font-size: 13px; text-shadow: none; }
.bead.pic.small { font-size: 9px; border-width: 1px; }

/* Bet board layouts for themed styles */
.board[data-style="race"], .board[data-style="dice"], .board[data-style="duel"] { grid-template-columns: repeat(3, 1fr); }
.board[data-style="wheel"] { grid-template-columns: repeat(4, 1fr); }
.board[data-style="wheel"] .bet-name { font-size: 12px; }
.stage.themed { background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--accent) 30%, #0b1f1b), #0b1220 75%); border-color: color-mix(in srgb, var(--accent) 50%, #1c4a3f); }

/* Race */
.race { position: relative; width: 100%; display: flex; flex-direction: column; gap: 4px; }
.lane { display: grid; grid-template-columns: 74px 1fr 26px; align-items: center; gap: 6px; height: 30px; }
.lane-name { font-size: 11px; color: var(--tone); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track {
  position: relative; height: 100%; border-radius: 8px; margin-right: 26px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 18px, rgba(255, 255, 255, 0.1) 18px 20px);
  border-bottom: 2px solid color-mix(in srgb, var(--tone) 60%, transparent);
}
.runner { position: absolute; left: 0; top: 50%; transform: translateY(-50%) scaleX(-1); font-size: 24px; line-height: 1; }
.runner.ready { animation: ready 0.5s ease-in-out infinite; }
.runner.running { animation: gallop 0.22s ease-in-out infinite; }
@keyframes ready { 50% { transform: translateY(-62%) scaleX(-1); } }
@keyframes gallop { 0%, 100% { transform: translateY(-50%) scaleX(-1) rotate(0); } 50% { transform: translateY(-75%) scaleX(-1) rotate(-8deg); } }
.lane .rank { font-size: 14px; font-weight: 800; text-align: center; }
.lane.first { background: linear-gradient(90deg, transparent, rgba(243, 207, 114, 0.18)); border-radius: 8px; }
.lane.first .rank { animation: total-in 0.5s ease both; }
.track::after {
  content: ''; position: absolute; top: -2px; bottom: -2px; right: 0; width: 5px;
  background: repeating-linear-gradient(0deg, #fff 0 5px, #111 5px 10px); opacity: 0.85;
}

/* Lucky wheel */
.spinner { --r: 96px; position: relative; width: calc(var(--r) * 2); height: calc(var(--r) * 2); }
.spinner-disc {
  position: absolute; inset: 0; border-radius: 50%; border: 5px solid #f8fafc;
  box-shadow: 0 0 0 3px var(--accent, var(--gold)), 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.35);
}
.spinner-disc.idle { animation: spin2d 6s linear infinite; }
.spinner .slot { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; display: grid; place-items: center; font-size: 26px; transition: transform 0.3s; }
.spinner .slot.hit { filter: drop-shadow(0 0 10px #fff3c4); animation: slot-hit 0.6s ease-in-out 3; }
@keyframes slot-hit { 50% { font-size: 38px; } }
.spinner-hub { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 60%, #9b6b16); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.spinner-pointer {
  position: absolute; left: 50%; top: -14px; width: 0; height: 0; margin-left: -13px;
  border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 28px solid #fff3c4;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}
.spinner.stopped .spinner-pointer { animation: pointer-bounce 0.4s ease 2; }
@keyframes pointer-bounce { 50% { transform: translateY(-6px); } }

/* Picture dice */
.pdie {
  width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; font-size: 38px;
  background: linear-gradient(145deg, #ffffff, #dfe5ee); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45), inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}
.pdie.rolling { animation: roll 0.35s linear infinite; }

/* Duel */
.avatar { font-size: 40px; line-height: 1; }
.versus { font-size: 22px; font-weight: 900; color: var(--gold-2); text-shadow: 0 0 12px rgba(230, 181, 74, 0.8); }
.hand.champion { border-color: #fff3c4; box-shadow: 0 0 0 2px var(--gold), 0 0 28px rgba(243, 207, 114, 0.7); animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); }
.hand.champion .avatar::after { content: ' 👑'; font-size: 24px; }

/* Staged classic reveals */
.die.landed, .color-die.landed, .pdie.landed { animation: die-land 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4); box-shadow: 0 0 0 3px #fff3c4, 0 0 22px rgba(243, 207, 114, 0.8); }
@keyframes die-land { 0% { transform: translateY(-40px) rotate(-25deg) scale(1.3); } 100% { transform: none; } }
.color-die.blank { background: #334155; }
.ball.landed, .wheel.landed { animation: die-land 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4); box-shadow: 0 0 0 4px #fff3c4, 0 0 32px rgba(243, 207, 114, 0.85); }
.ball.rolling-num, .wheel.rolling-num { transition: background 0.08s; }
.coin.tossed { animation: toss 2s cubic-bezier(0.3, 0, 0.7, 1), flip 0.25s linear infinite; }
@keyframes toss { 0% { translate: 0 0; } 45% { translate: 0 -70px; } 100% { translate: 0 0; } }
.bead-pile { display: flex; flex-wrap: wrap; gap: 3px; max-width: 240px; justify-content: center; }
.bead-pile i { width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #cbd5e1 50%, #64748b); }
.bead-count { font-size: 22px; font-weight: 800; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.stage-wrap.revealing .stage-banner { opacity: 1; background: rgba(230, 181, 74, 0.95); color: #1b1404; box-shadow: 0 0 18px rgba(230, 181, 74, 0.8); animation: blink 0.6s steps(2) infinite; }
.stage-wrap.revealing .stage { box-shadow: 0 0 0 2px rgba(230, 181, 74, 0.9), 0 0 46px rgba(230, 181, 74, 0.5); }

@media (max-width: 519px) {
  .lane { grid-template-columns: 54px 1fr 22px; }
  .lane-name { font-size: 10px; }
  .runner { font-size: 20px; }
  .spinner { --r: 84px; }
  .board[data-style="wheel"] { grid-template-columns: repeat(4, 1fr); }
  .board[data-style="wheel"] .bet { padding-left: 4px; padding-right: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .runner.running, .runner.ready, .spinner-disc.idle, .pdie.rolling, .coin.tossed { animation: none; }
}
.tile .tile-head { flex-direction: column-reverse; align-items: flex-start; gap: 4px; }

/* ===== Coin chips ===== */
.coin { --c: #64748b; --c2: #e2e8f0; }
.coin.c0 { --c: #2563eb; --c2: #dbeafe; }
.coin.c1 { --c: #dc2626; --c2: #fee2e2; }
.coin.c2 { --c: #16a34a; --c2: #dcfce7; }
.coin.c3 { --c: #111827; --c2: #f3cf72; }
.coin.c4 { --c: #7c3aed; --c2: #f3cf72; }
.amounts { gap: 10px; padding: 6px 2px; }
.chip.coin {
  position: relative; flex: 0 0 auto; width: 54px; height: 54px; min-width: 0; padding: 0; border-radius: 50%; border: 0;
  display: grid; place-items: center; cursor: pointer; color: #fff; font-weight: 800; font-size: 13px;
  background:
    radial-gradient(circle at 50% 50%, var(--c) 0 52%, transparent 53%),
    repeating-conic-gradient(var(--c2) 0 15deg, var(--c) 15deg 45deg);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 4px 0 rgba(0, 0, 0, 0.45), inset 0 0 0 3px rgba(255, 255, 255, 0.15);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.chip.coin .coin-face {
  width: 64%; height: 64%; border-radius: 50%; display: grid; place-items: center;
  border: 2px dashed rgba(255, 255, 255, 0.6); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.chip.coin[aria-checked="true"] { transform: translateY(-6px) scale(1.08); box-shadow: 0 0 0 2px #fff3c4, 0 0 18px rgba(243, 207, 114, 0.9), 0 8px 0 rgba(0, 0, 0, 0.45); }
.chip.coin:active { transform: scale(0.94); }
.chip.coin.fly { position: fixed; z-index: 60; pointer-events: none; margin: 0; }
.bet .stack, .num .stack { position: absolute; top: -8px; right: -6px; display: none; }
.stack.on {
  display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 4px; border-radius: 999px;
  font-size: 10px; font-weight: 800; color: #fff; background: var(--c, #e6b54a);
  box-shadow: 0 0 0 2px var(--c2, #fff), 0 2px 0 2px rgba(0, 0, 0, 0.45);
}
.stack.on.c0 { --c: #2563eb; --c2: #dbeafe; }
.stack.on.c1 { --c: #dc2626; --c2: #fee2e2; }
.stack.on.c2 { --c: #16a34a; --c2: #dcfce7; }
.stack.on.c3 { --c: #111827; --c2: #f3cf72; }
.stack.on.c4 { --c: #7c3aed; --c2: #f3cf72; }
.chip-hit { animation: chip-hit 0.35s ease; }
@keyframes chip-hit { 40% { transform: scale(1.06); box-shadow: 0 0 0 2px #fff3c4, 0 0 22px rgba(243, 207, 114, 0.8); } }
.mine-list { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.mine-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.mini-coin { width: 14px; height: 14px; border-radius: 50%; background: var(--c, #e6b54a); box-shadow: 0 0 0 2px var(--c2, #fff); }
.mini-coin.c0 { --c: #2563eb; --c2: #dbeafe; } .mini-coin.c1 { --c: #dc2626; --c2: #fee2e2; } .mini-coin.c2 { --c: #16a34a; --c2: #dcfce7; }
.mini-coin.c3 { --c: #111827; --c2: #f3cf72; } .mini-coin.c4 { --c: #7c3aed; --c2: #f3cf72; }

/* ===== Speed rooms, rules & guide ===== */
.rooms-head { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 6px; }
.rooms-label { font-weight: 700; }
.filters.rooms { margin-bottom: 10px; }
.filters.rooms .filter { height: 38px; font-weight: 700; }
.filters.rooms .filter[aria-pressed="true"] { border-color: var(--teal); color: #c8fffb; background: rgba(63, 208, 201, 0.14); }
.badge.room { color: var(--teal); border-color: rgba(63, 208, 201, 0.4); }
.badge.room-5S, .badge.room-10S { color: #fda4af; border-color: rgba(253, 164, 175, 0.4); }
.tile.lottery { border-top: 3px solid #e6b54a; background: linear-gradient(180deg, rgba(230, 181, 74, 0.12), var(--surface)); }
.tv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-btn {
  height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 13px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
}
.pill-btn:hover { border-color: var(--gold); }
.rules-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; }
.mono { font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; color: var(--muted); }
.drand-link { color: var(--teal); font-size: 13px; word-break: break-all; }
.outcome-text { font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
dialog { max-height: 86vh; overflow-y: auto; }

/* ===== Lottery stages ===== */
.lotto-board { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.drum-row { display: flex; align-items: center; gap: 8px; }
.drum-label { width: 70px; font-size: 12px; color: var(--muted); text-align: right; }
.drum {
  width: 48px; height: 62px; border-radius: 10px; display: grid; place-items: center; font-size: 34px; font-weight: 900;
  background: linear-gradient(180deg, #fff, #dfe5ee 50%, #fff); color: #111827; box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.4);
  font-variant-numeric: tabular-nums;
}
.drum.spinning { filter: blur(0.6px); color: #475569; animation: drum 0.12s linear infinite; }
@keyframes drum { 50% { transform: translateY(-3px); } }
.drum.set { color: #b91c1c; }
.drum.landed { animation: die-land 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.4); box-shadow: 0 0 0 3px #fff3c4, 0 0 20px rgba(243, 207, 114, 0.8); }
.keno-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; width: 100%; max-width: 420px; }
.kc {
  display: grid; place-items: center; height: 24px; border-radius: 6px; font-size: 11px; font-weight: 700;
  background: rgba(255, 255, 255, 0.06); color: var(--muted); font-variant-numeric: tabular-nums;
}
.kc.flash { background: rgba(230, 181, 74, 0.35); color: #fff; }
.kc.hit { background: radial-gradient(circle at 35% 30%, #fff3c4, #e6b54a 60%, #9b6b16); color: #1b1404; }
.kc.pop { animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); }
.lotto-info { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; font-weight: 700; }
.lotto-info .tag { padding: 2px 10px; border-radius: 999px; background: var(--tone); color: #fff; font-size: 13px; }
.lotto-info .sum { font-size: 18px; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.ball-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.lball {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 18px;
  background: radial-gradient(circle at 35% 30%, #fff, #e2e8f0 45%, #94a3b8); color: #111827; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}
.lball.spinning { animation: roll 0.35s linear infinite; color: #64748b; }
.lball.set { background: radial-gradient(circle at 35% 30%, #fff3c4, #f3cf72 45%, #b7791f); }
.lball.bonus.set { background: radial-gradient(circle at 35% 30%, #fecaca, #ef4444 50%, #7f1d1d); color: #fff; }
.lball.landed { animation: die-land 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
.plus { font-size: 22px; color: var(--muted); }
.slot.digit { font-size: 22px; font-weight: 900; color: #fff; text-shadow: 0 2px 2px rgba(0, 0, 0, 0.6); }

/* ===== Lottery boards ===== */
.board[data-style="thai"], .board[data-style="keno"], .board[data-style="lotto"] { display: flex; flex-direction: column; gap: 10px; }
.board[data-style="digit"] { grid-template-columns: repeat(5, 1fr); }
.lotto-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.lotto-tabs .filter { height: 34px; font-size: 13px; }
.digit-display { display: flex; gap: 8px; justify-content: center; }
.dbox {
  width: 52px; height: 62px; border-radius: 12px; display: grid; place-items: center; font-size: 34px; font-weight: 900;
  border: 2px dashed var(--line); background: var(--bg-2); color: var(--gold-2);
}
.dbox.set { border-style: solid; border-color: var(--gold); box-shadow: 0 0 14px rgba(230, 181, 74, 0.35); }
.lotto-pays { text-align: center; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 320px; width: 100%; margin: 0 auto; }
.key {
  height: 48px; border-radius: 12px; font-size: 22px; font-weight: 800; cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
}
.key:active { transform: scale(0.95); background: rgba(230, 181, 74, 0.2); }
.place-btn { align-self: center; min-width: 200px; height: 46px; font-size: 16px; }
.place-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.side-bets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.grid-hint { text-align: center; }
.num-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.num-grid.n35, .num-grid.n45, .num-grid.n49 { grid-template-columns: repeat(7, 1fr); }
.num {
  position: relative; height: 36px; border-radius: 8px; cursor: pointer; font-weight: 800; font-size: 13px;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.num:hover:not(:disabled) { border-color: var(--gold); }
.num:disabled { opacity: 0.55; cursor: not-allowed; }
.num.winner { background: radial-gradient(circle at 35% 30%, #fff3c4, #e6b54a 60%, #9b6b16); color: #1b1404; }
.num .stack.on { top: -6px; right: -6px; min-width: 22px; height: 22px; font-size: 9px; }
@media (max-width: 519px) {
  .num-grid { grid-template-columns: repeat(8, 1fr); }
  .num-grid.n35, .num-grid.n45, .num-grid.n49 { grid-template-columns: repeat(7, 1fr); }
  .chip.coin { width: 48px; height: 48px; font-size: 12px; }
  .drum { width: 42px; height: 56px; font-size: 30px; }
  .lball { width: 40px; height: 40px; font-size: 16px; }
}

/* ===== Slots ===== */
.slot-view { max-width: 820px; margin: 0 auto; padding: 18px 16px 48px; display: flex; flex-direction: column; gap: 14px; }
.slot-tile { gap: 6px; border-top: 3px solid var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 22%, var(--surface-2)), var(--surface)); }
.slot-pics { font-size: 26px; letter-spacing: 2px; white-space: nowrap; overflow: hidden; }
.slot-max { font-size: 11px; color: var(--gold-2); font-weight: 700; }
.badge.vol-low { color: #86efac; border-color: rgba(134, 239, 172, 0.4); }
.badge.vol-medium { color: #93c5fd; border-color: rgba(147, 197, 253, 0.4); }
.badge.vol-high { color: #fca5a5; border-color: rgba(252, 165, 165, 0.4); }
.badge.vol-extreme { color: #fff; background: linear-gradient(90deg, #dc2626, #7c3aed); border-color: transparent; font-weight: 800; }
.machine {
  position: relative; padding: 14px; border-radius: 22px;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent, #e6b54a) 40%, #1b1030), #0b0d12 75%);
  border: 2px solid color-mix(in srgb, var(--accent, #e6b54a) 60%, transparent);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.4), 0 0 40px color-mix(in srgb, var(--accent, #e6b54a) 35%, transparent), inset 0 0 40px rgba(0, 0, 0, 0.6);
}
.reels {
  position: relative; display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 6px; padding: 8px;
  border-radius: 16px; background: linear-gradient(180deg, #0b1020, #16122e 50%, #0b1020); overflow: hidden;
  box-shadow: inset 0 8px 18px rgba(0, 0, 0, 0.8), inset 0 -8px 18px rgba(0, 0, 0, 0.8);
}
.reels.free { box-shadow: inset 0 0 30px rgba(243, 207, 114, 0.5), 0 0 0 2px #f3cf72; }
.reel { display: grid; grid-template-rows: repeat(var(--rows), 1fr); gap: 6px; border-radius: 10px; }
.reel.spinning .cell { filter: blur(1.5px) brightness(0.9); animation: reel-shake 0.12s linear infinite; }
@keyframes reel-shake { 50% { transform: translateY(6px); } }
.reel.anticipate { box-shadow: 0 0 0 3px #f3cf72, 0 0 26px rgba(243, 207, 114, 0.9); animation: tease 0.3s ease-in-out infinite; }
@keyframes tease { 50% { box-shadow: 0 0 0 3px #ef4444, 0 0 34px rgba(239, 68, 68, 0.9); } }
.reel.stop .cell { animation: reel-stop 0.28s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes reel-stop { 0% { transform: translateY(-18%); } 100% { transform: none; } }
.cell {
  position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  font-size: clamp(22px, 7vw, 40px); user-select: none;
}
.m-lines .cell, .m-classic .cell { font-size: clamp(28px, 9vw, 52px); }
.cell.win { animation: cell-win 0.5s ease-in-out infinite; z-index: 2; box-shadow: 0 0 0 2px #fff3c4, 0 0 20px rgba(243, 207, 114, 0.95); }
@keyframes cell-win { 50% { transform: scale(1.12); } }
.cell.burst { animation: cell-burst 0.28s ease-out forwards; }
@keyframes cell-burst { to { transform: scale(1.6); opacity: 0; filter: brightness(3); } }
.cell.boom { animation: bomb-boom 0.5s ease-out; }
@keyframes bomb-boom { 40% { transform: scale(1.8) rotate(-12deg); filter: brightness(2.5); } }
.sym-wild {
  font-size: 0.42em; font-weight: 900; letter-spacing: 0.04em; padding: 6px 4px; border-radius: 8px;
  color: #1b1404; background: linear-gradient(135deg, #fff3c4, #e6b54a 50%, #b7791f); box-shadow: 0 0 12px rgba(243, 207, 114, 0.8);
}
.sym-scatter { filter: drop-shadow(0 0 8px #f97316); animation: scatter-glow 1s ease-in-out infinite; }
@keyframes scatter-glow { 50% { filter: drop-shadow(0 0 16px #facc15); } }
.sym-bomb { position: relative; display: grid; place-items: center; }
.bomb-x {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); font-size: 0.36em; font-weight: 900;
  padding: 0 5px; border-radius: 6px; color: #fff; background: #dc2626; box-shadow: 0 0 10px rgba(239, 68, 68, 0.9);
}
.lines-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lines-overlay polyline { fill: none; stroke: #f3cf72; stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px #f3cf72); }
.slot-fs {
  text-align: center; font-weight: 900; margin-bottom: 8px; padding: 6px 10px; border-radius: 999px;
  color: #1b1404; background: linear-gradient(90deg, #f3cf72, #fff3c4, #f3cf72); box-shadow: 0 0 18px rgba(243, 207, 114, 0.7);
}
.slot-winline { min-height: 34px; margin-top: 10px; text-align: center; font-size: 22px; font-weight: 900; color: #fff3c4; text-shadow: 0 0 12px rgba(243, 207, 114, 0.8); }
.slot-winline.hot { color: #fde68a; font-size: 24px; }
.slot-winline.big { color: #4ade80; font-size: 26px; text-shadow: 0 0 16px rgba(74, 222, 128, 0.9); }
.slot-winline.pop { animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); }
.slot-overlay {
  position: absolute; inset: 0; display: none; place-items: center; text-align: center; z-index: 5; border-radius: 22px;
  font-size: clamp(28px, 8vw, 54px); font-weight: 900; color: #fff3c4; background: rgba(5, 5, 15, 0.72);
  text-shadow: 0 0 18px #e6b54a, 0 4px 0 #9b6b16;
}
.slot-overlay.show { display: grid; animation: overlay-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes overlay-in { from { transform: scale(0.6); opacity: 0; } }
.slot-overlay.bigwin { display: grid; grid-template-rows: auto auto; align-content: center; gap: 6px; }
.bw-title { font-size: clamp(34px, 10vw, 68px); animation: bw-pulse 0.6s ease-in-out infinite; }
.tier-mega .bw-title { color: #a5f3fc; text-shadow: 0 0 22px #06b6d4, 0 4px 0 #155e75; }
.tier-epic .bw-title { color: #f5d0fe; text-shadow: 0 0 24px #c026d3, 0 4px 0 #701a75; }
.tier-super .bw-title { color: #fecaca; text-shadow: 0 0 26px #ef4444, 0 0 60px #f59e0b, 0 4px 0 #7f1d1d; }
@keyframes bw-pulse { 50% { transform: scale(1.08) rotate(-1deg); } }
.bw-amount { font-size: clamp(54px, 16vw, 120px); color: #4ade80; text-shadow: 0 0 18px rgba(74, 222, 128, 0.9), 0 3px 0 #14532d; font-variant-numeric: tabular-nums; }
.bw-amount.done { animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); }
.slot-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 8px; }
.bet-box { display: flex; flex-direction: column; gap: 4px; }
.bet-stepper { display: flex; align-items: center; gap: 6px; }
.step { width: 38px; height: 38px; border-radius: 50%; font-size: 22px; font-weight: 900; cursor: pointer; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.bet-value { min-width: 56px; text-align: center; font-weight: 900; font-size: 18px; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.spin-btn {
  width: 92px; height: 92px; border-radius: 50%; cursor: pointer; border: 0; font-size: 18px; font-weight: 900; color: #1b1404;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #f3cf72 40%, #b7791f 80%);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.4), 0 6px 0 #7c5a12, 0 0 30px rgba(243, 207, 114, 0.6);
  transition: transform 0.1s ease;
}
.spin-btn:active { transform: translateY(4px); box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.4), 0 2px 0 #7c5a12; }
.spin-btn.spinning { animation: spin-btn 0.8s linear infinite; }
@keyframes spin-btn { to { filter: hue-rotate(360deg); } }
.side-btns { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.side-btns .pill-btn[aria-pressed="true"] { border-color: var(--teal); color: #c8fffb; background: rgba(63, 208, 201, 0.14); }
.slot-fair-panel input { width: 100%; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-family: ui-monospace, monospace; }
.spin-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.spin-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 4px 10px; align-items: center; font-size: 12px; padding: 6px 8px; border-radius: 8px; background: var(--bg-2); }
.spin-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spin-win { color: var(--win); font-weight: 700; }
.spin-check { grid-column: 1 / -1; font-size: 12px; }
.spin-check.ok { color: var(--win); }
.spin-check.bad { color: var(--lose); }
.paytable { width: 100%; border-collapse: collapse; font-size: 14px; text-align: center; }
.paytable th, .paytable td { padding: 6px; border-bottom: 1px solid var(--line); }
.paytable td:first-child { font-size: 20px; }
@media (max-width: 519px) {
  .slot-controls { grid-template-columns: 1fr auto; }
  .side-btns { grid-column: 1 / -1; flex-direction: row; justify-content: center; }
  .spin-btn { width: 84px; height: 84px; }
  .reels { gap: 4px; padding: 6px; }
  .reel { gap: 4px; }
}

/* ---------- Rocket ---------- */
.rocket { width: 100%; display: grid; grid-template-columns: 1fr 52px; gap: 8px; }
.rk-sky {
  position: relative; height: 190px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, #0b1027 0%, #1b2559 60%, color-mix(in srgb, var(--accent) 40%, #1b2559) 100%);
  background-size: 100% 100%;
}
.rk-sky::before {
  content: ''; position: absolute; inset: 0; opacity: 0.55;
  background-image: radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 20%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, #fff, transparent), radial-gradient(1px 1px at 85% 55%, #fff, transparent),
    radial-gradient(1px 1px at 10% 80%, #fff, transparent), radial-gradient(1.5px 1.5px at 60% 45%, #fff, transparent);
}
.rocket.flying .rk-sky::before { animation: stars 0.6s linear infinite; }
@keyframes stars { from { transform: translateY(-20px); } to { transform: translateY(0); } }
.rk-trail { position: absolute; left: 0; bottom: 0; width: 6%; height: 6%; border-top: 3px solid var(--gold-2); border-right: 0; border-top-right-radius: 100% 100%; opacity: 0.8; filter: drop-shadow(0 0 6px var(--gold)); }
.rk-hero { position: absolute; left: 6%; bottom: 6%; transform: translate(-50%, 50%) rotate(-35deg); font-size: 34px; line-height: 1; display: flex; flex-direction: column; align-items: center; }
.rk-hero.idle { animation: rk-idle 0.5s ease-in-out infinite; }
@keyframes rk-idle { 50% { transform: translate(-50%, 45%) rotate(-30deg); } }
.rk-flame { font-size: 18px; transform: rotate(180deg); opacity: 0; }
.rocket.flying .rk-flame { opacity: 1; animation: flame 0.15s steps(2) infinite; }
@keyframes flame { 50% { transform: rotate(180deg) scale(1.4); } }
.rk-boom { font-size: 52px; animation: total-in 0.4s ease both; transform: rotate(35deg); }
.rk-x { position: absolute; left: 12px; top: 10px; font-size: 34px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.rocket.flying .rk-x { color: var(--win); }
.rocket.burst .rk-x { color: var(--lose); font-size: 24px; animation: shake 0.4s; }
.rocket.burst .rk-sky { box-shadow: inset 0 0 40px rgba(239, 68, 68, 0.55); }
.rk-ladder { display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.rk-rung { flex: 1; display: grid; place-items: center; border-radius: 8px; font-size: 13px; font-weight: 800; border: 1px solid var(--line); color: var(--muted); background: rgba(0, 0, 0, 0.25); transition: all 0.2s; }
.rk-rung.passed { color: #fff; background: var(--tone); border-color: var(--tone); box-shadow: 0 0 12px var(--tone); }

/* ---------- Plinko ---------- */
.plinko { width: 100%; max-width: 380px; }
.pk-board { position: relative; height: 200px; }
.pk-peg { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: #e2e8f0; box-shadow: 0 0 5px rgba(255, 255, 255, 0.6); }
.pk-ball { position: absolute; transform: translate(-50%, -60%); font-size: 22px; line-height: 1; z-index: 2; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }
.pk-ball.idle { animation: pk-idle 0.45s ease-in-out infinite; }
@keyframes pk-idle { 50% { transform: translate(-50%, -100%); } }
.pk-slots { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; }
.pk-slot { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 3px 0; border-radius: 6px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pk-m.low { color: #86efac; }
.pk-m.mid { color: #fde68a; }
.pk-m.high { color: #fca5a5; }
.pk-slot.hit { background: color-mix(in srgb, var(--accent) 45%, #000); border-color: #fff3c4; box-shadow: 0 0 16px rgba(243, 207, 114, 0.8); animation: total-in 0.4s ease; }

/* ---------- Card hi-lo ---------- */
.hilo-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; width: 100%; justify-content: center; }
.hc-card {
  flex: 0 0 auto; width: 92px; height: 128px; border-radius: 10px; background: #f8fafc; color: #111827;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.hc-card.back { background: repeating-linear-gradient(45deg, #7c2d12, #7c2d12 6px, #9a3412 6px, #9a3412 12px); border: 3px solid #f8fafc; }
.hc-card.pulse { animation: pulse 0.8s ease-in-out infinite; }
.hc-card.red { color: #dc2626; }
.hc-card.turned { animation: flip-in 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; box-shadow: 0 0 0 3px #fff3c4, 0 0 26px rgba(243, 207, 114, 0.7); }
.hc-rank { font-size: 34px; font-weight: 900; line-height: 1; }
.hc-pic { font-size: 36px; line-height: 1; }
.hc-suit { position: absolute; top: 6px; left: 8px; font-size: 16px; }
.hc-side { flex: 1 1 230px; max-width: 360px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hc-scale { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 2px; }
.hc-r { display: grid; place-items: center; height: 26px; border-radius: 5px; font-size: 11px; font-weight: 800; background: rgba(0, 0, 0, 0.3); border: 1px solid transparent; }
.hc-r.low { color: #93c5fd; }
.hc-r.high { color: #fca5a5; }
.hc-r.seven { color: var(--gold-2); }
.hc-r.on { background: #fff3c4; color: #111827; transform: translateY(-3px); }
.hc-r.hit { box-shadow: 0 0 12px rgba(243, 207, 114, 0.9); }
.hc-suits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.hc-s { text-align: center; font-size: 16px; padding: 3px 0; border-radius: 6px; background: rgba(0, 0, 0, 0.25); }
.hc-s.hit { background: color-mix(in srgb, var(--accent) 45%, #000); box-shadow: 0 0 0 2px #fff3c4; }

/* ---------- Claw machine ---------- */
.claw { position: relative; width: 100%; max-width: 360px; height: 210px; border-radius: 14px; border: 3px solid color-mix(in srgb, var(--accent) 70%, #fff); background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.3)); overflow: hidden; }
.cl-glass { position: absolute; left: 0; right: 0; bottom: 0; height: 66%; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); padding: 4px; gap: 4px; }
.cl-prize { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; background: color-mix(in srgb, var(--tone) 18%, rgba(0, 0, 0, 0.35)); border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent); transition: opacity 0.3s; }
.cl-pic { font-size: 26px; line-height: 1.1; }
.cl-odds { font-size: 10px; font-weight: 700; color: var(--muted); }
.cl-prize.hit { opacity: 0.25; }
.cl-rig { position: absolute; top: 0; left: 50%; width: 40px; height: 100%; margin-left: -20px; pointer-events: none; z-index: 2; }
.cl-rig.idle { animation: cl-sway 2.4s ease-in-out infinite; }
@keyframes cl-sway { 0%, 100% { transform: translateX(-60px); } 50% { transform: translateX(60px); } }
.cl-rig::before { content: ''; position: absolute; top: 0; left: -200vw; right: -200vw; height: 6px; background: #94a3b8; }
.cl-arm { position: absolute; left: 50%; top: 0; width: 4px; height: 10%; margin-left: -2px; background: linear-gradient(#cbd5e1, #64748b); }
.cl-head { position: absolute; left: 50%; top: 100%; width: 34px; height: 26px; margin-left: -17px; }
.cl-head i { position: absolute; top: 0; width: 6px; height: 24px; background: #e2e8f0; border-radius: 3px; transition: transform 0.25s; }
.cl-head i.l { left: 4px; transform-origin: top; transform: rotate(25deg); }
.cl-head i.r { right: 4px; transform-origin: top; transform: rotate(-25deg); }
.cl-head.closed i.l { transform: rotate(-5deg); }
.cl-head.closed i.r { transform: rotate(5deg); }
.cl-grabbed { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); font-size: 26px; }
.claw.caught .cl-grabbed { animation: total-in 0.4s ease both; filter: drop-shadow(0 0 10px #fff3c4); }

/* Boards for the new styles */
.board[data-style="rocket"], .board[data-style="plinko"] { grid-template-columns: repeat(3, 1fr); }
.board[data-style="claw"] { grid-template-columns: repeat(4, 1fr); }
.board[data-style="claw"] .bet-name { font-size: 12px; }
.board[data-style="hilo"] { grid-template-columns: repeat(12, 1fr); }
.board[data-style="hilo"] .bet { grid-column: span 3; }
.board[data-style="hilo"] .bet:nth-child(-n+3) { grid-column: span 4; }
@media (max-width: 519px) {
  .board[data-style="claw"] { grid-template-columns: repeat(4, 1fr); }
  .board[data-style="claw"] .bet { padding-left: 4px; padding-right: 4px; }
  .rk-sky { height: 170px; }
  .hc-card { width: 76px; height: 106px; }
  .hc-rank { font-size: 28px; }
  .hc-pic { font-size: 30px; }
  .hc-r { height: 22px; font-size: 10px; }
}

/* ---------- Live rounds: time strip, ticker, my bets by round ---------- */
.strip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 2px 0 6px; font-size: 13px; }
.strip-title { font-weight: 700; }
.round-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.strip-pill {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 72px; padding: 6px 10px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-variant-numeric: tabular-nums;
}
.strip-pill .strip-time { font-weight: 800; font-size: 14px; }
.strip-pill .strip-left { font-size: 11px; color: var(--muted); }
.strip-pill.hot .strip-left { color: #fca5a5; }
.strip-pill.on { border-color: var(--gold); background: rgba(230, 181, 74, 0.14); box-shadow: 0 0 0 1px var(--gold) inset; }
.strip-pill.on .strip-time { color: var(--gold-2); }
.strip-pill.mine::after { content: '●'; color: var(--gold); font-size: 9px; line-height: 1; }
.strip-gap { align-self: center; color: var(--muted); padding: 0 2px; }
.ticker { display: flex; gap: 6px; overflow: hidden; margin: 4px 0 10px; }
.tick-item { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; padding: 3px 6px 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.2); cursor: pointer; }
.tick-item .tick-time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tick-item.new { animation: tick-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); border-color: var(--gold); }
@keyframes tick-in { from { transform: translateX(-24px) scale(0.8); opacity: 0; } }
.mine-list { display: flex; flex-wrap: wrap; gap: 6px; }
.mine-round { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 12px; }
.mine-round.on { border-color: var(--gold); }
.mine-time { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--gold-2); }
.badge.live { color: #86efac; border-color: rgba(74, 222, 128, 0.5); }
.strip-head { flex-direction: column; align-items: flex-start; gap: 0; }

/* ---------- Betting board watermark: countdown, then "time's up" ---------- */
.board-wrap { position: relative; }
.board-mark { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; z-index: 3; }
.board-mark.off { display: none; }
.board-mark .mark-num {
  font-size: clamp(110px, 34vw, 200px); font-weight: 900; line-height: 1; color: #fff; opacity: 0.13;
  font-variant-numeric: tabular-nums; letter-spacing: -4px; text-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}
.board-mark.tick .mark-num { animation: mark-tick 0.6s ease-out; }
@keyframes mark-tick { from { transform: scale(1.18); opacity: 0.3; } }
.board-mark.hot .mark-num { color: #ef4444; opacity: 0.32; }
.board-mark.closed { background: rgba(10, 6, 8, 0.62); border-radius: 14px; backdrop-filter: blur(1.5px); }
.board-mark .mark-bang {
  display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%;
  font-size: 64px; font-weight: 900; line-height: 1; color: #fff; background: #dc2626;
  box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.35), 0 0 40px rgba(239, 68, 68, 0.8);
  animation: bang-blink 0.8s steps(2, jump-none) infinite;
}
.board-mark .mark-text { margin-top: 12px; padding: 6px 14px; border-radius: 999px; font-size: 17px; font-weight: 800; color: #fecaca; background: rgba(127, 29, 29, 0.85); border: 1px solid #ef4444; animation: bang-blink 0.8s steps(2, jump-none) infinite; }
@keyframes bang-blink { 50% { opacity: 0.35; transform: scale(0.94); } }
.board-wrap.closed .board { filter: grayscale(0.6) brightness(0.8); }
@media (prefers-reduced-motion: reduce) {
  .board-mark .mark-bang, .board-mark .mark-text, .board-mark.tick .mark-num { animation: none; }
}

/* ---------- Rock-paper-scissors and coins (live rooms and "play it yourself") ---------- */
.rps-table { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 4vw, 36px); width: 100%; }
.rps-player { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(0, 0, 0, 0.18); min-width: 104px; transition: box-shadow 0.3s, border-color 0.3s; }
.rps-player.side-a { border-color: rgba(239, 68, 68, 0.45); }
.rps-player.side-b { border-color: rgba(59, 130, 246, 0.45); }
.rps-player.champion { border-color: var(--gold-2); box-shadow: 0 0 0 2px var(--gold), 0 0 28px rgba(243, 207, 114, 0.6); }
.rps-player.champion .rps-avatar::after { content: '👑'; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 22px; }
.rps-avatar { position: relative; font-size: 30px; line-height: 1; }
.rps-name { font-size: 12px; color: var(--muted); max-width: 120px; text-align: center; }
.rps-hand { margin-top: 14px; font-size: clamp(54px, 15vw, 84px); line-height: 1.1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)); transform-origin: 50% 90%; }
.rps-hand.mirror { transform: scaleX(-1); }
.rps-hand.pump { animation: rps-pump 0.33s ease-in-out infinite alternate; }
.rps-hand.mirror.pump { animation-name: rps-pump-m; }
.rps-hand.thrown { animation: rps-throw 0.45s cubic-bezier(0.2, 1.5, 0.4, 1); }
.rps-hand.mirror.thrown { animation-name: rps-throw-m; }
@keyframes rps-pump { from { transform: translateY(-14px) rotate(-8deg); } to { transform: translateY(10px) rotate(6deg); } }
@keyframes rps-pump-m { from { transform: scaleX(-1) translateY(-14px) rotate(-8deg); } to { transform: scaleX(-1) translateY(10px) rotate(6deg); } }
@keyframes rps-throw { from { transform: scale(0.4); } to { transform: scale(1); } }
@keyframes rps-throw-m { from { transform: scaleX(-1) scale(0.4); } to { transform: scaleX(-1) scale(1); } }
.bo3-score { white-space: nowrap; font-size: 26px; font-weight: 900; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.bo3-log { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.bo3-throw { padding: 2px 8px; border-radius: 999px; font-size: 16px; background: rgba(255, 255, 255, 0.06); border: 1px solid transparent; }
.bo3-throw.a { border-color: rgba(239, 68, 68, 0.7); }
.bo3-throw.b { border-color: rgba(59, 130, 246, 0.7); }
.bo3-throw.tie { opacity: 0.6; }

.hcoins { display: flex; gap: clamp(8px, 3vw, 18px); justify-content: center; flex-wrap: wrap; }
.hcoin { --size: clamp(58px, 17vw, 86px); width: var(--size); height: var(--size); border-radius: 50%; perspective: 400px; }
.hcoins.n5 { flex-wrap: nowrap; gap: clamp(6px, 2vw, 14px); }
.hcoins.n5 .hcoin { --size: clamp(40px, 11vw, 64px); }
.hcoins.many .hcoin { --size: clamp(34px, 9vw, 48px); }
.hface { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; font-size: calc(var(--size) * 0.46);
  background: radial-gradient(circle at 35% 30%, #4b5563, #1f2937 70%); border: 3px solid rgba(255, 255, 255, 0.12); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45); }
.hface.heads { background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold-2) 30%, var(--gold) 60%, #9b6b16); border-color: #fff3c4; }
.hface.tails { background: radial-gradient(circle at 35% 30%, #ffffff, #cfd6e2 30%, #8e98ab 65%, #4a5263); border-color: #e5e7eb; }
.hcoin.tossing .hface { animation: hcoin-toss 0.42s linear infinite; }
.hcoin.landed { animation: hcoin-land 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); }
.hcoin.ok .hface { box-shadow: 0 0 0 3px #22c55e, 0 0 18px rgba(34, 197, 94, 0.7); }
.hcoin.miss .hface { box-shadow: 0 0 0 3px #ef4444, 0 0 18px rgba(239, 68, 68, 0.7); }
.hcoin.skipped { opacity: 0.25; }
@keyframes hcoin-toss { 0% { transform: translateY(0) rotateX(0); } 50% { transform: translateY(-26px) rotateX(180deg); } 100% { transform: translateY(0) rotateX(360deg); } }
@keyframes hcoin-land { from { transform: scale(1.35); } to { transform: scale(1); } }
.hcoins-count { margin-top: 10px; text-align: center; font-weight: 800; color: var(--gold-2); min-height: 1.4em; }

/* Play it yourself */
.instant-view .ip-stage { position: relative; margin: 12px 0; padding: 22px 12px 16px; border-radius: 22px; min-height: 230px;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--accent, #22c55e) 22%, #0f1d1a), #0b1220 75%);
  border: 1px solid color-mix(in srgb, var(--accent, #22c55e) 45%, transparent); display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.ip-stage.won { box-shadow: 0 0 0 2px var(--gold), 0 0 40px rgba(243, 207, 114, 0.45); }
.ip-stage.lost { filter: saturate(0.7); }
.ip-result { text-align: center; font-size: clamp(22px, 6vw, 32px); font-weight: 900; min-height: 1.3em; }
.ip-result.win { color: var(--gold-2); text-shadow: 0 0 16px rgba(243, 207, 114, 0.8); }
.ip-result.lose { color: #fca5a5; }
.ip-result.push { color: #e9ecf2; }
.ip-track { display: flex; gap: 8px; justify-content: center; }
.ip-step { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: rgba(255, 255, 255, 0.08); }
.ip-step.ok { background: #16a34a; }
.ip-step.miss { background: #dc2626; }
.ip-controls { display: grid; gap: 12px; }
.ip-controls h2 { margin: 0; font-size: 16px; }
.ip-picker { display: grid; gap: 10px; }
.ip-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.ip-opt { min-height: 54px; border-radius: 14px; border: 1px solid var(--line, rgba(255, 255, 255, 0.12)); background: var(--surface); color: inherit; font-size: 17px; font-weight: 700; cursor: pointer; }
.ip-opt[aria-pressed="true"] { border-color: var(--gold); background: rgba(230, 181, 74, 0.14); color: var(--gold-2); box-shadow: 0 0 0 1px var(--gold) inset; }
.ip-counter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ip-counter .label { flex: 1 1 140px; color: var(--muted); }
.ip-win { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ip-x { font-size: 28px; font-weight: 900; color: var(--gold-2); }
.ip-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.ip-play { flex: 1 1 160px; }
.ip-rules p { margin: 6px 0; color: var(--muted); }
.ip-rules summary { cursor: pointer; font-weight: 700; }
.spin-row .win { color: #4ade80; }
.spin-row .lose { color: #fca5a5; }
@media (prefers-reduced-motion: reduce) {
  .rps-hand.pump, .rps-hand.thrown, .hcoin.tossing .hface, .hcoin.landed { animation: none; }
}

/* ---------- Lobby: stats, views, home shelves, rooms in play ---------- */
.lobby-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.lobby-stats .stat { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lobby-stats .stat.live { color: #86efac; }
.filters.views { margin-bottom: 10px; }
.filters.views .filter { height: 42px; font-weight: 700; font-size: 15px; }
.filters.views .filter[aria-pressed="true"] { background: linear-gradient(180deg, rgba(243, 207, 114, 0.22), rgba(230, 181, 74, 0.08)); }
.shelves { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
.shelf { min-width: 0; }
.shelf-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.shelf-head h2 { margin: 0; font-size: 18px; }
.shelf-all { margin-left: auto; white-space: nowrap; font-weight: 700; }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(168px, 200px); gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.shelf-row > * { scroll-snap-align: start; }
.running h2 { font-size: 18px; margin: 18px 0 6px; }
.running .tiles { margin-top: 10px; }
.speed-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.speed-card { display: grid; gap: 4px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: inherit; text-align: left; cursor: pointer; }
.speed-card b { font-size: 16px; }
.speed-card span { font-size: 12px; color: var(--muted); }
.speed-card.on { border-color: var(--gold); }

/* ＋ on a room tile: add it to "several rooms at once" */
.tile { position: relative; }
.tile-add { position: absolute; right: 6px; bottom: 6px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.55); color: var(--gold-2); font-size: 18px; font-weight: 800; line-height: 1; cursor: pointer; }
.tile-add[aria-pressed="true"] { background: var(--gold); color: #1b1404; border-color: var(--gold-2); }
.tile-add[aria-pressed="true"]::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; background: inherit; border-radius: 50%; }
.multi-tray { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 30; width: min(720px, calc(100% - 24px));
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 16px;
  background: rgba(17, 21, 31, 0.96); border: 1px solid var(--gold); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); }
.multi-tray .multi-names { flex: 1 1 160px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-tray .multi-open { display: inline-flex; align-items: center; text-decoration: none; }

/* ---------- Several rooms at once ---------- */
.multi-view { max-width: 1400px; margin: 0 auto; padding: 18px 12px 48px; }
.multi-head h1 { margin: 6px 0 2px; font-size: 22px; }
.multi-grid { display: grid; gap: 12px; margin-top: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .multi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .multi-grid.n3, .multi-grid.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.multi-panel { display: grid; gap: 8px; padding: 12px; border-top: 3px solid var(--accent, var(--gold)); transition: box-shadow 0.3s; }
.multi-panel.closing { box-shadow: 0 0 0 2px #ef4444, 0 0 22px rgba(239, 68, 68, 0.45); }
.multi-panel.drawing { box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(230, 181, 74, 0.45); }
.mp-head { display: flex; align-items: center; gap: 8px; }
.mp-name { font-weight: 800; color: var(--text); text-decoration: none; flex: 1; }
.mp-close { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.mp-status { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mp-count { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--gold-2); }
.mp-count[data-phase="drawing"] { font-size: 15px; color: #fca5a5; animation: bang-blink 0.8s steps(2) infinite; }
.mp-count[data-phase="result"] { font-size: 15px; color: var(--teal); }
.multi-panel.closing .mp-count { color: #f87171; }
.mp-round { font-size: 12px; color: var(--muted); }
.mp-stage .stage { min-height: 150px; transform-origin: top center; }
.mp-result { min-height: 1.4em; margin: 0; font-weight: 800; text-align: center; }
.mp-result.win { color: #4ade80; font-size: 20px; }
.mp-result.lose { color: #fca5a5; }
.mp-beads { display: flex; gap: 3px; min-height: 18px; overflow: hidden; }
.mp-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.mp-chip { min-width: 44px; height: 32px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: inherit; font-weight: 700; cursor: pointer; }
.mp-chip[aria-pressed="true"] { border-color: var(--gold); color: #1b1404; background: var(--gold-2); }
.mp-board { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.mp-bet { display: grid; gap: 2px; padding: 8px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: inherit; cursor: pointer; text-align: center; }
.mp-bet:disabled { opacity: 0.45; cursor: not-allowed; }
.mp-bet.has-mine { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.mp-bet-label { font-size: 13px; font-weight: 700; }
.mp-bet-odds { font-size: 11px; color: var(--muted); }
.mp-bet-mine { font-size: 12px; color: var(--gold-2); min-height: 1em; }
.mp-mine { font-size: 12px; color: var(--muted); min-height: 1em; }
.multi-add { display: grid; place-items: center; min-height: 120px; border: 2px dashed var(--line); border-radius: 16px; color: var(--muted); text-decoration: none; font-weight: 700; }
.tile-foot { padding-right: 34px; }
/* Nothing may make the page wider than the screen (rows scroll inside themselves). */
html, body { overflow-x: clip; }

/* ---------- Loading screen (web/boot.js) and the bar for opening a room ---------- */
html.booting body { overflow: hidden; }
.splash { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 50% 35%, #1b2236, #0b0d12 70%); transition: opacity 0.4s ease, visibility 0.4s; }
.splash.out { opacity: 0; visibility: hidden; }
.splash-box { width: min(360px, 100%); display: grid; justify-items: center; gap: 14px; text-align: center; }
.splash-logo { width: 72px; height: 72px; filter: drop-shadow(0 0 22px rgba(243, 207, 114, 0.55)); animation: splash-pulse 1.6s ease-in-out infinite; }
.splash-name { font-size: 30px; font-weight: 900; letter-spacing: 0.02em; }
.splash-name b { color: var(--gold-2); }
.splash-bar { width: 100%; height: 12px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(243, 207, 114, 0.35); }
.splash-bar span { display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, #b8862b, var(--gold-2), #fff3c4, var(--gold-2)); background-size: 200% 100%; animation: splash-shine 1.2s linear infinite;
  box-shadow: 0 0 14px rgba(243, 207, 114, 0.7); }
.splash-row { width: 100%; display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); }
.splash-row b { color: var(--gold-2); font-variant-numeric: tabular-nums; }
.splash-retry { height: 42px; padding: 0 22px; border-radius: 12px; border: 0; background: var(--gold); color: #1b1404; font-weight: 800; cursor: pointer; }
@keyframes splash-pulse { 50% { transform: scale(1.07); } }
@keyframes splash-shine { to { background-position: -200% 0; } }
.route-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 900; height: 3px; overflow: hidden; }
.route-bar span { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, var(--gold-2), transparent); animation: route-run 0.9s ease-in-out infinite; }
@keyframes route-run { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { .splash-logo, .splash-bar span, .route-bar span { animation: none; } }
/* The bar moves from the very first paint, before any script has arrived. */
.splash-bar span.css { animation: splash-shine 1.2s linear infinite, splash-start 10s cubic-bezier(0.1, 0.6, 0.3, 1) forwards; }
@keyframes splash-start { from { width: 2%; } to { width: 36%; } }

/* ---------- Easy games: one big, clear result ---------- */
.stage.easy { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 220px; }
.easy-ball { width: clamp(110px, 32vw, 150px); height: clamp(110px, 32vw, 150px); border-radius: 50%; display: grid; place-items: center;
  font-size: clamp(56px, 16vw, 78px); font-weight: 900; color: #111827;
  background: radial-gradient(circle at 35% 30%, #ffffff, #e5e7eb 45%, #9ca3af); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), inset 0 -6px 12px rgba(0, 0, 0, 0.2); }
.easy-ball.rolling { animation: easy-wobble 0.35s ease-in-out infinite alternate; }
.easy-ball.landed { animation: easy-pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }
.easy-ball.tone-red { color: #b91c1c; }
.easy-ball.tone-blue { color: #1d4ed8; }
@keyframes easy-wobble { from { transform: rotate(-8deg) scale(0.96); } to { transform: rotate(8deg) scale(1.04); } }
@keyframes easy-pop { from { transform: scale(1.35); } to { transform: scale(1); } }
.easy-verdict { min-height: 1.2em; padding: 4px 18px; border-radius: 999px; font-size: clamp(30px, 9vw, 44px); font-weight: 900; }
.easy-verdict.tone-red { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.easy-verdict.tone-blue { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.easy-verdict.tone-dark { background: rgba(255, 255, 255, 0.12); color: #f3f4f6; }
.easy-verdict.tone-green { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.easy-verdict.tone-gold { background: rgba(230, 181, 74, 0.2); color: var(--gold-2); }
.easy-dice { display: flex; gap: clamp(10px, 4vw, 20px); justify-content: center; }
.stage.easy .die { width: clamp(64px, 19vw, 86px); height: clamp(64px, 19vw, 86px); border-radius: 16px; }
.stage.easy .die .pip { width: 13px; height: 13px; }
.stage.easy .die.landed { animation: easy-pop 0.4s cubic-bezier(0.2, 1.5, 0.4, 1); }
.stage.easy .easy-big-die { width: clamp(110px, 32vw, 140px); height: clamp(110px, 32vw, 140px); border-radius: 22px; }
.stage.easy .easy-big-die .pip { width: 20px; height: 20px; }
.easy-total { display: flex; align-items: center; gap: 12px; font-size: clamp(22px, 6vw, 30px); font-weight: 800; min-height: 1.4em; text-align: center; }
.easy-total b { font-size: clamp(36px, 10vw, 52px); color: #fff; }
.easy-pic { width: clamp(72px, 21vw, 96px); height: clamp(72px, 21vw, 96px); border-radius: 18px; display: grid; place-items: center;
  font-size: clamp(44px, 13vw, 60px); background: #fff7e6; border: 3px solid var(--gold); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45); }
.easy-pic.rolling { animation: easy-wobble 0.25s ease-in-out infinite alternate; }
.easy-pic.landed { animation: easy-pop 0.45s cubic-bezier(0.2, 1.5, 0.4, 1); }
.easy-card .card { transform: scale(1.6); margin: 30px 0; }
@media (prefers-reduced-motion: reduce) { .easy-ball.rolling, .easy-pic.rolling { animation: none; } }

/* ---------- Big-text mode for older players (👓 in the top bar) ---------- */
.easy-btn { height: 38px; padding: 0 10px; border-radius: 12px; cursor: pointer; white-space: nowrap; font-weight: 800;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.easy-btn[aria-pressed="true"] { background: var(--gold); color: #1b1404; border-color: var(--gold-2); }
.icon-btn#voice-toggle[aria-pressed="false"] { opacity: 0.45; }
html.easy-mode body { zoom: 1.2; }
html.easy-mode { --muted: #c9cfdb; --line: #3a4258; }
html.easy-mode body { font-weight: 500; }
html.easy-mode .api-link, html.easy-mode .brand-name { display: none; }
html.easy-mode .notice { font-size: 13px; }
html.easy-mode .tile-name, html.easy-mode .mp-name { font-size: 16px; }
html.easy-mode .bet-btn, html.easy-mode .board button, html.easy-mode .mp-bet, html.easy-mode .ip-opt { min-height: 60px; font-size: 17px; }
html.easy-mode .chip.coin { transform: scale(1.08); }
html.easy-mode .tile-beads .bead, html.easy-mode .bead.small { transform: scale(1.1); }
html.easy-mode .result-line { font-size: 20px; }
html.easy-mode .stage-count { font-size: 64px; }
/* Easy tiles stand out in every mode: a warm frame and big pictures. */
.tile.easy-tile { border-width: 2px; }
.tile.easy-tile .tile-pics { font-size: 22px; letter-spacing: 2px; }
/* The top bar wraps rather than running off the screen (big-text mode, small phones, long language names). */
.topbar-right { flex: 1 1 auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; row-gap: 8px; }
.lang select { max-width: 92px; }
@media (max-width: 420px) { .easy-btn { padding: 0 8px; } .topbar-right { gap: 6px; } }
.dev-link { display: none; color: var(--teal); font-size: 13px; text-decoration: none; }
@media (max-width: 420px) {
  .topbar .api-link { display: none; }
  .dev-link { display: inline; }
}
