:root {
  color-scheme: dark;
  --night: #08030f;
  --ink: #12071f;
  --purple: #8e24aa;
  --violet: #b82fe7;
  --magenta: #ff3cd4;
  --gold: #ffc857;
  --gold-bright: #ffe598;
  --gold-deep: #bd6d13;
  --mint: #4ff7a4;
  --danger: #ff7b9a;
  --text: #fff9ff;
  --muted: #c8b6d4;
  --faint: #9d89a8;
  --line: rgba(227, 121, 255, .3);
  --glass: rgba(16, 5, 27, .74);
  --shadow: 0 22px 60px rgba(0, 0, 0, .5);
  --gap: 7px;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--night); }

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: Inter, "Avenir Next", Avenir, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0a0312;
}

button { font: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}

button:disabled { cursor: not-allowed; filter: grayscale(.35); opacity: .44; }

/* ---------- Launch screen ---------- */

body.launching { overflow: hidden; }

.splash {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom));
  background: #0a0312;
  transition: opacity .55s ease, visibility .55s ease;
  /* Failsafe: if the script never runs, the splash still gets out of the way. */
  animation: splash-failsafe .4s 15s forwards;
}

.splash.done { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-art {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 196, 70, .16), transparent 45%),
    linear-gradient(180deg, rgba(10, 3, 18, .3) 0%, rgba(10, 3, 18, .55) 50%, rgba(10, 3, 18, .96) 100%),
    url("assets/superhero-city.jpg") 12% top / cover no-repeat;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 196, 70, .16), transparent 45%),
    linear-gradient(180deg, rgba(10, 3, 18, .3) 0%, rgba(10, 3, 18, .55) 50%, rgba(10, 3, 18, .96) 100%),
    image-set(url("assets/superhero-city.webp") type("image/webp"), url("assets/superhero-city.jpg") type("image/jpeg")) 12% top / cover no-repeat;
  filter: saturate(1.2);
  animation: scene-breathe 12s ease-in-out infinite alternate;
}

/* The hero in the foreground; the backdrop is shifted to the skyline so he is not doubled. */
.splash-hero { width: min(100%, 360px); margin-bottom: -38px; }

.splash-hero img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 26svh;
  margin: 0 auto;
  filter: drop-shadow(0 0 28px rgba(190, 80, 255, .35));
  animation: hero-rise .9s cubic-bezier(.2, .8, .2, 1) both;
}

.splash-inner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(100%, 340px);
  text-align: center;
}

.splash-logo { position: relative; display: flex; align-items: center; gap: 10px; }
.splash-logo .brand-mark { width: 46px; height: 46px; flex-basis: 46px; font-size: 26px; border-radius: 14px; }
.splash-logo .brand-name small { font-size: 10px; letter-spacing: 5px; }
.splash-logo .brand-name strong { font-size: 40px; }

.splash-shot {
  height: min(40svh, 380px);
  aspect-ratio: 520 / 885;
  margin: 4px 0;
  overflow: hidden;
  border: 3px solid rgba(255, 213, 110, .85);
  border-radius: 24px;
  background: #12071f;
  box-shadow: 0 26px 60px rgba(0, 0, 0, .65), 0 0 46px rgba(255, 190, 60, .25);
  transform: rotate(-4deg);
  animation: shot-float 4s ease-in-out infinite alternate;
}

.splash-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }

.splash-tag {
  margin: 0;
  color: #f2e7f7;
  font-size: 12px;
  font-weight: 750;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
}

.splash-progress { display: grid; gap: 7px; width: 100%; }
.splash-progress[hidden] { display: none; }

.splash-bar {
  height: 14px;
  padding: 2px;
  overflow: hidden;
  border: 1px solid rgba(255, 213, 110, .65);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.splash-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--gold), var(--magenta));
  box-shadow: 0 0 12px rgba(255, 196, 70, .6);
}

#splashStatus {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  font-variant-numeric: tabular-nums;
}

.splash-play { animation: cta-pulse 1.4s ease-in-out infinite, coach-pop .45s cubic-bezier(.2, 1.4, .4, 1); }
.splash-play[hidden] { display: none; }
.splash-play:focus-visible { outline-color: var(--gold-bright); }

/* ---------- Superhero backdrop ---------- */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 3, 15, .1) 0%, rgba(10, 2, 18, .28) 36%, rgba(8, 2, 14, .74) 82%, rgba(8, 2, 14, .82) 100%),
    url("assets/superhero-city.jpg") 66% top / cover no-repeat;
  background:
    linear-gradient(180deg, rgba(8, 3, 15, .1) 0%, rgba(10, 2, 18, .28) 36%, rgba(8, 2, 14, .74) 82%, rgba(8, 2, 14, .82) 100%),
    image-set(url("assets/superhero-city.webp") type("image/webp"), url("assets/superhero-city.jpg") type("image/jpeg")) 66% top / cover no-repeat;
  filter: saturate(1.18) contrast(1.08) brightness(1.04);
  transform: scale(1.015);
  animation: scene-breathe 12s ease-in-out infinite alternate;
}

.energy-grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .52;
  background:
    radial-gradient(circle at 50% 25%, rgba(255, 205, 91, .16), transparent 23%),
    repeating-linear-gradient(115deg, transparent 0 90px, rgba(244, 70, 255, .045) 91px 92px),
    linear-gradient(180deg, transparent 0 60%, rgba(41, 4, 63, .55));
}

.app { position: relative; z-index: 2; }

/* ---------- The one-screen game (phone first) ---------- */

.play {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  width: min(100%, 560px);
  height: 100vh;
  height: 100svh;
  min-height: 540px;
  margin: 0 auto;
  padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid rgba(255, 220, 116, .72);
  border-radius: 12px;
  color: var(--gold);
  font-size: 20px;
  background: linear-gradient(145deg, rgba(255, 199, 72, .22), rgba(111, 22, 132, .4));
  box-shadow: inset 0 0 20px rgba(255, 195, 62, .1), 0 0 24px rgba(255, 182, 61, .14);
}

.brand-name { display: grid; line-height: 1; }

.brand-name small {
  color: #fff1cf;
  font-size: 8px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
}

.brand-name strong {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 25px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: transparent;
  background: linear-gradient(180deg, #fff5bd 0%, #ffc74c 44%, #d57916 63%, #fff0a1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 2px 0 #6b1d36) drop-shadow(0 0 10px rgba(255, 179, 55, .4));
}

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid rgba(79, 247, 164, .45);
  border-radius: 999px;
  color: var(--mint);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 1px;
  background: rgba(8, 40, 28, .55);
}

.live-tag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
  animation: status-pulse 1.35s ease-in-out infinite;
}

.top-actions { display: flex; align-items: center; gap: 8px; }

.sound-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(224, 140, 246, .35);
  border-radius: 50%;
  color: #dac6e2;
  cursor: pointer;
  background: rgba(43, 19, 54, .82);
  transition: .2s ease;
}

.sound-toggle svg { display: block; width: 18px; height: 18px; margin: auto; }
.sound-toggle.waiting { animation: sound-invite 1.6s ease-in-out infinite; }

.sound-toggle[aria-pressed="true"] {
  color: var(--gold);
  border-color: rgba(255, 203, 83, .75);
  box-shadow: 0 0 24px rgba(255, 194, 61, .2);
}

.balance {
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 112px;
  padding: 5px 12px 5px 9px;
  border: 1px solid rgba(255, 211, 95, .55);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(59, 25, 65, .96), rgba(26, 10, 37, .96));
  box-shadow: 0 0 22px rgba(255, 190, 60, .12);
}

.coin-stack {
  color: var(--gold);
  font-size: 21px;
  filter: drop-shadow(0 0 8px rgba(255, 195, 66, .55));
}

.balance small {
  display: block;
  color: #bda8c6;
  font-size: 6.5px;
  font-weight: 850;
  letter-spacing: 1.1px;
}

.balance strong {
  display: block;
  color: var(--gold-bright);
  font-size: 17px;
  font-weight: 950;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.balance.bump strong { animation: balance-bump .7s ease-out; }

.account-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  border: 1px solid rgba(224, 140, 246, .35);
  border-radius: 50%;
  color: #dac6e2;
  cursor: pointer;
  background: rgba(43, 19, 54, .82);
}

