.tpk-facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-xs) var(--space-lg); margin: var(--space-sm) 0; }
.tpk-facts dt { color: var(--muted); }
.tpk-facts dd { margin: 0; font-weight: 500; }
.tpk-guest-panel { max-width: 680px; }
.tpk-game-rules { margin-top: var(--space-xl); }

.tpk-game-top { display: grid; grid-template-columns: minmax(200px, 360px) minmax(0, 1fr); gap: var(--gap-columns); align-items: end; padding-top: var(--space-lg); padding-bottom: var(--space-lg); border-bottom: 5px double var(--rule-2); }
.tpk-game-cover { position: relative; }
.tpk-cover-hero { border: 1px solid var(--rule-2); }
.tpk-game-info h1 { margin-block: 0.15em 0.25em; max-width: 14ch; }
.tpk-game-play { margin-top: var(--space-lg); }

.tpk-stage { background: var(--stage); color: var(--on-stage); border-top: 4px solid var(--ink); padding: var(--space-lg); position: relative; display: grid; gap: var(--space-md); overflow: hidden; }
.tpk-stage label, .tpk-stage .tpk-label { color: var(--on-stage-2); }
.tpk-stage input, .tpk-stage select { background: var(--stage-2); color: var(--on-stage); border-color: var(--on-stage-2); }
.tpk-stage input:hover, .tpk-stage select:hover { border-color: var(--on-stage); }
.tpk-stage input:focus, .tpk-stage select:focus { border-color: var(--brass); outline-color: var(--brass-hi); }
.tpk-stage :focus-visible { outline-color: var(--brass-hi); }
.tpk-stage .tpk-btn { background: var(--paper); color: var(--ink); }
.tpk-stage .tpk-btn:hover { background: var(--paper-3); }
.tpk-stage .tpk-btn:disabled { background: var(--stage-3); color: var(--on-stage-2); cursor: not-allowed; }
.tpk-stage .tpk-btn.tpk-ghost { background: none; color: var(--on-stage); border-block: 1px solid var(--on-stage-2); }
.tpk-stage .tpk-btn.tpk-ghost:hover { background: var(--stage-2); }
.tpk-stage .tpk-btn[aria-pressed="true"], .tpk-stage button[aria-pressed="true"] { background: var(--brass); color: var(--on-brass); }
.tpk-stage-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; z-index: 0; pointer-events: none; }
.tpk-hilo-table > *:not(.tpk-stage-bg), .tpk-bj-table > *:not(.tpk-stage-bg), .tpk-rt-wrap > *:not(.tpk-stage-bg), .tpk-wheel-game > *:not(.tpk-stage-bg) { position: relative; z-index: 1; }
.tpk-stage-msg { min-height: 1.6em; margin: 0; font: 700 1.25rem/1.3 var(--f-display); }
.tpk-stage-msg.tpk-win { color: var(--brass-hi); }
.tpk-stage-msg.tpk-lose { color: var(--on-stage-2); }
.tpk-stage-msg.tpk-error { color: var(--stage-bad-hi); }
.tpk-controls { display: flex; flex-wrap: wrap; gap: var(--space-md); align-items: end; }
.tpk-bet { display: flex; gap: var(--space-sm); align-items: end; flex-wrap: wrap; }
.tpk-bet-field { display: grid; gap: var(--space-2xs); }
.tpk-bet-field input, .tpk-bet-field select { width: 150px; }
.tpk-bet-quick { display: flex; gap: var(--space-xs); flex-wrap: wrap; }
.tpk-spin-btn { padding: var(--space-md) var(--space-xl); font-size: 1.25rem; }
a.tpk-spin-btn { text-decoration: none; }
.tpk-win-total { margin: 0; font: 700 1.5rem/1.2 var(--f-display); color: var(--brass-hi); min-height: 1.4em; }
.tpk-segmented { display: inline-flex; gap: var(--space-xs); }
.tpk-dice-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-xs) var(--space-md); margin: 0; }
.tpk-dice-facts dt { color: var(--on-stage-2); font-size: var(--text-sm); }
.tpk-dice-facts dd { margin: 0 0 var(--space-xs); font: 500 1rem/1.3 var(--f-figure); }

