:root {
  --bg0: #12081f;
  --bg1: #241041;
  --bg2: #3a1a63;
  --gold: #e8c15a;
  --gold-2: #fff0b8;
  --royal: #6d28d9;
  --royal-2: #a855f7;
  --panel: #0e0a16;
  --muted: #a89bc0;
  --win: #34d399;
  --lose: #e11d48;
  --card-face: #f6f3ec;
  --card-ink: #14121a;

  /* Asset seam: app.js overwrites these at boot from its ASSETS map, so
     dropping raster art into /assets/ needs no CSS edits. Each one is a
     background layer, so a missing file simply falls back to the gradient
     underneath instead of showing a broken image. */
  --asset-card-back: url("/assets/card-back.jpg");
  --asset-crown: url("/assets/crown.png");
  --asset-royal-texture: url("/assets/royal-texture.jpg");
  --asset-win-burst: url("/assets/win-burst.jpg");
  --asset-bust-overlay: url("/assets/bust-overlay.jpg");
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: #f3effa;
  background-color: var(--bg0);
  background-image:
    radial-gradient(circle at 50% -10%, rgba(109, 40, 217, 0.55), transparent 55%),
    linear-gradient(160deg, rgba(18, 8, 31, 0.72), rgba(58, 26, 99, 0.62)),
    var(--asset-royal-texture);
  background-size: auto, auto, 320px 320px;
  background-repeat: no-repeat, no-repeat, repeat;
  background-attachment: scroll;
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1080px, 96vw);
  margin: 1rem auto;
  padding: 1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(109, 40, 217, 0.14), rgba(0, 0, 0, 0.36));
  border: 1px solid rgba(232, 193, 90, 0.22);
}

/* ---- topbar ---- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.3rem 0 0.6rem;
  flex-wrap: wrap;
}

.logo-wrap { position: relative; display: flex; align-items: center; gap: 0.6rem; }

.crown-mark {
  display: inline-block;
  width: 44px;
  height: 36px;
  background: var(--asset-crown) center/contain no-repeat;
  filter: drop-shadow(0 2px 8px rgba(232, 193, 90, 0.55));
}

.crown-mark.big { width: 96px; height: 78px; }

h1 {
  margin: 0;
  font-size: clamp(1.3rem, 3.6vw, 2.1rem);
  color: var(--gold);
  letter-spacing: 0.12em;
  text-shadow: 0 2px 0 #33124f, 0 0 18px rgba(232, 193, 90, 0.35);
}

h2 { margin: 0 0 0.5rem; color: var(--gold-2); font-size: 1rem; }

.topbar-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.pill {
  border: 1px solid rgba(232, 193, 90, 0.35);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  background: rgba(0, 0, 0, 0.34);
  font-weight: 700;
}

.mode-pill { color: var(--royal-2); font-size: 0.78rem; letter-spacing: 0.1em; }
.balance-pill { color: var(--gold-2); }

.demo-toggle { display: flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.82rem; }
.demo-toggle input { accent-color: var(--royal-2); width: 1.05rem; height: 1.05rem; }

.sprinkle-zone { position: absolute; inset: -50% -30%; pointer-events: none; overflow: visible; }

.sprinkle-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 22px;
  margin: -11px 0 0 -13px;
  background: var(--asset-crown) center/contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(232, 193, 90, 0.95));
  animation: sprinkle-fly 900ms ease-out forwards;
}

@keyframes sprinkle-fly {
  0% { transform: translate(0, 0) scale(0.3) rotate(0deg); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* ---- stage ---- */

.stage { margin-top: 0.4rem; }

