/* HOT ONE — game-specific styling.
   Visual language: deep blue + elegant gold accents, mirroring 3DICE /
   FAUDA / 7X3. No bright casino reds/yellows, no neon, no cartoon.
   Layout: body is a flex column, board-wrap flex-grows to fill the
   middle, header + actions footer are fixed-height chrome.
   The board is a 2-column × 3-row grid of dice-face cells. The result
   panel sits above the heat strip and dominates the upper play area
   (per spec). */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }

:root {
  --bg:           #0a1530;
  --bg-elev-1:   #0f1d3f;
  --bg-elev-2:   #14264f;
  --bg-row:       #122142;
  --border:       #1d3260;
  --border-hot:   #f0c252;
  --border-warm:  #5b8db8;
  --text:         #e4ecff;
  --text-muted:   #8aa2c8;
  --gold-lt:      #ffd882;
  --gold:         #f0c252;
  --gold-deep:    #8a5a13;
  --teal:         #5ed4d4;
  --cyan:         #5fb7ff;
  --cyan-soft:    #8fcdff;
  --gold-glow:    #ffe39a;
  --cream:        #fff5d8;
  --txt-dim:      rgba(234, 242, 255, 0.62);
  /* Heat — five intensity stops used for the flame stack tinting. */
  --heat-0:       rgba(255, 245, 216, 0.10);
  --heat-1:       rgba(255, 178, 74, 0.60);
  --heat-2:       rgba(255, 213, 79, 0.78);
  --heat-3:       rgba(255, 121, 38, 0.85);
  --heat-4:       rgba(255, 60, 30, 0.95);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Desktop diamond pattern — same recipe as 3DICE / FAUDA. */
@media (min-width: 768px) {
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M16 13L19 16L16 19L13 16Z' fill='%235fb7ff' fill-opacity='0.05'/%3E%3C/svg%3E");
    background-repeat: repeat;
  }
}

/* ───────────────────────────────────────────────────────────────────
   Play area: vertical flex column inside .board-wrap.
   Stack order (top → bottom):
     result-panel  (single-line, compact — preserves the last roll)
     board         (vertical column of 6 betting rows — one per number)
*/
.board-wrap {
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  position: relative;
}

/* Result panel — single-line strip. Three Unicode dice glyphs at the
   left, outcome message immediately after. Compact: ~46 px tall on
   mobile; the panel preserves the last roll after the 3D dice replay
   hides, but no longer dominates the screen visually.
*/
.result-panel {
  flex: 0 0 auto;
  width: 100%;
  max-width: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  background:
    radial-gradient(ellipse 100% 100% at 50% 0%, rgba(255, 227, 154, 0.18) 0%, transparent 70%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.55) 0%, rgba(5, 13, 36, 0.85) 100%);
  border: 1px solid rgba(240, 194, 82, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 216, 0.18),
    inset 0 -1px 2px rgba(0, 0, 0, 0.45),
    0 4px 12px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}
.result-dice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
/* Result die — a MINIATURE of the on-board dice-face. Same plastic
   ivory body + dark CSS-positioned pips, just sized down to ~22px so
   three of them fit in the single-line result strip alongside the
   outcome message. Replaces the prior Unicode-glyph rendering. */
