/* Velvet Fox Roulette: the table, the wheel, the chips and every layout.
   (Tokens, plates, buttons, entry screen, overlays, sheets and the daily wheel are in styles.css.)

   How this file is organised
   - Sizes are in em (the font-size of .app is the scale knob) or follow --row, the height of one board row.
   - Portrait is the base: top bar, the stage (croupier + wheel), the table (last results, board, chips, buttons).
     Landscape puts the stage on the left and the table on the right.
   - main.js layout() sizes the wheel and plants the fox inside the stage; board.js reads where the cells are.
   - Painting order comes from the order in the page (fox, wheel, table), so the table hides where the fox's
     legs are cut and overlays that come later dim the whole play area. */

:root {
  --line: #e9c56a; /* the gold lines printed on the felt */
  --felt-1: #116240;
  --felt-2: #0a4429;
}

/* ======================================================================
   A. Layout (portrait)
   ====================================================================== */

.game {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 0.3em;
  padding: calc(0.45em + var(--safe-t)) calc(0.45em + var(--safe-r)) calc(0.3em + var(--safe-b))
    calc(0.45em + var(--safe-l));
}

/* z-index 32: the HUD sits above the flying coins (.fx, 30) and the overlay content (31). */
.top {
  position: relative;
  z-index: 32;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4em;
}

/* the credits and BET / WIN: on the slimmer plate (plaque.webp: more glass, thin rim).
   (the `border` shorthand resets border-image, so this rule comes after the plates' own border) */
.plaque.balance,
.rail .status {
  border: 1px solid transparent;
  border-image: url(../../art/plaque.webp) 0 64 fill / 0 calc(var(--ph) * 0.508) stretch;
}

.balance {
  --ph: max(2.9em, 38px);
  min-width: 8.9em;
  padding: 0 0.9em 0 0.8em;
}

.coin-ico {
  flex: none;
  width: 1.75em;
  height: 1.75em;
  margin-left: -0.3em;
}

.balance .num {
  flex: 1;
  font-size: 1.12em;
  text-align: center;
  white-space: nowrap;
}

/* Refill button: the round button in green. */
.btn-plus {
  margin-right: -0.9em;
  color: #073a02;
  background: radial-gradient(circle closest-side, #d8ffc0 0%, #4fd130 38%, #1e8a12 62%, #073a02 67%, transparent 69%)
    center / 100% 100% no-repeat;
  animation: breathe 1.2s ease-in-out infinite;
}

.logo-small {
  justify-self: center;
  height: 4em;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.25em 0.35em rgba(0, 0, 0, 0.65));
}

.top-buttons {
  display: flex;
  gap: 0.25em;
}

/* the level badge: "LV" over the number, like a medal */
.btn-level {
  flex-direction: column;
  grid-auto-flow: row;
  align-content: center;
  gap: 0;
}
.btn-level small {
  position: relative;
  font-size: max(0.5em, 7px);
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--gold-2);
  text-shadow: 0 0.08em 0 #000;
}
.btn-level b {
  font-size: 0.98em;
}

/* something free is waiting: a clear gold badge on the gift, not a speck */
.gift-dot {
  top: 2%;
  right: 2%;
  width: 0.95em;
  height: 0.95em;
  box-shadow:
    0 0 0 0.12em #2a1400,
    0 0 0.6em #ffd24a;
}

/* ======================================================================
   B. The stage: the croupier and the wheel (placed by main.js layout())
   ====================================================================== */

.stage {
  position: relative;
  min-height: 0;
}

.mascot {
  position: absolute;
  width: auto;
  pointer-events: none;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 0.3em 0.5em rgba(0, 0, 0, 0.55));
  animation: mascot-breathe 3.2s ease-in-out infinite;
}

.mascot[data-pose='hype'] {
  animation: mascot-hype 0.62s ease-in-out infinite;
}
.mascot[data-pose='cheer'] {
  animation: mascot-cheer 0.5s ease-in-out infinite;
}
/* watching the ball: still, leaning toward the wheel (no breathing: he holds his breath) */
.mascot[data-pose='watch'] {
  animation: mascot-lean 0.4s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
/* a small bow when he takes the chips of a lost round */
.mascot.bow {
  animation: mascot-bow 0.5s ease-in-out;
}

@keyframes mascot-lean {
  to {
    transform: rotate(2deg) translateX(0.25em);
  }
}

@keyframes mascot-bow {
  40% {
    transform: rotate(-2deg) scale(1, 0.985);
  }
}

@keyframes mascot-breathe {
  50% {
    transform: scale(1.012, 1.03);
  }
}

/* he grows from his feet (never lifts): the cut at his legs must stay hidden */
@keyframes mascot-hype {
  50% {
    transform: rotate(-1.1deg) scale(1.025);
  }
}

@keyframes mascot-cheer {
  50% {
    transform: scale(1.05, 1.035);
  }
}

/* while the daily wheel is on, the croupier of the table steps out (the wheel has its own) */
.app.staging .mascot {
  visibility: hidden;
}

.wheel-wrap {
  position: absolute;
  transform-origin: 92% 78%; /* the zoom grows toward the fox: never over the screen edge or the table */
  transition: transform 0.7s cubic-bezier(0.3, 0, 0.2, 1);
}

/* the ball drops: the wheel comes a little closer */
.wheel-wrap.zoom {
  transform: scale(1.1);
}

/* the decisive hop beside one of your numbers plays in slow motion: the wheel leans in a touch more */
.wheel-wrap.zoom.slow {
  transform: scale(1.16);
  transition-duration: 0.25s;
}

/* the replay of the final hops: closer, and a soft gold vignette around the wheel (no flash) */
.wheel-wrap.replay {
  transform: scale(1.22);
}
.wheel-wrap.replay::after {
  content: '';
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 52%,
    rgba(255, 214, 110, 0) 52%,
    rgba(255, 196, 80, 0.22) 72%,
    rgba(255, 196, 80, 0) 86%
  );
  pointer-events: none;
  animation: breathe 0.9s ease-in-out infinite;
}

/* the replay says so: a small gold medallion with the repeat sign over the wheel */
.replay-tag {
  position: absolute;
  left: 50%;
  bottom: 6%;
  z-index: 3;
  display: none;
  place-items: center;
  width: 2.6em;
  height: 2.6em;
  translate: -50% 0;
  border-radius: 50%;
  background: url(../../art/btn-blank.webp) center / contain no-repeat;
  filter: drop-shadow(0 0.15em 0.25em rgba(0, 0, 0, 0.6)) drop-shadow(0 0 0.5em rgba(255, 210, 100, 0.8));
}