.account-button svg { width: 19px; height: 19px; }
.account-button.signed-in { color: #2b0b25; border-color: #fff0a5; background: linear-gradient(145deg, #ffe99a, #f2ae28); }

@media (max-width: 430px) { .live-tag { display: none; } }

/* ---------- Round clock ---------- */

.phase-panel {
  --phase: var(--mint);
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "copy balls clock"
    "line line line";
  align-items: center;
  gap: 7px 10px;
  padding: 8px 10px 9px 12px;
  border: 1px solid rgba(255, 201, 79, .5);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(45, 11, 59, .84), rgba(14, 4, 24, .9));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 229, 150, .2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.phase-panel.flash { animation: stage-flash .7s ease-out; }
.phase-panel.reconnecting { --phase: #ffb347; }
.phase-panel.reconnecting .phase-name i { animation-duration: .6s; }
.phase-panel[data-phase="locked"] { --phase: var(--gold); }
.phase-panel[data-phase="drawing"] { --phase: var(--magenta); }
.phase-panel[data-phase="results"] { --phase: var(--gold-bright); }
.phase-panel.won { --phase: var(--mint); border-color: rgba(79, 247, 164, .7); }

.phase-copy { grid-area: copy; min-width: 0; }

.phase-name {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.phase-name i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--phase);
  box-shadow: 0 0 10px var(--phase);
  animation: status-pulse 1.35s ease-in-out infinite;
}

.phase-name b {
  color: var(--phase);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 1.3px;
}

.phase-name em {
  overflow: hidden;
  color: var(--faint);
  font-size: 8px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: .9px;
  text-overflow: ellipsis;
}

.phase-name em span { color: var(--muted); }

#statusText {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #f6ecfa;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.countdown {
  grid-area: clock;
  min-width: 48px;
  text-align: right;
}

.countdown small {
  display: block;
  color: var(--faint);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 1px;
  white-space: nowrap;
}

