/* Table props show public results only. Nothing animates while awaiting a draw. */
#table-content .game-stage {
  display: grid;
  justify-items: center;
  gap: 18px;
  width: 100%;
  max-width: 560px;
  padding: 16px 0;
}
#table-content .game-stage .hand-label {
  line-height: 1.8;
  font-size: 11px;
  letter-spacing: 1px;
}
.game-surface .draw-group { max-width: 100%; }
.game-surface .surface-title { overflow-wrap: anywhere; }
.game-surface .number-balls { margin-inline: auto; }
.game-surface .dice-faces { gap: clamp(5px, 2vw, 10px); }
.game-surface .dice-faces .number-ball {
  flex: 0 0 auto;
  width: clamp(34px, 8vw, 46px);
  min-width: 0;
  height: clamp(34px, 8vw, 46px);
  background: #f3f0df;
  color: #243a2b;
  border: 1px solid #d3d0ba;
  box-shadow: 0 4px 0 #bebca8, 0 7px 12px #07160d44;
}
.game-surface .dice-faces .die-face { font-size: 38px; line-height: 1; }
.coin-disc {
  display: grid;
  place-content: center;
  justify-items: center;
  width: clamp(130px, 35vw, 176px);
  aspect-ratio: 1;
  border: 8px double #f3d991;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #f9df93, #c99635 70%);
  color: #553916;
  box-shadow: 0 7px 0 #7f5b24, 0 15px 28px #05130944;
  font: 800 70px Georgia, serif;
}
.coin-disc span { font: 700 9px "Segoe UI", sans-serif; letter-spacing: 1.5px; }
.dice-gauge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 380px);
  padding: 22px 18px;
  background: #243d32;
  border: 1px solid #7d9775;
  border-bottom: 7px solid #102b21;
  border-radius: 14px;
  color: #d7e8cc;
}
.dice-gauge span { font-size: 10px; letter-spacing: 1.5px; }
.dice-gauge b { font-size: 48px; color: #eff3df; }
.keno-drum {
  width: min(100%, 310px);
  padding: 44px 18px;
  border: 2px solid #b7c49c;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 15%, #bfd5ad22, #061d1633);
  box-shadow: inset 0 -8px 0 #081c1644, 0 8px 0 #142d22;
}
.keno-drum .number-ball { background: #efdfb6; color: #3c361e; border-color: #fff1cc; }
.bingo-ticket {
  width: min(100%, 230px);
  padding: 16px;
  background: #efe5cb;
  color: #354c36;
  border-radius: 9px;
  border: 5px solid #bd9453;
  box-shadow: 0 8px 0 #152b21;
  transform: rotate(-3deg);
}
.bingo-ticket > b { display: block; text-align: center; letter-spacing: 7px; margin-bottom: 12px; }
.bingo-ticket > div { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.bingo-ticket span { display: grid; place-items: center; aspect-ratio: 1; background: #d9d1b8; font-size: 12px; }
.wheel-wrap { position: relative; padding: 10px; }
.wheel-pointer {
  position: absolute;
  z-index: 1;
  top: 0;
  left: calc(50% - 9px);
  width: 18px;
  height: 24px;
  background: #f7e6bb;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.roulette-wheel {
  display: grid;
  place-items: center;
  width: clamp(150px, 38vw, 210px);
  aspect-ratio: 1;
  border: 8px solid #bf9d59;
  border-radius: 50%;
  background: repeating-conic-gradient(#294d38 0deg 30deg, #af624e 30deg 60deg, #d7b966 60deg 90deg);
  box-shadow: 0 6px 0 #755c32, 0 12px 20px #06150d66;
}
.roulette-wheel b {
  display: grid;
  place-items: center;
  width: 65px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid #e2c987;
  background: #243b2e;
  color: #f3e4bd;
  font-size: 12px;
  letter-spacing: 2px;
}
.flight-chart { width: min(100%, 530px); height: auto; overflow: visible; }
.flight-grid { fill: none; stroke: #d8eacb20; stroke-width: 1; }
.flight-trail { fill: none; stroke: #c0e799; stroke-width: 5; stroke-linecap: round; }
.flight-craft { fill: #f2dc9e; stroke: #334b2f; stroke-width: 2; transform-box: fill-box; transform-origin: center; }
/* Live SVG paths use pathLength=1. The clock owns progress and craft coordinates;
   CSS never overrides the SVG transform or replays a live trajectory on polling. */
.crash-console {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(100%, 530px);
  --flight-color: #c0e799;
}
.crash-console .hand-label { line-height: 1.7; max-width: 42ch; }
#table-content .crash-console[data-live-crash] .flight-trail {
  stroke: var(--flight-color);
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--flight-progress, 0));
  animation: none;
  transition: none;
}
#table-content .crash-console[data-live-crash] .flight-craft {
  animation: none;
  transition: none;
  translate: none;
}
.crash-console.is-crashed { --flight-color: #f4a5a5; }
.crash-console.is-crashed .multiplier,
.crash-console.is-crashed .flight-craft { color: #f4a5a5; fill: #f4a5a5; }
.crash-console.is-cashed { --flight-color: #f1d69a; }
.crash-console.is-cashed .multiplier,
.crash-console.is-cashed .flight-craft { color: #f1d69a; fill: #f1d69a; }
.game-surface .rps-showdown { gap: clamp(8px, 2vw, 22px); max-width: 100%; }
.rps-showdown > span:not(.muted) { font-size: clamp(32px, 8vw, 58px); }
.rps-showdown > div { min-width: 0; padding: clamp(10px, 2vw, 18px); }
.rps-showdown .surface-title { font-size: clamp(17px, 3vw, 26px); margin-bottom: 0; }

/* Selection controls are ordinary theme-aware controls, outside the fixed felt. */
.keno-picker { width: 100%; min-width: 0; border: 0; padding: 0; margin: 0; }
.keno-picker legend { font-size: 13px; font-weight: 700; margin-bottom: 12px; color: var(--panel-text); }
.keno-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 7px; max-width: 520px; margin-bottom: 18px; }
.keno-number {
  min-width: 0;
  min-height: 44px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: var(--raised-text);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.keno-number:hover { border-color: var(--accent-border); }
.keno-number[aria-pressed=true] { background: var(--green); color: var(--ink); border-color: var(--green); box-shadow: inset 0 0 0 2px var(--ink); }
.keno-picker > label { display: grid; gap: 6px; max-width: 520px; color: var(--panel-muted); font-size: 12px; }
.keno-picker input { width: 100%; font-size: 16px; }
.keno-picker p { margin: 12px 0 4px; font-size: 12px; }
.keno-picker small { display: block; line-height: 1.6; }
.selection-tools, .stake-adjustments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.selection-tools button, .stake-adjustments button, .random-choice { min-height: 40px; padding: 9px 14px; font-size: 12px; }
.stake-adjustments button[data-adjust-stake] { min-width: 48px; font-size: 16px; }
.random-choice { align-self: end; }
.options-row .picks { min-width: 0; }
.options-row .pick span { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.game-tools { flex-wrap: wrap; }
.motion-choice { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); }
.game-tools .motion-choice button { min-height: 36px; padding: 7px 10px; border-radius: 5px; color: var(--raised-text); font-size: 11px; }
.game-tools .motion-choice button[aria-pressed=true] { background: var(--green); color: var(--ink); font-weight: 700; }

/* One short reveal per returned result. Final values never count through invented rolls.
   Backwards fill restores persistent state (such as held cards) after the reveal. */
html[data-motion=animated] .round-reveal .result { animation: result-arrive .32s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=coinflip] .idle-art,
html[data-motion=animated] .round-reveal[data-game=coinflip] .coin-disc { animation: coin-land .85s cubic-bezier(.2,.7,.2,1) backwards; }
html[data-motion=animated] .round-reveal[data-game=dice] .multiplier { animation: dice-score .55s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=slots] .reel { animation: reel-stop .65s cubic-bezier(.2,.8,.2,1) backwards; }
html[data-motion=animated] .round-reveal[data-game=scratch] .reel { animation: scratch-uncover .45s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=rps] .rps-showdown > div { animation: hand-showdown .55s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=rps] .rps-showdown > div:last-child { animation-delay: .16s; }
html[data-motion=animated] .round-reveal[data-game=war] .playing-card { animation: war-flip .6s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=war] .hand:nth-of-type(2) .playing-card { animation-delay: .22s; }
html[data-motion=animated] .round-reveal[data-game=baccarat] .playing-card { animation: banker-deal .5s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=blackjack] .playing-card { animation: table-deal .45s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=videopoker] .playing-card { animation: poker-fan .5s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=higherlower] .playing-card { animation: higher-turn .5s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=dicepoker] .dice-faces .number-ball { animation: poker-dice .65s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=ceelo] .dice-faces .number-ball { animation: street-dice .6s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=ceelo] .draw-group ~ .draw-group .number-ball { animation-delay: .42s; }
html[data-motion=animated] .round-reveal[data-game=keno] .number-ball { animation: ball-draw .5s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=keno2] .number-ball { animation: double-draw .5s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=keno3] .number-ball { animation: spot-draw .5s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=bingo] .number-ball { animation: bingo-stamp .45s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=wheel] .roulette-wheel { animation: wheel-settle 1.1s cubic-bezier(.15,.65,.2,1) backwards; }
html[data-motion=animated] .round-reveal[data-game=wheel] .multiplier { animation: wheel-score .7s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=cases] .case-prize { animation: case-open .7s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=limbo] .multiplier { animation: limbo-rise .6s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=crash] .multiplier { animation: crash-thrust .55s ease-out backwards; }
html[data-motion=animated] .round-reveal:is([data-game=crash], [data-game=limbo]) .flight-trail { stroke-dasharray: 660; animation: flight-draw .85s ease-out backwards; }
html[data-motion=animated] .round-reveal:is([data-game=crash], [data-game=limbo]) .flight-craft { animation: craft-arrive .85s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=crash] .crash-visual { animation: crash-thrust .55s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=tower] .tower-floor.cleared { animation: floor-rise .45s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=mines] .mines .gem { animation: gem-discover .5s ease-out backwards; }
html[data-motion=animated] .round-reveal[data-game=mines] .mines .bomb { animation: mine-reveal .45s ease-out backwards; }

/* Stagger caps keep even a 25-ball draw below 1.5 seconds. */
html[data-motion=animated] .round-reveal :is(.reel, .playing-card, .number-ball):nth-child(2) { animation-delay: .06s; }
html[data-motion=animated] .round-reveal :is(.reel, .playing-card, .number-ball):nth-child(3) { animation-delay: .12s; }
html[data-motion=animated] .round-reveal :is(.reel, .playing-card, .number-ball):nth-child(4) { animation-delay: .18s; }
html[data-motion=animated] .round-reveal :is(.reel, .playing-card, .number-ball):nth-child(5) { animation-delay: .24s; }
html[data-motion=animated] .round-reveal :is(.reel, .playing-card, .number-ball):nth-child(n+6) { animation-delay: .3s; }
html[data-motion=animated] .round-reveal :is(.reel, .number-ball):nth-child(n+8) { animation-delay: .4s; }
html[data-motion=animated] .round-reveal .number-ball:nth-child(n+11) { animation-delay: .5s; }

@keyframes result-arrive { from { transform: translateY(6px); } to { transform: none; } }
@keyframes coin-land { 0% { transform: translateY(-24px) rotateY(-270deg) scale(.85); } 70% { transform: translateY(3px) rotateY(0); } 100% { transform: none; } }
@keyframes dice-score { 0% { transform: translateX(-12px) rotate(-7deg); } 40% { transform: translateX(7px) rotate(4deg); } 75% { transform: translateX(-2px); } 100% { transform: none; } }
@keyframes reel-stop { 0% { transform: translateY(-18px) scaleY(.88); } 70% { transform: translateY(5px) scaleY(1.04); } 100% { transform: none; } }
@keyframes scratch-uncover { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes hand-showdown { 0% { transform: translateY(14px) rotate(-6deg); } 65% { transform: translateY(-3px); } 100% { transform: none; } }
@keyframes war-flip { from { transform: perspective(600px) rotateY(-80deg); } to { transform: none; } }
@keyframes banker-deal { from { transform: translateX(28px) rotate(7deg); } to { transform: none; } }
@keyframes table-deal { from { transform: translate(-20px,-16px) rotate(-9deg); } to { transform: none; } }
@keyframes poker-fan { from { transform: translateY(18px) rotate(-12deg); } to { transform: none; } }
@keyframes higher-turn { from { transform: perspective(600px) rotateX(65deg) translateY(-10px); } to { transform: none; } }
@keyframes poker-dice { 0% { transform: translateY(-15px) rotate(-95deg); } 65% { transform: translateY(3px) rotate(8deg); } 100% { transform: none; } }
@keyframes street-dice { 0% { transform: translateX(-22px) rotate(-120deg); } 70% { transform: translateX(3px) rotate(8deg); } 100% { transform: none; } }
@keyframes ball-draw { 0% { transform: translateY(-16px) scale(.8); } 65% { transform: translateY(3px) scale(1.04); } 100% { transform: none; } }
@keyframes double-draw { from { transform: translateX(-16px) rotate(-35deg); } to { transform: none; } }
@keyframes spot-draw { 0% { transform: scale(.65); } 65% { transform: scale(1.12); } 100% { transform: none; } }
@keyframes bingo-stamp { 0% { transform: scale(1.22) rotate(8deg); } 75% { transform: scale(.97); } 100% { transform: none; } }
@keyframes wheel-settle { from { transform: rotate(-330deg); } to { transform: rotate(0); } }
@keyframes wheel-score { 0% { transform: scale(.88) rotate(-7deg); } 70% { transform: scale(1.03); } 100% { transform: none; } }
@keyframes case-open { 0% { transform: translateY(14px) scale(.8); } 60% { transform: translateY(-7px) scale(1.03); } 100% { transform: none; } }
@keyframes limbo-rise { from { transform: translateY(28px) scale(.8); } to { transform: none; } }
@keyframes crash-thrust { from { transform: translate(-12px,12px) scale(.94); } to { transform: none; } }
@keyframes flight-draw { from { stroke-dashoffset: 660; } to { stroke-dashoffset: 0; } }
@keyframes craft-arrive { from { translate: -45px 22px; } to { translate: 0 0; } }
@keyframes floor-rise { from { transform: translateY(7px); filter: brightness(1.35); } to { transform: none; filter: none; } }
@keyframes gem-discover { 0% { transform: scale(.88); } 65% { transform: scale(1.06); } 100% { transform: none; } }
@keyframes mine-reveal { 0%, 100% { transform: none; } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

@media (max-width: 540px) {
  .keno-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .game-tools { gap: 8px; padding: 12px; }
  .game-tools .grow { display: none; }
  .motion-choice { margin-left: auto; }
  .game-surface .slot-reels { max-width: 100%; padding: 10px; gap: 6px; border-width: 5px; }
  .game-surface .slot-reels:not(.scratch-grid) .reel { width: clamp(42px, 16vw, 64px); height: 70px; }
  .game-surface .scratch-grid .reel { width: 48px; height: 48px; }
  .game-surface .rps-showdown .hand-label { font-size: 9px; letter-spacing: .6px; }
  .game-surface .rps-showdown > div { padding: 10px 8px; }
  .selection-tools button, .stake-adjustments button { min-height: 44px; }
  .game-tools .motion-choice button { min-height: 40px; }
}

/* These overrides also neutralize legacy/loading animations, regardless of selector weight. */
html[data-motion=instant] #table-content *,
html[data-motion=instant] #table-content *::before,
html[data-motion=instant] #table-content *::after {
  animation: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  #table-content *, #table-content *::before, #table-content *::after {
    animation: none !important;
    transition: none !important;
  }
}
#table-content [hidden] { display: none !important; }