.result-dice .result-die.dice-face {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: linear-gradient(180deg, var(--cream) 0%, #f7e8c8 60%, #ecd9b0 100%);
  border: 1px solid rgba(138, 90, 19, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 2px rgba(138, 90, 19, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.35);
  position: relative;
  flex: 0 0 auto;
}
.result-dice .result-die.dice-face.hit {
  background: linear-gradient(180deg, var(--cream) 0%, var(--gold-lt) 55%, var(--gold) 100%);
  border-color: var(--gold-deep);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -1px 2px rgba(138, 90, 19, 0.40),
    0 0 8px rgba(255, 213, 79, 0.55);
}
/* Pips inside the mini die — slightly bigger than the on-board dice
   ratio so they remain visible at the 22-px scale. The base .pip rule
   uses 16% which yields ~3.5 px at this size; 22% gives ~4.8 px which
   reads cleanly. */
.result-dice .result-die.dice-face .pip {
  width: 22%;
  height: 22%;
}
/* Pip position overrides — scoped to the result die so the on-board
   dice are unchanged. The base position constants (17%/42%) were
   tuned for the on-board 16% pip; at the result die's 22% pip those
   constants pack the middle and bottom rows so they overlap (e.g.
   the 6-face mid pip from 42–64% collides with the bottom pip at
   61–83%) and put the centre pip at 53% rather than true 50%. The
   12% / 39% / 12% grid below gives 22% pips a symmetric three-row
   layout: ~5% gap between every row, true centre for face 1/3/5. */
.result-dice .result-die.dice-face .pip-tl { top:    12%; left:   12%;          bottom: auto;  right:  auto; }
.result-dice .result-die.dice-face .pip-tr { top:    12%; right:  12%;          bottom: auto;  left:   auto; }
.result-dice .result-die.dice-face .pip-ml { top:    39%; left:   12%;          bottom: auto;  right:  auto; }
.result-dice .result-die.dice-face .pip-mr { top:    39%; right:  12%;          bottom: auto;  left:   auto; }
.result-dice .result-die.dice-face .pip-bl { bottom: 12%; left:   12%;          top:    auto;  right:  auto; }
.result-dice .result-die.dice-face .pip-br { bottom: 12%; right:  12%;          top:    auto;  left:   auto; }
.result-dice .result-die.dice-face .pip-c  { top:    39%; left:   39%;          bottom: auto;  right:  auto; }
@media (min-width: 480px) {
  .result-dice .result-die.dice-face { width: 26px; height: 26px; border-radius: 6px; }
}
.result-message {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}
.result-message.no-hit  { color: var(--text-muted); }
.result-message.win     { color: var(--gold-glow); text-shadow: 0 0 8px rgba(255, 213, 79, 0.45); }
.result-message.win.triple {
  background: linear-gradient(180deg, var(--cream) 0%, var(--gold-lt) 55%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(255, 227, 154, 0.65));
  text-shadow: none;
}
.result-panel:empty::before { content: '\2014'; color: var(--text-muted); opacity: 0.5; font-size: 18px; }

/* ───────────────────────────────────────────────────────────────────
   Heat indicator — lives INSIDE each .cell at the top, above the
   dice face. The .heat-col[data-heat-for="N"] container holds a
   horizontal row of up to 8 mini flames. Putting heat in the cell
   means the player can't mistake which number a flame stack belongs
   to — the heat for "Lucky 3" is literally above the dice-3 face.

   Double-hit / triple-hit gold capsules are drawn around the
   .heat-flames via :before — round.js sets the data-double or
   data-triple attribute on the column for a fixed duration.
*/
.heat-col {
  flex: 1 1 auto;                   /* take all the row width to the right of dice */
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  padding-left: 8px;
}
.heat-flames {
  display: flex;
  flex-direction: row;
  align-items: flex-end;            /* flames "rooted" at the bottom of the strip */
  justify-content: flex-start;      /* fill left → right */
  gap: 6px;
  height: 100%;
  width: 100%;
  position: relative;
  /* hot10: width-bounded sliding strip. New activity is prepended on
     the LEFT by heat.js so existing flames are pushed RIGHT; once the
     row's natural width exceeds the container, the rightmost flames
     overflow and are softly faded into the right border (mirroring
     FAUDA's .results-history mask). No scrollbar, no hard cut. */
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, black 0%, black 80%, transparent 100%);
          mask-image: linear-gradient(to right, black 0%, black 80%, transparent 100%);
}
/* Flame is an SVG teardrop with a warm radial-gradient outer body + a
   bright cream-yellow inner core, embedded as a data URL background.
   Much larger and more "flame-shaped" than the small candle-blob CSS
   shape used in v4 — significantly stronger visual weight per spec.
   Drop-shadow glow + a stronger flicker animation read as real fire. */
.heat-flame {
  width: 28px;
  height: 36px;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 130'><defs><radialGradient id='o' cx='50%25' cy='75%25' r='55%25'><stop offset='0%25' stop-color='%23ffe082'/><stop offset='35%25' stop-color='%23ff8a3d'/><stop offset='80%25' stop-color='%23e02a14'/><stop offset='100%25' stop-color='%237a0000'/></radialGradient><radialGradient id='i' cx='50%25' cy='80%25' r='32%25'><stop offset='0%25' stop-color='%23fffaf0' stop-opacity='1'/><stop offset='60%25' stop-color='%23ffd54f' stop-opacity='0.85'/><stop offset='100%25' stop-color='%23ffd54f' stop-opacity='0'/></radialGradient></defs><path d='M50,8 C36,30 18,52 18,82 C18,107 32,123 50,123 C68,123 82,107 82,82 C82,52 64,30 50,8 Z' fill='url(%23o)'/><path d='M50,52 C42,62 36,72 36,88 C36,106 42,116 50,116 C58,116 64,106 64,88 C64,72 58,62 50,52 Z' fill='url(%23i)'/></svg>") no-repeat center / contain;
  filter: drop-shadow(0 0 8px rgba(255, 121, 38, 0.75));
  opacity: 0.95;
  transform-origin: 50% 100%;
  animation: heatFlicker 1.6s ease-in-out infinite;
  flex: 0 0 auto;
}
/* Stagger the flicker so adjacent flames don't pulse in lockstep. */
.heat-flame:nth-child(2n) { animation-delay: 0.20s; }
.heat-flame:nth-child(3n) { animation-delay: 0.45s; }
@media (min-width: 480px) {
  .heat-flame { width: 32px; height: 42px; }
  .heat-col   { height: 50px; }
  .heat-flames { gap: 8px; }
}
.heat-flame:nth-child(2n) { animation-delay: 0.20s; }
.heat-flame:nth-child(3n) { animation-delay: 0.45s; }
@keyframes heatFlicker {
  0%, 100% { transform: scaleY(1.00) translateY(0);    filter: brightness(1.00) drop-shadow(0 0 8px  rgba(255, 121, 38, 0.65)); }
  35%      { transform: scaleY(1.06) translateY(-1px); filter: brightness(1.10) drop-shadow(0 0 10px rgba(255, 121, 38, 0.75)); }
  65%      { transform: scaleY(0.96) translateY(0);    filter: brightness(0.92) drop-shadow(0 0 7px  rgba(255, 121, 38, 0.55)); }
}

/* Premium gold capsule on double-hit; even stronger version on
   triple-hit. round.js sets data-double=1 or data-triple=1 on the
   column for ~1.6s after settle. The CSS combines THREE distinct
   effects to make the moment unmissable per review feedback:
     (1) a one-shot column pulse — the whole row briefly punches
         outward when the attribute lands;
     (2) a one-shot capsule "burst-in" — the gold rim expands from
         a compressed shape with a hot multi-layer glow, then
         settles to a steady held state;
     (3) newly-added flames get the .fresh class (set by heat.js)
         which runs a separate "burst-in" so the new heat bumps
         pop on screen brighter than the pre-existing flames.
   All compositor-only (transform + filter + opacity) — no reflow. */
.heat-col[data-double="1"] {
  animation: heatHitColumnPulse 720ms cubic-bezier(0.34, 1.56, 0.64, 1) 1;
  will-change: transform, filter;
}
.heat-col[data-triple="1"] {
  animation: heatHitColumnPulseTriple 1100ms cubic-bezier(0.34, 1.56, 0.64, 1) 1;
  will-change: transform, filter;
}

/* Multi-hit capsule — wraps the GROUP of newly-added flames when a
   roll lands 2 or 3 hits on the lucky number. heat.js creates a
   <span class="fresh-burst" data-count="N"> around the new flames
   and keeps it for life — the wrapper PERSISTS around its flames,
   never flattened. Single-hit gains (delta=1) get no wrapper and no
   capsule.

   Lifetime model:
     - Entry "burst-in" plays ONCE on creation (animation-iteration-
       count: 1; animation-fill-mode: forwards). The 100 % keyframe
       is the calm steady state — when the animation completes the
       element holds that state, so the wrapper never re-animates on
       subsequent renders even though its bright peak briefly looked
       like a flash.
     - Calm steady state is tuned smaller than the entry peak so
       SEVERAL persistent capsules on the same strip stay readable
       and don't overwhelm: double gets a thin gold rim with a
       single modest halo; triple gets a slightly thicker gold rim
       with a two-layer halo.
     - The wrapper rides with its flame group through the strip's
       existing advancement (currently: append-right; existing
       wrappers stay at their DOM positions) and disappears only
       when the last flame inside it is removed by decay or reset
       (handled in heat.js removeLastFlame).
     - data-count is the count AT BIRTH and is never mutated — the
       capsule visually identifies the original hit moment.

   Palette uses the existing heat / gold tokens — no new colours.
   Compositor-only animation (transform + opacity + box-shadow). */
.fresh-burst {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;                         /* match .heat-flames gap → strip looks continuous */
  flex: 0 0 auto;                   /* keep natural width so capsule overflows rather than compresses */
}
.fresh-burst[data-count="2"] {
  padding: 2px 6px;
  margin: 0 -1px;
  border-radius: 999px;
  /* Calm steady state — held after the entry animation completes.
     Modest single-layer halo so multiple capsules coexist without
     visual overload. */
  border: 1.5px solid rgba(255, 213, 79, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 216, 0.32),
    0 0 7px rgba(255, 213, 79, 0.45);
  animation: heatBurstCapsuleInDouble 800ms ease-out 1 forwards;
  will-change: transform, opacity, box-shadow;
}
.fresh-burst[data-count="3"] {
  padding: 2px 6px;
  margin: 0 -1px;
  border-radius: 999px;
  /* Calm steady state for triple — slightly stronger than double
     so the rarer event keeps a distinct visual identity, but still
     tuned so 2-3 of them on one strip don't blow out. */
  border: 2px solid rgba(255, 213, 79, 0.85);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 216, 0.45),
    0 0 10px rgba(255, 213, 79, 0.62),
    0 0 18px rgba(255, 178, 74, 0.32);
  animation: heatBurstCapsuleInTriple 1100ms ease-out 1 forwards;
  will-change: transform, opacity, box-shadow;
}
/* Entry burst — peaks bright + scales over, then settles at the
   calm steady state (100 % keyframe matches the rule's calm so the
   transition from animation-end to held state is seamless). With
   animation-fill-mode: forwards, the element holds the 100 % state. */