.countdown strong {
  display: block;
  color: var(--gold);
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown strong b { font-size: 28px; letter-spacing: -1px; }
.phase-panel[data-phase="betting"].urgent .countdown strong { color: #ff8fb1; animation: urgent-pulse .5s ease-in-out infinite alternate; }

.timeline {
  grid-area: line;
  display: flex;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  --fill: 0;
  position: relative;
  flex: var(--span) 1 0;
  min-width: 0;
  height: 15px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(255, 255, 255, .08);
}

.timeline li i {
  position: absolute;
  inset: 0;
  transform: scaleX(var(--fill));
  transform-origin: left;
  background: linear-gradient(90deg, var(--mint), var(--gold));
  opacity: .55;
}

.timeline li[data-phase="locked"] i { background: var(--gold); }
.timeline li[data-phase="drawing"] i { background: linear-gradient(90deg, var(--magenta), var(--violet)); }
.timeline li[data-phase="results"] i { background: linear-gradient(90deg, var(--gold-bright), var(--gold)); }

.timeline li.active { box-shadow: 0 0 0 1px rgba(255, 255, 255, .28), 0 0 14px rgba(255, 200, 87, .25); }
.timeline li.active i { opacity: 1; }

.timeline li span {
  position: relative;
  z-index: 1;
  display: block;
  overflow: hidden;
  color: rgba(255, 244, 255, .58);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .7px;
  line-height: 15px;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}

.timeline li.active span { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .75); }
.timeline li.active[data-phase="locked"] span,
.timeline li.active[data-phase="results"] span { color: #2a0822; text-shadow: none; }

/* ---------- Draw orbs ---------- */

.draw-balls {
  grid-area: balls;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reveal-orb {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid #ffd56e;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%, #d45add, #5c1971 46%, #21082f 75%);
  box-shadow: 0 0 16px rgba(222, 75, 255, .42), inset 0 0 14px rgba(255, 219, 121, .2);
}

.reveal-orb::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
}

.reveal-orb small {
  color: var(--gold-bright);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .5px;
  line-height: 1;
}

.reveal-orb span {
  color: #fff5d1;
  font-size: 17px;
  font-weight: 950;
  letter-spacing: -.5px;
  line-height: 1;
  text-shadow: 0 2px 0 #6d174b, 0 0 12px rgba(255, 213, 103, .8);
  font-variant-numeric: tabular-nums;
}

.reveal-orb.armed { animation: orb-breathe 1.15s ease-in-out infinite; }

.reveal-orb.spinning {
  animation: orb-draw .21s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(255, 199, 69, .72), inset 0 0 18px rgba(255, 206, 123, .4);
}

.reveal-orb.spinning span { animation: number-pop .12s ease-out infinite; }

.reveal-orb.final {
  border-color: #fff0b2;
  background: radial-gradient(circle at 32% 24%, #fff3b8, #ffc449 46%, #c06414 80%);
  box-shadow: 0 0 28px rgba(255, 199, 69, .65), inset 0 0 12px rgba(255, 255, 255, .35);
  animation: orb-land .45s cubic-bezier(.2, 1.4, .4, 1);
}

.reveal-orb.final small { color: #5a1640; }
.reveal-orb.final span { color: #2a0822; text-shadow: 0 1px rgba(255, 255, 255, .6); }

.reveal-orb.final.hit {
  border-color: #b9ffdc;
  background: radial-gradient(circle at 32% 24%, #e1fff0, #55f7a7 50%, #1a9c60 85%);
  box-shadow: 0 0 30px rgba(79, 247, 164, .8);
}

.reveal-orb.final.hit small, .reveal-orb.final.hit span { color: #062919; }

/* ---------- Line picker ---------- */

.line-tools {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.line-tools button {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas: "icon label" "icon hint";
  align-items: center;
  justify-content: center;
  gap: 1px 5px;
  min-height: 34px;
  padding: 4px;
  border: 1px solid rgba(207, 83, 238, .4);
  border-radius: 11px;
  color: #d4c2dc;
  cursor: pointer;
  background: linear-gradient(145deg, rgba(59, 21, 72, .92), rgba(29, 9, 40, .94));
  transition: .18s ease;
}

.line-tools button b { grid-area: icon; color: var(--gold); font-size: 14px; line-height: 1; }
.line-tools button span { grid-area: label; font-size: 9px; font-weight: 900; letter-spacing: .6px; line-height: 1.05; }
.line-tools button i { grid-area: hint; color: var(--gold-bright); font-size: 7.5px; font-style: normal; font-weight: 900; line-height: 1; opacity: .8; white-space: nowrap; }
.line-tools button.active i { color: #5a1640; opacity: 1; }
.line-tools button { position: relative; overflow: visible; }

/* How many lines of that type are on the ticket. */
.line-tools button[data-count]:not([data-count=""])::after {
  content: attr(data-count);
  position: absolute;
  top: -11px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 2px solid #1a0826;
  border-radius: 999px;
  color: #062919;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  background: var(--mint);
}
.line-tools button:hover:not(:disabled) { border-color: rgba(255, 206, 87, .68); }

.line-tools button.active {
  color: #22091f;
  border-color: #fff0a5;
  background: linear-gradient(145deg, #ffe99a, #f2ae28 70%, #c7660b);
  box-shadow: 0 0 18px rgba(255, 190, 45, .27), inset 0 1px rgba(255, 255, 255, .7);
}

.line-tools button.active b { color: #3b0b32; }

/* ---------- Shared card ---------- */

.card-frame {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 200px;
  max-height: calc(min(100vw, 560px) + 8px);
  margin-bottom: 7px;
  padding: 7px 8px 8px;
  border: 1px solid rgba(229, 125, 255, .62);
  border-radius: 18px;
  background: rgba(6, 2, 12, .82);
  box-shadow: inset 0 0 34px rgba(199, 59, 236, .12), 0 12px 38px rgba(0, 0, 0, .32);
  transition: border-color .3s ease, box-shadow .3s ease;
}

.card-frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 212, 106, .5), rgba(219, 65, 255, .35), transparent 55%);
  filter: blur(9px);
  opacity: .4;
}

/* ---------- Pick coach + slot counter overlays ---------- */

.pick-coach {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(12, 3, 22, .82) 0%, rgba(12, 3, 22, .5) 75%);
  opacity: 0;
  transform: scale(.97);
  transition: opacity .3s ease, transform .3s ease;
}

.pick-coach.show { opacity: 1; transform: none; }

.coach-lines { position: absolute; inset: 0; }

.coach-lines i {
  position: absolute;
  left: 1%;
  right: 1%;
  height: 18%;
  border: 2px dashed var(--gold);
  border-radius: 10px;
  background: rgba(255, 200, 87, .16);
  box-shadow: 0 0 18px rgba(255, 200, 87, .35), inset 0 0 14px rgba(255, 200, 87, .2);
  opacity: 0;
  animation: coach-line 1.9s ease-in-out infinite;
}

.coach-lines i:nth-child(1) { top: 1%; animation-delay: .05s; }
.coach-lines i:nth-child(2) { top: 21%; animation-delay: .25s; }
.coach-lines i:nth-child(3) { top: 61%; animation-delay: .45s; }
.coach-lines i:nth-child(4) { top: 81%; animation-delay: .65s; }

/* In column mode the same three highlights stand up as columns. */
.pick-coach[data-mode="column"] .coach-lines i { top: 1%; bottom: 1%; height: auto; right: auto; width: 18%; }
.pick-coach[data-mode="column"] .coach-lines i:nth-child(1) { left: 1%; }
.pick-coach[data-mode="column"] .coach-lines i:nth-child(2) { left: 21%; }
.pick-coach[data-mode="column"] .coach-lines i:nth-child(3) { left: 61%; }
.pick-coach[data-mode="column"] .coach-lines i:nth-child(4) { left: 81%; }
.pick-coach[data-mode="diagonal"] .coach-lines,
.pick-coach[data-mode="diagonal"] .coach-tap { display: none; }

.coach-tap {
  position: absolute;
  left: 82%;
  top: 4%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  box-shadow: 0 0 14px rgba(255, 255, 255, .6);
  opacity: 0;
  animation: coach-tap 1.9s ease-in-out infinite;
}

.pick-coach[data-mode="column"] .coach-tap { animation-name: coach-tap-column; }

.coach-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  max-width: 88%;
  padding: 11px 16px 12px;
  border: 1px solid rgba(255, 213, 110, .75);
  border-radius: 16px;
  text-align: center;
  background: linear-gradient(160deg, rgba(74, 20, 90, .96), rgba(25, 7, 38, .97));
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55), 0 0 30px rgba(255, 190, 60, .22);
}

.pick-coach.show .coach-card { animation: coach-pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }

.coach-card b {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 22px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1;
  color: transparent;
  background: linear-gradient(180deg, #fff5bd 0%, #ffc74c 48%, #e08a1e 72%, #fff0a1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 2px 0 #6b1d36);
}

.coach-card b span { font-size: 1.3em; }

.coach-card small {
  color: #eadcf1;
  font-size: 10.5px;
  font-weight: 750;
}

.coach-slots { display: flex; gap: 7px; margin-top: 2px; }

.coach-slots i {
  width: 13px;
  height: 13px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  animation: coach-slot 1.9s ease-in-out infinite;
}

.coach-slots i:nth-child(1) { animation-delay: .05s; }
.coach-slots i:nth-child(2) { animation-delay: .25s; }
.coach-slots i:nth-child(3) { animation-delay: .45s; }
.coach-slots i:nth-child(4) { animation-delay: .65s; }

.slot-pill {
  position: absolute;
  bottom: 0;
  left: 50%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 7px;
  border: 1px solid rgba(255, 213, 110, .75);
  border-radius: 999px;
  color: var(--gold-bright);
  font-size: 8.5px;
  font-weight: 950;
  letter-spacing: .8px;
  white-space: nowrap;
  background: linear-gradient(145deg, #3d1450, #1d0729);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45);
  transform: translate(-50%, 50%);
  pointer-events: none;
}

.slot-pill[hidden] { display: none; }
.slot-dots { display: flex; gap: 3px; }

.slot-dots i {
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  transition: background .2s ease, box-shadow .2s ease;
}

.slot-dots i.on { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.slot-pill.full { border-color: var(--mint); color: var(--mint); }
.slot-pill.full .slot-dots i { border-color: var(--mint); background: var(--mint); box-shadow: 0 0 6px var(--mint); }
.slot-pill.shake { animation: pill-shake .45s ease; }

.card-frame.won {
  border-color: var(--mint);
  box-shadow: inset 0 0 34px rgba(79, 247, 164, .16), 0 0 40px rgba(79, 247, 164, .3);
}

.ball-labels,
.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.ball-labels { flex: 0 0 auto; margin-bottom: 5px; }

.ball-labels div {
  color: var(--gold);
  font-size: 17px;
  font-weight: 950;
  letter-spacing: 1px;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 14px rgba(255, 196, 70, .3);
}

.ball-labels .column-power {
  --tier: var(--gold);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "letter chance"
    "multiplier multiplier";
  align-items: center;
  row-gap: 2px;
  min-width: 0;
  padding: 3px 5px 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 206, 87, .3);
  border: 1px solid color-mix(in srgb, var(--tier) 50%, transparent);
  border-radius: 9px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  background: linear-gradient(160deg, rgba(83, 27, 97, .75), rgba(20, 6, 30, .9));
  background: linear-gradient(160deg, color-mix(in srgb, var(--tier) 22%, #2a0d38), rgba(20, 6, 30, .92));
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.column-power strong {
  grid-area: letter;
  color: var(--gold-bright);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

.column-power small {
  grid-area: chance;
  color: #cdb9d6;
  font-size: 7.5px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.column-power em {
  grid-area: multiplier;
  justify-self: center;
  color: var(--tier);
  font-size: 17px;
  font-style: normal;
  font-weight: 950;
  letter-spacing: -.5px;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(0, 0, 0, .6);
}

.column-power:disabled { cursor: default; filter: none; opacity: 1; }
.column-power:hover:not(:disabled) { transform: translateY(-1px); }

.column-power.selected {
  border-color: var(--tier);
  background: var(--tier);
  box-shadow: 0 0 16px rgba(255, 200, 87, .35);
  box-shadow: 0 0 18px color-mix(in srgb, var(--tier) 60%, transparent);
  transform: translateY(-1px);
}

.column-power.selected strong,
.column-power.selected small,
.column-power.selected em { color: #1d071b; text-shadow: none; }

.column-power.preview {
  border: 2px dashed var(--tier);
  box-shadow: 0 0 14px rgba(255, 200, 87, .25);
  transform: translateY(-1px);
}

.column-power.invite { animation: chip-invite 1.1s ease-in-out infinite alternate; }

.board {
  flex: 1 1 auto;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  min-height: 0;
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(203, 88, 235, .42);
  border-radius: 10px;
  color: #fffaff;
  font-size: clamp(17px, 3.1svh, 28px);
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(150deg, #4b1c5d, #271036 76%);
  box-shadow: inset 0 1px rgba(255, 255, 255, .14), 0 5px 12px rgba(0, 0, 0, .18);
  transition: transform .18s ease, border-color .18s ease, filter .18s ease;
}

.cell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .08), transparent 45%);
  pointer-events: none;
}

button.cell:disabled { cursor: default; filter: none; opacity: 1; }

.board.pickable .cell { cursor: pointer; }
.board.pickable .cell:hover { z-index: 3; border-color: var(--gold); filter: brightness(1.16); }
.board.pickable .cell:active { transform: scale(.95); }

.cell.deal-in { animation: card-deal .42s both cubic-bezier(.2, .8, .2, 1); }

.cell.selected {
  color: #160515;
  border-color: #fff0b2;
  background: linear-gradient(145deg, #fff0a5 0%, #ffc449 47%, #db821d 100%);
  box-shadow: 0 0 18px rgba(255, 193, 66, .38), inset 0 1px rgba(255, 255, 255, .8);
  animation: selected-glow 1.25s ease-in-out infinite alternate;
}

.cell.preview {
  color: #fff4cf;
  border: 2px dashed var(--gold);
  background: linear-gradient(145deg, #6a2a72, #3a1446);
}

.cell.hit {
  z-index: 2;
  color: #082117;
  border-color: #b9ffdc;
  outline: 3px solid var(--mint);
  outline-offset: -4px;
  background: linear-gradient(145deg, #d4ffe9 0%, #55f7a7 50%, #20b973 100%);
  box-shadow: 0 0 30px rgba(79, 247, 164, .86), inset 0 1px rgba(255, 255, 255, .82);
  animation: match-glow .7s alternate infinite;
}

.cell.drawn.miss {
  z-index: 2;
  color: #fff2f6;
  border-color: #ff9db4;
  outline: 3px solid var(--danger);
  outline-offset: -4px;
  background: linear-gradient(145deg, #a72f5f, #5b173c 74%);
  box-shadow: 0 0 24px rgba(255, 83, 132, .46), inset 0 1px rgba(255, 255, 255, .28);
}

.cell.hit::after,
.cell.drawn.miss::after {
  position: absolute;
  right: 4px;
  bottom: 3px;
  font-size: 6.5px;
  font-weight: 950;
  letter-spacing: .6px;
}

.cell.hit::after { content: "MATCH"; color: #083e29; }
.cell.drawn.miss::after { content: "DRAW"; color: #ffdce5; }

/* ---------- Table strip: real players + last draws ---------- */

.table-strip {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 3px 12px 3px 4px;
  border: 1px solid rgba(207, 93, 235, .28);
  border-radius: 999px;
  color: #d9c8e1;
  cursor: pointer;
  text-align: left;
  background: rgba(14, 4, 23, .78);
}

.table-strip:hover { border-color: rgba(255, 206, 87, .5); }

.players-pill {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #2b0b25;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .8px;
  background: linear-gradient(145deg, #ffe492, #e79822);
}

.recent-label {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: .9px;
}

.recent-draws {
  display: flex;
  flex: 1 1 auto;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}

.recent-draws > em { color: var(--faint); font-size: 10px; font-style: normal; white-space: nowrap; }

.recent-draws i {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid rgba(255, 213, 95, .35);
  border-radius: 999px;
  color: var(--gold-bright);
  font-size: 9.5px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
  background: rgba(45, 14, 58, .8);
}

.recent-draws i:first-child { border-color: rgba(255, 213, 95, .8); }
.recent-draws i small {
  margin-left: 4px;
  color: var(--tier, var(--mint));
  font-size: 7px;
  font-weight: 950;
}
.table-strip > b { color: var(--gold); font-size: 16px; line-height: 1; }

/* ---------- Bet dock ---------- */

.dock {
  display: grid;
  flex: 0 0 auto;
  gap: 6px;
  margin-top: auto;
  padding: 8px;
  border: 1px solid rgba(255, 201, 79, .55);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(45, 11, 59, .92), rgba(14, 4, 24, .95));
  box-shadow: var(--shadow), 0 0 40px rgba(207, 61, 241, .15), inset 0 1px rgba(255, 229, 150, .2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.stake-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.stakes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.1fr);
  gap: 5px;
}
.stakes[hidden] { display: none; }

.stakes button {
  min-height: 38px;
  padding: 0;
  border: 1px solid rgba(205, 89, 233, .5);
  border-radius: 11px;
  color: #f8ecfc;
  cursor: pointer;
  background: linear-gradient(155deg, #3e174d, #281033);
  font-size: 15px;
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.stakes button.active {
  color: #1d091c;
  border-color: #fff0a6;
  background: linear-gradient(145deg, #ffeaa0, #f5b632 70%, #ce7111);
  box-shadow: 0 0 18px rgba(255, 184, 50, .34), inset 0 1px rgba(255, 255, 255, .75);
}

.stakes button.active:disabled { opacity: .85; filter: none; }

.potential {
  display: grid;
  justify-items: end;
  gap: 1px;
  min-width: 62px;
  max-width: 86px;
  overflow: hidden;
  line-height: 1;
}

.potential > * { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.potential small {
  color: var(--faint);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 1px;
}

.potential strong {
  color: var(--gold);
  font-size: 21px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.potential em {
  color: var(--mint);
  font-size: 8.5px;
  font-style: normal;
  font-weight: 850;
}

.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #fff0aa;
  border-radius: 14px;
  color: #270b25;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 950;
  letter-spacing: .6px;
  background: linear-gradient(180deg, #fff1a7, #ffc145 51%, #d47b17);
  box-shadow: 0 5px 0 #8a4310, 0 9px 26px rgba(255, 178, 42, .28), inset 0 1px rgba(255, 255, 255, .88);
  text-shadow: 0 1px rgba(255, 255, 255, .5);
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease, background .3s ease;
}

.primary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.primary:hover:not(:disabled) { filter: brightness(1.08); }
.primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #8a4310, 0 5px 18px rgba(255, 178, 42, .22); }
.primary[data-state="go"]:not(:disabled) { animation: cta-pulse 1.4s ease-in-out infinite; }

/* Disabled states that carry information read as banners, not greyed-out buttons. */
.primary[data-state]:disabled { opacity: 1; filter: none; cursor: default; }
.primary[data-state]:disabled > b { display: none; }

.primary[data-state="hint"]:disabled {
  color: var(--gold-bright);
  border: 1px dashed rgba(255, 213, 110, .7);
  background: rgba(40, 12, 50, .9);
  box-shadow: none;
  text-shadow: none;
}

.primary[data-state="locked"]:disabled {
  color: var(--mint);
  border-color: rgba(79, 247, 164, .6);
  background: linear-gradient(180deg, rgba(14, 60, 42, .92), rgba(9, 34, 25, .95));
  box-shadow: 0 0 22px rgba(79, 247, 164, .16);
  text-shadow: none;
}

.primary[data-state="wait"]:disabled {
  color: #ffd8f6;
  border-color: rgba(255, 60, 212, .55);
  background: linear-gradient(180deg, rgba(102, 18, 104, .92), rgba(52, 9, 64, .95));
  box-shadow: 0 0 22px rgba(255, 60, 212, .2);
  text-shadow: none;
}

.primary[data-state="win"]:disabled {
  color: #062919;
  border-color: #c8ffe3;
  background: linear-gradient(180deg, #d4ffe9, #55f7a7 55%, #1fae6b);
  box-shadow: 0 5px 0 #0d6b41, 0 0 34px rgba(79, 247, 164, .5);
  text-shadow: none;
  animation: win-pop .6s cubic-bezier(.2, 1.4, .4, 1);
}

.primary[data-state="partial"]:disabled {
  color: var(--gold-bright);
  border-color: rgba(255, 213, 110, .55);
  background: linear-gradient(180deg, rgba(70, 40, 20, .92), rgba(40, 18, 30, .95));
  box-shadow: none;
  text-shadow: none;
}

.primary[data-state="lose"]:disabled {
  color: #ffd0dc;
  border-color: rgba(255, 123, 154, .5);
  background: rgba(58, 14, 38, .92);
  box-shadow: none;
  text-shadow: none;
}

.result {
  min-height: 14px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result.drawing { color: var(--gold); }
.result.win { color: var(--mint); font-weight: 850; }
.result.lose { color: #ffc3d1; }

/* ---------- Below the fold ---------- */

.details {
  display: grid;
  gap: 12px;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 6px 12px max(16px, env(safe-area-inset-bottom));
}

.panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(221, 115, 248, .24);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(39, 12, 52, .9), rgba(16, 5, 26, .94));
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 10px;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.3px;
}

.panel-head small { color: var(--faint); font-size: 10px; font-weight: 650; }

.panel-note {
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.5;
}

.reset {
  padding: 6px 10px;
  border: 1px solid rgba(213, 92, 244, .35);
  border-radius: 999px;
  color: #cdb7d6;
  cursor: pointer;
  background: rgba(43, 19, 54, .7);
  font-size: 10px;
  font-weight: 750;
}

.sound-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.sound-settings > span {
  margin-right: 2px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
}

.sound-settings button {
  padding: 7px 11px;
  border: 1px solid rgba(213, 92, 244, .35);
  border-radius: 999px;
  color: #cdb7d6;
  cursor: pointer;
  background: rgba(43, 19, 54, .7);
  font-size: 11px;
  font-weight: 800;
}

.sound-settings button[aria-pressed="true"] {
  color: #2b0b25;
  border-color: #fff0a5;
  background: linear-gradient(145deg, #ffe99a, #f2ae28);
}

.reset.armed { color: #2b0b25; border-color: #fff0a5; background: var(--gold); }

.session-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid rgba(214, 101, 239, .22);
  border-radius: 12px;
  background: rgba(10, 3, 17, .5);
}

.session-strip > div { padding: 9px 8px; text-align: center; }
.session-strip > div + div { border-left: 1px solid rgba(214, 101, 239, .17); }

.session-strip small {
  display: block;
  color: var(--faint);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .8px;
}

.session-strip b { color: #f7eafb; font-size: 17px; font-variant-numeric: tabular-nums; }

.shared-history {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.shared-history > em { padding: 14px 4px; color: var(--faint); font-size: 11px; }

.history-card {
  display: grid;
  flex: 0 0 auto;
  gap: 3px;
  min-width: 150px;
  padding: 9px 11px;
  border: 1px solid rgba(211, 96, 239, .22);
  border-radius: 12px;
  background: rgba(45, 14, 58, .62);
  scroll-snap-align: start;
}

.history-card span { color: var(--faint); font-size: 8px; font-weight: 900; letter-spacing: .8px; }
.history-card strong { color: var(--gold-bright); font-size: 15px; }
.history-card strong em {
  margin-left: 4px;
  color: var(--mint);
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}
.history-card small { color: #b9a7c2; font-size: 9.5px; }

.rules-steps {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.rules-steps li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.rules-steps b {
  padding: 3px 0;
  border: 1px solid rgba(255, 201, 79, .45);
  border-radius: 8px;
  color: var(--gold);
  font-size: 10px;
  text-align: center;
  background: rgba(60, 22, 40, .5);
}

.rules-steps strong { color: #fff; }

.proof { margin: 0; color: var(--faint); font-size: 10.5px; overflow-wrap: anywhere; }
.proof code { color: var(--gold-bright); font-size: 10px; }

footer {
  display: grid;
  gap: 6px;
  padding: 8px 4px 4px;
  color: #81708a;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

footer div { color: #c1a9ca; font-weight: 900; letter-spacing: 1.6px; }
footer span { color: var(--gold); }
footer p { margin: 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(150px, calc(env(safe-area-inset-bottom) + 150px));
  z-index: 100;
  width: max-content;
  max-width: min(360px, calc(100% - 32px));
  padding: 11px 15px;
  border: 1px solid rgba(255, 209, 101, .55);
  border-radius: 12px;
  color: #fff6de;
  background: rgba(24, 7, 35, .97);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: .22s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.fx { position: fixed; inset: 0; z-index: 90; overflow: hidden; pointer-events: none; }

.fx-bit {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 8px;
  height: 14px;
  border-radius: 3px;
  background: var(--bit-color, var(--gold));
  box-shadow: 0 0 10px var(--bit-color, var(--gold));
  animation: burst 1s cubic-bezier(.17, .84, .42, 1) forwards;
}

@keyframes scene-breathe { to { transform: scale(1.035) translateY(-5px); } }
@keyframes status-pulse { 50% { transform: scale(.72); opacity: .68; } }
@keyframes card-deal { from { opacity: 0; transform: translateY(16px) scale(.88) rotateX(22deg); } to { opacity: 1; transform: none; } }
@keyframes selected-glow { from { filter: brightness(.94); } to { filter: brightness(1.12); } }
@keyframes match-glow { from { transform: scale(1); } to { transform: scale(1.045); } }
@keyframes orb-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes orb-draw { 0%, 100% { transform: scale(.95) rotate(-2deg); filter: brightness(.95); } 50% { transform: scale(1.08) rotate(2deg); filter: brightness(1.25); } }
@keyframes orb-land { from { transform: scale(.4); } to { transform: scale(1); } }
@keyframes number-pop { from { transform: scale(.72); opacity: .42; } to { transform: scale(1.08); opacity: 1; } }
@keyframes cta-pulse { 50% { box-shadow: 0 5px 0 #8a4310, 0 10px 34px rgba(255, 190, 60, .55), inset 0 1px rgba(255, 255, 255, .88); } }
@keyframes win-pop { from { transform: scale(.92); } to { transform: scale(1); } }
@keyframes urgent-pulse { to { transform: scale(1.08); } }
@keyframes balance-bump { 30% { transform: scale(1.18); color: var(--mint); } }
@keyframes stage-flash { 0% { box-shadow: 0 0 0 2px var(--phase), 0 0 40px var(--phase); } 100% { box-shadow: var(--shadow), inset 0 1px rgba(255, 229, 150, .2); } }
@keyframes chip-invite { from { transform: translateY(0); } to { transform: translateY(-2px); border-color: var(--tier); } }
@keyframes sound-invite { 50% { box-shadow: 0 0 0 5px rgba(255, 200, 87, .18), 0 0 18px rgba(255, 200, 87, .35); color: var(--gold); } }
@keyframes coach-line { 0% { opacity: 0; transform: scale(.94); } 10%, 72% { opacity: 1; transform: none; } 88%, 100% { opacity: 0; } }
@keyframes coach-slot { 0% { background: transparent; box-shadow: none; } 10%, 72% { background: var(--gold); box-shadow: 0 0 10px var(--gold); } 88%, 100% { background: transparent; box-shadow: none; } }
@keyframes coach-tap { 0% { top: 6%; opacity: 0; transform: scale(1.4); } 4% { opacity: 1; transform: scale(.8); } 16% { top: 6%; opacity: .9; transform: scale(1); } 22% { top: 50%; opacity: 1; transform: scale(.8); } 34% { top: 50%; } 41% { top: 90%; transform: scale(.8); } 55% { top: 90%; opacity: .9; } 70%, 100% { top: 90%; opacity: 0; } }
@keyframes coach-tap-column { 0% { left: 10%; top: 88%; opacity: 0; transform: scale(1.4); } 4% { opacity: 1; transform: scale(.8); } 16% { left: 10%; } 22% { left: 50%; transform: scale(.8); } 34% { left: 50%; } 41% { left: 90%; transform: scale(.8); } 55% { left: 90%; opacity: .9; } 70%, 100% { left: 90%; top: 88%; opacity: 0; } }
@keyframes coach-pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes pill-shake { 20%, 60% { transform: translate(calc(-50% - 5px), 50%); } 40%, 80% { transform: translate(calc(-50% + 5px), 50%); } }
@keyframes splash-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@keyframes hero-rise { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes shot-float { from { transform: rotate(-4deg) translateY(0); } to { transform: rotate(-2deg) translateY(-8px); } }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) rotate(var(--spin)); opacity: 0; } }

/* ---------- Phone height tiers ---------- */

/* Roomier phones (e.g. 6.1"+ with browser chrome hidden): give the controls a little more air. */
@media (max-width: 959px) and (min-height: 760px) {
  .play { --gap: 9px; }
  .topbar { min-height: 44px; }
  .phase-panel { padding: 10px 12px 11px 14px; }
  .reveal-orb { width: 50px; height: 50px; }
  .reveal-orb span { font-size: 19px; }
  .line-tools button { min-height: 38px; }
  .stakes button { min-height: 42px; }
  .primary { min-height: 52px; font-size: 14px; }
  .dock { padding: 10px; gap: 8px; }
}

/* Short screens (iPhone SE / small Androids with toolbars): tighten everything but the card. */
@media (max-width: 959px) and (max-height: 640px) {
  .play { --gap: 5px; padding-top: max(5px, env(safe-area-inset-top)); }
  .topbar { min-height: 34px; }
  .brand-mark, .sound-toggle { width: 32px; height: 32px; flex-basis: 32px; }
  .brand-name strong { font-size: 21px; }
  .balance { padding: 3px 10px 3px 8px; }
  .phase-panel { gap: 5px 8px; padding: 6px 8px 7px 10px; }
  #statusText { font-size: 11px; margin-top: 2px; }
  .reveal-orb { width: 38px; height: 38px; }
  .reveal-orb span { font-size: 15px; }
  .countdown strong b { font-size: 24px; }
  .timeline li { height: 12px; }
  .timeline li span { line-height: 12px; font-size: 6.5px; }
  .line-tools button { min-height: 30px; }
  .card-frame { padding: 5px 6px 6px; }
  .ball-labels { margin-bottom: 3px; }
  .ball-labels div { font-size: 14px; }
  .ball-labels .column-power { padding: 2px 4px 3px; row-gap: 1px; }
  .column-power strong { font-size: 9px; }
  .column-power small { font-size: 7px; }
  .column-power em { font-size: 14px; }
  .line-tools button i { display: none; }
  .board, .ball-labels { gap: 4px; }
  .table-strip { min-height: 26px; }
  .dock { padding: 6px; gap: 5px; }
  .stakes button { min-height: 34px; }
  .primary { min-height: 44px; font-size: 12.5px; }
}

@media (max-width: 370px) {
  .live-tag, .sound-toggle { display: none; }
  .line-tools button b { display: none; }
  .potential { min-width: 54px; }
  .potential strong { font-size: 18px; }
  .column-power small { display: none; }
  .ball-labels .column-power { grid-template-areas: "letter letter" "multiplier multiplier"; justify-items: center; }
  .column-power em { font-size: 15px; }
  .primary { font-size: 12px; letter-spacing: .3px; }
}

/* Landscape phones are too short for one screen; let the page scroll normally. */
@media (max-height: 520px) and (orientation: landscape) {
  .play { height: auto; min-height: 0; }
  .card-frame { flex: none; max-height: none; }
  .board { grid-template-rows: none; }
  .cell { aspect-ratio: 1.6; }
}

/* ---------- Desktop: card on the left, controls on the right ---------- */

@media (min-width: 960px) {
  .play {
    --gap: 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    grid-template-rows: auto auto auto auto 1fr;
    grid-template-areas:
      "top   top"
      "tools sim"
      "card  phase"
      "card  dock"
      "card  .";
    align-content: start;
    column-gap: 18px;
    width: min(1100px, calc(100% - 48px));
    height: auto;
    min-height: 100vh;
    padding: 18px 0 28px;
  }

  .topbar {
    grid-area: top;
    min-height: 64px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 222, 139, .18);
    border-radius: 18px;
    background: rgba(9, 3, 17, .66);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .brand { gap: 11px; }
  .brand-mark { width: 44px; height: 44px; flex-basis: 44px; font-size: 25px; border-radius: 14px; }
  .brand-name small { font-size: 9px; letter-spacing: 4px; }
  .brand-name strong { font-size: 28px; }
  .live-tag { font-size: 9px; padding: 4px 9px; }
  .sound-toggle { width: 44px; height: 44px; }
  .balance { min-width: 160px; padding: 8px 16px 8px 12px; border-radius: 15px; }
  .coin-stack { font-size: 27px; }
  .balance small { font-size: 8px; }
  .balance strong { font-size: 22px; }

  .phase-panel {
    grid-area: phase;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "copy  copy"
      "balls clock"
      "line  line";
    gap: 12px 16px;
    padding: 16px 18px 18px;
    border-radius: 22px;
  }

  .phase-name b { font-size: 13px; }
  .phase-name em { font-size: 10px; }
  #statusText { font-size: 15px; margin-top: 6px; white-space: normal; }
  .reveal-orb { width: 66px; height: 66px; border-width: 3px; }
  .reveal-orb small { font-size: 9px; }
  .reveal-orb span { font-size: 25px; }
  .draw-balls { gap: 10px; }
  .countdown { min-width: 86px; }
  .countdown small { font-size: 9px; }
  .countdown strong { font-size: 20px; }
  .countdown strong b { font-size: 42px; }
  .timeline { gap: 4px; }
  .timeline li { height: 20px; border-radius: 6px; }
  .timeline li span { font-size: 9px; line-height: 20px; letter-spacing: 1px; }

  .line-tools { grid-area: tools; gap: 8px; }
  .line-tools button { min-height: 46px; gap: 7px; border-radius: 13px; }
  .line-tools button b { font-size: 17px; }
  .line-tools button span { font-size: 11px; }

  .card-frame {
    grid-area: card;
    flex: none;
    align-self: start;
    justify-self: center;
    width: min(100%, calc((100vh - 340px) * 1.3 + 64px));
    min-height: 0;
    max-height: none;
    padding: 14px;
    border-radius: 22px;
  }

  .ball-labels { margin: 0 4px 10px; }
  .ball-labels div { font-size: 26px; }
  .ball-labels .column-power { padding: 7px 10px 8px; row-gap: 4px; border-radius: 12px; }
  .column-power strong { font-size: 15px; }
  .column-power small { font-size: 10px; }
  .column-power em { font-size: 27px; }
  .line-tools button i { font-size: 10px; }
  .coach-card { gap: 8px; padding: 18px 28px 18px; border-radius: 20px; }
  .coach-card b { font-size: 34px; }
  .coach-card small { font-size: 14px; }
  .coach-slots i { width: 18px; height: 18px; }
  .coach-tap { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
  .slot-pill { padding: 5px 14px 5px 10px; font-size: 10px; }
  .slot-dots i { width: 10px; height: 10px; }
  .board, .ball-labels { gap: 9px; }
  .board { grid-template-rows: none; }
  .cell { aspect-ratio: 1.3; border-radius: 13px; font-size: clamp(22px, 2.4vw, 32px); }
  .cell.hit::after, .cell.drawn.miss::after { right: 6px; bottom: 4px; font-size: 8px; }

  .table-strip { grid-area: sim; align-self: stretch; min-height: 46px; padding-left: 6px; }
  .players-pill { font-size: 9px; padding: 5px 10px; }
  .recent-label { font-size: 8.5px; }
  .recent-draws i { font-size: 11px; }

  .dock {
    grid-area: dock;
    align-self: start;
    gap: 14px;
    margin-top: 0;
    padding: 20px;
    border-radius: 22px;
  }

  .stake-row { grid-template-columns: 1fr; gap: 14px; }
  .stakes { gap: 8px; }
  .stakes button { min-height: 52px; font-size: 17px; border-radius: 13px; }

  .potential {
    grid-template-columns: auto 1fr auto;
    align-items: baseline;
    justify-items: start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(217, 102, 246, .35);
    border-radius: 13px;
    background: rgba(9, 3, 16, .66);
  }

  .potential small { font-size: 9px; }
  .potential strong { font-size: 26px; }
  .potential em { justify-self: end; font-size: 12px; }
  .primary { min-height: 60px; font-size: 15px; border-radius: 16px; }
  .result { min-height: 34px; font-size: 13px; white-space: normal; }

  .details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
    width: min(1100px, calc(100% - 48px));
    padding: 0 0 28px;
  }

  .panel { padding: 22px; border-radius: 22px; }
  .panel-head h2 { font-size: 22px; }
  .session-panel, .history-panel { grid-column: 1; }
  .rules-panel { grid-column: 2; grid-row: 1 / span 2; }
  .history-panel .shared-history { flex-wrap: wrap; overflow: visible; }
  .history-card { min-width: 0; flex: 1 1 140px; }
  footer { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; gap: 24px; text-align: left; }
  footer p { text-align: right; }
  .toast { bottom: 28px; }
}

@media (min-width: 960px) {
  .splash-inner { width: 420px; gap: 16px; }
  .splash-hero { width: 420px; }
  .splash-hero img { max-height: 30vh; }
  .splash-shot { height: min(42vh, 420px); }
}

@media (prefers-reduced-motion: reduce) {
  .coach-lines i, .coach-slots i { opacity: 1; background: rgba(255, 200, 87, .3); }
  .coach-tap { display: none; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Global helpers ---------- */

[hidden] { display: none !important; }
body.page-open { overflow: hidden; }
.up { color: var(--mint) !important; }
.down { color: #ff9db4 !important; }

/* ---------- Your play + live bets ---------- */

.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 213, 110, .45);
  border-radius: 12px;
  color: var(--gold-bright);
  cursor: pointer;
  background: rgba(43, 19, 54, .75);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.ghost:hover { border-color: var(--gold); }
.ghost.danger { width: 100%; margin-top: 14px; color: #ffb3c4; border-color: rgba(255, 123, 154, .45); }

.bets-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }

.bets-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 78px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(205, 88, 235, .16);
  border-radius: 10px;
  background: rgba(39, 12, 51, .6);
  font-size: 12px;
}

.bets-list li.mine { border-color: rgba(255, 213, 110, .6); background: rgba(70, 40, 20, .55); }
.bets-list li.won { border-color: rgba(79, 247, 164, .55); }
.bets-list li.lost { opacity: .6; }
.bets-list li.empty { display: block; color: var(--faint); text-align: center; }
.bet-name { overflow: hidden; color: #f0e4f4; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.bet-lines { color: var(--faint); }
.bet-stake { color: var(--gold-bright); font-weight: 800; font-variant-numeric: tabular-nums; }
.bet-win { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.bets-list li.won .bet-win { color: var(--mint); }

/* ---------- Pages ---------- */

.page {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  justify-items: center;
  align-items: start;
  overflow-y: auto;
  padding: max(14px, env(safe-area-inset-top)) 12px max(20px, env(safe-area-inset-bottom));
  background: rgba(8, 2, 14, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: page-in .22s ease-out;
}

.page-card {
  width: min(100%, 460px);
  padding: 16px;
  border: 1px solid rgba(255, 201, 79, .5);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(48, 13, 62, .97), rgba(16, 5, 26, .98));
  box-shadow: var(--shadow), 0 0 40px rgba(207, 61, 241, .18);
}

.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.page-head h2 { flex: 1; margin: 0; font-size: 20px; font-weight: 900; }

.page-back {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(224, 140, 246, .35);
  border-radius: 12px;
  color: var(--gold-bright);
  cursor: pointer;
  background: rgba(43, 19, 54, .82);
  font-size: 24px;
  line-height: 1;
}

.sandbox-tag {
  padding: 4px 8px;
  border: 1px dashed rgba(79, 247, 164, .6);
  border-radius: 999px;
  color: var(--mint);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 1px;
}

.seg {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid rgba(205, 89, 233, .35);
  border-radius: 14px;
  background: rgba(14, 4, 23, .7);
}

.seg button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}

.seg button[aria-selected="true"] { color: #22091f; background: linear-gradient(145deg, #ffe99a, #f2ae28 70%, #c7660b); }

.form { display: grid; gap: 11px; }
.form h3 { margin: 6px 0 0; font-size: 15px; }

.form label {
  display: grid;
  gap: 5px;
  color: #e9dcef;
  font-size: 12px;
  font-weight: 800;
}

.form label small { color: var(--faint); font-weight: 650; }

.form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(218, 97, 247, .55);
  border-radius: 12px;
  color: var(--text);
  outline: 0;
  background: #140821;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
}

.form input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 200, 87, .2); }
.form input[type="date"] { color-scheme: dark; }
.form .otp-input { letter-spacing: 10px; text-align: center; font-size: 22px; font-variant-numeric: tabular-nums; }

.form label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.form label.check input { width: 20px; height: 20px; accent-color: var(--gold); }

.link {
  justify-self: center;
  padding: 6px;
  border: 0;
  color: var(--gold-bright);
  cursor: pointer;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  text-decoration: underline;
}

.link:disabled { color: var(--faint); text-decoration: none; opacity: 1; filter: none; }
.form-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-note b { color: var(--gold-bright); }
.form-error { min-height: 16px; margin: 10px 0 0; color: #ffb3c4; font-size: 12px; font-weight: 750; text-align: center; }

.dev-code {
  margin: 0;
  padding: 9px 12px;
  border: 1px dashed rgba(79, 247, 164, .6);
  border-radius: 12px;
  color: var(--mint);
  background: rgba(8, 40, 28, .5);
  font-size: 12px;
  font-weight: 800;
}

.wallet-balance {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 213, 110, .4);
  border-radius: 16px;
  background: radial-gradient(circle at 50% 0%, rgba(255, 200, 87, .18), transparent 70%), rgba(14, 4, 23, .6);
}

.wallet-balance small { color: var(--faint); font-size: 9px; font-weight: 900; letter-spacing: 1.2px; }
.wallet-balance strong { color: var(--gold-bright); font-size: 30px; font-weight: 950; font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chips button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(205, 89, 233, .45);
  border-radius: 999px;
  color: #f3e6f8;
  cursor: pointer;
  background: rgba(43, 19, 54, .8);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}

.breakdown { display: grid; gap: 4px; margin: 0; padding: 0; }
.breakdown:empty { display: none; }

.breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(14, 4, 23, .55);
  font-size: 13px;
}

.breakdown dt { color: var(--muted); }
.breakdown dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.breakdown .total { border: 1px solid rgba(255, 213, 110, .45); }
.breakdown .total dt, .breakdown .total dd { color: var(--gold-bright); font-weight: 900; }

.tax-note {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(205, 89, 233, .25);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(14, 4, 23, .45);
  font-size: 12px;
  line-height: 1.5;
}

.tax-note summary { color: var(--gold-bright); cursor: pointer; font-weight: 850; }
.tax-note ul { margin: 8px 0; padding-left: 18px; }
.tax-note b { color: #fff; }
.tax-note p { margin: 0; color: var(--faint); font-size: 11px; }

.ledger-list, .ticket-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }

.ledger-list li, .ticket-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(205, 88, 235, .16);
  border-radius: 12px;
  background: rgba(39, 12, 51, .6);
}

.ledger-list li.empty, .ticket-list li.empty { display: block; color: var(--faint); text-align: center; font-size: 12px; }
.ledger-list span, .ticket-list span { min-width: 0; }
.ledger-list strong, .ticket-list strong { display: block; color: #f0e4f4; font-size: 13px; }
.ledger-list small, .ticket-list small { display: block; margin-top: 2px; color: var(--faint); font-size: 11px; line-height: 1.4; }
.ledger-list b, .ticket-list b { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-list li.credit b { color: var(--mint); }
.ledger-list li.debit b { color: #ffc3d1; }
.ticket-list li.won { border-color: rgba(79, 247, 164, .45); }
#page-history .session-strip { margin-bottom: 12px; }

.account-card { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.account-card strong { display: block; font-size: 17px; }
.account-card small { color: var(--muted); font-size: 12px; }

.avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #2b0b25;
  background: linear-gradient(145deg, #ffe99a, #f2ae28);
  font-size: 20px;
  font-weight: 950;
}

#passwordForm { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(205, 88, 235, .2); }

@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Licence and help links (footer, launch screen, account page). */
.splash-licence { margin: 10px 0 0; color: rgba(246, 236, 255, .62); font-size: 10px; letter-spacing: .3px; text-align: center; }
.footer-links, .account-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.footer-links a, .account-links a, .licence-line a { color: #d9c4e2; }
.licence-line { margin: 0; color: #9d89a7; }
.licence-line strong { color: #d9c4e2; white-space: nowrap; }
.account-links { margin: 14px 0 6px; font-size: 13px; }

.break-card { margin-top: 16px; padding: 14px; border: 1px solid rgba(255, 200, 87, .22); border-radius: 14px; background: rgba(255, 255, 255, .03); }
.break-card h3 { margin: 0 0 6px; }
.break-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.break-options .ghost { flex: 1 1 auto; }
.break-options .ghost.confirm { border-color: var(--gold); color: var(--gold-bright); }
.break-card.on .break-options { display: none; }
@media (min-width: 900px) { footer .footer-links, footer .licence-line { grid-column: 1 / -1; text-align: center; } }

/* Levels: badge on the account button, account row, levels page, level-up celebration. */
.account-button { position: relative; overflow: visible; }
.account-badge { position: absolute; inset: -7px; width: calc(100% + 14px); height: calc(100% + 14px); object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .55)); }
.account-button:has(.account-badge:not([hidden])) { border-color: transparent; background: transparent; }
.account-button:has(.account-badge:not([hidden])) svg { visibility: hidden; }

.wallet-bonus { margin: -4px 0 10px; color: var(--gold-bright); font-size: 12px; text-align: center; }

.level-row { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 12px; padding: 10px 12px; border: 1px solid rgba(255, 200, 87, .3); border-radius: 14px; background: linear-gradient(135deg, rgba(142, 36, 170, .28), rgba(255, 200, 87, .08)); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.level-row img { flex: none; width: 52px; height: 52px; object-fit: contain; }
.level-row span { display: grid; flex: 1; }
.level-row small { color: var(--muted); font-size: 10px; letter-spacing: 1.2px; }
.level-row strong { color: var(--gold-bright); font-size: 17px; }
.level-row em { color: var(--muted); font-size: 12px; font-style: normal; }
.level-row b { color: var(--gold); font-size: 22px; }

.level-now { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.level-now img { flex: none; width: 112px; height: 112px; object-fit: contain; filter: drop-shadow(0 6px 18px rgba(142, 36, 170, .55)); }
.level-now small { display: block; color: var(--muted); font-size: 10px; letter-spacing: 1.4px; }
.level-now strong { display: block; color: var(--gold-bright); font-size: 26px; line-height: 1.1; }
.level-now span { color: #e9dbf0; font-size: 13px; }
.level-progress { height: 10px; margin: 4px 0 8px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.level-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-bright)); transition: width .6s ease; }
.bonus-box { display: grid; gap: 4px; margin: 14px 0; padding: 12px 14px; border: 1px dashed rgba(255, 200, 87, .45); border-radius: 14px; }
.bonus-box small { color: var(--muted); font-size: 10px; letter-spacing: 1.4px; }
.bonus-box strong { display: block; color: var(--gold-bright); font-size: 22px; }
.bonus-box p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.ladder { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.ladder li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; }
.ladder li img { flex: none; width: 48px; height: 48px; object-fit: contain; }
.ladder li span { display: grid; flex: 1; }
.ladder li strong { font-size: 15px; }
.ladder li small { color: var(--muted); font-size: 12px; }
.ladder li em { color: var(--gold-bright); font-size: 12px; font-style: normal; font-weight: 700; text-align: right; }
.ladder li.done { opacity: .62; }
.ladder li.current { border-color: var(--gold); background: rgba(255, 200, 87, .08); }

.levelup { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: rgba(8, 2, 14, .82); backdrop-filter: blur(6px); }
.levelup[hidden] { display: none; }
.levelup-card { display: grid; justify-items: center; gap: 6px; width: min(340px, 100%); padding: 22px 18px 18px; border: 1px solid rgba(255, 200, 87, .55); border-radius: 22px; background: radial-gradient(circle at 50% 30%, rgba(142, 36, 170, .55), #1c0b28 70%); text-align: center; animation: coach-pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.levelup-card small { color: var(--gold); font-size: 13px; font-weight: 900; letter-spacing: 3px; }
.levelup-card img { width: 200px; height: 200px; object-fit: contain; filter: drop-shadow(0 10px 28px rgba(255, 200, 87, .35)); }
.levelup-card strong { color: var(--gold-bright); font-size: 28px; }
.levelup-card p { margin: 0 0 8px; color: #efe2f5; font-size: 14px; line-height: 1.5; }
.levelup-card p b { color: var(--gold-bright); font-size: 18px; }
.levelup-card .primary { width: 100%; }


/* Own stake: replaces the stake chips while typing, same height. */
.stakes .stake-custom { font-size: 14px; letter-spacing: -.3px; }
.stake-editor { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px auto; gap: 5px; align-items: stretch; }
.stake-editor[hidden] { display: none; }
.stake-editor button { min-height: 38px; border: 1px solid rgba(205, 89, 233, .5); border-radius: 11px; color: #f8ecfc; background: linear-gradient(155deg, #3e174d, #281033); font: inherit; font-size: 18px; font-weight: 900; cursor: pointer; }
.stake-editor .stake-ok { padding: 0 14px; color: #1d091c; border-color: #fff0a6; background: linear-gradient(145deg, #ffeaa0, #f5b632 70%, #ce7111); font-size: 14px; }
.stake-editor label { display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--gold); border-radius: 11px; background: rgba(0, 0, 0, .3); }
.stake-editor label span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.stake-editor input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--gold-bright); font: inherit; font-size: 18px; font-weight: 900; outline: none; -moz-appearance: textfield; }
.stake-editor input::-webkit-outer-spin-button, .stake-editor input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }


/* 15× rounds: a tag by the round number and a glowing 15× column. */
.boost-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: linear-gradient(145deg, #fff27a, #ff4fd8); color: #2a0827; font-size: 10px; font-weight: 900; letter-spacing: .6px; animation: boost-pulse 1.2s ease-in-out infinite alternate; }
.boost-tag[hidden] { display: none; }
.column-power.mega { box-shadow: 0 0 0 1px #fff27a, 0 0 16px rgba(255, 242, 122, .55), 0 0 26px rgba(255, 79, 216, .35); animation: boost-pulse 1.2s ease-in-out infinite alternate; }
.column-power.mega em { color: #fff27a; text-shadow: 0 0 10px rgba(255, 242, 122, .8); }
@keyframes boost-pulse { from { filter: brightness(1); } to { filter: brightness(1.25); } }
@media (prefers-reduced-motion: reduce) { .boost-tag, .column-power.mega { animation: none; } }


/* Crossings: a number where two or more of your lines meet pays every line through it. */
.cell.cross { box-shadow: inset 0 0 0 2px rgba(255, 242, 122, .95), 0 0 16px rgba(255, 79, 216, .4); }
.cell.cross::after {
  content: attr(data-cross);
  position: absolute;
  top: 1px;
  right: 1px;
  padding: 0 2px;
  border-radius: 4px;
  background: rgba(42, 8, 39, .82);
  color: #fff27a;
  font-size: 6.5px;
  font-weight: 900;
  line-height: 9px;
  letter-spacing: 0;
}
.cell.hit.multi-hit {
  color: #1b0420;
  border-color: #fffbe0;
  outline-color: #fff27a;
  background: conic-gradient(from 210deg, #fff27a, #ff8de6, #8fe9ff, #7dffc0, #fff27a);
  box-shadow: 0 0 34px rgba(255, 242, 122, .9), 0 0 64px rgba(255, 79, 216, .55), inset 0 1px rgba(255, 255, 255, .9);
  animation: cross-hit .55s ease-in-out infinite alternate;
}
.cell.hit.multi-hit::after { content: attr(data-hits); color: #2a0827; right: 2px; bottom: 1px; font-size: 5.5px; letter-spacing: .2px; }
@keyframes cross-hit {
  from { filter: brightness(1) saturate(1); transform: scale(1); }
  to { filter: brightness(1.18) saturate(1.35); transform: scale(1.05); }
}
@media (prefers-reduced-motion: reduce) { .cell.hit.multi-hit { animation: none; } }


/* 4 lines: the card switches to the higher multiplier set. */
#letters.full-ticket .column-power em { color: #fff27a; text-shadow: 0 0 10px rgba(255, 242, 122, .7); }
.column-power .up-arrow { margin-left: 2px; color: #7dffc0; font-size: .55em; vertical-align: super; }
#letters.upgraded .column-power { animation: multiplier-up .7s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes multiplier-up {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); filter: brightness(1.5); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { #letters.upgraded .column-power { animation: none; } }


/* Your play: rounds and wins, then each recent bet with its multipliers and result. */
.session-panel .session-strip { grid-template-columns: repeat(2, 1fr); }
.recent-bets { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.recent-bets:empty { display: none; }
.recent-bets li, .ticket-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.recent-bets li { padding: 8px 10px; border: 1px solid rgba(214, 101, 239, .17); border-radius: 11px; background: rgba(10, 3, 17, .4); }
.recent-bets span { display: grid; min-width: 0; }
.recent-bets strong { font-size: 12px; color: #f7eafb; }
.recent-bets small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.recent-bets b, .ticket-list .bet-result { flex: none; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: .4px; }
.recent-bets .won b, .ticket-list .won .bet-result { color: #082117; background: linear-gradient(145deg, #d4ffe9, #55f7a7); }
.recent-bets .lost b, .ticket-list .lost .bet-result { color: #ffdce5; background: rgba(255, 83, 132, .18); }
.recent-bets .open b, .ticket-list .open .bet-result { color: var(--gold-bright); background: rgba(255, 200, 87, .14); }


/* Biggest wins today */
.win-card strong { color: #7dffc0; }
.win-card.top { border-color: rgba(255, 200, 87, .7); background: linear-gradient(145deg, rgba(255, 200, 87, .16), rgba(45, 14, 58, .7)); }
.win-card.top strong { color: var(--gold-bright); }