.card-table {
  position: relative;
  border-radius: 18px;
  /* Headroom tracks the multiplier's own clamp so the overlay never covers the slot labels. */
  padding: calc(clamp(2.7rem, 10vw, 4.6rem) + 2.4rem) 1.1rem 1.1rem;
  border: 2px solid rgba(232, 193, 90, 0.45);
  background:
    radial-gradient(circle at 50% 20%, rgba(168, 85, 247, 0.22), transparent 62%),
    linear-gradient(180deg, #2c1550, #170a29);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55), 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* Floats over the felt so a multiplier growing to five digits never nudges the cards. */
.stage-mult {
  position: absolute;
  top: 0.7rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  z-index: 6;
}

.table-felt {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(1rem, 6vw, 3.5rem);
}

.card-slot { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }

.slot-label { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.18em; }

.playing-card { width: clamp(110px, 22vw, 150px); aspect-ratio: 5 / 7; perspective: 900px; }

/* Lifts the card off the felt mid-flip so it reads as a physical object. */
.playing-card.lift { animation: card-lift 560ms ease; }

@keyframes card-lift {
  0% { transform: translateY(0) scale(1); filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5)); }
  45% { transform: translateY(-16px) scale(1.07); filter: drop-shadow(0 28px 26px rgba(0, 0, 0, 0.7)); }
  100% { transform: translateY(0) scale(1); filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5)); }
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.card-inner.flipped { transform: rotateY(180deg); }

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
}

.card-back {
  background:
    var(--asset-card-back) center/cover no-repeat,
    repeating-linear-gradient(45deg, #3a1a63, #3a1a63 10px, #241041 10px, #241041 20px);
  border: 2px solid var(--gold);
}

.card-front {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #ffffff, var(--card-face));
  border: 2px solid var(--gold);
  color: var(--card-ink);
  display: grid;
  place-items: center;
  position: absolute;
}

.card-front.red { color: var(--lose); }

.card-front .pip { font-size: clamp(2.4rem, 8vw, 3.6rem); line-height: 1; }

.card-front .corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-style: normal;
  font-weight: 800;
  font-size: clamp(0.85rem, 2.4vw, 1.05rem);
}

.card-front .corner em { font-style: normal; }
.card-front .corner.tl { top: 7px; left: 9px; }
.card-front .corner.br { bottom: 7px; right: 9px; transform: rotate(180deg); }

.burn-pile {
  position: absolute;
  left: 0.9rem;
  bottom: 0.7rem;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  max-width: 45%;
}

.burn-chip {
  border: 1px solid rgba(232, 193, 90, 0.35);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.4);
}

.royal-burst {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 0.4rem;
  align-content: center;
  background: rgba(18, 8, 31, 0.62);
  border-radius: 18px;
  color: var(--gold-2);
  font-weight: 800;
  letter-spacing: 0.1em;
  animation: royal-pop 900ms ease-out forwards;
  pointer-events: none;
  isolation: isolate;
}

/* The generated burst art is a JPEG with no alpha, so screen blending drops
   its near-black background instead of pasting a rectangle over the table. */
.royal-burst::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--asset-win-burst) center/cover no-repeat;
  mix-blend-mode: screen;
  opacity: 0.85;
  border-radius: 18px;
  z-index: -1;
}

.royal-burst > * { position: relative; }

.royal-burst[hidden] { display: none; }

@keyframes royal-pop {
  0% { transform: scale(0.6); opacity: 0; }
  25% { transform: scale(1.05); opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

.card-table.flash-bust { animation: flash-bust 520ms ease-in-out 2; }
.card-table.flash-push { animation: flash-push 520ms ease-in-out 1; }

/* Same no-alpha trick as the royal burst: screen blend the crack overlay. */
.card-table.flash-bust::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--asset-bust-overlay) center/cover no-repeat;
  mix-blend-mode: screen;
  border-radius: 18px;
  pointer-events: none;
  animation: bust-overlay-fade 900ms ease-out forwards;
}

@keyframes bust-overlay-fade {
  0% { opacity: 0; transform: scale(1.15); }
  20% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; }
}

@keyframes flash-bust {
  0%, 100% { box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55); transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { box-shadow: inset 0 0 60px rgba(225, 29, 72, 0.6), 0 0 30px rgba(225, 29, 72, 0.5); }
  75% { transform: translateX(6px); }
}

@keyframes flash-push {
  0%, 100% { box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55); }
  50% { box-shadow: inset 0 0 60px rgba(168, 85, 247, 0.45); }
}

/* ---- HUD ---- */

.hud {
  margin-top: 0.45rem;
  padding: 0.3rem 0.6rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(232, 193, 90, 0.22);
}

.hud-label { display: block; color: var(--muted); font-size: 0.62rem; letter-spacing: 0.14em; }