@keyframes heatBurstCapsuleInDouble {
  0%   { opacity: 0; transform: scaleX(0.42);
         box-shadow: 0 0 0 rgba(255, 213, 79, 0); }
  30%  { opacity: 1; transform: scaleX(1.10);
         box-shadow:
           inset 0 1px 0 rgba(255, 245, 216, 0.72),
           0 0 20px rgba(255, 213, 79, 0.95),
           0 0 40px rgba(255, 178, 74, 0.78); }
  60%  { transform: scaleX(0.97); }
  100% { opacity: 1; transform: scaleX(1.00);
         box-shadow:
           inset 0 1px 0 rgba(255, 245, 216, 0.32),
           0 0 7px rgba(255, 213, 79, 0.45); }
}
@keyframes heatBurstCapsuleInTriple {
  0%   { opacity: 0; transform: scale(0.40);
         box-shadow: 0 0 0 rgba(255, 213, 79, 0); }
  25%  { opacity: 1; transform: scale(1.18);
         box-shadow:
           inset 0 1px 0 rgba(255, 245, 216, 0.95),
           0 0 28px rgba(255, 213, 79, 1.00),
           0 0 56px rgba(255, 178, 74, 0.90),
           0 0 88px rgba(255, 121, 38, 0.55); }
  55%  { transform: scale(0.95); }
  80%  { transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1.00);
         box-shadow:
           inset 0 1px 0 rgba(255, 245, 216, 0.45),
           0 0 10px rgba(255, 213, 79, 0.62),
           0 0 18px rgba(255, 178, 74, 0.32); }
}