.replay-tag b {
  position: relative;
  width: 52%;
  height: 52%;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 0.14em #ffe08a,
    0 0 0.3em rgba(255, 214, 110, 0.7);
}
.replay-tag b::before {
  content: '';
  position: absolute;
  left: calc(50% - 0.07em);
  bottom: 50%;
  width: 0.14em;
  height: 38%;
  border-radius: 0.1em;
  background: #fff3c4;
  transform-origin: 50% 100%;
  animation: ws-turn 2.4s linear infinite;
}
.replay-tag::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 15%;
  width: 0.32em;
  height: 0.24em;
  translate: -50% 0;
  border-radius: 0.08em;
  background: #ffe08a;
}
.replay-tag b::after {
  content: '';
  position: absolute;
  inset: calc(50% - 0.12em);
  border-radius: 50%;
  background: #fff3c4;
}
.wheel-wrap.replay .replay-tag {
  display: grid;
  animation: lk-in 0.3s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

/* a hard knock of the ball: the wheel takes it (a few pixels, once) */
#wheel.knock {
  animation: knock 0.16s ease-out;
}

@keyframes knock {
  35% {
    transform: translateY(0.14em);
  }
  70% {
    transform: translateY(-0.04em);
  }
}

#wheel {
  display: block;
}

/* the winning number: a big disc that slams in over the wheel, then flies to the row of last results */
.result {
  position: absolute;
  left: 50%;
  top: 44%;
  z-index: 2;
  width: 34%;
  aspect-ratio: 1;
  margin: -17% 0 0 -17%;
  display: grid;
  place-items: center;
  container-type: size;
  border-radius: 50%;
  border: 0.24em solid var(--line);
  box-shadow:
    0 0 0 0.1em #6b4a12,
    0 0.4em 0.9em rgba(0, 0, 0, 0.7),
    0 0 1.6em rgba(255, 214, 110, 0.75),
    inset 0 0.3em 0.6em rgba(255, 255, 255, 0.22),
    inset 0 -0.4em 0.7em rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.result b {
  font-size: 58cqw;
  line-height: 1;
  white-space: nowrap;
}

.result.slam {
  animation: slam 0.42s cubic-bezier(0.2, 1.4, 0.35, 1) both;
}

.result.red,
.hdisc.red {
  background: radial-gradient(circle at 35% 30%, #e23a45, #a3121c 60%, #6d0810);
}
.result.black,
.hdisc.black {
  background: radial-gradient(circle at 35% 30%, #4a4a54, #17171b 60%, #060607);
}
.result.green,
.hdisc.green {
  background: radial-gradient(circle at 35% 30%, #37c463, #128038 60%, #07501f);
}

/* ======================================================================
   C. The table: felt in a gold frame (frame.webp, 9 pieces baked by nine.js)
   ====================================================================== */

.table {
  --fc: clamp(
    26px,
    3.2em,
    58px
  ); /* the frame's corner piece (226 x 153 px of art); the gold border is about a fifth of it */
  --fct: calc(var(--fc) * 0.677);
  position: relative;
  width: min(100%, 48em);
  justify-self: center;
  border: solid transparent;
  border-width: var(--fct) var(--fc);
  border-image: url(../../art/frame.webp) 153 226 fill stretch;
  filter: drop-shadow(0 -0.25em 0.6em rgba(0, 0, 0, 0.55));
}

/* the content uses the felt inside the gold border, not only what is left between the corner pieces */
.table-in {
  display: flex;
  flex-direction: column;
  gap: 0.32em;
  margin: calc(var(--fct) * -0.62) calc(var(--fc) * -0.72);
}

/* last results on the left, BET / WIN on the right; the row keeps clear of the frame's corner fans */
.rail {
  position: relative;
  z-index: 6; /* the rake's handle passes under the results */
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding-inline: calc(var(--fc) * 0.6) calc(var(--fc) * 0.3);
}

.history {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.24em;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
  padding: 0 0.3em;
  height: 2.3em;
  border-radius: 1.2em;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.22));
  box-shadow:
    inset 0 0 0 0.08em rgba(233, 197, 106, 0.55),
    inset 0 0.15em 0.3em rgba(0, 0, 0, 0.5);
}

/* a place still waiting for a result */
.hdisc.empty {
  opacity: 0.4;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 0 0 0.07em rgba(233, 197, 106, 0.22);
}

.hdisc {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.8em;
  height: 1.8em;
  font-style: normal;
  border-radius: 50%;
  box-shadow:
    0 0 0 0.09em var(--line),
    0 0.12em 0.2em rgba(0, 0, 0, 0.6);
}

.hdisc b {
  font-size: 1.02em;
  line-height: 1;
  white-space: nowrap;
}

/* the newest one is a little bigger, and pops in */
.history .hdisc:first-child {
  width: 2em;
  height: 2em;
}
.hdisc.new {
  animation: disc-in 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

@keyframes disc-in {
  0% {
    transform: scale(0.2);
    filter: brightness(2.2);
  }
}

/* a new result pushes the older ones along */
.history.pushed .hdisc:not(:first-child) {
  animation: disc-shift 0.32s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes disc-shift {
  0% {
    transform: translateX(-2.1em);
  }
}

.status {
  --ph: max(2.25em, 30px);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-width: 9.4em;
  height: var(--ph);
  padding: 0 calc(var(--ph) * 0.52);
  filter: drop-shadow(0 0.15em 0.25em rgba(0, 0, 0, 0.55));
  white-space: nowrap;
}

.status small {
  font-size: max(0.66em, 9px);
  color: var(--gold-2);
  letter-spacing: 0.1em;
  text-shadow: 0 0.08em 0 #000;
}

.status b {
  font-size: 1.12em;
  line-height: 1;
}

.status.win {
  filter: drop-shadow(0 0 0.5em rgba(255, 205, 90, 0.85)) drop-shadow(0 0.15em 0.25em rgba(0, 0, 0, 0.55));
}

/* ======================================================================
   D. The betting board
   ====================================================================== */

.board {
  --row: clamp(30px, 4.6vh, 58px); /* one row of numbers */
  --ln: max(1.5px, 0.12em);
  --chip: 28px; /* set by board.js from the real cell size */
  --pad-l: calc(var(--fc) * 0.62); /* the outer line of the rows (streets) needs room for a chip */
  --pad-r: calc(var(--fc) * 0.3);
  position: relative;
  padding-inline: var(--pad-l) var(--pad-r);
  touch-action: none;
  cursor: pointer;
}

.cells {
  display: grid;
  gap: 0.3em;
  transition: filter 0.3s ease;
}

.inside,
.outside {
  display: grid;
  gap: var(--ln);
  padding: var(--ln);
  background: linear-gradient(180deg, #f6dc8c, #caa04a);
  box-shadow: 0 0.15em 0.35em rgba(0, 0, 0, 0.45);
}

.inside {
  border-radius: 0.55em 0.55em 0.15em 0.15em;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: calc(var(--row) * 0.86) repeat(4, var(--row)) calc(var(--row) * 0.8);
  grid-template-areas:
    'n0 n0 n0'
    'n1 n2 n3'
    'n4 n5 n6'
    'n7 n8 n9'
    'n10 n11 n12'
    'c1 c2 c3';
}

.outside {
  border-radius: 0.15em 0.15em 0.55em 0.55em;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: calc(var(--row) * 1.32); /* room for the label and, under it, a chip */
  grid-template-areas: 'low even red black odd high';
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  outline: none;
}

/* the felt of each colour: a soft light from the top, a darker foot */
.cell.num.red {
  background: linear-gradient(180deg, #c22a34 0%, #a01520 55%, #7d0c15 100%);
}
.cell.num.black {
  background: linear-gradient(180deg, #2c2c33 0%, #17171b 55%, #0a0a0c 100%);
}
.cell.num.green {
  background: linear-gradient(180deg, #24a850 0%, #14823a 55%, #0b5c27 100%);
}
.cell.out {
  background: linear-gradient(180deg, var(--felt-1), var(--felt-2));
}

.inside .cell:first-child {
  border-radius: 0.4em 0.4em 0 0;
}

.cell b {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 900;
  font-size: max(calc(var(--row) * 0.4), 11px);
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--ivory);
  text-shadow:
    0 0.07em 0 #2a1405,
    0 0 0.3em rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.cell.num b {
  font-size: calc(var(--row) * 0.66);
}

/* RED and BLACK: a diamond with a gold edge instead of a word */
.cell.out.red::before,
.cell.out.black::before,
.cell.out.red::after,
.cell.out.black::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(62%, calc(var(--row) * 1.25));
  aspect-ratio: 1.9;
  translate: -50% -50%;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: linear-gradient(180deg, #fff3b0, #c99a3a);
}

.cell.out.red::after,
.cell.out.black::after {
  width: calc(min(62%, var(--row) * 1.25) - 0.34em);
  background: linear-gradient(180deg, #e0303c, #9a121c);
}

.cell.out.black::after {
  background: linear-gradient(180deg, #33333a, #09090b);
}

.cell:focus-visible {
  box-shadow: inset 0 0 0 0.16em #fff;
  z-index: 1;
}

/* ---------- lucky numbers ---------- */
.marks {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

/* the cell struck by luck: a gold frame that breathes */
.cell.lucky {
  z-index: 1;
  animation: lucky-cell 2.4s ease-in-out infinite;
}

@keyframes lucky-cell {
  0%,
  100% {
    box-shadow:
      inset 0 0 0 0.12em #ffd76a,
      inset 0 0 0.5em rgba(255, 214, 110, 0.45);
  }
  50% {
    box-shadow:
      inset 0 0 0 0.12em #fff3c4,
      inset 0 0 1.1em rgba(255, 226, 140, 0.9);
  }
}

/* a lucky number steps a little down and back, so its multiplier tag fits in the corner of the cell */
.cell.num b {
  transition:
    scale 0.25s ease,
    translate 0.25s ease;
}
.cell.num.lucky b {
  scale: 0.92;
  translate: var(--lk-shift, 5% 12%);
}

/* the multiplier lands on its cell: the cell takes the punch (once) */
.cell.num.lucky.punch {
  animation:
    cell-punch 0.26s cubic-bezier(0.2, 1.4, 0.4, 1),
    lucky-cell 2.4s ease-in-out infinite;
}

@keyframes cell-punch {
  40% {
    scale: 1.1;
    z-index: 2;
  }
}

/* the ball passes a lucky number: its tag answers */
.lk.pulse {
  animation: lk-pulse 0.16s ease-out;
}

@keyframes lk-pulse {
  50% {
    transform: scale(1.18);
    filter: brightness(1.5);
  }
}

/* its multiplier: a small dark plate with a gold rim, in the upper left corner of the cell */
.lk {
  position: absolute;
  translate: -50% -50%;
  padding: 0.12em 0.34em 0.06em;
  font-style: normal;
  line-height: 1;
  white-space: nowrap;
  border-radius: 0.5em;
  background: linear-gradient(180deg, #4a2c05, #1c0f00);
  box-shadow:
    0 0 0 0.09em #ffd76a,
    0 0.12em 0.25em rgba(0, 0, 0, 0.7),
    0 0 0.7em rgba(255, 214, 110, 0.9);
  animation: lk-in 0.36s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

.lk.out {
  animation: lk-out 0.3s ease-in forwards;
}

@keyframes lk-in {
  0% {
    transform: scale(2.4);
    filter: brightness(2.2);
    opacity: 0;
  }
}

@keyframes lk-out {
  to {
    transform: scale(0.6);
    opacity: 0;
  }
}

/* chips on a number that luck struck: a gold aura under them */
.stack.charged::before {
  content: '';
  position: absolute;
  inset: -45%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 226, 140, 0.85) 0%,
    rgba(255, 200, 80, 0.35) 45%,
    rgba(255, 200, 80, 0) 70%
  );
  animation: breathe 2.4s ease-in-out infinite;
}

/* the multiplier of a lucky hit, big, over the winning chips */
.mult-fly {
  position: fixed;
  z-index: 34;
  translate: -50% -50%;
  font-size: max(2.6em, 34px);
  line-height: 1;
  white-space: nowrap;
  filter: drop-shadow(0 0.08em 0.06em rgba(30, 12, 0, 0.9)) drop-shadow(0 0 0.35em rgba(255, 214, 110, 0.95));
  pointer-events: none;
}

.plus-fly {
  position: fixed;
  z-index: 34;
  translate: -50% 0;
  font-size: max(1.3em, 17px);
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  filter: drop-shadow(0 0.08em 0.06em rgba(30, 12, 0, 0.9)) drop-shadow(0 0 0.3em rgba(255, 214, 110, 0.8));
}

.mult-fly.out {
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
  opacity: 0;
  transform: translateY(-0.6em) scale(0.9);
}

/* a chip in the lower half of an outside cell: the label (or the diamond) steps up while it is there, and
   comes back when the chip leaves. (In a wide cell the chip sits at the right end and nothing moves.) */
.cell.out b,
.cell.out::before,
.cell.out::after {
  transition:
    translate 0.18s ease,
    scale 0.18s ease;
}
.cell.out.up.has-chip b {
  translate: 0 var(--up, -0.6em);
}
.cell.out.aside.has-chip b {
  translate: var(--aside, -1em) 0;
}
.cell.out.red.aside.has-chip::after,
.cell.out.black.aside.has-chip::after {
  translate: calc(-50% + var(--aside, -1em)) -50%;
  scale: 0.8;
} /* --up: board.js, to just under the cell's top line */
.cell.out.red.up.has-chip::before,
.cell.out.black.up.has-chip::before,
.cell.out.red.up.has-chip::after,
.cell.out.black.up.has-chip::after {
  translate: -50% calc(-50% + var(--up, -0.6em));
  scale: 0.8;
}

/* a finger on a bet: the numbers it covers light up */
.cell.hl {
  z-index: 1;
  filter: brightness(1.5) saturate(1.15);
  box-shadow:
    inset 0 0 0 0.13em #fff3c4,
    inset 0 0 0.9em rgba(255, 232, 150, 0.75);
}

/* a chip has just landed on a bet: the numbers it covers answer once */
.cell.thud {
  animation: thud 0.16s ease-out;
}

@keyframes thud {
  0% {
    filter: brightness(1.22);
  }
}

/* the light that follows the ball from pocket to pocket */
.cell.track {
  animation: track 0.42s ease-out;
}

@keyframes track {
  0% {
    box-shadow:
      inset 0 0 0 0.12em #fff3c4,
      inset 0 0 1.1em rgba(255, 214, 110, 0.85);
  }
}

/* the winning number burns until the next bet */
/* the winning number burns three times, then stays lit (calm) until the next bet: nothing keeps blinking */
.cell.won {
  z-index: 1;
  box-shadow:
    inset 0 0 0 0.15em #ffe08a,
    inset 0 0 0.9em rgba(255, 214, 110, 0.7);
  animation: won 0.9s ease-in-out 3;
}

@keyframes won {
  0%,
  100% {
    box-shadow:
      inset 0 0 0 0.15em #ffe08a,
      inset 0 0 0.9em rgba(255, 214, 110, 0.7);
  }
  50% {
    box-shadow:
      inset 0 0 0 0.15em #fff6c8,
      inset 0 0 1.6em rgba(255, 226, 140, 1);
  }
}

/* no more bets: the felt steps back a little while the ball runs */
.board.locked {
  cursor: default;
}
.board.locked .cells {
  filter: brightness(0.86) saturate(0.9);
}

/* the tag over the finger: what the bet covers and what it pays */
.tip {
  position: absolute;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.32em 0.75em;
  translate: -50% -100%;
  font-size: max(0.86em, 12px);
  white-space: nowrap;
  color: var(--ivory);
  border-radius: 0.7em;
  border: 0.1em solid var(--line);
  background: linear-gradient(180deg, rgba(10, 46, 30, 0.97), rgba(3, 20, 12, 0.97));
  box-shadow: 0 0.3em 0.6em rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.tip i {
  font-style: normal;
  color: var(--gold-2);
}

/* ---------- chips on the table ---------- */
.stacks {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* a stack is centred on its spot; `translate` is kept apart from `transform`, which the animations use */
.stack {
  position: absolute;
  width: var(--chip);
  height: var(--chip);
  translate: -50% -50%;
}

.disc,
.ghost-chip,
.chip {
  background: center / contain no-repeat;
}

.chip-0 {
  background-image: url(../../art/chip-0.webp);
}
.chip-1 {
  background-image: url(../../art/chip-1.webp);
}
.chip-2 {
  background-image: url(../../art/chip-2.webp);
}
.chip-3 {
  background-image: url(../../art/chip-3.webp);
}
.chip-4 {
  background-image: url(../../art/chip-4.webp);
}
.chip-5 {
  background-image: url(../../art/chip-5.webp);
}

/* on the table and in the air the chips have a body: a sprite with the face at the table's angle and a
   striped side (made from the flat chip face) */
.disc.chip-0,
.ghost-chip.chip-0 {
  background-image: url(../../art/chip3d-0.webp);
}
.disc.chip-1,
.ghost-chip.chip-1 {
  background-image: url(../../art/chip3d-1.webp);
}
.disc.chip-2,
.ghost-chip.chip-2 {
  background-image: url(../../art/chip3d-2.webp);
}
.disc.chip-3,
.ghost-chip.chip-3 {
  background-image: url(../../art/chip3d-3.webp);
}
.disc.chip-4,
.ghost-chip.chip-4 {
  background-image: url(../../art/chip3d-4.webp);
}
.disc.chip-5,
.ghost-chip.chip-5 {
  background-image: url(../../art/chip3d-5.webp);
}

/* each disc is a whole chip (face + striped side, 160 x 148 px of art) resting on the one under it:
   the lift per chip is the thickness of its side */
.disc {
  --lift: calc(var(--k) * var(--chip) * -0.118);
  position: absolute;
  left: 0;
  top: 6%;
  width: 100%;
  aspect-ratio: 160 / 148;
  transform: translateY(var(--lift));
}

/* the bottom chip casts the stack's shadow on the felt */
.stack i:first-child {
  filter: drop-shadow(0 calc(var(--chip) * 0.07) calc(var(--chip) * 0.06) rgba(0, 0, 0, 0.7));
}

/* the amount, on the top chip */
.stack b {
  position: absolute;
  left: 50%;
  top: 46%; /* the middle of the top chip's face */
  translate: -50% -50%;
  transform: translateY(calc(var(--k) * var(--chip) * -0.118));
  font-family: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  font-size: max(calc(var(--chip) * 0.42), 11px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  white-space: nowrap;
  color: #2b1503;
  text-shadow:
    0 0 0.1em #fff6dd,
    0 0 0.1em #fff6dd,
    0 0 0.16em #fff6dd,
    0 0 0.24em #fff6dd;
}

.stack b.long {
  font-size: max(calc(var(--chip) * 0.3), 9px);
  letter-spacing: -0.07em;
}

.stack b.longer {
  font-size: max(calc(var(--chip) * 0.23), 9px);
}

/* a chip lands: it falls the last bit, squashes a little and rests (small overshoot, never jelly) */
.disc.drop {
  animation: chip-drop 0.22s cubic-bezier(0.3, 1.3, 0.5, 1) backwards;
}
.stack.arriving .disc.drop {
  animation-delay: 0.1s;
}

@keyframes chip-drop {
  0% {
    transform: translateY(calc(var(--lift) - var(--chip) * 0.75)) scale(1.14);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  70% {
    transform: translateY(var(--lift)) scale(1.04, 0.94);
  }
}

/* the ball is over one of your numbers: its chips jump once */
.stack.peek {
  animation: stack-peek 0.18s ease-out;
}

@keyframes stack-peek {
  40% {
    transform: translateY(-20%);
  }
}

/* the chips of a winning bet hop twice: "this one!" */
.stack.hop {
  animation: stack-hop 0.42s cubic-bezier(0.3, 0, 0.3, 1);
}

@keyframes stack-hop {
  25% {
    transform: translateY(-34%);
  }
  50% {
    transform: translateY(0);
  }
  72% {
    transform: translateY(-16%);
  }
}

/* a paid stack answers with a short gold flash */
.stack.paid {
  animation: paid 0.5s ease-out;
}

@keyframes paid {
  0% {
    filter: brightness(1.9) drop-shadow(0 0 0.5em rgba(255, 220, 120, 1));
    transform: scale(1.12);
  }
}

/* a gentle "no": only the piece itself shakes, sideways, once */
.deny {
  animation: deny 0.28s ease-out;
}

@keyframes deny {
  25% {
    transform: translateX(-0.22em);
  }
  55% {
    transform: translateX(0.18em);
  }
  80% {
    transform: translateX(-0.08em);
  }
}

/* a loose chip flying over the page (tray -> spot, croupier -> winner) */
.ghost-chip {
  position: fixed;
  z-index: 34;
  translate: -50% -50%;
  border-radius: 50%;
  filter: drop-shadow(0 0.25em 0.2em rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

/* ---------- the crystal marker on the winning number ---------- */
.dolly {
  position: absolute;
  z-index: 4;
  height: var(--dolly, calc(var(--row) * 1.15));
  width: auto;
  translate: -50% -74%;
  filter: drop-shadow(0 0.18em 0.2em rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

.dolly.land {
  animation: dolly-land 0.34s cubic-bezier(0.3, 1.4, 0.5, 1);
}

@keyframes dolly-land {
  0% {
    transform: translateY(-1.6em) scale(1.25);
    opacity: 0;
  }
  55% {
    opacity: 1;
  }
  75% {
    transform: translateY(0) scale(1.04, 0.94);
  }
}

/* ---------- the croupier's rake: its head lies across the board, the handle goes up to him ---------- */
.rake {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 5;
  height: 0;
  pointer-events: none;
}

/* the head spans the grid of numbers (the board's own side paddings), with its shadow on the felt */
.rake-head {
  position: absolute;
  left: var(--pad-l);
  right: var(--pad-r);
  top: 0;
  width: auto;
  height: calc(var(--chip) * 0.32);
  filter: drop-shadow(0 0.35em 0.25em rgba(0, 0, 0, 0.65));
}

/* the handle runs from the head up to the table's edge (main.js sets --reach): it comes from the croupier's
   side and never crosses the wheel. Only its lower part shows; it is cropped, not squeezed. */
.rake-handle {
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: calc(var(--chip) * 0.6);
  height: calc(var(--reach, 6em) / 0.82); /* tilted: longer, to still reach the table's edge */
  object-fit: cover;
  object-position: 50% 100%;
  translate: -50% 0;
  transform-origin: 50% 100%;
  rotate: -35deg;
  filter: drop-shadow(0.15em 0.2em 0.2em rgba(0, 0, 0, 0.5));
}

.cell.answer {
  animation: cell-answer 0.5s ease-out;
}

@keyframes cell-answer {
  30% {
    scale: 1.05;
    z-index: 2;
    box-shadow:
      inset 0 0 0 0.12em #ffe08a,
      inset 0 0 1em rgba(255, 214, 110, 0.75);
  }
}

.stack.sigh {
  animation: sigh 0.5s ease-in-out;
}

@keyframes sigh {
  40% {
    transform: translateY(3px);
    filter: brightness(0.85);
  }
}

.stack.doomed {
  filter: saturate(0.5) brightness(0.8);
  translate: 0 2px;
  transition:
    filter 0.15s ease,
    translate 0.15s ease;
}
.stack.swept {
  transition: opacity 0.18s ease-in;
}
.stack.gone {
  opacity: 0;
}

/* ======================================================================
   E. Chips to pick and the buttons
   ====================================================================== */

.deck {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25em;
}

/* the chip tray: walnut in a gold rim (tray.webp, ends kept, middle stretched) */
.tray {
  --th: max(3.6em, 48px); /* the chips are 0.84 of it: 40 px and up, a full touch target */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: var(--th);
  padding: 0 calc(var(--th) * 0.62);
  border: 1px solid transparent;
  border-image: url(../../art/tray.webp) 0 86 fill / 0 calc(var(--th) * 0.55) stretch;
  filter: drop-shadow(0 0.2em 0.3em rgba(0, 0, 0, 0.55));
}

.tray.nudge {
  animation: bump 0.3s ease-out;
}

.chip {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: calc(var(--th) * 0.84);
  height: calc(var(--th) * 0.84);
  border-radius: 50%;
  filter: drop-shadow(0 0.16em 0.14em rgba(0, 0, 0, 0.65));
  transition:
    transform 0.14s cubic-bezier(0.3, 1.4, 0.5, 1),
    filter 0.15s;
}

.chip b {
  font-family: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  font-size: max(calc(var(--th) * 0.25), 10px);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #2b1503;
}

/* the chip in hand: lifted, with a ring of light */
.chip[aria-checked='true'] {
  transform: translateY(-16%) scale(1.14);
  filter: drop-shadow(0 0 0.45em rgba(255, 220, 120, 1)) drop-shadow(0 0.35em 0.2em rgba(0, 0, 0, 0.6));
}

.chip:active {
  transform: scale(0.92);
}
.chip[aria-checked='true']:active {
  transform: translateY(-16%) scale(1.05);
}
.chip.pick {
  animation: bump 0.22s ease-out;
}
.app.celebrating .chip[aria-checked='true'] {
  filter: drop-shadow(0 0.35em 0.2em rgba(0, 0, 0, 0.6));
}

/* a chip a higher level opens: its colours stay alive (a little darker), and a small level medal says when */
.chip.locked {
  filter: brightness(0.74) drop-shadow(0 0.16em 0.14em rgba(0, 0, 0, 0.65));
}
.chip .lock {
  display: none;
}

.chip.locked .lock {
  position: absolute;
  right: -12%;
  bottom: -10%;
  display: grid;
  place-items: center;
  width: 46%;
  height: 46%;
  font-style: normal;
  flex-direction: column;
  font-size: max(calc(var(--th) * 0.18), 9px);
  font-weight: 900;
  line-height: 0.85;
  color: var(--gold-1);
  text-shadow: 0 0.08em 0 #000;
  background: url(../../art/btn-blank.webp) center / contain no-repeat;
  filter: brightness(1.35);
}

.chip .lock small {
  font-size: 0.62em;
  letter-spacing: 0.04em;
  color: var(--gold-2);
}
.chip.locked .lock {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52%;
  height: 52%;
}

/* a 3-character chip value (100, 500) keeps clear of the chip's inner ring */
.chip b.long {
  font-size: max(calc(var(--th) * 0.21), 10px);
  letter-spacing: -0.05em;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  width: 100%;
}

.actions .btn-ico {
  width: max(3.4em, 44px);
  height: max(3.4em, 44px);
}

.btn-x2 b {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.25em;
  font-weight: 900;
  line-height: 1;
  color: var(--gold-1);
  text-shadow:
    0 0.07em 0 #2a1400,
    0 0 0.3em rgba(0, 0, 0, 0.8);
}

/* REBET waits for you after a round */
.btn-ico.nudge {
  animation: breathe 1.3s ease-in-out 3;
}

/* SPIN: the ruby dome; its word is written by the game, so it follows the language */
.spin {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: max(6.8em, 90px); /* big enough that a long word (DREHEN, КРУТИТЬ) still reads on the dome */
  aspect-ratio: 1;
  margin: 0.15em 0.2em 0.25em; /* clear of the tray above and of the frame below */
  filter: drop-shadow(0 0.3em 0.45em rgba(0, 0, 0, 0.6));
  transition: transform 0.09s;
}

.spin img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.spin span {
  position: relative;
  display: block;
  max-width: 68%;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.4em;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--gold-1);
  text-shadow:
    0 0.07em 0 #4a0508,
    0 0.12em 0.18em rgba(0, 0, 0, 0.75);
}

.spin:active {
  transform: scale(0.92);
}
.spin.ready {
  animation: spin-idle 1.7s ease-in-out 3;
}
.spin.busy img {
  filter: saturate(0.75) brightness(0.8);
}

@keyframes spin-idle {
  50% {
    transform: scale(1.04);
    filter: drop-shadow(0 0.3em 0.45em rgba(0, 0, 0, 0.6)) drop-shadow(0 0 0.8em rgba(255, 120, 90, 0.8));
  }
}

/* the one-line credits notice: always on screen while playing (SCOPE.md) */
.notice {
  margin: 0;
  overflow: hidden;
  font-size: max(0.62em, 9px);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: rgba(255, 241, 207, 0.9);
  text-shadow:
    0 0.08em 0 #000,
    0 0 0.3em #000;
}

/* quick messages show under the top bar, over the hall: never over the chips or the board */
.toast {
  top: var(--toast-top, calc(var(--safe-t) + max(3.9em, 52px)));
  bottom: auto;
}

/* the gift waits during a round: dimmed, never grey (grey reads as broken) */
.top-buttons button:disabled {
  filter: brightness(0.8) drop-shadow(0 0.2em 0.3em rgba(0, 0, 0, 0.55));
}

/* a button that has nothing to do right now: the same painted piece, a little dimmer (never grey) */
.actions button:disabled {
  filter: brightness(0.72) saturate(0.75);
}

/* a config error on the entry screen: plain and readable */
.disclaimer.load-error {
  visibility: visible !important;
} /* a wrong config value is said at once */

/* the credits notice of the title screen waits for the player's language (it was English for a moment) */
html:not(.texts) .entry .disclaimer {
  visibility: hidden;
}

.disclaimer.load-error {
  position: static;
  transform: none;
  font-size: 0.9em;
  border-image: none;
  border-radius: 0.8em;
  padding: 0.8em 1em;
  background: rgba(120, 10, 10, 0.88);
}

/* brand pieces step back while a win is being celebrated: the title owns the screen */
.app.celebrating .logo-small {
  filter: brightness(0.5);
  transition: filter 0.3s;
}

/* ======================================================================
   F. Painted ivory numerals (table, wheel, last results) and the sheets' own pieces
   ====================================================================== */

.glyph-board {
  background-image: url(../../art/font-board.webp);
  background-size: calc(var(--glyph-board, 10) * 1em) 0.86em;
}

/* the sheets sit on the felt: text in ivory, the content reaches into the frame's corner pieces */
.sheet-card {
  border-radius: 0;
}

/* the close button sits ON the frame's top-right corner, clear of the title and the tabs */
.sheet-close {
  top: calc(var(--fb) * -0.62);
  right: calc(var(--fb) * -0.9);
}

.sheet-body {
  margin: calc(var(--fb) * -0.36) calc(var(--fb) * -0.66);
  width: auto;
  flex: 1;
  color: var(--ivory);
}

.menu-pop > * {
  margin-inline: calc(var(--fb) * -0.62);
}
.menu-pop > :first-child {
  margin-top: calc(var(--fb) * -0.3);
}
.menu-pop > :last-child {
  margin-bottom: calc(var(--fb) * -0.3);
}
#btn-turbo[aria-pressed='true'] {
  filter: drop-shadow(0 0 0.45em rgba(255, 200, 80, 1)) brightness(1.3);
}

/* the four tabs of the rules sheet: a full touch target on a small phone too */
.tabs .btn-pill {
  --ph: max(3.3em, 42px);
  height: var(--ph);
}

/* row captions of the sheets: sentence case in every language, whatever the text's own case */
.cap {
  display: inline-block;
  font-weight: inherit;
  text-transform: lowercase;
}
.cap::first-letter {
  text-transform: uppercase;
}
/* a button waiting for its timer: dimmer, still alive */
.sheet button:disabled {
  filter: saturate(0.85) brightness(0.74);
}
/* without a title, the tabs keep clear of the close button on the corner */
.sheet-body > .tabs:first-child {
  margin-top: 0.2em;
  margin-right: max(2.6em, 46px);
} /* clear of the close button */

/* free coins sheet: both buttons wide enough for their label in every language */
#wheel-go {
  min-width: 9.5em;
  padding: 0 calc(var(--ph) * 0.62);
}
#coins-go {
  min-width: 12em;
}

/* auto play: the rounds left on a small medallion on SPIN; SPIN glows while it runs */
/* turbo at hand: a small bolt on SPIN's shoulder, lit when turbo is on */
.turbo-quick {
  position: absolute;
  left: -2%;
  top: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 33%;
  height: 33%;
  border-radius: 50%;
  background: url(../../art/btn-blank.webp) center / contain no-repeat;
  filter: drop-shadow(0 0.12em 0.2em rgba(0, 0, 0, 0.6));
  transition: filter 0.2s ease;
}

.turbo-quick::before {
  content: '';
  position: absolute;
  inset: -30%;
  border-radius: 50%;
} /* a finger-sized target */
/* position: static: the rule that stretches SPIN's own art (.spin img) must not pull the bolt into the corner */
.turbo-quick img {
  position: static;
  width: 62%;
  height: 62%;
  opacity: 0.85;
  filter: saturate(0.6) brightness(0.9);
  transition:
    opacity 0.2s ease,
    filter 0.2s ease;
}
.spin.turbo .turbo-quick {
  filter: drop-shadow(0 0 0.35em rgba(255, 214, 110, 0.95));
}
.spin.turbo .turbo-quick img {
  opacity: 1;
  filter: none;
}

.spin-count {
  position: absolute;
  right: -4%;
  top: -4%;
  display: grid;
  place-items: center;
  min-width: 36%;
  height: 36%;
  padding: 0 0.2em;
  font-style: normal;
  font-size: max(0.82em, 11px);
  font-weight: 900;
  line-height: 1;
  color: var(--gold-1);
  text-shadow: 0 0.08em 0 #000;
  border-radius: 999px;
  background: radial-gradient(circle at 40% 30%, #1d5a3a, #062716);
  box-shadow:
    0 0 0 0.12em #e9c56a,
    0 0.15em 0.25em rgba(0, 0, 0, 0.6);
}

.spin.auto img {
  animation: auto-glow 1.1s ease-in-out infinite;
}

@keyframes auto-glow {
  50% {
    filter: brightness(1.18) drop-shadow(0 0 0.5em rgba(255, 210, 100, 0.9));
  }
}

.auto-opts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6em;
  margin: 0.8em 0;
}

.auto-opts .btn-pill {
  min-width: 0;
  width: 100%;
  font-size: 1.15em;
}

/* favourite bets: SAVE and PLACE side by side */
.fav-btns {
  display: flex;
  gap: 0.4em;
  flex: none;
}
.fav-btns .btn-pill,
.fav-btns .btn-gold {
  --ph: max(3em, 42px);
  min-width: 6.4em;
  font-size: 0.9em;
  padding: 0 calc(var(--ph) * 0.62);
  font-family: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
}

/* daily missions: what to try, how far, the reward */
.mission {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.6em auto;
  align-items: center;
  gap: 0.6em;
  margin: 0.45em 0;
  padding: 0.45em 0.7em;
  border-radius: 0.7em;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(233, 197, 106, 0.4);
}

.mission > i {
  position: relative;
  height: 1.3em;
  border-radius: 0.65em;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 0 0 0.08em rgba(233, 197, 106, 0.5);
  overflow: hidden;
}

.mission > i::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(100% * var(--p, 0));
  background: linear-gradient(180deg, #fff3b0, #ffc93c 45%, #c97a00);
}
.mission > i b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.8em;
  color: #fff;
  text-shadow:
    0 0.08em 0 #000,
    0 0 0.2em #000;
}
.mission em {
  font-style: normal;
  color: var(--gold-2);
  white-space: nowrap;
}
.mission em img {
  width: 1.6em;
  height: 1.6em;
}
.mission.done {
  border-color: #ffd76a;
}
.mission.done span {
  opacity: 0.7;
}

/* ---------- INFO: the game's own pieces, never a web page ---------- */

/* a caption under the tabs: centred, with a fine gold rule under it */
.lead {
  margin: 0.2em auto 0.8em;
  max-width: 34em;
  text-align: center;
  color: rgba(255, 241, 207, 0.88);
}
.lead::after {
  content: '';
  display: block;
  width: 46%;
  height: 1px;
  margin: 0.55em auto 0;
  background: linear-gradient(90deg, transparent, rgba(233, 197, 106, 0.85), transparent);
}
.lead.muted::after {
  display: none;
}
.sheet-body h3.sub {
  margin: 0.9em 0 0.45em;
  text-align: center;
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95em;
}

/* one plate for every card of INFO: dark glass in a fine gold rim */
.pay,
.rule,
.stat-box,
.stat-tag,
.opt-list {
  border: 1px solid rgba(233, 197, 106, 0.5);
  border-radius: 0.8em;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.24));
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 170, 0.14),
    inset 0 0 1.4em rgba(0, 0, 0, 0.35),
    0 0.15em 0.35em rgba(0, 0, 0, 0.4);
}

/* PAYS: a card per kind of bet (two columns when the panel is wide) */
.pay-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17em), 1fr));
  gap: 0.5em;
}

.pay {
  display: grid;
  grid-template-columns: 3.8em minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85em;
  padding: 0.55em 0.85em 0.55em 0.6em;
}

.pay-name b {
  display: block;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.1em;
  line-height: 1.15;
  color: var(--gold-1);
}
.pay-name small {
  display: block;
  margin-top: 0.15em;
  font-size: 0.86em;
  opacity: 0.85;
}

/* what it pays: the board's own painted digits, big, with a small ":1" */
.pay-odds {
  display: flex;
  align-items: baseline;
  gap: 0.05em;
  white-space: nowrap;
}
.pay-odds b {
  font-size: 2.1em;
  line-height: 1;
  filter: drop-shadow(0 0.06em 0.05em rgba(0, 0, 0, 0.8));
}
.pay-odds span {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-size: 1.05em;
  color: var(--gold-2);
}
.pay.lucky {
  border-color: #ffd76a;
  box-shadow:
    inset 0 0 1.2em rgba(255, 214, 110, 0.22),
    0 0 0.6em rgba(255, 214, 110, 0.25);
}
.pay.lucky .pay-odds b {
  font-size: 1.7em;
}

/* the small felt board: gold lines between the cells, the bet's numbers lit, the others asleep, its chip on it */
.bm {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 0.8fr repeat(4, 1fr) 0.7fr 0.7fr;
  gap: 1px;
  width: 3.8em;
  aspect-ratio: 3 / 4.4;
  padding: 1px;
  border-radius: 0.3em;
  background: #b8913c;
  box-shadow: 0 0.12em 0.25em rgba(0, 0, 0, 0.6);
}

.bm i {
  filter: brightness(0.3) saturate(0.5);
}
.bm i:first-child,
.bm i.band {
  grid-column: 1 / -1;
}
.bm i.red {
  background: #c22a34;
}
.bm i.black {
  background: #26262c;
}
.bm i.green {
  background: #1f9a48;
}
.bm i.col,
.bm i.band {
  background: #1c5a3b;
}
.bm i.on {
  filter: brightness(1.15);
  box-shadow:
    inset 0 0 0 1.5px #ffe7a3,
    0 0 0.3em rgba(255, 214, 110, 0.75);
  z-index: 1;
}
.bm.lucky i.on {
  box-shadow:
    inset 0 0 0 1px #ffe08a,
    0 0 0.35em rgba(255, 214, 110, 0.95);
}

.bm-chip {
  position: absolute;
  z-index: 2;
  width: 1.2em;
  height: 1.2em;
  translate: -50% -50%;
  background: url(../../art/chip-1.webp) center / contain no-repeat;
  filter: drop-shadow(0 0.08em 0.08em rgba(0, 0, 0, 0.7));
}

/* RULES: one card per rule, a piece of the game as its picture */
.rule-list {
  display: grid;
  gap: 0.5em;
}

.rule {
  display: grid;
  grid-template-columns: 2.7em minmax(0, 1fr);
  align-items: center;
  gap: 0.85em;
  padding: 0.65em 0.9em 0.65em 0.7em;
}

.rule p {
  margin: 0;
}
.rule-ico {
  display: grid;
  place-items: center;
  width: 2.7em;
  height: 2.7em;
}
.rule-ico img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.1em 0.12em rgba(0, 0, 0, 0.6));
}
.rule-ico .hdisc {
  width: 2.2em;
  height: 2.2em;
  font-size: 1em;
}
.rule-ico .hdisc b {
  font-size: 1.15em;
}

/* the lucky tag, as it looks on the table */
.rule-lk {
  white-space: nowrap;
  padding: 0.15em 0.3em 0.08em;
  font-style: normal;
  font-size: 0.78em;
  line-height: 1;
  border-radius: 0.5em;
  background: linear-gradient(180deg, #4a2c05, #1c0f00);
  box-shadow:
    0 0 0 0.09em #ffd76a,
    0 0.12em 0.25em rgba(0, 0, 0, 0.7),
    0 0 0.7em rgba(255, 214, 110, 0.8);
}

/* NUMBERS: a gold bar per number, its count on top, its roulette disc under it */
.stat-box {
  padding: 0.7em 0.6em 0.6em;
}

.bars {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  align-items: end;
  gap: 0.18em;
  height: 11em;
}

.bar {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  gap: 0.2em;
  height: 100%;
}

.bar small {
  font-size: max(0.78em, 9px);
  line-height: 1;
  opacity: 0.9;
}

.bar > .lvl {
  align-self: end;
  width: 66%;
  height: max(0.2em, calc(100% * var(--h)));
  border-radius: 0.3em 0.3em 0.05em 0.05em;
  background: linear-gradient(90deg, #a86a00, #ffd25c 40%, #fff3b0 55%, #e0a226 80%, #9a6100);
  box-shadow: 0 0 0.4em rgba(255, 200, 80, 0.35);
}

.bar.cold > .lvl {
  background: linear-gradient(90deg, #1d5f8c, #7cc4ee 45%, #dff4ff 58%, #5fa9d9 80%, #1d5f8c);
  box-shadow: 0 0 0.4em rgba(120, 190, 240, 0.35);
}
.bar .hdisc {
  width: min(1.75em, 100%);
  height: auto;
  aspect-ratio: 1;
  font-size: 1em;
}
.bar .hdisc b {
  font-size: 0.95em;
}

.hist-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3em;
}
.hist-row .hdisc {
  width: 2em;
  height: 2em;
}
.hist-row .hdisc:first-child {
  box-shadow:
    0 0 0 0.12em #ffe08a,
    0 0 0.6em rgba(255, 214, 110, 0.7);
}

.stat-tags {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13em), 1fr));
  gap: 0.5em;
  margin-top: 0.8em;
}

.stat-tag {
  display: grid;
  grid-template-columns: 2em minmax(0, 1fr);
  align-items: center;
  gap: 0.2em 0.6em;
  padding: 0.55em 0.75em;
}

.stat-tag img {
  width: 2em;
  height: 2em;
  grid-row: span 2;
}
.stat-tag span {
  color: var(--gold-1);
  font-family: Georgia, 'Times New Roman', serif;
}
.stat-tag div {
  display: flex;
  gap: 0.3em;
}

/* OPTIONS: the switches on one plate, a fine line between them */
.opt-list {
  padding: 0.15em 0.95em;
}
.opt-list .opt-row + .opt-row {
  border-top: 1px solid rgba(233, 197, 106, 0.2);
  padding-top: 0.6em;
}
.muted {
  font-size: 0.88em;
  opacity: 0.8;
}
.buy-price {
  color: var(--gold-1);
  font-size: 1.15em;
  text-align: center;
}
.opt-row small {
  color: rgba(255, 241, 207, 0.8);
}
.sheet-body h3 {
  color: var(--gold-2);
}

/* ======================================================================
   G. Landscape: the stage on the left, the table on the right
   ====================================================================== */
@media (orientation: landscape) {
  .bg-base {
    background-image: url(../../art/bg-landscape.webp);
  }

  /* Everything fits centred; no need to push the button down. */
  .entry {
    justify-content: center;
    padding-top: 1em;
    padding-bottom: 1em;
  }

  .btn-play,
  .entry-cta {
    margin-top: 0;
  }

  .game {
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      'top top'
      'stage table'
      'stage notice';
    gap: 0.3em 0.8em;
    padding-left: calc(16px + var(--safe-l));
    padding-right: calc(16px + var(--safe-r));
  }

  .top {
    grid-area: top;
  }
  .stage {
    grid-area: stage;
  }
  .notice {
    grid-area: notice;
  }

  .table {
    grid-area: table;
    align-self: center;
    width: 100%;
  }

  /* UNDO, CLEAR, REBET and x2 stand two by two beside the board; SPIN, big, fills the corner under them */
  .table-in {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      'rail rail rail'
      'board undo clear'
      'board rebet double'
      'board spin spin'
      'tray spin spin';
    gap: 0.3em 0.4em;
    align-items: center;
  }

  .deck,
  .actions {
    display: contents;
  }
  .rail {
    grid-area: rail;
  }
  .tray {
    grid-area: tray;
    justify-self: center;
  }
  #undo {
    grid-area: undo;
  }
  #clear {
    grid-area: clear;
  }
  #rebet {
    grid-area: rebet;
  }
  #double {
    grid-area: double;
  }
  .actions .btn-ico {
    justify-self: center;
  }
  #clear,
  #double {
    margin-right: calc(var(--fc) * 0.3);
  }

  .board {
    grid-area: board;
    --row: clamp(34px, 10.2vh, 92px);
    --pad-l: calc(var(--fc) * 0.3);
    --pad-r: 0px;
  }

  .inside {
    border-radius: 0.55em 0.55em 0.15em 0.15em;
    grid-template-columns: minmax(0, 0.72fr) repeat(4, minmax(0, 1fr)) minmax(0, 0.72fr);
    grid-template-rows: repeat(3, var(--row));
    grid-template-areas:
      'n0 n3 n6 n9 n12 c3'
      'n0 n2 n5 n8 n11 c2'
      'n0 n1 n4 n7 n10 c1';
  }

  .inside .cell:first-child {
    border-radius: 0.4em 0 0 0;
  }
  .outside {
    grid-template-rows: calc(var(--row) * 1.12);
  }

  .wheel-wrap {
    transform-origin: 40% 96%;
  }

  .spin {
    grid-area: spin;
    justify-self: center;
    align-self: center;
    width: max(7.4em, 92px);
    margin: 0 calc(var(--fc) * 0.3) 0 0;
  }

  /* quick messages go over the hall (left), never over the table */
  .toast {
    top: calc(var(--safe-t) + max(3.9em, 52px));
    left: 22%;
    max-width: 42vw;
  }
}