.hud-mult {
  display: block;
  font-size: clamp(2.7rem, 10vw, 4.6rem);
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 26px rgba(232, 193, 90, 0.55), 0 2px 0 rgba(0, 0, 0, 0.4);
  line-height: 1;
  letter-spacing: -0.01em;
}

.hud-mult.pulse-win { animation: mult-pulse 620ms ease-out; }

@keyframes mult-pulse {
  0% { transform: scale(1) translateY(0); color: var(--gold); }
  40% { transform: scale(1.16) translateY(-6px); color: var(--win); }
  100% { transform: scale(1) translateY(0); color: var(--gold); }
}

.hud-side { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; align-items: center; }
.hud-side strong { display: block; margin-top: 0.05rem; color: var(--gold-2); font-size: 0.86rem; }

.royal-meter { display: flex; gap: 0.28rem; margin-top: 0.35rem; }

/* ---- royal ladder progress ---- */

.ladder {
  padding: 0.6rem 0.8rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(232, 193, 90, 0.22);
}

.ladder-head { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.45rem; }
.ladder-note { color: var(--muted); font-size: 0.74rem; margin-left: auto; text-align: right; }

.ladder-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.ladder-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--royal-2), var(--gold));
  transition: width 420ms ease;
}

.ladder-marks { position: absolute; inset: 0; pointer-events: none; }

.ladder-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.45);
}

.ladder-mark.hit { background: var(--gold-2); box-shadow: 0 0 8px 2px rgba(232, 193, 90, 0.7); }

/* ---- auto collect ---- */

.control-row.auto {
  grid-template-columns: auto 92px 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
}

.auto-toggle { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.control-row.auto input[type="number"] {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 0.4rem;
  color: #f1f1f1;
  background: #2a1a3f;
}
.auto-hint { color: var(--muted); font-size: 0.74rem; }

/* ---- opening odds rail ---- */

.royal-pip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(232, 193, 90, 0.5);
  background: rgba(255, 255, 255, 0.07);
}

.royal-pip.tier { border-color: var(--royal-2); box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25); }
.royal-pip.lit { background: var(--gold); box-shadow: 0 0 8px rgba(232, 193, 90, 0.8); }

/* ---- controls ---- */

.controls {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.control-row { display: grid; gap: 0.5rem; align-items: stretch; }
.control-row.guesses { grid-template-columns: 1fr 1fr; }

/* ---- chicken-cross style control bar ---- */

.control-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(232, 193, 90, 0.22);
}

.bet-group { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }

.bet-pill {
  display: flex;
  align-items: center;
  background: #2a1a3f;
  border-radius: 999px;
  padding: 4px 6px;
}

.bet-step {
  flex: 0 0 auto;
  padding: 0.4rem 0.7rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: transparent;
  border-radius: 999px;
  min-width: 0;
}

.bet-step:not(:disabled):hover { color: var(--gold-2); }

#bet {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--gold-2);
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  outline: none;
  font-family: inherit;
}

#bet:disabled { opacity: 0.45; }

.quick-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; }

.quick-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: #2a1a3f;
  border-radius: 10px;
  padding: 0.38rem 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #f3effa;
  min-width: 0;
}