@keyframes heatHitColumnPulse {
  0%   { transform: scale(1.00); filter: brightness(1.00); }
  35%  { transform: scale(1.10); filter: brightness(1.20); }
  100% { transform: scale(1.00); filter: brightness(1.00); }
}
@keyframes heatHitColumnPulseTriple {
  0%   { transform: scale(1.00); filter: brightness(1.00); }
  25%  { transform: scale(1.16); filter: brightness(1.30); }
  55%  { transform: scale(0.97); filter: brightness(1.08); }
  100% { transform: scale(1.00); filter: brightness(1.00); }
}
/* FRESH flame — flames added on the CURRENT settle get the .fresh
   class for ~1500ms (heat.js sets + auto-clears it). Runs a burst-in
   that overshoots and settles — so a double-hit's two NEW flames
   pop on screen noticeably brighter than the pre-existing ones, then
   blend back into the regular flicker. */
.heat-flame.fresh {
  animation:
    heatFreshBurst 1.2s cubic-bezier(0.25, 1.6, 0.4, 1) 1,
    heatFlicker    1.6s ease-in-out infinite 1.2s;
}
@keyframes heatFreshBurst {
  0%   { transform: scale(0)    translateY(10px); filter: brightness(2.0) drop-shadow(0 0 22px rgba(255, 232, 130, 1.0)); opacity: 0; }
  25%  { transform: scale(1.45) translateY(-6px); filter: brightness(1.55) drop-shadow(0 0 18px rgba(255, 213, 79, 0.95)); opacity: 1; }
  55%  { transform: scale(0.95) translateY(0);    filter: brightness(1.10) drop-shadow(0 0 12px rgba(255, 178, 74, 0.75)); }
  100% { transform: scale(1.00) translateY(0);    filter: brightness(1.00) drop-shadow(0 0 8px  rgba(255, 121, 38, 0.65)); opacity: 0.95; }
}

@media (prefers-reduced-motion: reduce) {
  .heat-col[data-double="1"],
  .heat-col[data-triple="1"],
  .fresh-burst[data-count="2"],
  .fresh-burst[data-count="3"],
  .heat-flame.fresh { animation: none; }
}

/* ───────────────────────────────────────────────────────────────────
   Board — vertical column of 6 rows. One row per number, positions
   FIXED 1..6 top-to-bottom (spec: never reordered, never sorted).
   Each row contains:
     (1) a small dice-face label on the LEFT identifying the number,
     (2) a dominant heat strip on the RIGHT — large flames left-to-
         right, max 8 — so the heat reads as the focal element,
     (3) on the SELECTED row, a larger chip stack absolute-positioned
         over the dice-face area (partially covering it).
*/
.board {
  flex: 1 1 auto;
  width: 100%;
  max-width: 460px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cell {
  appearance: none;
  -webkit-appearance: none;
  flex: 1 1 auto;
  min-height: 56px;
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse 100% 100% at 0% 50%, rgba(95, 183, 255, 0.14) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-elev-2) 0%, var(--bg-elev-1) 100%);
  color: var(--text);
  font-family: inherit;
  border-radius: 12px;
  padding: 6px 14px 6px 12px;
  display: flex;
  /* `row-reverse` puts the dice-face (markup-second) on the visual LEFT
     and the heat-col (markup-first) flowing to the RIGHT. This pairs
     with .chip-on-board { left: 6px } so the chip stack overlays the
     dice face, not the heat strip. */
  flex-direction: row-reverse;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 80ms ease, border-color 120ms ease, box-shadow 120ms ease;
  touch-action: manipulation;
  outline: none;
  position: relative;
  min-width: 0;
  overflow: visible;             /* chip stack overlays dice-face slightly outside the row */
}
.cell:active { transform: translateY(1px); }

/* Selected (active) target — exactly ONE at a time per spec. Gold
   border + warm halo + brighter background so the selected row reads
   immediately above the other 5. */
.cell.is-selected {
  border-color: var(--gold-lt);
  background:
    radial-gradient(ellipse 100% 100% at 0% 50%, rgba(255, 213, 79, 0.20) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-elev-2) 0%, var(--bg-elev-1) 100%);
  box-shadow:
    0 0 0 1px rgba(240, 194, 82, 0.45) inset,
    0 0 14px rgba(240, 194, 82, 0.30);
}

