:root {
  --bg: #1b2346;
  --bg-2: #253061;
  --felt: #17716f;
  --felt-deep: #0f4f52;
  --line: #e3c27a;
  --line-soft: rgba(227, 194, 122, 0.35);
  --ink: #f4f1e8;
  --ink-dim: rgba(244, 241, 232, 0.62);
  --win: #5ef2b5;
  --lose: #ff6b6b;
  --push: #9db7ff;
  --gold: #f2c45a;
  --ruby: #c8243a;
  --footer-h: 150px;
  --gutter: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(120% 55% at 50% 0%, #34428a 0%, rgba(27, 35, 70, 0) 65%),
    linear-gradient(#1f2851, #161d3b);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  padding-bottom: calc(var(--footer-h) + env(safe-area-inset-bottom) + 12px);
  position: relative;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: calc(env(safe-area-inset-top) + 8px) var(--gutter) 8px;
  background: linear-gradient(#222c58 80%, rgba(34, 44, 88, 0));
  flex-wrap: wrap;
}
.statbar {
  flex-basis: 100%;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: 10px; overflow: hidden;
  background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(255, 255, 255, 0.08);
}
/* Player level: tap for the Trophy case. Hidden in the tournament. */
.levelbar {
  flex-basis: 100%; display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 0 4px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
}
.levelbar[hidden] { display: none; }
.levelbar.full .lb-track { animation: lb-full 0.45s ease-out; }
.levelbar.full b { animation: lb-tick 0.45s ease-out; }
@keyframes lb-full { 30% { box-shadow: 0 0 0 2px rgba(255, 224, 138, 0.8), 0 0 14px rgba(242, 196, 90, 0.9); } }
@keyframes lb-tick { 40% { transform: scale(1.3); color: #fff; } }
@media (prefers-reduced-motion: reduce) { .levelbar.full .lb-track, .levelbar.full b { animation: none; } }
.levelbar b { font: 400 12px/1 "Bungee", "Archivo", sans-serif; color: var(--gold); white-space: nowrap; }
.levelbar small { font-size: 10px; font-weight: 700; color: var(--ink-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb-track { flex: 1; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.lb-track i { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: linear-gradient(90deg, #c8901f, #ffe08a); transition: width 0.6s ease-out; }
/* The tournament's roll count in the level bar's spot: purple, gold for the final five. */
.rollbar { cursor: default; }
.rollbar[hidden] { display: none; }
.rollbar b { color: #d9c7ff; }
.rollbar .lb-track i { background: linear-gradient(90deg, #9b7bff, #c9a8ff); }
.rollbar.final b { color: var(--gold); }
.rollbar.final .lb-track i { background: linear-gradient(90deg, #f2b53c, #ffe39a); box-shadow: 0 0 8px rgba(242, 181, 60, 0.7); }
.rollbar.tick b { animation: lb-tick 0.45s ease-out; }
.stat { display: flex; align-items: baseline; justify-content: center; gap: 5px; padding: 5px 4px; min-width: 0; white-space: nowrap; }
.stat + .stat { border-left: 1px solid rgba(255, 255, 255, 0.08); }
.stat span { font-size: 9.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
.stat b { font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat.win b { color: var(--gold); display: inline-block; }
.stat.win b.flash { animation: stat-flash 1.2s ease-out; }
@keyframes stat-flash { 0%, 30% { transform: scale(1.3); text-shadow: 0 0 12px rgba(255, 210, 90, 0.95); } }
.app { overflow-x: clip; }
.brand { display: flex; align-items: center; gap: 6px; margin-right: auto; min-width: 0; }
.brand-mark { width: 36px; height: 38px; flex: none; overflow: visible; filter: drop-shadow(0 0 8px rgba(95, 216, 204, 0.45)); }
.bd-die { transform-box: fill-box; transform-origin: 50% 100%; animation: bd-hop 7s ease-in-out infinite; }
.bd-die2 { animation-delay: 0.12s; }
@keyframes bd-hop {
  0%, 86%, 100% { transform: translateY(0) rotate(0); }
  90% { transform: translateY(-7px) rotate(-25deg); }
  94% { transform: translateY(0) rotate(0); }
  96% { transform: translateY(-2px) rotate(8deg); }
}
body.rolling .bd-die { animation: bd-jumble 0.32s linear infinite; }
body.rolling .bd-die2 { animation-duration: 0.27s; animation-direction: reverse; }
@keyframes bd-jumble {
  0% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(2px, -7px) rotate(90deg); }
  50% { transform: translate(-2px, -3px) rotate(180deg); }
  75% { transform: translate(1px, -8px) rotate(270deg); }
  100% { transform: translate(0, 0) rotate(360deg); }
}
.brand-text { display: grid; justify-items: center; line-height: 0.92; font-family: "Bungee", "Archivo", system-ui, sans-serif; text-transform: uppercase; }
.bw-bounce {
  font-size: 21px; letter-spacing: 0.02em;
  background: linear-gradient(100deg, #fff4c4 0%, #f6c451 30%, #fff9e0 45%, #f2b53c 55%, #c77d12 100%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #5a3304) drop-shadow(0 0 10px rgba(242, 181, 60, 0.35));
  animation: bw-shine 5.5s ease-in-out infinite;
}
@keyframes bw-shine { 0%, 62% { background-position: 100% 0; } 85%, 100% { background-position: 0% 0; } }
.bw-craps {
  font-size: 10.5px; letter-spacing: 0.42em; margin-top: 2px; padding-left: 0.42em; /* balances the trailing letter space so it centers */
  color: #b6fff4;
  text-shadow: 0 0 4px rgba(95, 242, 220, 0.9), 0 0 12px rgba(95, 242, 220, 0.55);
  animation: bw-neon 4s steps(1) infinite;
}
@keyframes bw-neon { 0%, 46%, 50%, 100% { opacity: 1; } 48% { opacity: 0.55; } }
.bank { min-width: 0; display: grid; grid-template-columns: auto auto; align-self: center; column-gap: 6px; align-items: baseline; text-align: right; }
.bank-label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.bank strong { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; transition: color 0.3s; }
.bank strong.up { color: var(--win); }
.bank strong.down { color: var(--lose); }

.icon-btn {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  display: grid; place-items: center;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg circle { fill: currentColor; stroke: none; }
.icon-btn .off { display: none; }
.icon-btn[aria-pressed="true"] .on { display: none; }
.icon-btn[aria-pressed="true"] .off { display: inline; }
#musicBtn .slash { display: inline; }
#musicBtn[aria-pressed="true"] { color: var(--gold); border-color: rgba(242, 196, 90, 0.5); background: rgba(242, 196, 90, 0.12); }
#musicBtn[aria-pressed="true"] .slash { display: none; }
#voiceBtn .slash { display: inline; }
#voiceBtn[aria-pressed="true"] { color: var(--gold); border-color: rgba(242, 196, 90, 0.5); background: rgba(242, 196, 90, 0.12); }
#voiceBtn[aria-pressed="true"] .slash { display: none; }
/* Sound is "pressed" when muted, so it lights up gold while sound is on, like music and voice. */
#soundBtn[aria-pressed="false"] { color: var(--gold); border-color: rgba(242, 196, 90, 0.5); background: rgba(242, 196, 90, 0.12); }
.icon-btn circle { fill: none !important; stroke: currentColor !important; }
#menuBtn circle { fill: currentColor !important; stroke: none !important; }
.menu {
  position: absolute; right: var(--gutter); top: calc(100% - 2px); z-index: 2;
  background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 6px; width: 230px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
/* The open menu stands out: everything behind it dims (a tap there closes it). */
/* (The open menu's bar rises above the chip tray, z-index 30, so the shade covers it too.) */
.topbar:has(#menu:not([hidden])) { z-index: 45; }
.topbar:has(#menu:not([hidden]))::before {
  content: ''; position: fixed; inset: 0; z-index: 1;
  background: rgba(6, 9, 24, 0.62); animation: shade-in 0.18s ease-out;
}
@keyframes shade-in { from { opacity: 0; } }
.menu button {
  display: block; width: 100%; text-align: left; padding: 11px 12px; border: 0; border-radius: 9px;
  background: transparent; font-weight: 600; font-size: 14px;
}
.menu button:hover, .menu button:focus-visible { background: rgba(255, 255, 255, 0.07); }
.menu p { margin: 6px 12px 8px; font-size: 11.5px; color: var(--ink-dim); }
.menu p.legal-line { margin-top: 0; opacity: 0.8; }
.menu-getapp { display: flex; align-items: center; gap: 8px; padding: 6px 12px 10px; font-weight: 700; font-size: 14px; }
.menu-getapp span { flex: 1; white-space: nowrap; }
.menu-getapp a { padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); color: var(--gold); font-size: 13px; font-weight: 800; text-decoration: none; }
.menu-getapp a:hover { background: rgba(255, 255, 255, 0.16); }
.menu hr { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.1); margin: 6px 4px; }
.switch { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-weight: 600; font-size: 14px; cursor: pointer; border-radius: 9px; }
.switch:hover { background: rgba(255, 255, 255, 0.07); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { width: 40px; height: 24px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); position: relative; transition: background 0.2s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch input:checked + i { background: var(--win); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Free play / Tournament switch ---------- */
.playmode {
  flex-basis: 100%;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px;
  border-radius: 12px; background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.08);
}
.playmode button {
  border: 0; border-radius: 9px; padding: 6px 4px; background: transparent;
  font-size: 12px; font-weight: 800; letter-spacing: 0.02em; color: var(--ink-dim); white-space: nowrap;
}
.free-pill { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: #3fd08a; color: #06281a; font-size: 9.5px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; vertical-align: 1px; }
.playmode button[aria-selected="true"] { background: rgba(255, 255, 255, 0.12); color: var(--ink); }
body.tournament .playmode button#playTourney[aria-selected="true"] {
  background: linear-gradient(#ffe39a, #f2b53c); color: #2b1600; box-shadow: 0 0 14px rgba(242, 181, 60, 0.45);
}

/* Tournament mode: a gold-and-purple table so it never feels like free play. */
body.tournament .layout {
  border-color: rgba(242, 181, 60, 0.75);
  background:
    radial-gradient(140% 60% at 50% 0%, rgba(255, 220, 140, 0.1), rgba(255, 255, 255, 0) 60%),
    linear-gradient(#3b2a6b, #251a47);
}
/* In the lobby there's nothing to bet on yet: hide the table and the footer. */
body.tournament-lobby .layout,
body.tournament-lobby .side-btn,
body.tournament-lobby .controls { display: none; }

/* ---------- Tournament lobby ---------- */
.tourney-lobby {
  margin: 8px var(--gutter) 0; padding: 14px 14px 16px; border-radius: 22px;
  background:
    radial-gradient(140% 60% at 50% 0%, rgba(255, 220, 140, 0.14), rgba(255, 255, 255, 0) 60%),
    linear-gradient(#3b2a6b, #251a47);
  border: 2px solid rgba(242, 181, 60, 0.75);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: grid; gap: 10px;
}
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tl-head h2 {
  margin: 0; font: 400 20px "Bungee", "Archivo", sans-serif;
  background: linear-gradient(#fff4c4, #f2b53c 60%, #c77d12); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #5a3304);
}
.tl-head span { font-size: 11.5px; font-weight: 700; color: var(--ink-dim); }
.tl-rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tl-rules li { padding: 8px 4px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); text-align: center; font-size: 11.5px; font-weight: 700; color: var(--ink-dim); }
.tl-rules b { display: block; font: 400 18px "Bungee", "Archivo", sans-serif; color: var(--gold); }
.tl-small { margin: 0; font-size: 12px; line-height: 1.45; color: rgba(244, 241, 232, 0.8); }
.tl-start {
  min-height: 56px; border: 0; border-radius: 16px;
  font-size: 18px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: #2b1600;
  background: linear-gradient(#ffe39a, #f2b53c 55%, #d48d19);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), 0 5px 0 #8a5a12, 0 10px 22px rgba(242, 181, 60, 0.35);
}
.tl-start:active { transform: translateY(4px); box-shadow: 0 1px 0 #8a5a12; }
.tl-wait { margin: 0; padding: 12px; border-radius: 14px; text-align: center; font-weight: 700; font-size: 13px; background: rgba(0, 0, 0, 0.25); color: var(--ink-dim); }
.tl-week { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.tl-week li { display: grid; justify-items: center; gap: 2px; padding: 6px 1px; border-radius: 10px; background: rgba(0, 0, 0, 0.22); border: 1px solid transparent; min-width: 0; }
.tl-week span { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--ink-dim); }
.tl-week b { font-size: 10.5px; font-weight: 900; font-variant-numeric: tabular-nums; }
.tl-week li.today { border-color: rgba(255, 255, 255, 0.4); }
.tl-week li.best { background: rgba(242, 181, 60, 0.22); border-color: var(--gold); }
.tl-week li.best b { color: var(--gold); }
.tl-best { margin: 0; font-size: 12.5px; color: var(--ink-dim); text-align: center; }
.tl-best b { color: var(--ink); }
.tl-board { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(255, 255, 255, 0.1); font-size: 12px; color: var(--ink-dim); }
.tl-board > b { color: var(--ink); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.tl-board-empty { margin: 0; font-size: 13px; }
.tl-ranks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tl-ranks li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); font-size: 14px; color: var(--ink); }
.tl-ranks li:nth-child(-n + 3) .tl-rank { color: var(--gold); }
.tl-ranks li.me { background: rgba(242, 181, 60, 0.18); outline: 1px solid var(--gold); }
.tl-rank { font: 400 15px "Bungee", "Archivo", sans-serif; color: var(--ink-dim); text-align: center; }
.tl-name { font: inherit; font-weight: 800; color: inherit; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.25); text-underline-offset: 3px; }
/* A player's tournament card (tap a name on the leaderboard). */
.pc-top { display: grid; justify-items: center; gap: 2px; margin-bottom: 12px; text-align: center; }
.pc-top b { font: 400 22px/1.1 "Bungee", "Archivo", sans-serif; color: var(--gold); overflow-wrap: anywhere; }
.pc-top span { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); }
.pc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pc-grid div { display: grid; justify-items: center; gap: 3px; padding: 12px 6px; border-radius: 14px; background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(255, 255, 255, 0.08); }
.pc-grid b { font: 400 20px/1 "Bungee", "Archivo", sans-serif; color: var(--ink); }
.pc-grid .gold b { color: var(--gold); }
.pc-grid span { font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); text-align: center; }
.pc-note { margin: 12px 0 0; font-size: 12px; color: var(--ink-dim); text-align: center; }
.tl-ranks b { font-weight: 900; font-variant-numeric: tabular-nums; color: var(--ink); }
.tl-result {
  display: grid; justify-items: center; gap: 2px; padding: 12px; border-radius: 16px;
  background: rgba(0, 0, 0, 0.3); border: 1.5px solid rgba(255, 255, 255, 0.2);
  animation: board-in 0.55s cubic-bezier(0.2, 1.7, 0.4, 1) both;
}
.tl-result span { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
.tl-result b { font: 400 34px/1.1 "Bungee", "Archivo", sans-serif; color: var(--ink); }
.tl-result em { font-style: normal; font-size: 12.5px; font-weight: 800; color: var(--ink-dim); }
.tl-result.best { border-color: var(--gold); box-shadow: 0 0 22px rgba(242, 181, 60, 0.4); }
.tl-result.best b { color: var(--gold); }
.tl-result.best em { color: var(--gold); }

/* ---------- Dome ---------- */
/* While betting the dome sits small (compact); pressing Roll grows it to full
   size. The canvas keeps its full resolution and is scaled with a transform,
   while the box around it changes height so the table moves up and down. */
.stage {
  --dome-size: min(calc(100vw - 2 * var(--gutter)), 360px, 46vh);
  --dome-small: 0.5;
  padding: 0 var(--gutter); display: grid; justify-items: center;
}
.dome-box {
  width: var(--dome-size); height: var(--dome-size);
  transition: height 0.52s cubic-bezier(0.3, 1.15, 0.45, 1);
}
.dome-wrap {
  position: relative; width: var(--dome-size); height: var(--dome-size);
  transform-origin: 50% 0;
  transition: transform 0.52s cubic-bezier(0.3, 1.15, 0.45, 1);
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.55));
}
.stage.compact .dome-box { height: calc(var(--dome-size) * var(--dome-small)); }
/* Lite mode (src/lite.js): slow devices skip the costliest effects. */
.lite .dome-wrap { filter: none; }
.lite .controls { backdrop-filter: none; -webkit-backdrop-filter: none; background: #1a2245; }
.stage.compact .dome-wrap { transform: scale(var(--dome-small)); }
#dome { width: 100%; height: 100%; display: block; transform-origin: 50% 60%; }
#dome.pop { animation: dome-pop 0.38s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes dome-pop {
  0% { transform: scale(1); }
  25% { transform: scale(0.955, 0.94); }
  100% { transform: scale(1); }
}
.callout {
  margin-top: 6px; min-height: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 14px 4px 4px; border-radius: 999px;
  background: rgba(8, 10, 20, 0.92); border: 1.5px solid var(--line-soft);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  opacity: 0; transform: scale(0.85);
  transition: opacity 0.25s, transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.callout:empty { display: none; }
.callout.show { opacity: 1; transform: scale(1); }
.callout .total {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font-size: 19px; font-weight: 900;
}
.callout .label { font-size: 12.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.callout.seven-out .label, .callout.craps .label { color: var(--lose); }
.callout.point-made .label, .callout.natural .label { color: var(--win); }
.callout.point-set .label { color: var(--gold); }

.status {
  margin-top: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-dim);
  display: flex; align-items: center; gap: 8px;
}
.status b { color: var(--ink); background: var(--ink); color: var(--bg); border-radius: 999px; padding: 2px 8px; font-weight: 900; }

/* Tournament roll tracker under the dome. */
.roll-tracker {
  margin-top: 8px; width: min(340px, 92%); box-sizing: border-box;
  display: grid; justify-items: center;
}

/* 🔒 Lock it in: end a tournament entry early. */
.bank-btn {
  margin-top: 2px; padding: 7px 16px; border-radius: 999px;
  border: 1.5px solid var(--gold); background: rgba(242, 181, 60, 0.16); color: #ffe7b0;
  font-size: 13px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}
.bank-btn b { font-family: "Bungee", "Archivo", sans-serif; font-weight: 400; color: var(--gold); margin-left: 4px; letter-spacing: 0; }
.bank-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.bank-btn:disabled { opacity: 0.4; }
.rt-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.board-btn {
  margin-top: 2px; padding: 7px 14px; border-radius: 999px;
  border: 1.5px solid rgba(201, 168, 255, 0.6); background: rgba(155, 123, 255, 0.16); color: var(--ink);
  font-size: 13px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}
.board-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.board-btn .ic { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; }
/* Standings mid-entry: the leaderboard, and where you'd land if you locked in now. */
.board-dialog { width: min(380px, calc(100vw - 32px)); max-height: min(640px, calc(100dvh - 48px)); display: none; }
.board-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; }
#boardDialogBody { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; min-height: 0; }
.bs-summary { display: grid; gap: 4px; }
.bs-now { margin: 0; font-size: 14px; font-weight: 800; color: var(--ink-dim); }
.bs-now b { font: 400 26px/1.1 "Bungee", "Archivo", sans-serif; color: var(--gold); display: block; }
.bs-line { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.bs-line b { color: var(--gold); }
.bs-small { margin: 0; font-size: 12px; color: var(--ink-dim); }
.bs-list { overflow-y: auto; text-align: left; min-height: 0; }
.bd-close { min-height: 46px; border-radius: 14px; font-size: 14px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); }
.bank-dialog {
  width: min(340px, calc(100vw - 32px)); padding: 18px 18px 16px; border: 2px solid var(--gold); border-radius: 20px;
  background: linear-gradient(#3b2a6b, #251a47); color: var(--ink); text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.bank-dialog::backdrop { background: rgba(5, 8, 20, 0.6); }
.bank-dialog h2 { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.bd-amount { margin: 6px 0 8px; font: 400 40px/1 "Bungee", "Archivo", sans-serif; color: var(--gold); filter: drop-shadow(0 2px 0 #5a3304); }
.bd-note { margin: 0 0 14px; font-size: 13px; line-height: 1.45; color: rgba(244, 241, 232, 0.85); }
.bd-note b { color: #ffd1d1; }
.bd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bd-actions button { min-height: 48px; border-radius: 14px; font-size: 14px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
.bd-keep { border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.08); }
.bd-bank { border: 0; color: #2b1600; background: linear-gradient(#ffe39a, #f2b53c 55%, #d48d19); box-shadow: 0 4px 0 #8a5a12; }

/* Machine buttons beside the small dome (betting only). */
.stage { position: relative; }
.side-btn {
  position: absolute; top: calc(var(--dome-size) * var(--dome-small) / 2); transform: translateY(-50%);
  width: calc((100% - var(--dome-size) * var(--dome-small)) / 2 - var(--gutter) - 8px); max-width: 118px; min-height: 64px;
  display: grid; justify-items: center; align-content: center; gap: 1px; padding: 6px 4px;
  border-radius: 16px; border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: opacity 0.3s, transform 0.3s, background 0.2s, border-color 0.2s;
}
.side-btn.left { left: var(--gutter); }
.side-btn.right { right: var(--gutter); }
.side-btn:active:not(:disabled) { transform: translateY(calc(-50% + 3px)); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.side-btn:disabled { opacity: 0.4; }
.stage:not(.compact) .side-btn { opacity: 0; pointer-events: none; transform: translateY(-50%) scale(0.8); }
.sb-top { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.side-btn small { font-size: 9.5px; color: var(--ink-dim); font-weight: 600; }
.sb-state {
  font: 400 15px/1.1 "Bungee", "Archivo", sans-serif; padding: 2px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.35); color: var(--ink-dim);
}
#betsOnBtn[aria-pressed="true"] { border-color: var(--win); background: linear-gradient(rgba(94, 242, 181, 0.22), rgba(94, 242, 181, 0.06)); }
#betsOnBtn[aria-pressed="true"] .sb-state { background: var(--win); color: #06281a; box-shadow: 0 0 12px rgba(94, 242, 181, 0.7); }
.sb-x { font: 400 22px/1 "Bungee", "Archivo", sans-serif; color: var(--gold); filter: drop-shadow(0 2px 0 #5a3304); }

/* ---------- History ---------- */
.history { margin: 6px 0 2px; }
.history-strip {
  list-style: none; margin: 0; padding: 4px var(--gutter) 8px;
  display: flex; gap: 6px;
  overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: none;
  min-height: 62px;
}
.history-strip::-webkit-scrollbar { display: none; }
.history-strip:empty::before {
  content: "Roll history shows here — newest first";
  font-size: 12px; color: var(--ink-dim); align-self: center;
}
.history-strip li {
  flex: 0 0 auto; scroll-snap-align: start;
  width: 50px; padding: 6px 0 5px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid; justify-items: center; gap: 3px;
}
.history-strip li.new { animation: slide-in 0.4s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes slide-in { from { transform: translateX(-30px) scale(0.6); opacity: 0; } }
.history-strip li .dice { display: flex; gap: 3px; }
.history-strip li .t { font-size: 15px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.history-strip li.seven-out, .history-strip li.craps { border-color: rgba(255, 107, 107, 0.6); background: rgba(255, 107, 107, 0.12); }
.history-strip li.seven-out .t, .history-strip li.craps .t { color: var(--lose); }
.history-strip li.natural, .history-strip li.point-made { border-color: rgba(94, 242, 181, 0.6); background: rgba(94, 242, 181, 0.1); }
.history-strip li.natural .t, .history-strip li.point-made .t { color: var(--win); }
.history-strip li.point-set { border-color: rgba(242, 196, 90, 0.7); background: rgba(242, 196, 90, 0.1); }
.history-strip li.point-set .t { color: var(--gold); }

.mini-die {
  width: 16px; height: 16px; border-radius: 4px; background: var(--ruby);
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 2px;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.35);
}
.mini-die i { width: 3px; height: 3px; border-radius: 50%; background: #fff; place-self: center; visibility: hidden; }
.mini-die i.p { visibility: visible; }
.pair { display: flex; gap: 4px; justify-content: center; }
.pair .mini-die { width: 22px; height: 22px; border-radius: 5px; padding: 3px; }
.pair .mini-die i { width: 4px; height: 4px; }

/* ---------- Layout ---------- */
.layout {
  margin: 4px var(--gutter) 0;
  padding: 10px;
  border-radius: 22px;
  background:
    radial-gradient(140% 60% at 50% 0%, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 60%),
    linear-gradient(var(--felt), var(--felt-deep));
  border: 2px solid var(--line-soft);
  box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.18), 0 10px 30px rgba(0, 0, 0, 0.4);
  display: grid; gap: 8px;
}
.row { display: grid; gap: 8px; }
.row.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row.line { grid-template-columns: minmax(0, 1fr) minmax(76px, 30%); }
.section-title {
  margin: 8px 2px 0; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
}
.section-title span { font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--ink-dim); font-size: 11px; }

.spot {
  position: relative;
  min-width: 0;
  min-height: 58px;
  border: 1.5px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.14);
  padding: 8px 8px 8px;
  display: grid; align-content: center; justify-items: center; gap: 2px;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, opacity 0.2s, transform 0.08s;
}
.spot:active { transform: scale(0.97); }
.spot:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.spot .name { font-weight: 800; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; overflow-wrap: anywhere; line-height: 1.1; }
.spot small { font-size: 10.5px; color: rgba(244, 241, 232, 0.75); font-weight: 600; overflow-wrap: anywhere; }
.spot.off { opacity: 0.38; }
.spot.has-bet { border-color: var(--line); background: rgba(227, 194, 122, 0.08); }

.spot.pass { min-height: 64px; border-color: rgba(255, 255, 255, 0.55); }
.spot.pass .name { font-size: clamp(15px, 5vw, 19px); letter-spacing: 0.06em; }
.spot.dont .name { font-size: 13px; }
.spot.come-box.main .name { font-size: clamp(16px, 5vw, 20px); letter-spacing: 0.1em; }
.spot.come-box .name { font-size: clamp(12px, 3.6vw, 14px); }
.spot.field { min-height: 76px; }
.spot.field .name { color: var(--gold); font-size: 16px; letter-spacing: 0.16em; }
.field-nums { font-weight: 800; font-size: clamp(13px, 4vw, 16px); display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0 2px; max-width: 100%; }
.field-nums i {
  font-style: normal; display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); margin: 0 4px; font-size: 12px; flex: none;
}
.spot.odds { border-style: dashed; }
.spot.odds .name { font-size: 12px; }
.spot.prop { min-height: 60px; }
.spot.prop .name { font-size: 12.5px; }
.spot.seven .name { color: var(--lose); font-size: 15px; letter-spacing: 0.14em; }
.spot.wide { grid-column: 1 / -1; }

/* Stake chip on a spot */
.stake {
  position: absolute; top: 4px; right: 4px;
  min-width: 28px; height: 28px; padding: 0 4px;
  border-radius: 999px;
  display: none; place-items: center;
  font-size: 10px; font-weight: 900; font-variant-numeric: tabular-nums;
  color: #fff;
  background: var(--chip, #c8243a);
  border: 2px dashed rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 2px var(--chip, #c8243a), 0 3px 6px rgba(0, 0, 0, 0.45);
  z-index: 2;
}
.spot.has-bet .stake { display: grid; animation: chip-drop 0.22s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes chip-drop { from { transform: translateY(-10px) scale(1.25); opacity: 0.4; } }

/* Pucks */
.puck {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase;
}
.puck.off { background: #111; color: #fff; border: 2px solid #555; }
.puck.on { background: #fff; color: #111; border: 2px solid #ccc; box-shadow: 0 0 12px rgba(255, 255, 255, 0.6); }

/* ---------- Bounce House ---------- */
.dome-run {
  border-radius: 14px; padding: 9px 9px 10px;
  background: linear-gradient(160deg, rgba(255, 210, 90, 0.16), rgba(0, 0, 0, 0.2) 60%);
  border: 1.5px solid rgba(242, 196, 90, 0.55);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.25);
  display: grid; gap: 8px; min-width: 0;
}
.bh-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bh-title {
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
  font-family: "Bungee", "Archivo", sans-serif; font-size: clamp(14px, 4.3vw, 17px); text-transform: uppercase; letter-spacing: 0.03em;
  background: linear-gradient(#fff4c4, #f2b53c 60%, #c77d12); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #5a3304);
}
.bh-die {
  width: 15px; height: 15px; border-radius: 4px; flex: none;
  background:
    radial-gradient(circle, #fff 0 1.4px, transparent 1.6px) 3px 3px / 4px 4px no-repeat,
    radial-gradient(circle, #fff 0 1.4px, transparent 1.6px) 5.5px 5.5px / 4px 4px no-repeat,
    radial-gradient(circle, #fff 0 1.4px, transparent 1.6px) 8px 8px / 4px 4px no-repeat,
    #d6283f;
  box-shadow: inset 0 -1.5px 0 rgba(0, 0, 0, 0.3);
  animation: bh-die-bounce 2.4s ease-in-out infinite;
}
@keyframes bh-die-bounce { 0%, 70%, 100% { transform: translateY(0) rotate(0); } 78% { transform: translateY(-5px) rotate(-12deg); } 86% { transform: translateY(0) rotate(0); } 92% { transform: translateY(-2px); } }
/* Bounce House win: the hit numbers chase with light like a marquee. */
#bhTrack.chase b.hit { animation: chase 0.7s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes chase { 0%, 100% { box-shadow: 0 0 10px rgba(255, 210, 90, 0.75); filter: none; } 50% { box-shadow: 0 0 22px rgba(255, 230, 140, 1); filter: brightness(1.35); } }
/* Bounce House: the dome bounces like an inflatable castle while its glow
   cycles through party colors. */
#dome.party { animation: party-jiggle 2.6s cubic-bezier(0.3, 0.9, 0.4, 1), party-glow 2.6s linear; }
@keyframes party-jiggle {
  0% { transform: translateY(0) scale(1); }
  8% { transform: translateY(-26px) scale(0.94, 1.08); }
  16% { transform: translateY(0) scale(1.12, 0.86); }
  24% { transform: translateY(-18px) scale(0.96, 1.06); }
  32% { transform: translateY(0) scale(1.08, 0.9) rotate(-2deg); }
  40% { transform: translateY(-12px) scale(0.98, 1.04) rotate(2deg); }
  48% { transform: translateY(0) scale(1.06, 0.93) rotate(-1.5deg); }
  57% { transform: translateY(-7px) scale(1, 1.02) rotate(1deg); }
  66% { transform: translateY(0) scale(1.04, 0.96); }
  76% { transform: translateY(-3px); }
  86% { transform: translateY(0) scale(1.015, 0.985); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes party-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 210, 90, 0)); }
  12% { filter: drop-shadow(0 0 22px #f2c45a) drop-shadow(0 0 8px #fff3c4); }
  30% { filter: drop-shadow(0 0 24px #ff4fa3) drop-shadow(0 0 8px #ffd1e8); }
  48% { filter: drop-shadow(0 0 24px #4fd8ff) drop-shadow(0 0 8px #d1f6ff); }
  66% { filter: drop-shadow(0 0 24px #9bff6a) drop-shadow(0 0 8px #e6ffd1); }
  84% { filter: drop-shadow(0 0 22px #f2c45a) drop-shadow(0 0 8px #fff3c4); }
}
/* Low and High Bounce: the victory bounce plus a warm gold glow. */
#dome.victory.cheer { animation: victory 1.05s cubic-bezier(0.3, 0.9, 0.4, 1), cheer-glow 1.7s ease-in-out; }
@keyframes cheer-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 210, 90, 0)); }
  30%, 60% { filter: drop-shadow(0 0 20px #f2c45a) drop-shadow(0 0 6px #fff3c4); }
}
.party-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 66; pointer-events: none; }
/* ...and the dice in the dome take a big victory bounce. */
#dome.victory { animation: victory 1.05s cubic-bezier(0.3, 0.9, 0.4, 1); }
@keyframes victory {
  0% { transform: translateY(0) scale(1); }
  18% { transform: translateY(-16px) scale(1.035); }
  34% { transform: translateY(0) scale(1.02, 0.97); }
  50% { transform: translateY(-8px) scale(1.015); }
  64% { transform: translateY(0) scale(1.01, 0.99); }
  78% { transform: translateY(-3px); }
  100% { transform: translateY(0) scale(1); }
}
.bh-status { font-size: 11px; font-weight: 700; color: var(--ink-dim); text-align: right; white-space: nowrap; }
.bh-track { display: flex; align-items: center; gap: 5px; min-width: 0; }
.bh-group { flex: 1 1 0; min-width: 0; display: flex; justify-content: space-between; gap: 3px; padding: 2px; border-radius: 999px; transition: background 0.3s, box-shadow 0.3s; }
.bh-group.complete { background: rgba(255, 210, 90, 0.25); box-shadow: 0 0 14px rgba(255, 210, 90, 0.6); }
.bh-track b {
  flex: 1 1 0; min-width: 0; max-width: 28px; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; font-size: clamp(10px, 3.2vw, 12px); font-weight: 900;
  color: rgba(244, 241, 232, 0.55); background: rgba(0, 0, 0, 0.28); border: 1.5px solid rgba(255, 255, 255, 0.18);
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}
.bh-track b.hit {
  color: #2b1600; border-color: #fff3c4;
  background: radial-gradient(circle at 35% 30%, #fff6d0, #f2b53c 70%);
  box-shadow: 0 0 10px rgba(255, 210, 90, 0.75);
}
/* One number away: the missing numbers blink like marquee bulbs, the group
   glows, and a bet riding on that run pulses. */
.bh-track b.close { animation: bh-close 0.75s ease-in-out infinite; border-color: #ffe9a8; }
@keyframes bh-close {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 220, 120, 0.55), 0 0 6px rgba(255, 210, 90, 0.4); transform: scale(1); }
  50% { box-shadow: 0 0 0 3px #fff3c4, 0 0 22px rgba(255, 210, 90, 1); transform: scale(1.14); background: rgba(255, 214, 102, 0.35); }
}
.bh-group.close { animation: bh-group-close 1.5s ease-in-out infinite; }
@keyframes bh-group-close { 50% { background: rgba(255, 210, 90, 0.18); box-shadow: 0 0 16px rgba(255, 210, 90, 0.55); } }
.spot.bh-bet.close { animation: bh-bet-close 0.75s ease-in-out infinite; }
@keyframes bh-bet-close {
  0%, 100% { border-color: rgba(242, 196, 90, 0.55); box-shadow: none; }
  50% { border-color: #fff3c4; box-shadow: 0 0 0 2px rgba(255, 220, 120, 0.7), 0 0 20px rgba(255, 210, 90, 0.75), inset 0 0 14px rgba(255, 210, 90, 0.3); }
}
@media (prefers-reduced-motion: reduce) {
  .bh-track b.close, .bh-group.close, .spot.bh-bet.close { animation: none; box-shadow: 0 0 0 2px #fff3c4, 0 0 14px rgba(255, 210, 90, 0.8); }
}
.bh-track b.new { animation: bh-pop 0.9s cubic-bezier(0.3, 1.8, 0.5, 1); }
@keyframes bh-pop { 0% { transform: scale(0.4); } 40% { transform: scale(1.45); box-shadow: 0 0 22px rgba(255, 220, 120, 1); } }
.bh-count { font-size: 11px; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; flex: none; }
.bh-bets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.spot.bh-bet { min-height: 58px; padding: 6px 4px 8px; border-color: rgba(242, 196, 90, 0.55); }
.spot.bh-bet .stake { top: auto; bottom: 3px; right: 50%; transform: translateX(50%); min-width: 24px; height: 24px; font-size: 9px; }
.spot.bh-bet.has-bet small { visibility: hidden; }
.spot.bh-bet.has-bet .stake { animation-name: chip-drop-c; }
.spot.bh-bet .name { font-size: clamp(11px, 3.4vw, 13px); line-height: 1.05; white-space: normal; text-wrap: balance; letter-spacing: 0.02em; }
.spot.bh-bet.grand { background: rgba(255, 210, 90, 0.12); border-color: var(--gold); }
.spot.bh-bet.grand .name { color: var(--gold); }

/* Place bets 2–12 (no 7) */
.places { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.spot.placenum { min-height: 56px; padding: 6px 2px 7px; gap: 1px; border-color: rgba(255, 255, 255, 0.28); }
.spot.placenum b { font-size: clamp(18px, 6vw, 24px); font-weight: 900; line-height: 1; }
.spot.placenum small { font-size: 10px; font-weight: 800; color: var(--gold); }
.spot.placenum .stake { top: auto; bottom: 2px; right: 50%; transform: translateX(50%); min-width: 22px; height: 22px; font-size: 9px; }
.spot.placenum.has-bet small { visibility: hidden; }
.spot.placenum.is-point { border-color: #fff; background: rgba(255, 255, 255, 0.12); box-shadow: 0 0 14px rgba(255, 255, 255, 0.28); }
.spot.placenum .puck { top: 3px; left: 3px; transform: none; width: 20px; height: 20px; font-size: 7px; }
.spot.placenum.is-off::after { top: auto; bottom: 4px; left: 3px; }
.spot.placenum.is-off .stake { right: 3px; transform: none; }
@keyframes chip-drop-c { from { transform: translateX(50%) translateY(-10px) scale(1.25); opacity: 0.4; } }
.spot.placenum.has-bet .stake { animation-name: chip-drop-c; }
.row.two-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Number boxes */
.numbers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; align-items: end; }
.num { display: grid; gap: 4px; min-width: 0; }
.num .spot.place { min-height: 74px; padding: 6px 2px; border-color: rgba(255, 255, 255, 0.3); }
.num .spot.place b { font-size: clamp(20px, 7vw, 28px); font-weight: 900; line-height: 1; }
.num .spot.place.is-point { border-color: #fff; background: rgba(255, 255, 255, 0.1); box-shadow: 0 0 14px rgba(255, 255, 255, 0.25); }
.num .puck { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; font-size: 9px; }
.num .stake { top: auto; bottom: 3px; right: 50%; transform: translateX(50%); min-width: 24px; height: 24px; font-size: 9px; }
.num .spot.place.has-bet small { visibility: hidden; }
.travel { display: flex; flex-wrap: wrap; gap: 6px; }
.num-sub {
  min-width: 0; overflow: hidden;
  min-height: 34px; border-radius: 8px; padding: 4px 10px; border: 1.5px solid; font-size: 10px; font-weight: 800; line-height: 1.15;
  display: grid; place-content: center; text-align: center; font-variant-numeric: tabular-nums;
}
.num-sub.come { border-color: rgba(94, 242, 181, 0.7); background: rgba(94, 242, 181, 0.12); color: var(--win); }
.num-sub.dc { border-color: rgba(157, 183, 255, 0.7); background: rgba(157, 183, 255, 0.12); color: var(--push); }
.num-sub span { color: var(--ink); font-weight: 700; }
.num-sub b { font-size: 15px; font-weight: 900; color: var(--ink); margin-right: 2px; }
.num-sub { display: flex !important; align-items: center; gap: 4px; font-size: 11px; }
.num-sub[hidden] { display: none !important; }
.num-sub:active { transform: scale(0.96); }

/* Resolution flashes */
.spot.flash-win, .num-sub.flash-win { animation: flash-win 1.4s ease-out; }
.spot.flash-lose, .num-sub.flash-lose { animation: flash-lose 1.2s ease-out; }
.spot.flash-push, .num-sub.flash-push { animation: flash-push 1.2s ease-out; }
@keyframes flash-win { 0%, 30% { background: rgba(94, 242, 181, 0.4); border-color: var(--win); box-shadow: 0 0 22px rgba(94, 242, 181, 0.6); } }
@keyframes flash-lose { 0%, 25% { background: rgba(255, 107, 107, 0.35); border-color: var(--lose); } }
@keyframes flash-push { 0%, 25% { background: rgba(157, 183, 255, 0.3); border-color: var(--push); } }

.layout.removing .spot.has-bet, .layout.removing .num-sub { outline: 2px dashed var(--lose); outline-offset: 2px; }
.layout.removing .spot:not(.has-bet) { opacity: 0.35; }

.fine { margin: 6px 4px 2px; font-size: 11px; line-height: 1.5; color: var(--ink-dim); }

/* ---------- Win celebration ---------- */
.cash-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 65; pointer-events: none; }
.dome-wrap.win-glow { animation: win-glow 1.1s ease-in-out 2; }
@keyframes win-glow {
  0%, 100% { filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.55)); }
  50% { filter: drop-shadow(0 0 26px rgba(255, 210, 90, 0.95)) drop-shadow(0 0 60px rgba(255, 190, 60, 0.55)); }
}
.win-splash {
  position: fixed; z-index: 70;
  display: grid; justify-items: center; gap: 2px;
  transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap;
  animation: splash-in 0.6s cubic-bezier(0.2, 1.8, 0.4, 1) both;
}
.win-splash.out { animation: splash-out 0.45s ease-in both; }
@keyframes splash-in { from { transform: translate(-50%, -50%) scale(0.2) rotate(-8deg); opacity: 0; } }
@keyframes splash-out { to { transform: translate(-50%, -80%) scale(1.15); opacity: 0; } }
.ws-label {
  font-family: "Bungee", "Archivo", sans-serif; font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase;
  color: #1a1206; background: linear-gradient(#fff3c4, #f2b53c); padding: 3px 12px 2px; border-radius: 999px;
  box-shadow: 0 4px 0 #8a5a12, 0 8px 18px rgba(0, 0, 0, 0.45);
}
.ws-amount {
  font-family: "Bungee", "Archivo", sans-serif; font-size: clamp(40px, 13vw, 58px); line-height: 1;
  background: linear-gradient(100deg, #fff6d0 0%, #ffd25c 35%, #fffbe8 48%, #f2b53c 60%, #c77d12 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #5a3304) drop-shadow(0 0 18px rgba(255, 200, 70, 0.7));
  animation: ws-shine 1.4s ease-in-out 0.3s 2 both;
}
@keyframes ws-shine { from { background-position: 100% 0; } to { background-position: 0% 0; } }
.win-splash.level-3 .ws-amount, .win-splash.level-4 .ws-amount { font-size: clamp(48px, 16vw, 72px); }
.win-splash.level-3 .ws-label, .win-splash.level-4 .ws-label { font-size: 18px; animation: label-pulse 0.5s ease-in-out 0.6s 4 alternate; }
@keyframes label-pulse { to { transform: scale(1.12); } }
.bank strong.counting { animation: bank-pulse 0.5s ease-in-out 3 alternate; color: var(--gold); }
@keyframes bank-pulse { to { transform: scale(1.14); text-shadow: 0 0 14px rgba(255, 210, 90, 0.9); } }
.bank strong { display: inline-block; transform-origin: right center; }

/* Chips swept away on a seven out */
.flying-chip {
  position: fixed; z-index: 60; pointer-events: none;
  min-width: 30px; height: 30px; padding: 0 4px; border-radius: 999px;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums;
  background: var(--chip, #c8243a);
  border: 2px dashed rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 2px var(--chip, #c8243a), 0 6px 12px rgba(0, 0, 0, 0.45);
  will-change: transform, opacity;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--footer-h) + env(safe-area-inset-bottom) + 14px);
  transform: translate(-50%, 16px);
  width: max-content; max-width: min(440px, calc(100vw - 32px));
  background: rgba(18, 21, 42, 0.96); border: 1px solid var(--line-soft);
  padding: 10px 14px; border-radius: 14px;
  font-size: 13px; font-weight: 600; text-align: center;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.25s;
  z-index: 40;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .net { display: block; font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.toast .net.up { color: var(--win); }
.toast .net.down { color: var(--lose); }
.toast .lines { display: block; margin-top: 3px; color: var(--ink-dim); font-size: 12px; }
.toast .lines.kept { color: #ffe7b0; }
.toast .lines.skipped { color: #ffb3b3; }

/* ---------- Footer controls ---------- */
.controls {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(27, 35, 70, 0.8), #1a2245 30%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.controls > * { max-width: 452px; margin-left: auto; margin-right: auto; }
.chip-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.chip-row { flex: 1; min-width: 0; display: flex; justify-content: space-between; gap: 6px; --chip-count: 5; }
.chip-edit {
  flex: none; width: 28px; height: 44px; padding: 0; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.08); color: var(--ink);
  display: grid; place-items: center;
}
.chip-edit[hidden] { display: none; }
.chip-edit svg { width: 18px; height: 18px; }
.chip {
  --size: min(50px, calc((100vw - 2 * var(--gutter) - 34px - (var(--chip-count) - 1) * 6px) / var(--chip-count)));
  width: var(--size); height: var(--size); border-radius: 50%;
  border: 0; padding: 0;
  background:
    radial-gradient(circle, var(--chip) 0 52%, transparent 53%),
    repeating-conic-gradient(var(--chip) 0 22.5deg, #fff 22.5deg 45deg);
  box-shadow: 0 0 0 2px var(--chip), 0 4px 0 rgba(0, 0, 0, 0.4);
  display: grid; place-items: center;
  font-weight: 900; font-size: 13px; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  transition: transform 0.15s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.15s;
  position: relative;
}
.chip::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, 0.55); }
.chip[aria-checked="true"] { transform: translateY(-5px) scale(1.06); box-shadow: 0 0 0 2px var(--chip), 0 0 0 5px var(--gold), 0 9px 14px rgba(0, 0, 0, 0.5); }
.chip:disabled { opacity: 0.3; }

.action-row { display: grid; grid-template-columns: 72px 92px 1fr; gap: 6px; align-items: stretch; }
.btn-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 5px; }
.btn-stack .ghost-btn { min-height: 30px; padding: 0 6px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.ghost-btn.toggle.on-off[aria-pressed="true"] { background: rgba(242, 196, 90, 0.2); border-color: var(--gold); color: #ffe7b0; }

.mode-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 9px; padding: 7px 8px 7px 12px; border-radius: 12px;
  background: rgba(242, 196, 90, 0.14); border: 1px solid rgba(242, 196, 90, 0.45);
  font-size: 12.5px; font-weight: 700;
}
.mode-bar span { margin-right: auto; }
.mode-bar .pill { border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
/* Small cells: OFF badge and chip sit side by side along the bottom, clear of the number */
.spot.hard.is-off::after { top: auto; bottom: 4px; left: 3px; }
.spot.hard.is-off .stake { top: auto; bottom: 3px; }
.mode-bar .pill:disabled { opacity: 0.35; }
.mode-bar .pill.done { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.mode-bar .pill.danger:not(:disabled) { color: #ffd1d1; border-color: rgba(255, 107, 107, 0.6); background: rgba(255, 107, 107, 0.16); }
.ghost-btn.rebet:not(:disabled) { color: #ffe7b0; border-color: rgba(242, 196, 90, 0.55); background: rgba(242, 196, 90, 0.1); }

/* ⓘ buttons on section titles */
.info {
  width: 18px; height: 18px; border-radius: 50%; padding: 0; margin: 0 auto 0 6px;
  display: inline-grid; place-items: center; flex: none;
  font: italic 800 11px/1 Georgia, "Times New Roman", serif; text-transform: none; letter-spacing: 0;
  color: var(--bg); background: var(--line); border: 0;
  -webkit-text-fill-color: var(--bg);
}
.bh-title .info { margin-left: 8px; filter: none; }
.section-title { align-items: center; }

/* ---------- How to play ---------- */
.help-sheet {
  width: min(480px, 100vw); max-width: 100vw; max-height: min(86vh, 760px);
  margin: auto auto 0; padding: 0; border: 0; border-radius: 20px 20px 0 0;
  background: var(--bg-2); color: var(--ink);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.55);
}
.help-sheet[open] { display: flex; flex-direction: column; animation: sheet-up 0.32s cubic-bezier(0.2, 1, 0.3, 1); }
@keyframes sheet-up { from { transform: translateY(40%); opacity: 0; } }
.help-sheet::backdrop { background: rgba(5, 8, 20, 0.6); backdrop-filter: blur(2px); }
.help-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.help-head h2 { margin: 0; font: 400 20px "Bungee", "Archivo", sans-serif; color: var(--gold); }
.help-body { overflow-y: auto; padding: 4px 16px calc(18px + env(safe-area-inset-bottom)); font-size: 14px; line-height: 1.5; }
.help-body section { padding: 12px 10px; margin: 6px -10px 0; border-radius: 12px; scroll-margin-top: 6px; }
.help-body section.spotlight { animation: spotlight 1.6s ease-out; }
@keyframes spotlight { 0%, 40% { background: rgba(242, 196, 90, 0.16); } }
.help-body h3 { margin: 0 0 6px; font-size: 15px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; color: var(--line); }
.help-body p { margin: 0 0 8px; color: rgba(244, 241, 232, 0.88); }
.help-body ul { margin: 0; padding-left: 18px; color: rgba(244, 241, 232, 0.88); }
.help-body li { margin-bottom: 5px; }
.help-body table { width: 100%; border-collapse: collapse; margin: 4px 0 8px; font-size: 13.5px; }
.help-body td { padding: 5px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.help-body td:last-child { text-align: right; font-weight: 800; color: var(--gold); white-space: nowrap; }
.help-foot { margin-top: 12px !important; font-size: 12px; color: var(--ink-dim) !important; }

/* ---------- Coach marks (tutorial and first-time tips) ---------- */
.coach-ring {
  position: fixed; z-index: 60; border-radius: 16px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--gold), 0 0 22px 4px rgba(242, 196, 90, 0.55), 0 0 0 9999px rgba(5, 8, 20, 0.55);
  opacity: 0; transition: opacity 0.22s ease;
}
.coach-ring.show { opacity: 1; }
.coach-ring.no-dim { box-shadow: 0 0 0 3px var(--gold), 0 0 22px 4px rgba(242, 196, 90, 0.55); }
.coach {
  position: fixed; z-index: 61; padding: 14px 16px 12px; border-radius: 16px;
  background: #fff8e6; color: #1b2346; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  opacity: 0; transform: translateY(6px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.2, 1, 0.3, 1);
}
.coach.show { opacity: 1; transform: none; }
.coach.center { box-shadow: 0 0 0 9999px rgba(5, 8, 20, 0.6), 0 14px 40px rgba(0, 0, 0, 0.5); }
.coach-title { margin: 0 0 4px; font: 400 17px "Bungee", "Archivo", sans-serif; color: #1b2346; }
.coach-text { margin: 0; font-size: 14.5px; line-height: 1.45; color: #2d3550; }
.coach-text b { color: #1b2346; }
/* The tournament invite's trophy row: silver, gold (or the themed cup), bronze, Top 10. */
.coach-title:has(+ .coach-text .coach-trophies) { text-align: center; }
.coach-trophies { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin: 2px 0 10px; }
.coach-trophies svg { flex: none; filter: drop-shadow(0 2px 3px rgba(27, 35, 70, 0.25)); }
.coach-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.coach-btn { min-height: 38px; padding: 0 14px; border-radius: 10px; border: 1.5px solid #c9bfa3; background: transparent; color: #1b2346; font-weight: 800; font-size: 14px; }
.coach-btn.primary { border: 0; color: #2b1600; background: linear-gradient(#ffe39a, #f2b53c 55%, #d48d19); box-shadow: 0 3px 0 #8a5a12; }
.coach-skip { margin-right: auto; border: 0; background: none; padding: 6px 0; color: #6b6f80; font-weight: 700; font-size: 13.5px; text-decoration: underline; }
body.rolling .coach, body.rolling .coach-ring { opacity: 0; pointer-events: none; transition: opacity 0.12s; }
@media (prefers-reduced-motion: reduce) { .coach, .coach-ring { transition: none; transform: none; } }
.quick-steps { margin: 0 0 10px; padding-left: 20px; color: rgba(244, 241, 232, 0.88); }
.quick-steps li { margin-bottom: 6px; }
.help-tutorial { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--gold); background: rgba(242, 196, 90, 0.12); color: var(--gold); font-weight: 800; font-size: 14.5px; }

/* ---------- Prize mode (tournament lobby) ---------- */
.tl-prize { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(242, 196, 90, 0.22), rgba(242, 196, 90, 0.06)); border: 1px solid var(--gold); font-size: 12.5px; color: var(--ink-dim); }
.tl-prize-tag { font: 400 15px "Bungee", "Archivo", sans-serif; color: var(--gold); }
.tl-prize ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 15px; color: var(--ink); font-weight: 800; }
.tl-prize ul b { color: var(--gold); margin-right: 6px; }
.tl-prize-note { margin: 0; color: #ffd1a1; font-weight: 700; }
.tl-prize-by { display: block; font-size: 12px; font-weight: 600; color: var(--ink-dim); }
.tl-prize-terms { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--ink-dim); }
.tl-legal { margin: 8px 0 2px; }
/* Weekly awards: trophy + place + bonus chips, in the lobby and in Standings. */
.tl-awards { margin: 10px 0 2px; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.18); border: 1px solid rgba(242, 196, 90, 0.25); }
.tl-awards-title { display: block; margin-bottom: 6px; font: 400 12px/1 "Bungee", "Archivo", sans-serif; color: var(--gold); letter-spacing: 0.04em; }
.tl-awards ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.tl-awards li { display: grid; justify-items: center; gap: 2px; padding: 4px 2px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.tl-awards li span { font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-dim); }
.tl-awards li b { font: 400 12px/1.1 "Bungee", "Archivo", sans-serif; color: var(--ink); }
.tl-awards p { margin: 6px 0 0; font-size: 11px; line-height: 1.4; color: var(--ink-dim); text-align: center; }
.board-dialog .tl-awards { margin-top: 10px; }
.tl-prize-fine { margin: 2px 0 0; font-size: 12px; color: var(--ink-dim); }
.tl-prize-fine a { color: var(--gold); font-weight: 700; }
.tl-rules { color: var(--line); font-weight: 800; }
.acct-check a { color: var(--line); }

/* ---------- Feedback / contact form ---------- */
.contact-form { display: grid; gap: 12px; }
.cf-field { display: grid; gap: 5px; font-size: 13px; font-weight: 800; color: var(--ink); }
.cf-field em { font-style: normal; font-weight: 600; color: var(--ink-dim); }
.cf-field input, .cf-field select, .cf-field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06); color: var(--ink); font: 600 15px "Archivo", system-ui, sans-serif;
}
.cf-field textarea { resize: vertical; min-height: 110px; line-height: 1.4; }
.cf-field select option { color: #111; }
.cf-field input:focus, .cf-field select:focus, .cf-field textarea:focus { outline: none; border-color: var(--gold); }
.cf-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cf-switch { justify-self: center; text-align: center; }
/* ---------- Owner stats ---------- */
.stats-sheet .help-body { padding-top: 12px; }
.st-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.st-cards div { display: grid; gap: 2px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); }
.st-cards b { font: 400 24px "Bungee", "Archivo", sans-serif; color: var(--ink); }
.st-cards span { font-size: 12px; color: var(--ink-dim); }
.st-cards em { font-style: normal; opacity: 0.8; }
.st-cards .good { border-color: rgba(95, 216, 140, 0.6); }
.st-cards .good b { color: #7fe3a2; }
.st-cards .low { border-color: rgba(255, 180, 90, 0.6); }
.st-cards .low b { color: #ffc27a; }
.st-sub { font: 500 12px "Archivo", sans-serif; font-style: normal; color: var(--ink-dim); letter-spacing: 0; text-transform: none; margin-left: 6px; }
.st-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.st-table th { text-align: right; font-size: 10.5px; color: var(--ink-dim); padding: 4px 3px; font-weight: 800; }
.st-table td { text-align: right; padding: 5px 3px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.st-table th:first-child, .st-table td:first-child { text-align: left; }
.st-msg { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); margin-bottom: 8px; }
.st-msg header { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.st-msg header span { color: var(--ink-dim); white-space: nowrap; }
.st-msg p { margin: 6px 0 !important; font-size: 14px; }
.st-msg footer { font-size: 11.5px; color: var(--ink-dim); overflow-wrap: anywhere; }
.st-msg a { color: var(--line); }

.st-prize { margin: 6px 0 12px; padding: 12px; border-radius: 14px; background: rgba(242, 196, 90, 0.08); border: 1px solid rgba(242, 196, 90, 0.35); }
.st-prize p { margin: 0 0 8px !important; }
.st-list { margin: 0 0 12px; padding-left: 18px; font-size: 13px; color: var(--ink-dim); }
.st-table a { color: var(--line); font-size: 11px; }

/* ---------- Free chips (daily refill + rewarded ads) ---------- */
.freechips-sheet .help-body { display: grid; gap: 10px; padding-top: 14px; }
.chip-sheet .help-body { padding-top: 12px; }
.cp-note { margin: 0 0 14px; color: var(--muted, rgba(255, 255, 255, 0.7)); font-size: 14px; }
.cp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 8px; justify-items: center; }
.cp-item { display: grid; justify-items: center; gap: 7px; border: 0; padding: 4px 0; background: none; color: var(--ink); font: inherit; font-size: 12px; font-weight: 700; }
.cp-item .chip { --size: 54px; pointer-events: none; }
.cp-item[aria-pressed="true"] .chip { box-shadow: 0 0 0 2px var(--chip), 0 0 0 5px var(--gold); }
.cp-item[aria-pressed="false"] .chip { filter: saturate(0.55) brightness(0.72); }
.cp-item:disabled { opacity: 0.45; }
.cp-state { min-height: 15px; }
.fc-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); }
.fc-icon { font-size: 24px; text-align: center; }
.fc-row b { display: block; font-size: 15px; }
.fc-row span { font-size: 12.5px; color: var(--ink-dim); }
.fc-btn { min-height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--gold); background: rgba(242, 196, 90, 0.12); color: var(--gold); font-weight: 900; font-size: 14px; white-space: nowrap; }
.fc-btn.primary { border: 0; color: #2b1600; background: linear-gradient(#ffe39a, #f2b53c 55%, #d48d19); box-shadow: 0 3px 0 #8a5a12; }
.fc-wait { font-size: 12.5px; font-weight: 700; color: var(--ink-dim); text-align: right; max-width: 110px; }
.fc-fine { margin: 2px 0 0 !important; font-size: 12px; color: var(--ink-dim) !important; }
.ad-sheet {
  width: min(380px, calc(100vw - 32px)); margin: auto; padding: 16px; border: 0; border-radius: 20px;
  background: #0d1124; color: var(--ink); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
}
.ad-sheet[open] { display: grid; gap: 10px; }
.ad-sheet::backdrop { background: rgba(5, 8, 20, 0.85); }
.ad-label { margin: 0; justify-self: start; padding: 2px 8px; border-radius: 6px; background: #f2c45a; color: #2b1600; font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.ad-stage { display: grid; place-items: center; gap: 6px; min-height: 180px; padding: 16px; border-radius: 14px; text-align: center; background: repeating-linear-gradient(45deg, #1a2045 0 14px, #161b3a 14px 28px); }
.ad-stage p { margin: 0; font: 400 22px "Bungee", "Archivo", sans-serif; color: var(--gold); }
.ad-stage span { font-size: 13px; color: var(--ink-dim); max-width: 260px; }
.ad-reward { margin: 0; text-align: center; font-size: 14px; }
.ad-reward b { color: var(--gold); }
.ad-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.ad-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 1s linear; }
.ad-count { margin: 0; text-align: center; font-size: 12.5px; color: var(--ink-dim); }
.ad-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ad-actions:has(#adCollect[hidden]) .ad-close { grid-column: 1 / -1; }
.ad-close { min-height: 50px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.2); background: transparent; color: var(--ink); font-weight: 800; }

/* ---------- 21+ age screen (first visit only) ---------- */
.age-gate {
  width: min(400px, calc(100vw - 32px)); margin: auto; padding: 26px 20px 20px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 22px;
  background: var(--bg-2); color: var(--ink); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}
.age-gate[open] { display: grid; gap: 14px; }
.age-gate::backdrop { background: #10162e; }
.age-brand { display: grid; justify-items: center; line-height: 0.92; font-family: "Bungee", "Archivo", sans-serif; text-transform: uppercase; }
.age-brand .bw-bounce { font-size: 34px; }
.age-brand .bw-craps { font-size: 15px; }
.age-gate form { display: grid; gap: 12px; }
.age-lead { margin: 0; text-align: center; font-size: 17px; font-weight: 800; }
.age-lead:focus { outline: none; } /* takes the dialog's first focus, so iPhone doesn't pop the month picker open */
.age-note { margin: 0; text-align: center; color: var(--ink-dim); }
.age-fields { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr; gap: 8px; }
.age-fields select, .age-fields input {
  min-height: 48px; padding: 0 8px; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06); color: var(--ink); font: 700 15px "Archivo", system-ui, sans-serif;
}
.age-fields select:focus, .age-fields input:focus { outline: none; border-color: var(--gold); }
.age-fields input { width: 100%; min-width: 0; padding: 0 12px; font-size: 16px; }
.age-fields input::placeholder { color: var(--ink); opacity: 1; }
.age-fields option { color: #111; }
.age-error { margin: -4px 0 0; min-height: 16px; text-align: center; font-size: 13px; font-weight: 700; color: #ffb4b4; }
.age-fine { margin: 0; text-align: center; font-size: 11.5px; color: var(--ink-dim); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Account (sign in with an emailed code) ---------- */
.account-sheet .help-body { padding-top: 14px; }
.account-sheet form { display: grid; gap: 10px; }
.acct-lead { margin: 0 !important; font-size: 17px; font-weight: 800; color: var(--ink) !important; }
.acct-name { margin: 0 !important; font: 400 26px "Bungee", "Archivo", sans-serif; color: var(--gold) !important; overflow-wrap: anywhere; }
.acct-note { margin: 0 !important; font-size: 13.5px; color: var(--ink-dim) !important; }
.acct-note.small { font-size: 12px; }
.acct-note b { color: var(--ink); }
.acct-input {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.06);
  color: var(--ink); font: 700 17px "Archivo", system-ui, sans-serif;
}
.acct-input:focus { outline: none; border-color: var(--gold); }
.acct-code { font-size: 26px; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.acct-hint { margin: -4px 0 0 !important; min-height: 16px; font-size: 12.5px; color: #ffb4b4 !important; }
.acct-check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 700; }
.acct-check input { width: 22px; height: 22px; accent-color: var(--gold); }
.acct-error { margin: 0 !important; padding: 8px 12px; border-radius: 10px; background: rgba(255, 107, 107, 0.15); color: #ffd1d1 !important; font-size: 13.5px; font-weight: 700; }
.acct-btn {
  min-height: 50px; border: 0; border-radius: 14px; font-size: 16px; font-weight: 900; letter-spacing: 0.04em; color: #2b1600;
  background: linear-gradient(#ffe39a, #f2b53c 55%, #d48d19); box-shadow: 0 4px 0 #8a5a12;
}
.acct-btn:disabled { opacity: 0.6; }
.acct-btn.ghost { margin-top: 8px; color: var(--ink); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: none; }
.acct-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.acct-link { border: 0; background: none; padding: 6px 0; color: var(--line); font-size: 13.5px; font-weight: 700; text-decoration: underline; }
.acct-link:disabled { color: var(--ink-dim); text-decoration: none; }

/* ---------- Trophy case ---------- */
.trophy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 6px; }
.trophy {
  display: grid; justify-items: center; gap: 2px; padding: 12px 4px 10px; border-radius: 14px;
  background: rgba(0, 0, 0, 0.22); border: 1.5px solid rgba(242, 196, 90, 0.4);
}
.trophy b { font: 400 30px/1 "Bungee", "Archivo", sans-serif; color: var(--gold); filter: drop-shadow(0 2px 0 #5a3304); }
.trophy span { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); }
.trophy.grand { background: rgba(242, 196, 90, 0.14); border-color: var(--gold); }
.trophy-note { font-size: 12px; color: var(--ink-dim) !important; }

/* Collection summary */
.tc-level { display: grid; justify-items: stretch; text-align: left; gap: 6px; padding: 12px 14px; margin-bottom: 8px; border-radius: 14px; background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(255, 255, 255, 0.08); }
.tc-level.spot { animation: award-spot 1.8s 0.45s ease-out; }
.tl-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; }
.tc-level .tc-bar { width: 100%; }
.tl-top b { font: 400 20px/1 "Bungee", "Archivo", sans-serif; color: var(--gold); }
.tl-top span { font-size: 12px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.tc-level > p { margin: 0; font-size: 12px; color: var(--ink-dim); }
.tc-level summary { font-size: 12px; font-weight: 800; color: var(--ink); cursor: pointer; }
.tc-level ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.tc-level li { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ink-dim); }
.tc-level li b { color: var(--ink); font-variant-numeric: tabular-nums; }
.lv-disc { display: grid; place-items: center; font: 400 22px/1 "Bungee", "Archivo", sans-serif; color: #3b2306; }
.tc-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.tc-head > div:not(.tc-bar) { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(255, 255, 255, 0.08); }
.tc-head b { font: 400 22px/1 "Bungee", "Archivo", sans-serif; color: var(--gold); }
.tc-head small { font-size: 12px; color: var(--ink-dim); }
.tc-head span { font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
.tc-bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.tc-bar i { display: block; height: 100%; width: calc(var(--p) * 100%); min-width: 6px; border-radius: inherit; background: linear-gradient(90deg, #c8901f, #ffe08a); }

/* The cup shelf */
.tc-shelf {
  display: grid; grid-template-columns: 1fr 1.25fr 1fr; align-items: end; gap: 6px; padding: 14px 10px 0; margin-top: 6px;
  border-radius: 16px 16px 6px 6px;
  background: radial-gradient(90% 80% at 50% 10%, rgba(242, 196, 90, 0.14), transparent 70%), linear-gradient(#141a36, #10152c);
  border: 1px solid rgba(242, 196, 90, 0.22); border-bottom: 0;
  box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.35);
  position: relative;
}
.tc-shelf::after {
  content: ""; position: absolute; left: -4px; right: -4px; bottom: -10px; height: 12px; border-radius: 3px;
  background: linear-gradient(#a8742c, #6b4515 60%, #3d2709); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.45);
}
.tc-cup { margin: 0; display: grid; justify-items: center; gap: 4px; padding-bottom: 14px; }
.tc-cup svg { width: 74%; height: auto; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45)); }
.tc-cup.grand svg { width: 86%; filter: drop-shadow(0 0 14px rgba(242, 196, 90, 0.35)) drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45)); }
.tc-cup.empty svg { filter: none; }
.tc-cup figcaption { display: grid; justify-items: center; text-align: center; line-height: 1.15; }
.tc-cup figcaption b { font-size: 11px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
.tc-cup figcaption span { font: 400 15px "Bungee", "Archivo", sans-serif; color: var(--gold); }
.tc-cup.empty figcaption b { color: var(--ink-dim); }
.tc-cup.empty figcaption span { font: 700 11px "Archivo", sans-serif; color: var(--ink-dim); }
.tc-shelf-wrap .trophy-note { margin-top: 18px !important; }

/* Medals */
.md-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.md {
  position: relative; display: grid; justify-items: center; align-content: start; gap: 8px; text-align: center;
  padding: 14px 8px 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(255, 255, 255, 0.08); overflow: hidden;
}
.md-ring { width: 66px; height: 66px; border-radius: 50%; padding: 4px; background: conic-gradient(var(--ring, var(--gold)) calc(var(--p) * 360deg), rgba(255, 255, 255, 0.09) 0); }
.md-disc {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; color: var(--md-ink, rgba(255, 255, 255, 0.3));
  background: var(--md-face, radial-gradient(circle at 35% 30%, #2f3966, #19203e)); box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.35), inset 0 2px 3px rgba(255, 255, 255, 0.25);
}
.md-disc svg { width: 28px; height: 28px; }
.md.bronze { --md-face: radial-gradient(circle at 35% 28%, #ffd2a6, #c47a3a 55%, #7a4119); --md-ink: #4a230b; --ring: #e09a5a; }
.md.silver { --md-face: radial-gradient(circle at 35% 28%, #ffffff, #c3ccda 55%, #737d90); --md-ink: #2e3546; --ring: #dfe6f2; }
.md.gold { --md-face: radial-gradient(circle at 35% 28%, #fff4c4, #f2c45a 55%, #9c6512); --md-ink: #4d2f05; --ring: #ffd76a; border-color: rgba(242, 196, 90, 0.45); }
.md.locked .md-disc svg { opacity: 0.55; }
.md-text { display: grid; justify-items: center; gap: 1px; min-width: 0; }
.md-text b { font-size: 14px; font-weight: 900; }
.md-status { font-size: 11.5px; color: var(--ink); opacity: 0.85; }
.md.locked .md-status { color: var(--ink-dim); }
/* Ten lights toward the next tier, like the Bounce House tracker. */
.md-meter { display: flex; gap: 2px; width: 100%; max-width: 132px; margin: 5px 0 3px; }
.md-meter i { flex: 1; height: 7px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); }
.md-meter i.on { background: var(--ring, var(--gold)); box-shadow: 0 0 5px color-mix(in srgb, var(--ring, var(--gold)) 55%, transparent); }
.md-meter.close i.on { animation: md-close 1.6s ease-in-out infinite; }
@keyframes md-close { 50% { opacity: 0.65; } }
.md-count { font-size: 11.5px; color: var(--ink-dim); line-height: 1.3; }
.md-count b { color: var(--ink); font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; }
.md-unit { font-size: 10.5px; color: var(--ink-dim); line-height: 1.25; }
.md-next { font-size: 10.5px; color: var(--ink-dim); line-height: 1.25; }
.md-next.done { color: var(--gold); font-weight: 800; }
.md-new {
  position: absolute; top: 8px; right: 8px; z-index: 2; padding: 2px 6px; border-radius: 99px; font-size: 9.5px; font-weight: 900; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  letter-spacing: 0.08em; text-transform: uppercase; color: #3b2306; background: linear-gradient(#ffe39a, #f2b53a);
}
.md.new { border-color: rgba(242, 196, 90, 0.6); animation: md-pop 0.5s ease-out both; }
.md.new .md-disc { position: relative; overflow: hidden; }
.md.new .md-disc::after {
  content: ""; position: absolute; inset: -20%; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.85) 50%, transparent 65%);
  transform: translateX(-120%); animation: md-shine 1.6s 0.35s ease-in-out 2;
}
@keyframes md-pop { from { transform: scale(0.94); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes md-shine { to { transform: translateX(120%); } }
/* The award the case opened on glows once as it scrolls into view. */
.tc-cup { position: relative; border-radius: 14px; }
.md.spot { animation: md-pop 0.5s ease-out both, award-spot 1.8s 0.45s ease-out; }
.tc-cup.spot { animation: award-spot 1.8s 0.45s ease-out; }
@keyframes award-spot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 196, 90, 0); }
  30% { box-shadow: 0 0 0 3px rgba(242, 196, 90, 0.7), 0 0 26px rgba(242, 196, 90, 0.45); }
}
@media (prefers-reduced-motion: reduce) { .md.new, .md.new .md-disc::after, .md.spot, .tc-cup.spot, .md-meter.close i.on, .tc-level.spot { animation: none; } }
.tc-records table + h3 { margin-top: 14px; }
.trophy-sheet td.up { color: var(--win); }
.trophy-sheet td.down { color: var(--lose); }

/* ---------- Bounce House celebration: casino marquee ---------- */
.marquee-board {
  position: fixed; z-index: 71; transform: translate(-50%, 0); pointer-events: none;
  display: grid; justify-items: center; gap: 3px;
  padding: 10px 20px 9px; border-radius: 14px; white-space: nowrap;
  background: #10162e;
  border: 3px solid #0b0f20;
  box-shadow:
    0 0 0 3px #f2b53c,
    0 14px 30px rgba(0, 0, 0, 0.55),
    inset 0 0 18px rgba(0, 0, 0, 0.6);
  animation: board-in 0.55s cubic-bezier(0.2, 1.7, 0.4, 1) both;
}
/* Marquee bulbs chasing around the board. */
.marquee-board::before {
  content: ""; position: absolute; inset: -9px; border-radius: 18px; pointer-events: none;
  background:
    radial-gradient(circle, #fff6c8 0 2.2px, transparent 3px) 0 0 / 12px 12px;
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  padding: 4px;
  animation: bulbs 0.5s steps(2) infinite;
  filter: drop-shadow(0 0 4px rgba(255, 220, 120, 0.9));
}
@keyframes bulbs { to { background-position: 6px 0; } }
.marquee-board.out { animation: board-out 0.4s ease-in both; }
@keyframes board-in { from { transform: translate(-50%, -30px) scale(0.3); opacity: 0; } }
@keyframes board-out { to { transform: translate(-50%, -20px) scale(0.9); opacity: 0; } }
.mq-title {
  font: 400 30px/1 "Bungee", "Archivo", sans-serif; text-transform: uppercase; letter-spacing: 0.02em;
  background: linear-gradient(#fff4c4, #f2b53c 60%, #c77d12); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #5a3304) drop-shadow(0 0 12px rgba(255, 200, 70, 0.6));
}
.mq-sub { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #b6fff4; text-shadow: 0 0 8px rgba(95, 242, 220, 0.7); }
.marquee-board.big .mq-title { font-size: 36px; animation: label-pulse 0.45s ease-in-out 0.5s 5 alternate; }
.marquee-board.big { box-shadow: 0 0 0 3px #f2b53c, 0 0 40px rgba(255, 200, 70, 0.6), 0 14px 30px rgba(0, 0, 0, 0.55), inset 0 0 18px rgba(0, 0, 0, 0.6); }

/* Bets that are turned off: chips stay, greyed, with an OFF tag */
.spot.is-off { border-style: dashed; }
.spot.is-off .stake { filter: grayscale(1) brightness(0.8); opacity: 0.75; }
.spot.is-off::after {
  content: "OFF"; position: absolute; top: 4px; left: 4px; z-index: 3;
  font-size: 9px; font-weight: 900; letter-spacing: 0.06em;
  padding: 2px 5px; border-radius: 999px; background: #0d0f1c; color: #fff; border: 1px solid rgba(255, 255, 255, 0.5);
}
.num-sub i { font-style: normal; font-size: 9px; font-weight: 900; text-transform: uppercase; background: #0d0f1c; color: #fff; padding: 1px 4px; border-radius: 999px; }
.layout.toggling .spot:not(.has-bet) { opacity: 0.3; }
.layout.toggling .spot.can-toggle, .layout.toggling .num-sub.can-toggle { outline: 2px dashed var(--gold); outline-offset: 2px; }
.ghost-btn {
  min-height: 64px; padding: 0 11px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.05);
  font-size: 12.5px; font-weight: 700;
}
.ghost-btn:disabled { opacity: 0.35; }
.ghost-btn.toggle[aria-pressed="true"] { background: rgba(255, 107, 107, 0.2); border-color: var(--lose); color: #ffd1d1; }
.roll-btn {
  min-height: 65px; border: 0; border-radius: 18px;
  font-size: 24px; font-weight: 900; letter-spacing: 0.2em; text-transform: uppercase; color: #2b1600;
  background: linear-gradient(#ffe39a, #f2b53c 55%, #d48d19);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -4px 0 rgba(0, 0, 0, 0.18), 0 6px 0 #8a5a12, 0 12px 24px rgba(242, 181, 60, 0.35);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.2s;
}
.roll-btn:active:not(:disabled) { transform: translateY(5px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 rgba(0, 0, 0, 0.18), 0 1px 0 #8a5a12, 0 4px 10px rgba(242, 181, 60, 0.3); }
.roll-btn:disabled { filter: grayscale(0.7) brightness(0.7); }
.roll-btn.rolling { animation: pulse 0.9s ease-in-out infinite; }
@keyframes pulse { 50% { filter: grayscale(0.4) brightness(0.85); } }

@media (min-width: 420px) {
  .num .spot.place b { font-size: 30px; }
  .chip { --size: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Most phones: drop the BANK label so a 5-digit bank still fits beside the buttons. */
@media (max-width: 390px) {
  .bank-label { display: none; }
  .icon-btn { width: 34px; height: 34px; }
}

/* Phones: four header buttons share the row with the brand and the bank, so
   the bank label sits above the amount. */
@media (max-width: 480px) {
  .topbar { gap: 4px; }
  .icon-btn { width: 32px; height: 32px; border-radius: 10px; }
  .brand { gap: 4px; }
  .brand-mark { width: 30px; height: 32px; }
  .bank { grid-template-columns: auto; line-height: 1.05; }
  .bank-label { font-size: 9px; }
  .bank strong { font-size: 17px; }
}

/* Narrow phones (iPhone SE and smaller) */
@media (max-width: 360px) {
  :root { --gutter: 10px; }
  .topbar { gap: 4px; }
  .bank-label { display: none; }
  .stat { flex-direction: column; align-items: center; gap: 0; padding: 3px 2px; }
  .stat span { font-size: 8.5px; }
  .brand-mark { width: 30px; height: 32px; }
  .bw-bounce { font-size: 17px; }
  .bw-craps { font-size: 9px; letter-spacing: 0.36em; }
  .bank { grid-template-columns: auto; }
  .bank strong { font-size: 17px; }
  .icon-btn { width: 30px; height: 30px; }
  .action-row { grid-template-columns: 62px 82px 1fr; }
  .btn-stack .ghost-btn { font-size: 11px; }
  .mode-bar { font-size: 11.5px; padding-left: 9px; }
  .mode-bar .pill { padding: 5px 8px; font-size: 11px; }
}

/* The smallest phones (320 px): squeeze the header a little more. */
@media (max-width: 340px) {
  .icon-btn { width: 28px; height: 28px; }
  .brand-mark { width: 26px; height: 28px; }
  .bank strong { font-size: 15px; }
}

/* ---------- Wider screens (tablets, computers) ----------
   The game sits in a phone-width column; give it its own panel so it stands
   out from the page: a darker backdrop, a soft edge and a deep shadow. The
   chip rack and Roll bar line up with the column instead of the whole screen. */
@media (min-width: 540px) {
  body {
    background:
      radial-gradient(70% 60% at 50% 35%, #1c2550 0%, rgba(11, 15, 34, 0) 70%),
      #0b0f22;
  }
  .app {
    background:
      radial-gradient(120% 55% at 50% 0%, #34428a 0%, rgba(27, 35, 70, 0) 65%),
      linear-gradient(#1f2851, #161d3b);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.07),
      0 0 0 6px rgba(0, 0, 0, 0.18),
      0 30px 90px rgba(0, 0, 0, 0.7),
      0 0 140px rgba(52, 66, 138, 0.35);
  }
  .controls {
    left: calc(50% - 240px);
    right: calc(50% - 240px);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
  }
}

/* Tablets (see the script at the top of index.html): a wider column. */
.tablet .app { max-width: 600px; }
.tablet .controls > * { max-width: none; }
.tablet .stage { --dome-size: min(calc(600px - 2 * var(--gutter)), 400px, 46vh); }
.tablet .chip { --size: 58px; }
@media (min-width: 601px) {
  .tablet .controls { left: calc(50% - 300px); right: calc(50% - 300px); }
}
@media (max-width: 601px) {
  .tablet .controls { left: 0; right: 0; }
}

/* ---------- Line icons (src/ui/icons.js) ---------- */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; margin-right: 0.5em; }
.menu button { display: flex; align-items: center; }
.menu button .ic { color: var(--gold); width: 18px; height: 18px; margin-right: 12px; }
.menu button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playmode button .ic { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
.fc-icon .ic { width: 26px; height: 26px; margin: 0; color: var(--gold); vertical-align: middle; }
.tl-prize-tag .ic { margin-right: 6px; }
.bank-btn .ic { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; }
.acct-btn .ic, .help-tutorial .ic { vertical-align: -3px; }
.st-msg header .ic { width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; }
/* Long menu on a phone: stop above the chip rack and scroll. */
.menu { max-height: calc(100dvh - 130px - var(--footer-h) - env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }

/* Delete account */
.acct-danger { justify-self: center; margin-top: 6px; color: #ffb4b4 !important; }
.acct-btn.danger { color: #fff; background: linear-gradient(#e2525a, #b5232f); box-shadow: 0 4px 0 #6d1219; }

/* Older iPhones without <dialog> (see src/polyfills.js) */
.no-dialog dialog:not([open]) { display: none; }
.no-dialog dialog[open] { position: fixed; inset: 0; z-index: 200; box-shadow: 0 0 0 100vmax rgba(5, 8, 20, 0.6); }
.no-dialog dialog.help-sheet[open] { top: auto; margin: 0 auto; }
.no-dialog dialog.age-gate[open], .no-dialog dialog.ad-sheet[open], .no-dialog dialog.bank-dialog[open] { margin: auto; height: fit-content; }

/* Phones held sideways: the game is built for portrait, like the machine's cabinet. */
.rotate-note { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .rotate-note {
    display: grid; place-content: center; justify-items: center; gap: 14px; position: fixed; inset: 0; z-index: 500;
    background: linear-gradient(#1f2851, #0f1530); color: var(--ink); font-weight: 800; font-size: 18px; text-align: center;
  }
  .rotate-note svg { width: 54px; height: 54px; color: var(--gold); animation: rotate-hint 2.4s ease-in-out infinite; }
  .rotate-note p { margin: 0; }
}
@keyframes rotate-hint { 0%, 30% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0deg); } }
.tl-open-table { margin-top: 8px; width: 100%; min-height: 42px; border-radius: 12px; border: 1px solid var(--gold); background: rgba(242, 196, 90, 0.12); color: var(--gold); font-weight: 900; font-size: 14px; }
.tl-open-table .ic { vertical-align: -3px; }

/* ---------- New medal banner (slides in at the top; tap to open the Trophy case) ---------- */
.medal-pop {
  position: fixed; z-index: 60; left: 50%; top: calc(env(safe-area-inset-top) + 10px);
  width: min(calc(100vw - 24px), 380px); transform: translateX(-50%);
  display: grid; grid-template-columns: auto 1fr; justify-items: start; align-items: center; gap: 12px; text-align: left;
  padding: 10px 14px 10px 10px; border-radius: 18px; border: 1.5px solid var(--ring, var(--gold));
  background: linear-gradient(180deg, #273162, #161d3b);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55), 0 0 26px rgba(242, 196, 90, 0.25);
  animation: mp-in 0.55s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.medal-pop.out { animation: mp-out 0.35s ease-in both; }
.medal-pop .md-ring { width: 60px; height: 60px; }
.medal-pop .md-disc { position: relative; overflow: hidden; }
.medal-pop .md-disc::after {
  content: ""; position: absolute; inset: -20%; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.85) 50%, transparent 65%);
  transform: translateX(-120%); animation: md-shine 1.4s 0.45s ease-in-out 2;
}
.mp-text { display: grid; gap: 2px; min-width: 0; }
.mp-text small { font-size: 10.5px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.mp-text b { font: 400 17px/1.15 "Bungee", "Archivo", sans-serif; color: var(--ink); }
.mp-text span { font-size: 12px; color: var(--ink-dim); }
@keyframes mp-in { from { opacity: 0; transform: translate(-50%, -24px) scale(0.92); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes mp-out { to { opacity: 0; transform: translate(-50%, -18px) scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .medal-pop, .medal-pop.out, .medal-pop .md-disc::after { animation: none; } }

/* Unseen medals: a dot on the ⋯ button and a NEW tag on "Trophy case". */
#menuBtn { position: relative; }
#menuBtn.has-new::after {
  content: ""; position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 2px var(--bg), 0 0 8px rgba(242, 196, 90, 0.8);
}
#trophyMenuBtn.has-new::after {
  content: "New"; margin-left: auto; padding: 2px 7px; border-radius: 99px; font-size: 10px; font-weight: 900;
  letter-spacing: 0.08em; text-transform: uppercase; color: #3b2306; background: linear-gradient(#ffe39a, #f2b53a);
}

/* Free chips leads the ⋯ menu: the first thing you see. */
.menu .menu-feature {
  margin-bottom: 6px; padding: 12px; border-radius: 12px; font-weight: 800; font-size: 15px; color: #2b1600;
  background: linear-gradient(#ffe39a, #f2b53c 60%, #dc9a24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 3px 0 #8a5a12;
}
.menu .menu-feature:hover, .menu .menu-feature:focus-visible { background: linear-gradient(#ffeab0, #f5bf52 60%, #e0a232); }
.menu .menu-feature .ic { color: #5a3304; width: 22px; height: 22px; }
.menu .menu-feature span { display: grid; gap: 1px; white-space: normal; }
.menu .menu-feature small { font-size: 11.5px; font-weight: 600; color: rgba(43, 22, 0, 0.75); }

/* Sharing a medal or cup */
.md-share, .tc-share {
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.06); color: var(--ink); border-radius: 99px;
}
.md-share { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; font-size: 11px; font-weight: 800; justify-self: center; }
.md-share .ic, .tc-share .ic { width: 15px; height: 15px; }
.tc-share { margin-top: 6px; padding: 4px 10px; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; }
.share-body { display: grid; gap: 12px; justify-items: center; }
.share-body img { width: min(100%, 320px); aspect-ratio: 1080 / 1350; border-radius: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); background: rgba(255, 255, 255, 0.04); }
.share-body.loading img { animation: pulse 1s ease-in-out infinite; }
.share-actions { display: grid; gap: 8px; width: min(100%, 320px); }
.share-actions .acct-btn.ghost { margin-top: 0; }

/* Chip rewards for medals and cups */
.mp-text .mp-reward { font-style: normal; font-size: 13px; font-weight: 900; color: #7fe3a2; }
.md-next .md-pay { color: #7fe3a2; font-weight: 800; }
.tc-cup .tc-pay { font-size: 10.5px; font-weight: 800; color: #7fe3a2; margin-top: 2px; }
.acct-terms { align-items: flex-start; font-size: 13px; font-weight: 600; line-height: 1.4; margin: 4px 0 10px; }
.acct-terms input { flex: none; margin-top: 1px; }
.acct-terms a, .legal-line a, .help-foot a { color: var(--gold); }
.st-split { display: block; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--ink-dim); white-space: nowrap; }
/* Ad-free sheet */
.af-lead { margin: 0 0 10px; font-size: 15px; line-height: 1.45; }
.af-list { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 5px; font-size: 14px; color: var(--ink-dim); }
.af-buy { width: 100%; min-height: 50px; font-size: 16px; }
.af-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,0.25); font-size: 13.5px; text-align: center; }
.af-restore { display: block; margin: 10px auto 4px; padding: 6px 10px; border: 0; background: none; color: var(--ink-dim); font-size: 13.5px; font-weight: 700; text-decoration: underline; }
.menu-adfree { background: rgba(155, 123, 255, 0.14); }

/* ---------- Champion rewards (1.1) ---------- */
.tl-ranks li .tl-who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tl-crown { display: inline-flex; flex: none; filter: drop-shadow(0 0 4px rgba(242, 196, 90, 0.6)); }
.tl-champs svg { width: 11px; height: 11px; }
.tl-champs { flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px; border-radius: 999px; background: rgba(242, 196, 90, 0.18); color: var(--gold); font-size: 9.5px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.tl-ranks li.crowned { box-shadow: inset 3px 0 0 var(--gold); }

.tl-hall { display: grid; gap: 6px; padding: 12px; border-radius: 14px; background: linear-gradient(160deg, rgba(59, 42, 107, 0.9), rgba(37, 26, 71, 0.9)); border: 1px solid rgba(242, 196, 90, 0.5); font-size: 12px; color: var(--ink-dim); }
.tl-hall > b { font: 400 14px/1.2 "Bungee", "Archivo", sans-serif; color: var(--gold); }
.tl-hall ol { list-style: none; margin: 0; padding: 0; display: grid; }
.tl-hall li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); font-size: 13.5px; color: var(--ink); }
.tl-hall li:last-child { border-bottom: 0; }
.tl-hall li > span:first-child { color: var(--ink-dim); font-size: 12px; }
.tl-hall .tl-who { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.tl-hall em { font-style: normal; font-size: 10.5px; font-weight: 800; color: var(--theme, #ff8a7a); white-space: nowrap; }
.tl-hall li b { font-weight: 900; font-variant-numeric: tabular-nums; }
.tl-hall p { margin: 0; font-size: 11.5px; }

.tl-theme { display: grid; gap: 2px; padding: 10px 14px; border-radius: 14px; background: linear-gradient(135deg, var(--theme, #c0392b), rgba(0, 0, 0, 0.25)); border: 1px solid rgba(255, 255, 255, 0.25); text-align: center; }
.tl-theme b { font: 400 18px/1.15 "Bungee", "Archivo", sans-serif; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }
.tl-theme span { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, 0.9); }
body.tournament.themed .layout,
body.tournament.themed .tourney-lobby { border-color: var(--theme); }
body.tournament.themed .layout { background: radial-gradient(140% 60% at 50% 0%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 60%), linear-gradient(#3b2a6b, #251a47); box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.18), 0 0 26px color-mix(in srgb, var(--theme) 55%, transparent); }

/* Trophy case: the weekly tournament shelf. */
.tc-tourney .tt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tt-tile { display: grid; justify-items: center; gap: 3px; padding: 10px 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); }
.tt-tile b { font-size: 12px; color: var(--ink); }
.tt-tile span { font-size: 11px; font-weight: 800; color: var(--ink-dim); }
.tt-tile.won.gold { background: linear-gradient(rgba(242, 196, 90, 0.22), rgba(242, 196, 90, 0.05)); border-color: #f2c45a; }
.tt-tile.won.gold span { color: #f2c45a; }
.tt-tile.won.silver { border-color: #9aa4b8; }
.tt-tile.won.silver span { color: #dfe4ee; }
.tt-tile.won.bronze { border-color: #a8602e; }
.tt-tile.won.bronze span { color: #f0b78a; }
.tt-tile.won.ribbon { background: rgba(155, 123, 255, 0.12); border-color: #c9a8ff; }
.tt-tile.won.ribbon span { color: #c9a8ff; }
.tt-themed { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.tt-themed li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-dim); }
.tt-themed b { color: var(--ink); }

/* "You won the week" */
.award-sheet { width: min(420px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid rgba(242, 196, 90, 0.55); border-radius: 24px; color: var(--ink); background: radial-gradient(90% 55% at 50% 30%, #5a3f9e 0%, #2d1f58 45%, #150f30 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); overflow: auto; }
.award-sheet::backdrop { background: rgba(5, 4, 15, 0.72); }
.award-sheet .aw-close { position: absolute; top: 10px; right: 10px; }
.award-win { display: grid; justify-items: center; gap: 12px; padding: 30px 20px 20px; text-align: center; }
.aw-week { font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #c9a8ff; padding: 0 30px; }
.award-win h2 { margin: 0; font: 400 30px/1.05 "Bungee", "Archivo", sans-serif; color: var(--gold); text-shadow: 0 3px 0 #6b4410; text-transform: uppercase; }
.award-win.silver h2 { color: #e6ebf3; text-shadow: 0 3px 0 #4b5366; }
.award-win.bronze h2 { color: #f0b78a; text-shadow: 0 3px 0 #5a2e10; }
.award-win.ribbon h2 { color: #d9c6ff; text-shadow: 0 3px 0 #3b2a7a; }
.aw-art { animation: aw-pop 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes aw-pop { from { transform: scale(0.4) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .aw-art { animation: none; } }
.aw-score { display: grid; gap: 2px; }
.aw-score span { font-size: 12.5px; color: var(--ink-dim); }
.aw-score b { font: 400 36px/1.1 "Bungee", "Archivo", sans-serif; }
.aw-list { list-style: none; margin: 0; padding: 12px 14px; width: 100%; box-sizing: border-box; display: grid; gap: 8px; border-radius: 16px; background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(242, 196, 90, 0.4); text-align: left; }
.aw-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.aw-list b { color: var(--gold); text-align: right; }
.aw-list b.up { color: #5ef2b5; }
.aw-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; width: 100%; }
.aw-share { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 50px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.06); color: var(--ink); font: 800 15px "Archivo", sans-serif; cursor: pointer; }
.aw-share svg { width: 18px; height: 18px; }
.aw-collect { min-height: 50px; border: 0; border-radius: 14px; background: linear-gradient(#ffe39a, #f2b53c 55%, #d48d19); box-shadow: 0 4px 0 #8a5a12; color: #2b1600; font: 400 15px "Bungee", "Archivo", sans-serif; cursor: pointer; }
.aw-collect:disabled { opacity: 0.6; }
.aw-fine { margin: 0; font-size: 11.5px; color: var(--ink-dim); }
.aw-error { margin: 0; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); color: #ffb4a8; font-size: 13px; font-weight: 700; }

/* ---------- Themed weeks: Holiday pack ---------- */
.th-snowfall { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.th-snowfall i { position: absolute; top: -10px; border-radius: 50%; background: #fff; animation: th-fall linear infinite; }
@keyframes th-fall { from { transform: translate(0, -10px); } 50% { transform: translate(8px, 50vh); } to { transform: translate(-4px, 110vh); } }
@media (prefers-reduced-motion: reduce) { .th-snowfall i { animation: none; top: auto; transform: none; } .th-snowfall i:nth-child(odd) { top: 20%; } .th-snowfall i:nth-child(even) { top: 60%; } }

.th-scene { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 14px 10px 0; border-radius: 16px; min-height: 238px; }
.th-holiday-scene { background: radial-gradient(80% 70% at 50% 35%, #2d5b8a 0%, #163556 55%, #0c1f36 100%); border: 1px solid rgba(255, 255, 255, 0.25); box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.35); }
.th-scene > * { position: relative; z-index: 1; }
.th-scene .th-snowfall { z-index: 2; }
.th-title { margin: 0; font: 400 30px/1 "Bungee", "Archivo", sans-serif; color: #fff; letter-spacing: 0.02em; text-shadow: 0 3px 0 #9e1b1b, 0 0 18px rgba(255, 255, 255, 0.35); }
.th-dates { margin-top: 4px; font-size: 11px; font-weight: 900; letter-spacing: 0.18em; text-transform: uppercase; color: #ffd2d2; }
.th-flakes { position: absolute; inset: 0; z-index: 0; }
.th-flakes svg { position: absolute; opacity: 0.55; }
.th-flakes svg:nth-child(1) { left: 8%; top: 14%; } .th-flakes svg:nth-child(2) { right: 10%; top: 10%; }
.th-flakes svg:nth-child(3) { left: 22%; top: 44%; } .th-flakes svg:nth-child(4) { right: 24%; top: 40%; }
.th-stage { display: flex; align-items: flex-end; justify-content: center; gap: 0; width: 100%; margin-top: -6px; margin-bottom: -14px; z-index: 3; }
.th-stage .th-snowman { margin-right: -8px; margin-bottom: 6px; }
.th-stage .th-ginger { margin-left: -6px; margin-bottom: 8px; transform: rotate(6deg); }
.th-centre { position: relative; display: grid; place-items: center; }
.th-centre > * { grid-area: 1 / 1; }
.th-centre .th-wreath { opacity: 0.95; }
.th-centre .th-cup { margin-top: 6px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)); }
.th-ground { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34px; z-index: 2; }
.th-banner-text { margin: -2px 0 0; text-align: center; font-size: 13px; font-weight: 800; color: #ffe1e1; }

/* The tournament table in a holiday week: candy-cane rails and snowy green felt. */
body.tournament.th-holiday .layout,
body.tournament.th-holiday .tourney-lobby {
  border: 6px solid transparent;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.10) 0 1.5px, transparent 2px) 0 0 / 46px 46px padding-box,
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.08) 0 1px, transparent 1.6px) 0 0 / 31px 31px padding-box,
    linear-gradient(#17573a, #0b3322) padding-box,
    repeating-linear-gradient(45deg, #d62f2f 0 10px, #ffffff 10px 20px) border-box;
  box-shadow: 0 0 26px rgba(214, 47, 47, 0.35), 0 10px 30px rgba(0, 0, 0, 0.4);
}
body.tournament.th-holiday .playmode button#playTourney[aria-selected="true"] { background: linear-gradient(#ff6b6b, #c0392b); color: #fff; box-shadow: 0 0 14px rgba(214, 47, 47, 0.55); }

/* Winner screen in a holiday week. */
.award-win { position: relative; overflow: hidden; }
.award-win > * { position: relative; z-index: 1; }
.award-win .th-snowfall { z-index: 0; }
.award-sheet:has(.th-holiday) { background: radial-gradient(90% 55% at 50% 32%, #9e2626 0%, #4a1520 50%, #0c2a1d 100%); border-color: rgba(255, 255, 255, 0.45); }
.award-win.th-holiday h2 { color: #fff; text-shadow: 0 3px 0 #9e1b1b; }
.award-win.th-holiday .aw-week { color: #ffd2d2; }
.th-win-art { position: relative; display: flex; align-items: flex-end; justify-content: center; width: 100%; }
.th-win-art .th-centre { margin: 0 -10px; }
.th-win-art .th-snowman { margin-bottom: 2px; }
.th-win-art .th-ginger { margin-bottom: 6px; transform: rotate(6deg); }
.tt-themed li svg { flex: none; }

/* Holiday touches on the game screen itself (tournament mode only). */
.th-decor { display: none; }
body.tournament .th-decor { display: block; }
.th-lights { position: absolute; left: 0; right: 0; top: -6px; z-index: 3; pointer-events: none; padding: 0 4px; }
.th-garland { display: block; width: 100%; height: auto; }
.th-bulb { animation: th-twinkle 2.4s ease-in-out infinite; }
@keyframes th-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .th-bulb { animation: none; } }
/* Snow globe: flakes drift inside the glass. */
.th-globe { position: absolute; inset: 0; pointer-events: none; clip-path: ellipse(33% 31% at 50% 41%); z-index: 2; }
.th-globe .th-snowfall i { animation-name: th-globe-fall; }
@keyframes th-globe-fall { from { transform: translate(0, 0); } 50% { transform: translate(10px, 160px); } to { transform: translate(-6px, 330px); } }
.th-page-snow { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.55; }
/* Snow caps on the two side buttons. */
body.tournament.th-holiday .side-btn { overflow: visible; }
body.tournament.th-holiday .side-btn::before { content: ""; position: absolute; left: 6px; right: 6px; top: -7px; height: 14px; border-radius: 10px 10px 8px 8px; background: radial-gradient(circle at 20% 70%, #fff 0 6px, transparent 6.5px), radial-gradient(circle at 50% 55%, #fff 0 8px, transparent 8.5px), radial-gradient(circle at 80% 70%, #fff 0 6px, transparent 6.5px), linear-gradient(transparent 55%, #fff 55%); filter: drop-shadow(0 1px 0 #c9dcef); }
/* The roll counter: dark green, red rim, candy-cane progress bar. */
body.tournament.th-holiday .rollbar .lb-track i { background: repeating-linear-gradient(45deg, #d62f2f 0 6px, #ffffff 6px 12px); box-shadow: 0 0 8px rgba(255, 255, 255, 0.4); }
body.tournament.th-holiday .status { color: #ffd2d2; }
.th-globe .th-snowfall i { box-shadow: 0 0 6px rgba(255, 255, 255, 0.9); }

/* Themed week: the Weekly tournament tab gets noticed on the Open Table. */
.playmode button.tab-themed { position: relative; overflow: visible; display: inline-flex; align-items: center; justify-content: center; gap: 4px; color: #fff; background: linear-gradient(var(--theme, #c0392b), color-mix(in srgb, var(--theme, #c0392b) 55%, #000)); box-shadow: 0 0 12px color-mix(in srgb, var(--theme, #c0392b) 60%, transparent); animation: tab-glow 2.6s ease-in-out infinite; }
.playmode button.tab-themed svg { flex: none; }
.tab-theme-name { font-weight: 900; }
@keyframes tab-glow { 50% { box-shadow: 0 0 20px color-mix(in srgb, var(--theme, #c0392b) 85%, transparent); } }
@media (prefers-reduced-motion: reduce) { .playmode button.tab-themed { animation: none; } }
body.th-holiday .playmode button.tab-themed { --theme: #c0392b; background: linear-gradient(#e04646, #a32020); }
body.th-holiday .playmode button.tab-themed::after { content: ""; position: absolute; left: 10px; right: 10px; top: calc(100% - 1px); height: 11px; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 11'%3E%3Cpath d='M0 0H30L28 0 26.5 5 25 0H21L19 10 17 0H13L11.5 4 10 0H6L4.5 7 3 0Z' fill='%23eef8ff' stroke='%23bfe3f7' stroke-width='.6' stroke-linejoin='round'/%3E%3C/svg%3E") 0 0 / 30px 11px repeat-x; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)); }
body.th-holiday .playmode button.tab-themed svg { opacity: 0.95; }
body.tournament .playmode button.tab-themed[aria-selected="true"] { color: #fff; }
/* Narrow phones: keep the wreath and name, drop the end snowflakes. */
@media (max-width: 374px) { body.th-holiday .playmode button.tab-themed > svg:not(.th-wreath) { display: none; } }


/* ---------- New Year's Cup (art pack 'newyear', ui/themes.js) ---------- */
.th-newyear-scene { min-height: 262px; background: radial-gradient(90% 70% at 50% 30%, #2e3590 0%, #151a52 55%, #080b26 100%); border: 1px solid rgba(242, 196, 90, 0.5); box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4); }
.th-newyear-scene .th-title { text-shadow: 0 3px 0 #8a5a12, 0 0 18px rgba(242, 196, 90, 0.45); }
.th-newyear-scene .th-dates { color: #ffe39a; }
.th-stars { position: absolute; inset: 0; z-index: 0; background:
  radial-gradient(circle at 12% 18%, #fff 0 1px, transparent 1.5px), radial-gradient(circle at 30% 8%, #fff 0 1px, transparent 1.5px),
  radial-gradient(circle at 72% 14%, #fff 0 1.2px, transparent 1.7px), radial-gradient(circle at 88% 26%, #fff 0 1px, transparent 1.5px),
  radial-gradient(circle at 55% 22%, rgba(255,255,255,0.7) 0 0.8px, transparent 1.3px), radial-gradient(circle at 20% 40%, rgba(255,255,255,0.6) 0 0.8px, transparent 1.3px); }
.th-newyear-scene .th-stage { align-items: flex-end; margin-bottom: 18px; gap: 6px; }
.th-newyear-scene .th-flutes { margin-bottom: 4px; }
.th-skyline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 46px; z-index: 2; }

/* The ball drop: a tower out of the skyline, a pole on top, the ball sliding
   down onto a glowing 2027 sign. */
.th-balldrop { position: relative; width: 58px; flex: none; z-index: 3; margin-bottom: -18px; }
.th-tower { position: absolute; left: 50%; bottom: 0; width: 40px; height: 54px; margin-left: -20px; border-radius: 3px 3px 0 0; background:
  radial-gradient(circle, #ffd97a 0 1px, transparent 1.6px) 4px 6px / 8px 9px, linear-gradient(#141a4a, #070a22); box-shadow: 0 0 0 1px rgba(242, 196, 90, 0.35); }
.th-year { position: absolute; left: 50%; bottom: 54px; transform: translateX(-50%); padding: 1px 4px; border-radius: 3px; background: #070a22; font: 400 12px/1 "Bungee", "Archivo", sans-serif; color: #ffe39a; letter-spacing: 0.04em; animation: th-year-glow 8s ease-in-out infinite; }
.th-pole { position: absolute; left: 50%; top: 4px; bottom: 68px; width: 4px; margin-left: -2px; border-radius: 2px; background: linear-gradient(90deg, #8a5a12, #ffe39a, #8a5a12); box-shadow: 0 0 8px rgba(242, 196, 90, 0.5); }
.th-ball-wrap { position: absolute; left: 50%; top: 0; transform: translate(-50%, 0); animation: th-ball-drop 8s cubic-bezier(0.5, 0, 0.5, 1) infinite; filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6)); }
.th-ball-wrap svg { display: block; }
@keyframes th-ball-drop { 0%, 8% { top: 0; } 70%, 100% { top: calc(100% - 70px - var(--ball)); } }
@keyframes th-year-glow { 0%, 66% { opacity: 0.35; text-shadow: none; } 72%, 96% { opacity: 1; text-shadow: 0 0 10px rgba(242, 196, 90, 1), 0 0 20px rgba(255, 255, 255, 0.6); } 100% { opacity: 0.35; text-shadow: none; } }

/* Fireworks: each burst blooms and fades, over and over. */
.th-fireworks { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.th-burst { position: absolute; opacity: 0; transform: scale(0.2); animation: th-burst 3.6s ease-out infinite; }
@keyframes th-burst { 0% { opacity: 0; transform: scale(0.2); } 12% { opacity: 1; } 55% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.15) translateY(6px); } }

/* Confetti: little rectangles that tumble down. */
.th-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.th-confetti i { position: absolute; top: -14px; border-radius: 1.5px; animation: th-confetti-fall linear infinite; }
@keyframes th-confetti-fall { from { transform: translate(0, -14px) rotate(0deg); } 50% { transform: translate(10px, 50vh) rotate(260deg); } to { transform: translate(-6px, 110vh) rotate(540deg); } }
.th-ny-globe .th-confetti i { animation-name: th-globe-confetti; }
@keyframes th-globe-confetti { from { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(10px, 160px) rotate(260deg); } to { transform: translate(-6px, 330px) rotate(540deg); } }
.th-ny-globe .th-burst { animation-duration: 4.2s; }
.th-page-confetti { opacity: 0.45; }
@media (prefers-reduced-motion: reduce) {
  .th-ball-wrap { animation: none; top: calc(100% - 70px - var(--ball)); } .th-year { animation: none; opacity: 1; }
  .th-burst { animation: none; opacity: 0.7; transform: none; }
  .th-confetti i { animation: none; top: auto; transform: rotate(30deg); } .th-confetti i:nth-child(odd) { top: 20%; } .th-confetti i:nth-child(even) { top: 60%; }
}

/* The tournament table in the New Year's week: midnight felt, gold rails. */
body.tournament.th-newyear .layout,
body.tournament.th-newyear .tourney-lobby {
  border: 6px solid transparent;
  background:
    radial-gradient(circle at 20% 30%, rgba(242, 196, 90, 0.16) 0 1.4px, transparent 2px) 0 0 / 46px 46px padding-box,
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.10) 0 1px, transparent 1.6px) 0 0 / 31px 31px padding-box,
    linear-gradient(#1d2470, #0c1040) padding-box,
    linear-gradient(135deg, #8a5a12, #ffe39a 25%, #c8901f 50%, #fff1c2 75%, #8a5a12) border-box;
  box-shadow: 0 0 26px rgba(242, 196, 90, 0.35), 0 10px 30px rgba(0, 0, 0, 0.4);
}
body.tournament.th-newyear .playmode button#playTourney[aria-selected="true"] { background: linear-gradient(#ffe08a, #c8901f); color: #1b1300; box-shadow: 0 0 14px rgba(242, 196, 90, 0.6); }
body.tournament.th-newyear .rollbar .lb-track i { background: linear-gradient(90deg, #c8901f, #fff1c2, #f2c45a); box-shadow: 0 0 8px rgba(242, 196, 90, 0.6); }
body.tournament.th-newyear .status { color: #ffe39a; }
body.th-newyear .playmode button.tab-themed { --theme: #c8901f; background: linear-gradient(#1f267a, #0d1240); border: 1px solid #f2c45a; color: #ffe39a; }
body.th-newyear .playmode button.tab-themed .th-ball { margin: -4px 0; }
@media (max-width: 374px) { body.th-newyear .playmode button.tab-themed > .th-sparkle { display: none; } }

/* Winner screen and award sheet in the New Year's week. */
.award-sheet:has(.th-newyear) { background: radial-gradient(90% 55% at 50% 32%, #2e3590 0%, #151a52 50%, #080b26 100%); border-color: rgba(242, 196, 90, 0.6); }
.award-win.th-newyear h2 { color: #fff; text-shadow: 0 3px 0 #8a5a12; }
.award-win.th-newyear .aw-week { color: #ffe39a; }
.th-ny-win { align-items: flex-end; gap: 4px; }
.th-ny-win .th-balldrop { margin-bottom: 0; }
.th-ny-win .th-fireworks, .th-ny-win .th-confetti { z-index: 0; }


/* ---------- Lunar New Year Cup (art pack 'lunar', ui/themes.js) ---------- */
.th-lunar-scene { min-height: 262px; padding-top: 30px; background: radial-gradient(90% 70% at 50% 35%, #c0161f 0%, #7a0b13 55%, #3a050a 100%); border: 1px solid rgba(245, 197, 66, 0.6); box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4); }
.th-lunar-scene .th-title { text-shadow: 0 3px 0 #5a0b10, 0 0 18px rgba(245, 197, 66, 0.5); }
.th-lunar-scene .th-dates { color: #ffe08a; }
.th-lunar-scene .th-stage { margin-bottom: 14px; gap: 2px; }
.th-lunar-scene .th-crackers { margin-bottom: 18px; transform-origin: top center; animation: th-swing 3.4s ease-in-out infinite; }
.th-lunar-scene .th-plum { margin-bottom: 4px; }
/* Same-width boxes on both sides keep the cup centred (the branch is wider than the firecrackers). */
.th-lunar-scene .th-stage > .th-plum, .th-lunar-scene .th-stage > .th-crackers, .th-lny-win > .th-plum, .th-lny-win > .th-crackers { width: 80px; flex: none; }
.th-hanging { position: absolute; inset: 0 0 auto; display: flex; justify-content: space-between; padding: 0 8%; z-index: 0; pointer-events: none; }
.th-hanging svg { transform-origin: top center; animation: th-swing 3.6s ease-in-out infinite; }
.th-hanging svg:nth-child(2) { margin-right: auto; margin-left: 10%; animation-delay: -1.2s; }
.th-hanging svg:nth-child(3) { margin-left: auto; margin-right: 10%; animation-delay: -2.1s; }
.th-hanging svg:nth-child(4) { animation-delay: -0.6s; }
.th-swing { transform-box: view-box; animation: th-swing 3.6s ease-in-out infinite; }
@keyframes th-swing { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.th-clouds { height: 30px; }
.th-coins i { border-radius: 50%; }
.th-coins svg { display: block; }
@media (prefers-reduced-motion: reduce) { .th-hanging svg, .th-swing, .th-lunar-scene .th-crackers { animation: none; } }

body.tournament.th-lunar .layout,
body.tournament.th-lunar .tourney-lobby {
  border: 6px solid transparent;
  background:
    radial-gradient(circle at 20% 30%, rgba(245, 197, 66, 0.16) 0 1.4px, transparent 2px) 0 0 / 46px 46px padding-box,
    radial-gradient(circle at 70% 60%, rgba(255, 159, 192, 0.12) 0 1px, transparent 1.6px) 0 0 / 31px 31px padding-box,
    linear-gradient(#8e121b, #4a070d) padding-box,
    linear-gradient(135deg, #9a6a0c, #fff0b8 25%, #d6a12a 50%, #fff0b8 75%, #9a6a0c) border-box;
  box-shadow: 0 0 26px rgba(245, 197, 66, 0.35), 0 10px 30px rgba(0, 0, 0, 0.4);
}
body.tournament.th-lunar .playmode button#playTourney[aria-selected="true"] { background: linear-gradient(#ff4d4d, #b3141f); color: #fff; box-shadow: 0 0 14px rgba(245, 197, 66, 0.6); }
body.tournament.th-lunar .rollbar .lb-track i { background: linear-gradient(90deg, #b3141f, #f5c542, #fff0b8); box-shadow: 0 0 8px rgba(245, 197, 66, 0.6); }
body.tournament.th-lunar .status { color: #ffe08a; }
body.th-lunar .playmode button.tab-themed { --theme: #d6202a; background: linear-gradient(#e0262f, #8f0f17); border: 1px solid #f5c542; color: #fff; }
body.th-lunar .playmode button.tab-themed .th-lantern { margin: -4px 0 -6px; }
@media (max-width: 374px) { body.th-lunar .playmode button.tab-themed > .th-coin { display: none; } }
.th-lny-lights { top: -4px; }

.award-sheet:has(.th-lunar) { background: radial-gradient(90% 55% at 50% 32%, #c0161f 0%, #7a0b13 50%, #3a050a 100%); border-color: rgba(245, 197, 66, 0.6); }
.award-win.th-lunar h2 { color: #fff; text-shadow: 0 3px 0 #5a0b10; }
.award-win.th-lunar .aw-week { color: #ffe08a; }
.th-lny-win { align-items: flex-end; gap: 2px; }
.th-lny-win .th-confetti { z-index: 0; }
.th-lny-win .th-crackers { margin-bottom: 20px; }


/* ---------- Shared bits for the 2027 packs ---------- */
.th-shapes i { display: block; }
.th-shapes svg { display: block; }
.th-rise i { top: auto; bottom: -20px; animation-name: th-rise; }
@keyframes th-rise { from { transform: translate(0, 0) rotate(-8deg); } 50% { transform: translate(10px, -50vh) rotate(8deg); } to { transform: translate(-6px, -110vh) rotate(-8deg); } }
.th-ny-globe .th-rise i { animation-name: th-globe-rise; }
@keyframes th-globe-rise { from { transform: translate(0, 0); } to { transform: translate(-6px, -330px); } }
.th-hang-lights { top: -4px; }
.th-pack-win { align-items: flex-end; gap: 2px; }
.th-pack-win .th-confetti { z-index: 0; }
@media (prefers-reduced-motion: reduce) { .th-rise i { animation: none; bottom: auto; } }

/* ---------- Valentine's: Lucky in Love Cup (art pack 'valentine') ---------- */
.th-valentine-scene { min-height: 250px; background: radial-gradient(90% 70% at 50% 35%, #d81b60 0%, #8c1036 55%, #3d0619 100%); border: 1px solid rgba(255, 194, 212, 0.6); box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4); }
.th-valentine-scene .th-title { text-shadow: 0 3px 0 #5a0a24, 0 0 18px rgba(255, 143, 176, 0.6); }
.th-valentine-scene .th-dates { color: #ffd6e2; }
.th-valentine-scene .th-stage { margin-bottom: 10px; }
.th-valentine-scene .th-stage > .th-rose, .th-valentine-scene .th-stage > .th-hdice, .th-valentine-win > .th-rose { width: 72px; flex: none; }
.th-valentine-scene .th-hdice { margin-bottom: 8px; }
.th-bigheart { align-self: start; margin-top: -26px; animation: th-beat 2.4s ease-in-out infinite; }
@keyframes th-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.06); } 30% { transform: scale(1); } 45% { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .th-bigheart { animation: none; } }
body.tournament.th-valentine .layout,
body.tournament.th-valentine .tourney-lobby {
  border: 6px solid transparent;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 194, 212, 0.16) 0 1.4px, transparent 2px) 0 0 / 46px 46px padding-box,
    linear-gradient(#7a1035, #3d0619) padding-box,
    linear-gradient(135deg, #b7790f, #ffd6e2 25%, #f2c45a 50%, #ffd6e2 75%, #b7790f) border-box;
  box-shadow: 0 0 26px rgba(255, 92, 138, 0.4), 0 10px 30px rgba(0, 0, 0, 0.4);
}
body.tournament.th-valentine .playmode button#playTourney[aria-selected="true"] { background: linear-gradient(#ff7aa2, #d81b60); color: #fff; box-shadow: 0 0 14px rgba(255, 92, 138, 0.6); }
body.tournament.th-valentine .rollbar .lb-track i { background: linear-gradient(90deg, #d81b60, #ff8fb0, #ffd6e2); box-shadow: 0 0 8px rgba(255, 143, 176, 0.6); }
body.tournament.th-valentine .status { color: #ffd6e2; }
body.th-valentine .playmode button.tab-themed { --theme: #e0234e; background: linear-gradient(#ff5c8a, #b0124a); border: 1px solid #ffc2d4; color: #fff; }
@media (max-width: 374px) { body.th-valentine .playmode button.tab-themed > svg:last-child { display: none; } }
.award-sheet:has(.th-valentine) { background: radial-gradient(90% 55% at 50% 32%, #d81b60 0%, #8c1036 50%, #3d0619 100%); border-color: rgba(255, 194, 212, 0.6); }
.award-win.th-valentine h2 { color: #fff; text-shadow: 0 3px 0 #5a0a24; }
.award-win.th-valentine .aw-week { color: #ffd6e2; }
.award-win.th-valentine .th-hdice, .award-win.th-valentine .th-rose { width: 72px; flex: none; }

/* ---------- The Big Game: Big Game Cup (art pack 'biggame') ---------- */
.th-biggame-scene { min-height: 256px; background: radial-gradient(90% 70% at 50% 30%, #2a4a80 0%, #13264a 55%, #060d1c 100%); border: 1px solid rgba(201, 210, 224, 0.6); box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45); }
.th-biggame-scene .th-title { text-shadow: 0 3px 0 #050b18, 0 0 18px rgba(255, 255, 255, 0.4); }
.th-biggame-scene .th-dates { color: #ffe39a; }
.th-biggame-scene .th-stage { margin-bottom: 14px; }
.th-biggame-scene .th-stage > .th-beers, .th-biggame-scene .th-stage > .th-snacks, .award-win.th-biggame .th-beers, .award-win.th-biggame .th-snacks { width: 68px; flex: none; }
.th-biggame-scene .th-beers { height: auto; }
.th-biggame-scene .th-tv { width: 146px; height: auto; }
.th-biggame-scene .th-centre .th-cup { width: 82px; height: auto; }
.th-snacks .th-wings { width: 68px; height: auto; } .th-snacks .th-nachos { width: 66px; height: auto; }
.th-biggame-scene .th-stage { gap: 0; justify-content: center; }
/* Narrow phones (320px): shrink the party spread so the cup and TV stay centred. */
@media (max-width: 359px) { .th-biggame-scene .th-tv { width: 124px; } .th-biggame-scene .th-centre .th-cup { width: 70px; } .th-biggame-scene .th-stage > .th-beers, .th-biggame-scene .th-stage > .th-snacks { width: 58px; } .th-snacks .th-wings, .th-snacks .th-nachos { width: 56px; } }
.th-biggame-scene .th-beers { margin-bottom: 2px; position: relative; z-index: 2; }
.th-snacks { display: grid; justify-items: center; gap: 0; margin-bottom: 0; position: relative; z-index: 2; }
.th-snacks svg { display: block; }
.th-snacks .th-wings { margin-bottom: -6px; }
.th-biggame-scene .th-centre .th-tv, .th-ny-win .th-tv, .award-win.th-biggame .th-tv { align-self: start; filter: drop-shadow(0 0 14px rgba(120, 170, 255, 0.35)); }
.th-biggame-scene .th-centre .th-cup, .award-win.th-biggame .th-centre .th-cup { align-self: end; margin-top: 56px; }
.th-football { animation: th-spiral 3.2s ease-in-out infinite; }
@keyframes th-spiral { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-8deg); } }
.th-stadium { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.th-stadium i { position: absolute; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 65%); animation: th-flash 5s ease-in-out infinite; }
.th-stadium i:first-child { left: -66px; } .th-stadium i:last-child { right: -66px; animation-delay: -2.5s; }
.th-stadium i::after { content: ""; position: absolute; left: 50%; top: 46px; width: 32px; height: 12px; margin-left: -16px; border-radius: 3px; background: radial-gradient(circle, #fff 0 1.8px, transparent 2.4px) 0 0 / 8px 6px, #2a3550; }
@keyframes th-flash { 0%, 100% { opacity: 0.8; } 50% { opacity: 1; } }
.th-field { height: 30px; }
@media (prefers-reduced-motion: reduce) { .th-football, .th-stadium i { animation: none; } }
body.tournament.th-biggame .layout,
body.tournament.th-biggame .tourney-lobby {
  border: 6px solid transparent;
  background:
    repeating-linear-gradient(90deg, transparent 0 58px, rgba(255, 255, 255, 0.07) 58px 60px) padding-box,
    linear-gradient(#1f6b34, #0d3d1d) padding-box,
    linear-gradient(135deg, #6b7a90, #ffffff 25%, #c9d2e0 50%, #ffffff 75%, #6b7a90) border-box;
  box-shadow: 0 0 26px rgba(255, 255, 255, 0.25), 0 10px 30px rgba(0, 0, 0, 0.4);
}
body.tournament.th-biggame .playmode button#playTourney[aria-selected="true"] { background: linear-gradient(#2a4a80, #0f1f3d); color: #fff; box-shadow: 0 0 14px rgba(255, 255, 255, 0.4); }
body.tournament.th-biggame .rollbar .lb-track i { background: linear-gradient(90deg, #8b4a22, #f2c45a, #ffffff); box-shadow: 0 0 8px rgba(255, 255, 255, 0.5); }
body.tournament.th-biggame .status { color: #ffe39a; }
body.th-biggame .playmode button.tab-themed { --theme: #2a4a80; background: linear-gradient(#2a4a80, #0f1f3d); border: 1px solid #c9d2e0; color: #fff; }
body.th-biggame .playmode button.tab-themed .th-football { margin: -3px 0; }
@media (max-width: 374px) { body.th-biggame .playmode button.tab-themed > svg:last-child { display: none; } }
.award-sheet:has(.th-biggame) { background: radial-gradient(90% 55% at 50% 32%, #2a4a80 0%, #13264a 50%, #060d1c 100%); border-color: rgba(201, 210, 224, 0.6); }
.award-win.th-biggame h2 { color: #fff; text-shadow: 0 3px 0 #050b18; }
.award-win.th-biggame .aw-week { color: #ffe39a; }

/* ---------- St. Patrick's: Lucky Cup (art pack 'stpatricks') ---------- */
.th-stpatricks-scene { min-height: 256px; background: radial-gradient(90% 70% at 50% 35%, #26a85a 0%, #0f6a33 55%, #053018 100%); border: 1px solid rgba(245, 197, 66, 0.6); box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4); }
.th-stpatricks-scene .th-title { text-shadow: 0 3px 0 #0b3d1e, 0 0 18px rgba(245, 197, 66, 0.5); }
.th-stpatricks-scene .th-dates { color: #fff0b8; }
.th-stpatricks-scene .th-stage { margin-bottom: 14px; }
.th-stpatricks-scene .th-stage > .th-horseshoe, .th-stpatricks-scene .th-stage > .th-pot, .award-win.th-stpatricks .th-horseshoe, .award-win.th-stpatricks .th-pot { width: 78px; flex: none; }
.th-stpatricks-scene .th-horseshoe { margin-bottom: 14px; transform: rotate(-10deg); }
.th-stpatricks-scene .th-pot { margin-bottom: 6px; }
.th-rainbow { align-self: start; margin-top: -8px; }
.th-hills { height: 30px; }
body.tournament.th-stpatricks .layout,
body.tournament.th-stpatricks .tourney-lobby {
  border: 6px solid transparent;
  background:
    radial-gradient(circle at 20% 30%, rgba(245, 197, 66, 0.16) 0 1.4px, transparent 2px) 0 0 / 46px 46px padding-box,
    linear-gradient(#13733a, #063a1b) padding-box,
    linear-gradient(135deg, #9a6a0c, #fff0b8 25%, #d6a12a 50%, #fff0b8 75%, #9a6a0c) border-box;
  box-shadow: 0 0 26px rgba(245, 197, 66, 0.35), 0 10px 30px rgba(0, 0, 0, 0.4);
}
body.tournament.th-stpatricks .playmode button#playTourney[aria-selected="true"] { background: linear-gradient(#4dd17a, #1b8a44); color: #fff; box-shadow: 0 0 14px rgba(77, 209, 122, 0.6); }
body.tournament.th-stpatricks .rollbar .lb-track i { background: linear-gradient(90deg, #1b8a44, #6fdc8c, #f5c542); box-shadow: 0 0 8px rgba(245, 197, 66, 0.6); }
body.tournament.th-stpatricks .status { color: #fff0b8; }
body.th-stpatricks .playmode button.tab-themed { --theme: #22a352; background: linear-gradient(#2cb862, #0f6a33); border: 1px solid #f5c542; color: #fff; }
@media (max-width: 374px) { body.th-stpatricks .playmode button.tab-themed > .th-coin { display: none; } }
.award-sheet:has(.th-stpatricks) { background: radial-gradient(90% 55% at 50% 32%, #26a85a 0%, #0f6a33 50%, #053018 100%); border-color: rgba(245, 197, 66, 0.6); }
.award-win.th-stpatricks h2 { color: #fff; text-shadow: 0 3px 0 #0b3d1e; }
.award-win.th-stpatricks .aw-week { color: #fff0b8; }


/* ---------- The award moment (trophies.js spotlight) ---------- */
.spotlight { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: radial-gradient(60% 45% at 50% 42%, rgba(20, 26, 60, 0.55), rgba(4, 6, 18, 0.86)); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: sp-fade 0.3s ease-out both; cursor: pointer; }
.spotlight.out { animation: sp-fade-out 0.3s ease-in both; }
.sp-card { display: grid; justify-items: center; text-align: center; width: min(340px, 100%); animation: sp-pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.sp-art { position: relative; display: grid; place-items: center; width: 210px; height: 210px; margin-bottom: 4px; }
.sp-art > :not(.sp-rays) { position: relative; z-index: 1; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.55)); animation: sp-land 0.9s 0.1s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.sp-rays { position: absolute; inset: -40px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--ring) 55%, transparent) 0 22%, transparent 60%), repeating-conic-gradient(color-mix(in srgb, var(--ring) 35%, transparent) 0 8deg, transparent 8deg 22deg); -webkit-mask-image: radial-gradient(circle, #000 25%, transparent 68%); mask-image: radial-gradient(circle, #000 25%, transparent 68%); animation: sp-spin 14s linear infinite; }
.sp-medal { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; min-height: 0 !important; }
.sp-medal .md-ring { width: 150px; height: 150px; padding: 8px; }
.sp-medal .md-disc { font-size: 64px; }
.sp-medal .md-disc svg { width: 58%; height: 58%; }
.sp-medal .lv-disc { font: 400 66px/1 "Bungee", "Archivo", sans-serif; }
.sp-medal .md-disc::after { content: ""; position: absolute; inset: -20%; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.85) 50%, transparent 65%); transform: translateX(-120%); animation: md-shine 1.4s 0.7s ease-in-out 2; }
.sp-medal .md-disc { position: relative; overflow: hidden; }
.sp-cup svg { width: 150px; height: auto; display: block; }
.sp-kicker { font-size: 13px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ring); }
.sp-title { margin: 6px 0 0; font: 400 32px/1.05 "Bungee", "Archivo", sans-serif; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), 0 0 24px color-mix(in srgb, var(--ring) 45%, transparent); }
.sp-sub { margin: 8px 0 0; font-size: 15px; font-weight: 700; color: var(--ink-dim); }
.sp-reward { margin: 14px 0 0; font: 400 30px/1 "Bungee", "Archivo", sans-serif; color: #7dffb0; text-shadow: 0 0 18px rgba(125, 255, 176, 0.45); animation: sp-pulse 1.2s 0.6s ease-in-out 2; }
.sp-reward span { font: 800 14px/1 "Archivo", sans-serif; color: var(--ink-dim); letter-spacing: 0.04em; }
.sp-actions { display: flex; gap: 10px; margin-top: 20px; }
.sp-actions button { padding: 11px 20px; border-radius: 999px; font: 900 14px/1 "Archivo", sans-serif; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.sp-close { border: 0; background: linear-gradient(#ffe08a, #e0a630); color: #2a1a00; box-shadow: 0 4px 0 #8a5a12; }
.sp-cta { border: 1.5px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.fly-chip { position: fixed; z-index: 80; width: 28px; height: 28px; font-size: 0; pointer-events: none; }
#bankroll.bank-hit { animation: bank-hit 0.5s ease-out; }
@keyframes sp-fade { from { opacity: 0; } }
@keyframes sp-fade-out { to { opacity: 0; } }
@keyframes sp-pop { from { opacity: 0; transform: scale(0.85) translateY(16px); } }
@keyframes sp-land { from { transform: scale(0.2) rotate(-25deg); opacity: 0; } }
@keyframes sp-spin { to { transform: rotate(360deg); } }
@keyframes sp-pulse { 50% { transform: scale(1.08); } }
@keyframes bank-hit { 30% { transform: scale(1.25); color: #7dffb0; } }
@media (prefers-reduced-motion: reduce) { .spotlight, .sp-card, .sp-art > *, .sp-rays, .sp-reward, .sp-medal .md-disc::after { animation: none !important; } }

/* ---------- Owner replays (ui/replay.js) ---------- */
.rp-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.rp-pick select { font: inherit; padding: 6px 8px; border-radius: 8px; }
.rp-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-dim); }
.rp-runs { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.rp-runs li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); }
.rp-place { font: 400 14px "Bungee", "Archivo", sans-serif; color: var(--gold); }
.rp-who { display: grid; min-width: 0; }
.rp-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-who em { font-style: normal; font-size: 12px; color: var(--ink-dim); }
.rp-go { font: 700 13px "Archivo", sans-serif; padding: 7px 12px; border-radius: 999px; border: 0; background: var(--gold); color: #1b2346; cursor: pointer; }
.rp-go:disabled { opacity: 0.5; cursor: default; }

/* While replaying, the table plays itself: no bet taps or tournament buttons. */
body.replaying .layout, body.replaying #chips, body.replaying #chipEdit, body.replaying .rt-actions,
body.replaying .playmode, body.replaying #undoBtn, body.replaying #rebetBtn, body.replaying #removeBtn, body.replaying #offModeBtn { pointer-events: none; }
.replay-bar { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 6px); display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 999px; background: rgba(10, 14, 30, 0.82); border: 1px solid rgba(255, 255, 255, 0.18); font: 600 12px "Archivo", sans-serif; color: var(--ink); transition: opacity 0.3s; }
.replay-bar.away { opacity: 0; pointer-events: none; }
.replay-bar button { font: inherit; padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.2); background: transparent; color: inherit; cursor: pointer; }
.replay-bar #replayExit { background: var(--gold); color: #1b2346; border-color: transparent; }
#replayCount { white-space: nowrap; }
.rp-auto { display: flex; align-items: center; gap: 4px; }
.replay-end { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); background: radial-gradient(circle at 50% 40%, rgba(27, 35, 70, 0.88), rgba(10, 14, 30, 0.96)); animation: rp-in 0.5s ease-out; }
.rp-card { display: grid; justify-items: center; gap: 6px; text-align: center; max-width: 360px; }
.rp-card svg { max-width: 60vw; height: auto; filter: drop-shadow(0 10px 30px rgba(242, 196, 90, 0.35)); }
.rp-title { margin: 10px 0 0; font: 400 26px "Bungee", "Archivo", sans-serif; color: var(--gold); }
.rp-name { margin: 0; font: 800 20px "Archivo", sans-serif; color: var(--ink); }
.rp-score { margin: 4px 0 0; font: 400 52px "Bungee", "Archivo", sans-serif; color: var(--win); font-variant-numeric: tabular-nums; }
.rp-meta { margin: 0; font-size: 14px; color: var(--ink-dim); }
.rp-warn { margin: 10px 0 0; font-size: 12px; color: var(--lose); }
@keyframes rp-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .replay-end { animation: none; } }