.tpk-slot-machine { max-width: 720px; width: 100%; margin-inline: auto; background: var(--stage-2); border: 3px solid var(--brass); padding: var(--space-md); }
.tpk-slot-banner { margin: 0 0 var(--space-xs); text-align: center; font: 700 1.15rem/1.3 var(--f-display); color: var(--brass-hi); }
.tpk-slot-banner[hidden] { display: none; }
.tpk-reels { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-xs); position: relative; }
.tpk-reel { display: grid; grid-template-rows: repeat(3, 1fr); gap: var(--space-xs); overflow: hidden; }
.tpk-cell { aspect-ratio: 1; background: var(--stage-3); display: grid; place-items: center; overflow: hidden; position: relative; border: 1px solid var(--stage-line); }
.tpk-cell.tpk-win { outline: 3px solid var(--brass-hi); outline-offset: -3px; animation: pulse .8s ease-in-out 3; z-index: 1; }
.tpk-cell.tpk-win .tpk-sym { filter: drop-shadow(0 2px 4px var(--stage)); }
.tpk-reel.tpk-spin .tpk-cell { filter: blur(1.5px); transform: translateY(2px); }
.tpk-reel.tpk-land .tpk-cell { animation: land .28s ease-out; }
.tpk-sym { display: grid; place-items: center; width: 100%; height: 100%; padding: var(--space-3xs); font-weight: 700; text-align: center; line-height: 1.05; font-size: clamp(.62rem, 2vw, .95rem); color: var(--on-stage); }
.tpk-sym img { width: 100%; height: 100%; object-fit: contain; }
.tpk-sym-label { padding: var(--space-3xs); width: 100%; height: 100%; display: grid; place-items: center; background: var(--stage-3); }
.tpk-sym-1 { background: var(--brass); color: var(--on-brass); }
.tpk-line-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; overflow: visible; }
.tpk-win-caption { margin: var(--space-sm) 0 0; text-align: center; font-weight: 500; color: var(--brass-hi); }
.tpk-win-caption[hidden] { display: none; }

.tpk-plinko-board { background: var(--stage-2); padding: var(--space-sm) var(--space-xs); }
.tpk-plinko-field { position: relative; width: 100%; max-width: 640px; margin-inline: auto; }
.tpk-plinko-peg { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--on-stage-2); transform: translate(-50%, -50%); }
.tpk-plinko-ball { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--brass-hi); transform: translate(-50%, -50%); z-index: 2; }
.tpk-plinko-ball[hidden] { display: none; }
.tpk-plinko-slots { display: grid; grid-template-columns: repeat(13, 1fr); gap: var(--space-2xs); max-width: 640px; margin: var(--space-xs) auto 0; }
.tpk-plinko-slot { text-align: center; padding: var(--space-xs) 0; font: 500 clamp(.55rem, 1.9vw, .85rem)/1.2 var(--f-figure); background: var(--stage-3); }
.tpk-plinko-slot.tpk-tier-hot { background: var(--stage-bad); }
.tpk-plinko-slot.tpk-tier-warm { background: var(--brass); color: var(--on-brass); }
.tpk-plinko-slot.tpk-tier-even { background: var(--stage-line); }
.tpk-plinko-slot.tpk-hit { outline: 3px solid var(--on-stage); transform: translateY(-3px); }
.tpk-plinko-cap { margin: var(--space-xs) 0 0; text-align: center; color: var(--on-stage-2); font-size: var(--text-sm); }

.tpk-dice-track { position: relative; height: 34px; overflow: hidden; display: flex; background: var(--stage-2); max-width: 720px; width: 100%; margin-inline: auto; }
.tpk-dice-zone { display: block; height: 100%; }
.tpk-dice-win { background: var(--stage-ok); }
.tpk-dice-lose { background: var(--stage-bad); }
.tpk-dice-marker { position: absolute; top: 4px; bottom: 4px; width: 6px; background: var(--on-stage); left: 0; transition: transform .5s ease-out; }
.tpk-dice-marker.tpk-win { outline: 2px solid var(--stage-ok); }
.tpk-dice-marker.tpk-lose { outline: 2px solid var(--stage-bad-hi); }
.tpk-dice-roll { text-align: center; font: 700 2.6rem/1.1 var(--f-display); margin: 0; font-variant-numeric: tabular-nums; }
input[type="range"] { padding: 0; accent-color: var(--brass); width: min(320px, 100%); }

.tpk-wheel-game { position: relative; display: grid; place-items: center; padding: var(--space-xs); overflow: hidden; }
.tpk-wheel-holder { position: relative; width: min(380px, 100%); }
.tpk-wheel-svg { width: 100%; height: auto; display: block; }
.tpk-wheel-spinner { transform-box: fill-box; transform-origin: center; }
.tpk-wheel-pointer-game { position: absolute; left: 50%; top: -6px; width: 0; height: 0; transform: translateX(-50%); border: 12px solid transparent; border-top: 24px solid var(--brass-hi); z-index: 2; }