/* Locked (autobet running) — cells stop responding to taps and dim. */
.cell.is-locked {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

/* Dice face — small ivory label on the left, identifies the row's
   number. NOT a large card any more; it's a quiet identifier that
   the heat (right) and chip stack (overlaying) play around. */
.dice-face {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--cream) 0%, #f7e8c8 60%, #ecd9b0 100%);
  border: 1px solid rgba(138, 90, 19, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 4px rgba(138, 90, 19, 0.22),
    0 2px 4px rgba(0, 0, 0, 0.35);
}
@media (min-width: 480px) {
  .dice-face { width: 48px; height: 48px; border-radius: 11px; }
}
.pip {
  position: absolute;
  width: 16%;
  height: 16%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #4a3010 0%, #1a1408 80%);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.50);
}
.pip-tl { top: 17%; left: 17%; }
.pip-tr { top: 17%; right: 17%; }
.pip-ml { top: 42%; left: 17%; }
.pip-mr { top: 42%; right: 17%; }
.pip-bl { bottom: 17%; left: 17%; }
.pip-br { bottom: 17%; right: 17%; }
.pip-c  { top: 42%; left: 42%; }

/* Chip stack on the selected row. Overlays the dice-face area on the
   LEFT (partially covering it), so a glance at the row immediately
   reveals "this is where my bet is". Multiple chips offset vertically
   for a casino-stack feel; newest chip in front via z-index. Position
   set inline per chip by bet.js (top + translate for stack offsets).
   ~56px on mobile, ~64px on larger screens; this is much larger than
   the dice-face beneath, so the dice face peeks out behind the stack.

   Specificity: scoped under .cell so this rule wins over the later
   `.chip { position: relative }` declaration in the chip-cycler
   section below — both selectors are (0,1,0) on their own and source
   order would pick `.chip { position: relative }` otherwise. */
.cell .chip-on-board {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  aspect-ratio: 1 / 1;
  font-size: 18px;
  position: absolute;
  left: 6px;
  top: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.40);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
@media (min-width: 480px) {
  .cell .chip-on-board { width: 64px; height: 64px; font-size: 20px; left: 4px; }
}

/* Rejected-bet flash (per-cell, 400ms). */
.cell.rejected { animation: rejected-flash 400ms ease-out; }
@keyframes rejected-flash {
  0%   { box-shadow: 0 0 0 0  rgba(239, 68, 68, 0.65); }
  100% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}

/* Hit-celebration pulse on the selected cell at settle. */
@keyframes cellWinPulse {
  0%   { border-color: var(--gold-lt); box-shadow: 0 0 0 1px rgba(240, 194, 82, 0.45) inset, 0 0 14px rgba(240, 194, 82, 0.30); }
  50%  { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(255, 213, 79, 0.65) inset, 0 0 24px rgba(255, 213, 79, 0.65); }
  100% { border-color: var(--gold-lt); box-shadow: 0 0 0 1px rgba(240, 194, 82, 0.45) inset, 0 0 14px rgba(240, 194, 82, 0.30); }
}
.cell.cell-win-pulse { animation: cellWinPulse 0.8s ease-in-out 2; }

@keyframes chipWinningSpin {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}
.chip-winning-spin {
  animation: chipWinningSpin 1.0s ease-in-out 1;
  transform-style: preserve-3d;
}

/* ───────────────────────────────────────────────────────────────────
   Footer actions — two-row layout identical in chassis to 3DICE / FAUDA.
*/
.actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 12px 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  position: relative;     /* anchor for the AutoBet floating panel */
}
.actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.actions-top {
  justify-content: flex-start;
  gap: 4px;
}
.actions-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 12px;
}
.actions-bottom {
  justify-content: center;
  position: relative;
}

.bet-total {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.bet-total-amount {
  color: var(--gold-lt);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.auto-status {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--gold-glow);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.auto-status.show { opacity: 1; }

/* AUTO + CLEAR — small pill buttons. AUTO toggles the floating panel
   and becomes STOP while AutoBet is running. */
.auto-btn,
.clear-btn {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.10em;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform 80ms ease, color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.auto-btn:hover,
.clear-btn:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.auto-btn:active,
.clear-btn:active { transform: translateY(1px); }
.auto-btn.is-active {
  color: var(--cream);
  border-color: var(--gold-lt);
  background: rgba(40, 30, 6, 0.55);
}
.auto-btn.is-running {
  color: var(--cream);
  border-color: var(--gold);
  background: rgba(70, 24, 24, 0.55);
}

.sound-toggle {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 80ms ease, border-color 120ms ease;
}
.sound-toggle[aria-pressed="true"] { color: var(--text-muted); border-color: rgba(255, 255, 255, 0.10); }
.sound-toggle:active { transform: translateY(1px); }

/* Help + PF badge — identical chassis to 3DICE / FAUDA. */
.help-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(95, 183, 255, 0.45) 0%, transparent 60%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.85) 0%, rgba(5, 13, 36, 0.95) 100%);
  color: var(--gold-glow);
  border: 1px solid rgba(240, 194, 82, 0.65);
  font-family: inherit;
  font-size: 14px; font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55), 0 0 6px rgba(255, 227, 154, 0.45);
  -webkit-tap-highlight-color: transparent;
}
.help-btn:active { transform: translateY(1px); }