/* Tall landscape (desktop, tablet lying down). */
@media (orientation: landscape) and (min-height: 521px) {
  .app {
    font-size: clamp(9px, 2.4vh, 19px);
  }
  .app .toast {
    top: calc(var(--safe-t) + 5.9em);
  } /* under the logo of the top bar */
  .logo-small {
    height: 4.4em;
  }
  .spin {
    width: max(8.4em, 110px);
  }
  .tray {
    --th: max(4em, 50px);
  }
}

/* Short landscape (phone lying down): everything compact, touch targets stay 42 px+. */
@media (orientation: landscape) and (max-height: 520px) {
  .app {
    font-size: clamp(11px, 3.5vh, 16px);
  }

  .btn-ico {
    width: 2.95em;
    height: 2.95em;
  }

  .entry {
    gap: 0.5em;
  }
  .entry-logo {
    width: min(40vw, 58vh);
  }
  .game {
    gap: 0.15em 0.7em;
    padding-top: calc(0.3em + var(--safe-t));
    padding-bottom: calc(0.15em + var(--safe-b));
  }
  .logo-small {
    height: 2.7em;
  }
  .balance {
    --ph: max(2.6em, 36px);
  }
  .table {
    --fc: clamp(22px, 2.6em, 40px);
    gap: 0.25em;
  }
  .board {
    --row: clamp(30px, 10.4vh, 52px);
  }
  .tray {
    --th: max(3.2em, 48px);
    gap: 0.3em;
  }
  .actions .btn-ico {
    width: max(3em, 42px);
    height: max(3em, 42px);
  }
  .spin {
    width: max(6.6em, 92px);
  }
  .history {
    height: 1.8em;
  }
}

/* Phone in portrait with the browser bars showing: the em-based sizes drop under a finger's
   size, so every control keeps a 42 px floor (the art scales with the box). */
@media (orientation: portrait) {
  .btn-pill {
    --ph: max(3.7em, 42px);
  }
  .btn-round {
    width: max(2.7em, 42px);
    height: max(2.7em, 42px);
  }
  .btn-ico {
    width: max(2.75em, 42px);
    height: max(2.75em, 42px);
  }
}

/* a very short upright phone (360 x 640 with the bars): the logo gives its height to the wheel */
@media (orientation: portrait) and (max-height: 700px) {
  .logo-small {
    height: 2.6em;
  }
  .spin {
    width: max(6em, 82px);
    margin-block: 0.1em 0.15em;
  }
}

/* the prize lands: a flash, no growth (it stays inside its plate) */
.ws-won b.slam {
  animation: ws-hit 0.45s ease-out;
}
@keyframes ws-hit {
  0% {
    filter: brightness(2.4);
  }
}

/* End of assets/ui/game.css */