.tpk-keno-board { display: grid; grid-template-columns: repeat(8, 1fr); gap: var(--space-xs); max-width: 560px; }
.tpk-keno-tile { aspect-ratio: 1; border: 1px solid var(--stage-line); background: var(--stage-2); color: var(--on-stage); font: 500 1rem/1 var(--f-figure); cursor: pointer; }
.tpk-keno-tile:hover { border-color: var(--on-stage-2); }
.tpk-keno-tile.tpk-picked { background: var(--brass); color: var(--on-brass); border-color: var(--brass); }
.tpk-keno-tile.tpk-drawn { background: var(--stage-line); }
.tpk-keno-tile.tpk-hit { background: var(--stage-ok); color: var(--on-brass); border-color: var(--on-stage); animation: pulse .6s ease-in-out 2; }
.tpk-keno-pay { margin: 0; color: var(--on-stage-2); }

.tpk-scratch-card { color: var(--on-stage); display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-sm); max-width: 420px; padding: var(--space-md); background: var(--stage-2); border: 2px solid var(--brass); }
.tpk-scratch-tile { aspect-ratio: 1.3; border: 0; font: 700 1.3rem/1 var(--f-display); cursor: pointer; background: repeating-linear-gradient(135deg, var(--rule), var(--rule) 6px, var(--paper-3) 6px, var(--paper-3) 12px); color: var(--ink); }
.tpk-scratch-tile:disabled { cursor: default; }
.tpk-scratch-tile.tpk-open { background: var(--paper); animation: land .3s ease-out; }
.tpk-scratch-tile.tpk-match { background: var(--brass-hi); outline: 3px solid var(--on-stage); }

.tpk-mines-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-xs); max-width: 420px; }
.tpk-mine-tile { aspect-ratio: 1; border: 1px solid var(--stage-line); background: var(--stage-3); cursor: pointer; position: relative; }
.tpk-mine-tile:disabled { cursor: default; }
.tpk-mine-tile:not(:disabled):hover { background: var(--stage-line); }
.tpk-mine-tile.tpk-safe { background: var(--stage-2); }
.tpk-mine-tile.tpk-safe::after { content: ""; position: absolute; inset: 24%; background: var(--brass-hi); transform: rotate(45deg); }
.tpk-mine-tile.tpk-pop { animation: land .3s ease-out; }
.tpk-mine-tile.tpk-mine { background: var(--stage-2); }
.tpk-mine-tile.tpk-mine::after { content: ""; position: absolute; inset: 28%; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px var(--on-stage-2); }
.tpk-mine-tile.tpk-boom { background: var(--stage-bad); animation: pulse .5s ease-in-out 2; }
.tpk-mine-tile.tpk-dim { opacity: .45; }