.pf-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: 0;
  margin-right: -2px;
  padding: 0;
  border-radius: 50%;
  background: rgba(2, 7, 15, 0.40);
  border: 1px solid rgba(255, 227, 154, 0.55);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.pf-badge:hover  { border-color: #ffd882; }
.pf-badge:active { transform: translateY(1px); }
.pf-badge-icon {
  width: 22px;
  height: 22px;
  display: block;
  filter: drop-shadow(0 0 3px rgba(255, 227, 154, 0.45));
}

/* ───────────────────────────────────────────────────────────────────
   Chip cycler + on-board chip — identical chassis to 3DICE.
*/
.chip-selector {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
}
.chip-arrow {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(20, 42, 100, 0.65) 0%, rgba(10, 24, 56, 0.85) 100%);
  border: 1px solid rgba(240, 194, 82, 0.40);
  border-radius: 11px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  transition: transform 80ms ease;
}
.chip-arrow:active { transform: translateY(1px); }
.chip-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 4px;
}
.chip {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7), 0 0 4px rgba(0, 0, 0, 0.5);
  position: relative;
  background-clip: padding-box;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 0 2px rgba(240, 194, 82, 0.65),
    0 0 8px rgba(255, 227, 154, 0.20);
}
.chip::before {
  content: '';
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(
    var(--gold-glow) 0deg     22deg,
    transparent      22deg     60deg,
    var(--gold-glow) 60deg     82deg,
    transparent      82deg    120deg,
    var(--gold-glow) 120deg   142deg,
    transparent     142deg    180deg,
    var(--gold-glow) 180deg   202deg,
    transparent     202deg    240deg,
    var(--gold-glow) 240deg   262deg,
    transparent     262deg    300deg,
    var(--gold-glow) 300deg   322deg,
    transparent     322deg    360deg
  );
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 60%, #000 90%, transparent 91%);
          mask: radial-gradient(circle, transparent 60%, #000 60%, #000 90%, transparent 91%);
  pointer-events: none;
}
.chip::after {
  content: '';
  position: absolute; inset: 12%;
  border-radius: 50%;
  background: inherit;
  border: 1px dashed rgba(255, 245, 216, 0.40);
  box-shadow:
    inset 0 2px 3px rgba(255, 245, 216, 0.30),
    inset 0 -3px 4px rgba(0, 0, 0, 0.35),
    inset 0 0 8px rgba(95, 183, 255, 0.15);
  pointer-events: none;
}
.chip > .chip-val { position: relative; z-index: 2; pointer-events: none; }
.chip-sel {
  width: 56px; height: 56px;
  font-size: 18px;
  border: 1.5px solid rgba(0, 0, 0, 0.45);
  margin: 0 4px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 0 2px rgba(240, 194, 82, 0.85),
    0 0 14px rgba(255, 227, 154, 0.35),
    0 6px 14px rgba(0, 0, 0, 0.65);
}
.chip-sel:active { transform: scale(0.93); }

@media (min-width: 480px) {
  .chip-arrow { width: 40px; height: 40px; font-size: 16px; }
  .chip-sel    { width: 64px; height: 64px; font-size: 20px; }
  .chip-on-board { width: 30px; height: 30px; font-size: 12px; }
  .result-die { width: 42px; height: 42px; font-size: 16px; }
  .result-message { font-size: 16px; }
}

/* ───────────────────────────────────────────────────────────────────
   ROLL button.
*/
.roll-btn {
  appearance: none;
  -webkit-appearance: none;
  flex: 1 1 auto;
  min-width: 110px;
  max-width: 200px;
  height: 52px;
  padding: 0 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 100% at 50% 100%, rgba(95, 183, 255, 0.45) 0%, transparent 70%),
    radial-gradient(ellipse 100% 50% at 50% 0%, rgba(255, 227, 154, 0.25) 0%, transparent 70%),
    linear-gradient(180deg, #1f4ea8 0%, #0e1f4a 60%, #050d24 100%);
  border: 1px solid rgba(255, 227, 154, 0.85);
  border-radius: 999px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 12px rgba(255, 227, 154, 0.35),
    inset 0 1px 0 rgba(255, 245, 216, 0.40),
    inset 0 -2px 4px rgba(0, 0, 0, 0.55),
    0 4px 10px rgba(0, 0, 0, 0.55);
  transition: transform 80ms ease;
}
.roll-btn:active { transform: translateY(1px); }
.roll-btn:disabled,
.roll-btn.rolling { opacity: 0.55; cursor: default; }
.roll-btn.rolling:active { transform: none; }
@media (min-width: 480px) {
  .roll-btn   { height: 56px; font-size: 18px; }
}

/* ───────────────────────────────────────────────────────────────────
   AutoBet floating panel. Anchored near the AUTO button in the
   actions-top row; positioned absolute over the actions footer so it
   never displaces other content. Closed by default; .open reveals.
*/
.autobet-panel {
  position: absolute;
  right: 12px;
  bottom: 10px;             /* bottom-right of board-wrap — just above the
                                actions footer where the AUTO button lives */
  z-index: 80;
  /* width sized to fit comfortably inside a 390-px-wide viewport with the
     right:12 anchor + a 12-px breathing margin to the left edge. Bumps to
     228 at ≥480 widths where there's more room for a slightly wider panel. */
  width: 210px;
  padding: 12px 12px 10px;
  border-radius: 14px;
  background:
    radial-gradient(ellipse 100% 30% at 50% 0%, rgba(95, 183, 255, 0.18) 0%, transparent 60%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.96) 0%, rgba(5, 13, 36, 0.96) 100%);
  border: 1px solid rgba(240, 194, 82, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 216, 0.22),
    0 12px 28px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}
.autobet-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.autobet-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-lt);
  margin-bottom: 8px;
}
.autobet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.autobet-label {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--cream);
}
.autobet-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.autobet-step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(240, 194, 82, 0.55);
  background: rgba(2, 7, 15, 0.55);
  color: var(--cream);
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.autobet-step:active { transform: translateY(1px); }
.autobet-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 900;
  color: var(--gold-glow);
  font-variant-numeric: tabular-nums;
}
.autobet-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.autobet-preset {
  appearance: none;
  border: 1px solid rgba(95, 183, 255, 0.40);
  background: rgba(20, 42, 100, 0.45);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 6px 0;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.autobet-preset:hover  { border-color: var(--gold-lt); color: var(--cream); }
.autobet-preset:active { transform: translateY(1px); }
.autobet-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 8px;
}
.autobet-cancel,
.autobet-start {
  appearance: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px 12px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  border: 1px solid var(--border);
}
.autobet-cancel { color: var(--text-muted); background: transparent; }
.autobet-cancel:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.autobet-start {
  color: var(--cream);
  border-color: rgba(255, 227, 154, 0.85);
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(255, 227, 154, 0.28) 0%, transparent 70%),
    linear-gradient(180deg, #1f4ea8 0%, #0e1f4a 60%, #050d24 100%);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 8px rgba(255, 227, 154, 0.30);
}
.autobet-start:active { transform: translateY(1px); }
.autobet-note {
  margin: 8px 2px 0;
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.02em;
}
@media (min-width: 480px) {
  .autobet-panel { width: 228px; padding: 14px 14px 12px; }
}

