/* The same physical objects stay mounted from the first frame to the stop. */
[data-motion-game] .reel-strip,
[data-motion-game] .wheel,
[data-motion-game] .wheel-pointer { animation: none !important; }
[data-motion-game="slots"] .reel-strip { opacity: 1; transform: translateY(calc(var(--reel-position, 0) * -8.333333333333%)); will-change: transform; }
[data-motion-game="slots"] .reel-window::before { content: none !important; }
[data-motion-game="roulette"] .wheel { will-change: transform; }
[data-motion-game="roulette"] .wheel-pointer { transform-origin: 50% 0; }
[data-motion-game="roulette"][data-motion-state="rolling"] .stage-caption b,
[data-motion-game="roulette"][data-motion-state="braking"] .stage-caption b { visibility: hidden; }
[data-motion-game="roulette"] .stage-caption { flex: 0 0 126px; width: 126px; }

.physical-dice { overflow: hidden; isolation: isolate; }
.physical-dice .dice-pair { gap: 82px; min-height: 185px; align-items: center; perspective: 900px; margin: 28px 0 6px; }
.dice-rig { --die-size: 66px; width: var(--die-size); height: var(--die-size); position: relative; }
.die-camera { width: 100%; height: 100%; transform: rotateX(-18deg) rotateY(-24deg) rotateZ(-8deg); transform-style: preserve-3d; }
.dice-rig:nth-child(2) .die-camera { transform: rotateX(-18deg) rotateY(24deg) rotateZ(10deg); }
.die-solid { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; will-change: transform; }
.die-face { position: absolute; inset: 0; display: grid; grid-template: repeat(3,1fr) / repeat(3,1fr); gap: 4px; padding: 11px; border: 1px solid #e2e6df; border-radius: 9px; background: linear-gradient(135deg,#fffdf2,#e4e8df); box-shadow: inset 0 0 7px #9ba79870; backface-visibility: hidden; }
.die-face i { border-radius: 50%; background: #233b34; box-shadow: inset 1px 2px 2px #071a1580,0 1px 0 #fff; }
.die-face-1 { transform: translateZ(calc(var(--die-size) / 2)); }
.die-face-6 { transform: rotateY(180deg) translateZ(calc(var(--die-size) / 2)); }
.die-face-2 { transform: rotateY(90deg) translateZ(calc(var(--die-size) / 2)); }
.die-face-5 { transform: rotateY(-90deg) translateZ(calc(var(--die-size) / 2)); }
.die-face-3 { transform: rotateX(90deg) translateZ(calc(var(--die-size) / 2)); }
.die-face-4 { transform: rotateX(-90deg) translateZ(calc(var(--die-size) / 2)); }
.die-shadow { position: absolute; width: 90px; height: 20px; left: -10px; bottom: -20px; background: #0007; filter: blur(8px); border-radius: 50%; z-index: -1; }
.physical-dice .dice-total { min-height: 22px; font-size: 13px; letter-spacing: .04em; position: relative; bottom: 16px; }

.pinball-cabinet { background: radial-gradient(ellipse at 50% 25%,#25434b75,transparent 65%),#101a23; border: 1px solid #8dbdb93b; border-radius: 14px; padding: 12px; box-shadow: inset 0 0 0 5px #080f174d; }
.pinball-board { display: block; width: 100%; max-width: 480px; height: auto; aspect-ratio: 480/438; margin: auto; overflow: visible; }
.pinball-rail { fill: #0b142547; stroke: #6b9098; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.pinball-launch { fill: none; stroke: #c1d9d6; stroke-width: 5; stroke-linecap: round; }
.pin-stud { fill: url(#pin-metal); filter: drop-shadow(0 2px 1px #0009); }
.pin-impact { fill: none; stroke: #9bf9ec; stroke-width: 1.5; opacity: 0; }
.pinball-pin.hit .pin-stud { fill: #e1fff8; filter: drop-shadow(0 0 5px #b2fff0); }
.pinball-pin:not(.hit) .pin-impact { opacity: 0 !important; }
.pinball-ball { fill: url(#ball-metal); stroke: #ffe9a4; stroke-width: .6; }
.pinball-shadow { fill: #0007; filter: blur(1px); }
.pin-pocket rect { fill: #1b3341; stroke: #65818d; stroke-width: 1; }
.pin-pocket path { fill: none; stroke: #8aa2ad; stroke-width: 3; stroke-linecap: round; }
.pin-pocket text { fill: #d5e5e8; font: 700 12px system-ui,sans-serif; text-anchor: middle; }
.pin-pocket:first-of-type rect { fill: #725c35; }
.pin-pocket[data-bin="0"] rect, .pin-pocket[data-bin="8"] rect { fill: #68533b; }
.pin-pocket[data-bin="1"] rect, .pin-pocket[data-bin="7"] rect { fill: #50466b; }
.pin-pocket.landed rect { fill: #e5c27c; stroke: #fff2bc; stroke-width: 2; }
.pin-pocket.landed text { fill: #332617; }

/* Fixed front and back faces share one solid coin throughout a toss. */
.physical-coin { isolation: isolate; }
.coin-scene { --coin-size: 132px; position: relative; width: 260px; height: 280px; perspective: 900px; }
.coin-rig { position: absolute; bottom: 32px; left: calc(50% - var(--coin-size) / 2); width: var(--coin-size); height: var(--coin-size); }
.coin-camera, .coin-body { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.coin-camera { transform: rotateX(-12deg) rotateZ(-12deg); }
.coin-body { will-change: transform; }
.coin-face, .coin-edge { position: absolute; inset: 0; border-radius: 50%; }
.coin-edge { background: repeating-conic-gradient(#dbb767 0deg 3deg,#8c631f 3deg 5deg); border: 1px solid #b4873d; }
.coin-face { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 5px solid #e9c676; outline: 1px solid #946425; box-shadow: inset 0 0 0 2px #8c6328,inset 0 0 0 5px #f5d687; backface-visibility: hidden; }
.coin-face span { font-size: 66px; line-height: 1; font-family: Georgia,serif; }
.coin-face small { font: 800 9px system-ui,sans-serif; letter-spacing: 3px; margin-left: 3px; }
.coin-sun { transform: translateZ(7px); color: #775020; background: radial-gradient(circle at 30% 22%,#fff3bd,#e5b65a 60%,#a87127); text-shadow: 0 1px #fff6ca; }
.coin-moon { transform: rotateY(180deg) translateZ(7px); color: #394569; border-color: #b8c4df; outline-color: #4b5a76; background: radial-gradient(circle at 30% 22%,#f6f6ff,#a4b5d4 60%,#657591); box-shadow: inset 0 0 0 2px #657591,inset 0 0 0 5px #dce4f2; text-shadow: 0 1px #eef3ff; }
.coin-scene .coin-shadow { position: absolute; left: 50%; bottom: 18px; width: 140px; height: 19px; margin: 0; background: #0009; border-radius: 50%; filter: blur(6px); transform: translateX(-50%); }

/* Flip the complete card; its two faces never change halfway through. */
.physical-duel { gap: 44px; min-height: 300px; }
.physical-duel .card-hand { min-width: 0; }
.duel-perspective { width: 92px; height: 134px; perspective: 850px; }
.duel-flipper { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; will-change: transform; }
.duel-front, .duel-back { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 10px; }
.duel-front { transform: rotateY(180deg); }
.duel-front .playing-cards { display: block; width: 100%; height: 100%; margin: 0; }
.physical-duel .playing-card { display: block; width: 100%; height: 100%; margin: 0; transform: none !important; animation: none !important; }
.physical-duel .playing-card::after { content: none !important; }
.physical-duel .playing-card>b, .physical-duel .playing-card>span { opacity: 1 !important; animation: none !important; }
.duel-back { display: grid; place-items: center; color: #ead7a3; border: 4px solid #eee5d7; background: repeating-linear-gradient(45deg,#263957 0 3px,#344a6d 3px 6px); box-shadow: 0 5px 0 #0b1224,0 8px 18px #0006; }
.duel-back::before { content: ''; position: absolute; inset: 8px; border: 1px solid #ddc996; border-radius: 5px; }
.duel-back span { font: 700 25px Georgia,serif; letter-spacing: -4px; padding-right: 4px; }
.physical-duel.decided .card-hand.winner .duel-front { box-shadow: 0 0 0 3px #ebcf89,0 0 25px #ebcf8955; }

.physical-rocket .rocket-ship { transition: none; will-change: transform; }
.physical-rocket .rocket-impact-fx { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.rocket-burst { display: block; position: absolute; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle,#fff9d0 0 8%,#ffc65d 15%,#f57333 32%,#c13a2255 52%,transparent 70%); }
.rocket-fragment { position: absolute; width: 6px; height: 12px; border-radius: 2px; background: #ffb25f; box-shadow: 0 0 8px #ed703f; }
.rocket-fragment:nth-child(3n) { background: #a6b6c4; width: 8px; height: 5px; box-shadow: none; }
.physical-rocket.impact { border-color: #b96258; background: radial-gradient(ellipse at 65% 60%,#71352977,transparent 70%),#1c1520; }
.physical-rocket.impact .rocket-ship .game-art { animation: none; }
.physical-rocket[data-flight-phase="wreck"] .rocket-ship { filter: grayscale(.85) brightness(.38); }
.physical-rocket.impact .flight-chart { color: #cf755f; opacity: .45; }
.physical-rocket.impact .rocket-label { color: #ffc1ac; font-weight: 700; }

/* Every token and label gets the same center, irrespective of word length. */
.sort-chip { flex: none; vertical-align: middle; }
.sort-chip svg { display: block; width: 66%; height: 66%; fill: currentColor; }
.sort-bins .sort-bin { display: grid; grid-template-rows: 38px 20px; place-items: center; align-content: center; gap: 6px; min-height: 94px; padding: 10px 6px; }
.sort-bins .sort-chip { width: 38px; height: 38px; }
.sort-bins .sort-bin b { display: block; line-height: 20px; text-align: center; }
.work-idle .sort-chip, .work-idle .sort-chip:nth-child(2), .work-idle .sort-chip:nth-child(3) { transform: none; }

.blackjack-explanation { border: 1px solid #b6c9bd28; background: #19282080; border-radius: 10px; padding: 12px; line-height: 1.65; }
.blackjack-explanation strong { display: block; font-size: 15px; color: #f1ead3; }
.blackjack-explanation p { margin: 5px 0 0; font-size: 12px; color: #d1dbd6; }
.blackjack-explanation .card-sum { font-variant-numeric: tabular-nums; color: #b1c6b9; font-size: 12px; }
.blackjack-explanation small { display: block; margin-top: 5px; font-size: 11px; color: #a7bab0; }
.blackjack-explanation.busted { border-color: #e98c9566; background: #572a3538; }
.blackjack-explanation.busted strong { color: #ffb3bd; }
/* Dealt cards enter from outside the table without widening the mobile page. */
.blackjack-table { overflow: hidden; overflow: clip; }
.blackjack-table .playing-card { animation: none !important; }
.card-table.blackjack-table.revealing .card-hand:first-child .playing-card:not(:first-child)::after {
  animation: blackjack-cover .34s steps(1,end) both;
  animation-delay: calc(.08s + (var(--i) - 1)*.13s);
}
@keyframes blackjack-cover { 0%,49.99% { opacity: 1; } 50%,100% { opacity: 0; } }
@media(max-width:600px) {
  .coin-scene { --coin-size: 116px; width: 230px; height: 240px; }
  .coin-face span { font-size: 58px; }
  .physical-duel { gap: 20px; }
  .duel-perspective { width: 74px; height: 108px; }
  .physical-duel .duel-vs { font-size: 16px; }
  .physical-dice .dice-pair { gap: 46px; min-height: 166px; }
  .dice-rig { --die-size: 51px; }
  .die-face { padding: 8px; gap: 3px; border-radius: 7px; }
  .die-shadow { width: 68px; left: -8px; }
  .pinball-cabinet { padding: 6px; }
  .blackjack-explanation { padding: 11px 12px; }
}
@media(prefers-reduced-motion:reduce) {
  html:not([data-game-motion="full"]) [data-motion-game] *, html:not([data-game-motion="full"]) .pinball-cabinet * { animation: none !important; }
}

html[data-game-motion="simple"] *, html[data-game-motion="simple"] *::before, html[data-game-motion="simple"] *::after { animation: none !important; transition: none !important; }
html[data-game-motion="simple"] .win-sparks { display: none; }
html .boot-retry { animation: show-boot-retry 1ms 8s forwards !important; }
.win-sparks { left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; }
.win-sparks i { left: 50%; top: 46%; }