.quick-chip:not(:disabled):hover { background: #3a2456; }

.chip-coin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 60%, #8a6b1c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.action-group { display: flex; gap: 0.5rem; align-items: stretch; }

/* 46px keeps the primary action above the ~44px minimum tap target while
   giving back ~16px of vertical space on a phone. */
.action-group .primary,
.action-group .collect {
  min-width: 150px;
  height: 46px;
  border-radius: 12px;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.action-group .collect {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.action-group .collect[hidden],
.action-group .primary[hidden] { display: none; }

.collect .collect-amount { font-size: 1.2rem; line-height: 1; }
.collect .collect-caption { font-size: 0.9rem; font-weight: 700; opacity: 0.9; line-height: 1; }

button {
  border: 0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  color: #fff;
}

button:disabled { opacity: 0.45; cursor: not-allowed; }

.guess {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(232, 193, 90, 0.4);
  background: linear-gradient(180deg, rgba(109, 40, 217, 0.85), rgba(58, 26, 99, 0.9));
}

.guess .guess-title { font-size: 0.88rem; }
.guess .guess-caption { font-size: 0.66rem; font-weight: 600; color: var(--gold-2); opacity: 0.9; }
.guess.higher { border-color: rgba(52, 211, 153, 0.45); }
.guess.lower { border-color: rgba(225, 29, 72, 0.45); }
.guess.unavailable { filter: grayscale(0.7); }
.guess:not(:disabled):hover { box-shadow: 0 0 16px rgba(168, 85, 247, 0.5); }

.control-block { background: rgba(0, 0, 0, 0.36); border-radius: 10px; padding: 0.4rem 0.55rem; }
.control-block label { display: block; color: var(--muted); font-size: 0.74rem; }
.control-block select {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 0.45rem;
  color: #f1f1f1;
  background: #2a1a3f;
}

.primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #3b2606;
  min-width: 130px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.collect { background: linear-gradient(180deg, #2e7d32, #1b5e20); min-width: 130px; }

/* :not([hidden]) is required — a bare `display` here would beat the UA sheet's
   [hidden]{display:none} on specificity and leave the button laid out. */
.collect:not([hidden]) { display: flex; flex-direction: column; gap: 0.1rem; align-items: center; }
.collect .collect-amount { font-size: 0.95rem; font-weight: 800; letter-spacing: 0.02em; }
.collect .collect-caption { font-size: 0.72rem; font-weight: 600; opacity: 0.85; }
.collect:not(:disabled) { box-shadow: 0 0 14px rgba(52, 211, 153, 0.35); }

/* ---- coach tip ---- */

.coach-tip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(232, 193, 90, 0.35);
  background: rgba(109, 40, 217, 0.22);
  color: var(--gold-2);
  font-size: 0.84rem;
}

.coach-tip .coach-icon { font-size: 1rem; color: var(--gold); }
.coach-tip.hot { border-color: rgba(52, 211, 153, 0.55); background: rgba(46, 125, 50, 0.24); color: #d7ffe9; }
.coach-tip.warn { border-color: rgba(225, 29, 72, 0.5); background: rgba(120, 20, 40, 0.28); color: #ffd9e0; }

.coach-dismiss {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: inherit;
  opacity: 0.6;
  font-size: 1rem;
  padding: 0 0.25rem;
  min-width: 0;
  cursor: pointer;
}

.coach-dismiss:hover { opacity: 1; }

/* ---- history ---- */

.history-wrap { margin-top: 0.8rem; }
.history-strip { display: flex; gap: 0.35rem; overflow-x: auto; padding: 0.4rem 0; }
.history-empty { color: var(--muted); font-size: 0.82rem; }

.history-chip {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.history-chip.win { background: rgba(232, 193, 90, 0.18); border-color: var(--gold); color: var(--gold-2); }
.history-chip.bust { background: rgba(225, 29, 72, 0.18); border-color: var(--lose); color: #ffc9d4; }

/* ---- results / panels ---- */

.results {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.results div {
  background: linear-gradient(180deg, rgba(58, 26, 99, 0.6), rgba(0, 0, 0, 0.5));
  border: 1px solid rgba(232, 193, 90, 0.28);
  border-radius: 10px;
  padding: 0.55rem;
}

.results span { display: block; color: var(--muted); font-size: 0.74rem; }
.results strong { display: block; margin-top: 0.25rem; font-size: 0.92rem; color: var(--gold-2); overflow-wrap: anywhere; }

.verify-link {
  display: block;
  margin: 0.7rem auto 0;
  background: none;
  border: 1px solid rgba(232, 193, 90, 0.4);
  color: var(--gold-2);
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  border-radius: 8px;
}

.panels {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
}

.panel {
  background: var(--panel);
  border-radius: 12px;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.panel table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.panel th, .panel td { text-align: left; padding: 0.25rem 0.4rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.panel th { color: var(--muted); font-weight: 600; }
.panel ul { margin: 0; padding-left: 1.1rem; color: #e9e3f5; }
.panel ul li { margin: 0.2rem 0; }

/* ---- toast / modal ---- */

.toast {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(46, 16, 78, 0.96);
  color: #fff6e0;
  border: 1px solid rgba(232, 193, 90, 0.45);
  border-radius: 10px;
  padding: 0.6rem 1.1rem;
  z-index: 60;
  max-width: 90vw;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 4, 16, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
  overflow: auto;
}

.modal-overlay[hidden] { display: none; }

.modal-card {
  margin: auto;
  background: linear-gradient(180deg, #2a1546, #170b28);
  border: 3px solid var(--gold);
  border-radius: 16px;
  padding: 1.3rem 1.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(168, 85, 247, 0.3);
}

.modal-card h2 { margin-bottom: 0.4rem; }
.modal-card p { margin: 0.2rem 0 0.6rem; color: var(--muted); }

.verify-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.7rem;
  text-align: left;
  margin: 0 0 0.9rem;
  font-size: 0.8rem;
}

.verify-details dt { color: var(--muted); }
.verify-details dd { margin: 0; color: var(--gold-2); overflow-wrap: anywhere; }

/* ---- ambience ---- */

.sparks { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }

.sparks span {
  position: absolute;
  bottom: -20px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-2), var(--royal-2) 70%, transparent);
  box-shadow: 0 0 6px 2px rgba(168, 85, 247, 0.55);
  animation: spark-rise linear infinite;
  opacity: 0;
}

.sparks span:nth-child(1) { left: 6%; animation-duration: 11s; animation-delay: 0s; }
.sparks span:nth-child(2) { left: 18%; animation-duration: 13s; animation-delay: 1.5s; }
.sparks span:nth-child(3) { left: 31%; animation-duration: 9s; animation-delay: 3s; }
.sparks span:nth-child(4) { left: 46%; animation-duration: 12s; animation-delay: 0.8s; }
.sparks span:nth-child(5) { left: 60%; animation-duration: 10s; animation-delay: 2.4s; }
.sparks span:nth-child(6) { left: 73%; animation-duration: 14s; animation-delay: 4s; }
.sparks span:nth-child(7) { left: 86%; animation-duration: 10.5s; animation-delay: 1s; }
.sparks span:nth-child(8) { left: 94%; animation-duration: 12.5s; animation-delay: 3.6s; }

@keyframes spark-rise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  8% { opacity: 0.85; }
  100% { transform: translateY(-100vh) translateX(20px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sparks { display: none; }
  .sprinkle-icon { display: none; animation: none; }
  .card-inner { transition: none; }
  /* The bust effect is deliberately exempt: it is the round's key feedback. */
  .hud-mult.pulse-win, .royal-burst { animation: none; }
  .playing-card.lift { animation: none; }
}

@media (max-width: 900px) {
  .results, .panels { grid-template-columns: 1fr 1fr; }
  .table-felt { gap: 1rem; }
  .control-bar { grid-template-columns: 1fr; padding: 0.7rem; }
  .action-group .primary,
  .action-group .collect { width: 100%; min-width: 0; }
}

@media (max-width: 560px) {
  .results, .panels { grid-template-columns: 1fr; }
  .hud-side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .control-row.auto { grid-template-columns: auto 80px; }
  .control-row.auto .auto-hint { grid-column: 1 / -1; }
}

/* Always-visible language toggle, matching the lobby's selector. */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 92, 0.45);
  background: rgba(0, 0, 0, 0.4);
  color: #e9d9a8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.lang-toggle svg { width: 12px; height: 12px; fill: currentColor; }
.lang-toggle:hover { filter: brightness(1.2); }
.lang-toggle:active { transform: scale(0.96); }

/* Covers the table until the card art is decoded, so the felt and cards can
   never render bare while their images are still downloading. */
.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050b1e;
  transition: opacity 0.35s ease;
}
.boot-loader.is-done { opacity: 0; pointer-events: none; }
.boot-inner { width: min(280px, 70vw); text-align: center; }
.boot-title {
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 15px;
  color: #e9d9a8;
  margin-bottom: 14px;
}
.boot-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.boot-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8a6d24, #e9d9a8);
  transition: width 0.2s ease;
}
.boot-pct { margin-top: 8px; font-size: 12px; color: rgba(233, 217, 168, 0.6); }