/* ───────────────────────────────────────────────────────────────────
   Start overlay + help overlay + dice render overlay + win FX.
   Same shape as 3DICE / FAUDA.
*/
.dice-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  display: none;
}
.dice-overlay.active { display: block; }

.win-amount-display {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #ffd54f;
  text-shadow: 0 0 12px rgba(255, 193, 7, 0.6), 0 1px 2px rgba(0, 0, 0, 0.7);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  white-space: nowrap;
}
.win-amount-display.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.0);
}
@media (min-width: 720px) { .win-amount-display { font-size: 3.2rem; } }

.win-fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 70;
  overflow: visible;
}
.fx-money-particle {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff3c4 0%, #ffd54f 50%, #d4a017 100%);
  border: 1px solid #c79100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 6px rgba(255, 213, 79, 0.55);
  opacity: 0;
  --tx: 0px;
  --rot: 0deg;
  animation: fxRise 1.8s ease-out forwards;
  will-change: transform, opacity;
}
@keyframes fxRise {
  0%   { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.6); }
  10%  { opacity: 1; transform: translate(calc(var(--tx) * 0.1), -20px) rotate(calc(var(--rot) * 0.1)) scale(1); }
  70%  { opacity: 1; transform: translate(calc(var(--tx) * 0.7), -210px) rotate(calc(var(--rot) * 0.7)) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), -300px) rotate(var(--rot)) scale(0.85); }
}
.fx-firework-burst { position: absolute; width: 0; height: 0; pointer-events: none; }
.fx-firework-spoke {
  position: absolute;
  left: -1px;
  top: -70px;
  width: 2px;
  height: 70px;
  background: linear-gradient(to top, rgba(255, 213, 79, 1) 0%, rgba(255, 215, 100, 0.9) 50%, rgba(255, 213, 79, 0) 100%);
  border-radius: 1px;
  transform-origin: 50% 100%;
  transform: rotate(var(--angle, 0deg)) scaleY(0);
  opacity: 0;
  animation: fxFireworkSpoke 0.6s ease-out forwards;
  will-change: transform, opacity;
}
@keyframes fxFireworkSpoke {
  0%   { transform: rotate(var(--angle, 0deg)) scaleY(0); opacity: 1; }
  40%  { transform: rotate(var(--angle, 0deg)) scaleY(1); opacity: 1; }
  100% { transform: rotate(var(--angle, 0deg)) scaleY(1); opacity: 0; }
}
.fx-zigzag-token {
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff3c4 0%, #ffd54f 50%, #d4a017 100%);
  border: 1px solid #c79100;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 213, 79, 0.85);
  opacity: 0;
  --dx1: 0px; --dy1: 0px;
  --dx2: 0px; --dy2: 0px;
  --dx3: 0px; --dy3: 0px;
  --dxF: 0px; --dyF: 0px;
  animation: fxZigzag 1.15s ease-in-out forwards;
  will-change: transform, opacity;
}
@keyframes fxZigzag {
  0%   { opacity: 0; transform: translate(0, 0) scale(1); }
  10%  { opacity: 1; transform: translate(0, 0) scale(1.05); }
  35%  { opacity: 1; transform: translate(var(--dx1), var(--dy1)) scale(1.05); }
  60%  { opacity: 1; transform: translate(var(--dx2), var(--dy2)) scale(1.05); }
  82%  { opacity: 1; transform: translate(var(--dx3), var(--dy3)) scale(1.05); }
  95%  { opacity: 1; transform: translate(var(--dxF), var(--dyF)) scale(0.55); }
  100% { opacity: 0; transform: translate(var(--dxF), var(--dyF)) scale(0.2); }
}
.wallet-received-money { animation: walletReceivedMoney 0.25s ease-out 1; }
@keyframes walletReceivedMoney {
  0%   { filter: brightness(1)    drop-shadow(0 0 0   rgba(255, 215, 100, 0)); }
  50%  { filter: brightness(1.25) drop-shadow(0 0 10px rgba(255, 215, 100, 0.85)); }
  100% { filter: brightness(1)    drop-shadow(0 0 0   rgba(255, 215, 100, 0)); }
}

.bet-error-msg {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--cyan-soft);
  background: rgba(20, 42, 100, 0.85);
  border: 1px solid rgba(95, 183, 255, 0.45);
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 30;
}
.bet-error-msg.show { opacity: 1; }
.bet-error-msg.err {
  color: #ffb89f;
  border-color: rgba(255, 184, 159, 0.55);
}

.config-loading-hint {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--gold-lt);
  background: rgba(40, 30, 6, 0.88);
  border: 1px solid rgba(240, 194, 82, 0.45);
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease-out;
  z-index: 5;
}
.config-loading-hint.show { opacity: 1; }