.tpk-pcard { display: inline-grid; grid-template-rows: auto 1fr; justify-items: center; width: 74px; height: 104px; background: var(--paper); padding: var(--space-xs) var(--space-2xs); font-weight: 700; }
.tpk-pcard.tpk-red { color: var(--error); }
.tpk-pcard.tpk-dark { color: var(--ink); }
.tpk-pcard-rank { font: 700 1.3rem/1 var(--f-display); }
.tpk-pcard-suit { font-size: 2rem; align-self: center; }
.tpk-pcard.tpk-down { background: repeating-linear-gradient(45deg, var(--ink-2), var(--ink-2) 6px, var(--rule-2) 6px, var(--rule-2) 12px); border: 3px solid var(--paper); }
.tpk-pcard.tpk-mini { width: 40px; height: 56px; }
.tpk-pcard.tpk-mini .tpk-pcard-rank { font-size: .85rem; }
.tpk-pcard.tpk-mini .tpk-pcard-suit { font-size: 1.1rem; }
.tpk-pcard.tpk-flip, .tpk-pcard.tpk-deal-in { animation: deal .35s ease-out; }
.tpk-hilo-table, .tpk-bj-table { background: var(--stage-2); padding: var(--space-md); display: grid; gap: var(--space-sm); justify-items: center; position: relative; overflow: hidden; min-height: 220px; }
.tpk-hilo-current .tpk-pcard { width: 100px; height: 140px; }
.tpk-hilo-trail { display: flex; gap: var(--space-xs); flex-wrap: wrap; justify-content: center; min-height: 56px; }
.tpk-guess-row { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.tpk-bj-label { margin: 0; font-weight: 500; color: var(--on-stage); }
.tpk-bj-hand { display: flex; gap: var(--space-xs); flex-wrap: wrap; justify-content: center; min-height: 108px; }

.tpk-rt-wrap { display: grid; gap: var(--space-md); position: relative; padding: var(--space-xs); overflow: hidden; }
.tpk-rt-wheel { display: grid; justify-items: center; gap: var(--space-xs); }
.tpk-rt-wheel .tpk-wheel-svg { width: min(300px, 80%); }
.tpk-rt-result { margin: 0; font: 700 1.2rem/1.3 var(--f-display); }
.tpk-rt-label { color: var(--on-stage-2); }
.tpk-rt-board { display: grid; grid-template-columns: 0.9fr repeat(12, 1fr) 1.1fr; grid-template-rows: repeat(5, 40px); gap: var(--space-2xs); max-width: 760px; width: 100%; margin-inline: auto; }
.tpk-rt-spot { position: relative; border: 1px solid var(--stage-line); color: var(--on-stage); font: 500 .85rem/1 var(--f-figure); cursor: pointer; background: var(--stage-2); padding: 0; }
.tpk-rt-spot.tpk-red, .tpk-rt-spot.tpk-outside.tpk-red { background: var(--stage-bad); }
.tpk-rt-spot.tpk-black, .tpk-rt-spot.tpk-outside.tpk-black { background: var(--ink); }
.tpk-rt-spot.tpk-green { background: var(--ok); }
.tpk-rt-spot.tpk-outside { background: var(--stage-2); }
.tpk-rt-spot.tpk-has-chip { outline: 2px solid var(--brass); }
.tpk-rt-spot.tpk-won { outline: 3px solid var(--on-stage); animation: pulse .7s ease-in-out 3; }
.tpk-rt-chip { position: absolute; right: 2px; top: 2px; min-width: 22px; height: 22px; padding: 0 var(--space-2xs); border-radius: 11px; background: var(--brass); color: var(--on-brass); font-size: .68rem; display: grid; place-items: center; }
.tpk-rt-chip[hidden] { display: none; }
.tpk-chip-row { display: flex; gap: var(--space-xs); flex-wrap: wrap; }

.tpk-is-guest .tpk-controls, .tpk-is-guest .tpk-bet, .tpk-is-guest .tpk-guess-row, .tpk-is-guest .tpk-chip-row { opacity: .8; }
.tpk-is-guest button:disabled, .tpk-is-guest input:disabled, .tpk-is-guest select:disabled { cursor: not-allowed; }
.tpk-is-guest .tpk-bet-field input:disabled { color: var(--brass-hi); font-weight: 500; background: var(--stage-3); }
.tpk-is-guest .tpk-keno-tile, .tpk-is-guest .tpk-mine-tile, .tpk-is-guest .tpk-rt-spot, .tpk-is-guest .tpk-scratch-tile { cursor: not-allowed; }

.tpk-game-below { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--space-lg); margin-top: var(--space-lg); align-items: start; }
.tpk-coin-note { margin: var(--space-md) 0 0; font: 700 1.1rem/1.35 var(--f-display); text-align: center; max-width: none; }

.tpk-stamp { position: absolute; inset: 0; margin: auto; width: clamp(130px, 26vw, 200px); height: clamp(130px, 26vw, 200px); background: url("../img/win-badge.svg") center / contain no-repeat; display: grid; place-items: center; align-content: center; text-align: center; color: var(--ink); font: 700 1rem/1.05 var(--f-display); z-index: 6; pointer-events: none; animation: stamp-in .55s var(--ease-out) both, stamp-out .6s ease-in 3.2s forwards; }
.tpk-stamp b { display: block; font-size: clamp(1.4rem, 4vw, 2.2rem); line-height: 1; }
.tpk-confetti-layer { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 90; pointer-events: none; }

@keyframes land { 0% { transform: translateY(-14px); opacity: .5; } 100% { transform: none; opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes deal { 0% { transform: translateY(-16px) rotate(-6deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes stamp-in { 0% { transform: scale(2.6) rotate(-30deg); opacity: 0; } 55% { transform: scale(.92) rotate(-10deg); opacity: 1; } 100% { transform: scale(1) rotate(-12deg); opacity: 1; } }
@keyframes stamp-out { to { opacity: 0; transform: scale(1.05) rotate(-12deg); } }

@media (max-width: 760px) {
  .tpk-game-top { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .tpk-cover-hero { max-width: 240px; }
  .tpk-keno-board { grid-template-columns: repeat(8, 1fr); gap: var(--space-2xs); }
  .tpk-rt-board { grid-template-rows: repeat(5, 34px); gap: var(--space-3xs); }
  .tpk-rt-spot { font-size: .62rem; }
  .tpk-bet-field input, .tpk-bet-field select { width: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  .tpk-reel.tpk-land .tpk-cell, .tpk-cell.tpk-win, .tpk-pcard.tpk-flip, .tpk-pcard.tpk-deal-in, .tpk-mine-tile.tpk-pop, .tpk-scratch-tile.tpk-open, .tpk-keno-tile.tpk-hit, .tpk-rt-spot.tpk-won, .tpk-stamp { animation: none !important; }
}