/* Start overlay — canonical pattern from spec §4.4. */
.start-ov {
  position: absolute; inset: 0; z-index: 50;
  background:
    radial-gradient(ellipse 60% 50% at 50% 45%, rgba(31, 78, 168, 0.30) 0%, transparent 70%),
    radial-gradient(ellipse 80% 40% at 50% 80%, rgba(95, 183, 255, 0.15) 0%, transparent 70%),
    rgba(2, 6, 15, 0.96);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  padding: 0 20px;
  cursor: pointer;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 2500ms ease-out, transform 2500ms ease-out;
}
.start-ov.hidden {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}
.start-ov .site-logo {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; opacity: 0.9;
  -webkit-tap-highlight-color: transparent;
}
.start-ov .site-logo img {
  height: 28px; width: auto; display: block;
  filter: drop-shadow(0 0 4px rgba(255, 227, 154, 0.30));
}
.start-ov .site-logo span {
  font-size: 13px; font-weight: 800; letter-spacing: 0.04em; line-height: 1;
  background: linear-gradient(180deg, var(--cream) 0%, var(--gold-lt) 60%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.start-ov .site-logo:hover { opacity: 1; }
.start-ov .title {
  font-size: 40px; font-weight: 900; letter-spacing: 0.20em;
  background: linear-gradient(180deg, var(--cream) 0%, var(--gold-lt) 50%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 14px rgba(240, 194, 82, 0.45));
}
.start-ov .icon { font-size: 48px; filter: drop-shadow(0 0 18px rgba(255, 227, 154, 0.55)); }

/* Low-opacity flame backdrop layer rising from the bottom of the
   overlay. Static — the prior breathing animation was rejected as
   "fake fire" by review feedback. Keeps the deep-blue gradient base
   dominant per spec ("Fire is an accent layer, not the entire
   theme"); opacity capped at ~0.16 so the layer reads as warmth
   beneath the title rather than competing with it. */
.start-ov::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 86vw);
  height: 64%;
  max-height: 540px;
  background: url('https://1gambling.online/assets/images/hot-one-lobby.png?v=hotbg1') no-repeat center bottom / contain;
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}
.start-ov > * { position: relative; z-index: 1; }
.start-ov .payout-hook {
  font-size: 18px; font-weight: 800;
  color: var(--gold-glow);
  letter-spacing: 0.06em;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 227, 154, 0.45);
}
.start-ov .tip {
  font-size: 15px; color: #ffb24a;
  text-align: center; max-width: 280px; padding: 0 16px;
  line-height: 1.45;
  text-shadow: 0 0 8px rgba(255, 178, 74, 0.30);
}
.start-ov-footer {
  position: absolute;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  left: 50%; transform: translateX(-50%);
  display: flex; gap: 14px; align-items: center;
}
.start-ov-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  color: var(--gold-lt);
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; cursor: pointer; text-decoration: none;
  filter: drop-shadow(0 0 4px rgba(255, 227, 154, 0.30));
  -webkit-tap-highlight-color: transparent;
}
.start-ov-icon:hover {
  color: var(--cream);
  filter: drop-shadow(0 0 6px rgba(255, 227, 154, 0.55));
}
.start-ov-icon svg { display: block; }
@media (min-width: 480px) { .start-ov .payout-hook { font-size: 20px; } }

/* Help overlay — same chassis as 3DICE / FAUDA. */
.help-ov {
  position: fixed; inset: 0;
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 100;
  padding: 24px 14px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.20s ease-out;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.help-ov.open {
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.30s ease-in;
}
@media (min-width: 540px) { .help-ov { align-items: center; padding: 24px; } }
.help-ov-bd {
  position: fixed; inset: 0;
  background: rgba(2, 7, 15, 0.70);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}
.help-ov-card {
  position: relative;
  width: 100%; max-width: 460px;
  padding: 22px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px;
  background:
    radial-gradient(ellipse 100% 30% at 50% 0%, rgba(95, 183, 255, 0.22) 0%, transparent 60%),
    linear-gradient(180deg, rgba(20, 42, 100, 0.96) 0%, rgba(5, 13, 36, 0.96) 100%);
  border: 1px solid rgba(240, 194, 82, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 216, 0.22),
    inset 0 0 0 1px rgba(255, 227, 154, 0.10),
    0 16px 36px rgba(0, 0, 0, 0.70);
  transform: translateY(8px);
  transition: transform 0.20s ease-out;
}
.help-ov.open .help-ov-card {
  transform: translateY(0);
  transition: transform 0.30s ease-in;
}
.help-ov-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(240, 194, 82, 0.55);
  color: var(--cream);
  font-size: 20px; line-height: 1;
  cursor: pointer; outline: none;
  font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
}
.help-ov-close:hover { border-color: var(--gold-lt); color: var(--gold-glow); }
.help-ov-title {
  font-size: 18px; font-weight: 900; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--cream);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
  padding-right: 36px;
  margin-bottom: 12px;
}
.help-ov-section { margin-top: 12px; }
.help-ov-section:first-of-type { margin-top: 0; }
.help-ov-section-title {
  margin: 0 0 4px 0;
  font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold-lt);
}
.help-ov-section-title a,
.help-ov-section-title a:link,
.help-ov-section-title a:visited,
.help-ov-section-title a:hover,
.help-ov-section-title a:active {
  color: var(--gold-lt);
  text-decoration: underline;
}
.help-ov-section-body {
  margin: 0;
  font-size: 13px; line-height: 1.55;
  color: var(--text);
}
.help-ov-section-body b { color: var(--gold-glow); font-weight: 800; }
