.arcade-shell { padding-block: clamp(14px,2vw,26px) 22px; }
.free-breadcrumb { margin: 0 0 10px; color: var(--muted); font-size: .85rem; }
.free-breadcrumb a { text-decoration: underline; text-underline-offset: .2em; }
.arcade-shell h1 { margin: 0; font-size: clamp(2rem,5vw,3.9rem); line-height: 1.02; letter-spacing: -.035em; }
.arcade-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(12px,2vw,24px); }
.arcade-card { min-width: 0; }
.arcade-card > button { display: block; width: 100%; height: 100%; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; text-align: start; }
.arcade-card > button:hover { border-color: var(--brand-bright); }
.arcade-page main button:focus-visible { outline: 3px solid #f6d78e; outline-offset: 3px; }
.card-caption { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 52px; padding: 8px 14px; font-weight: 700; }
.play-mark { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: white; font-size: .8rem; padding-left: 2px; }
.points-note { margin-block: 24px 0; color: var(--muted); font-size: .85rem; }
body.table-open { overflow: hidden; }
#table { width: min(calc(100% - 24px),660px); padding: 0; max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; background: #131313; color: #fff; border: 1px solid #514237; border-radius: 18px; box-shadow: 0 26px 85px #000b; }
#table::backdrop { background: #070809df; }
.table-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: #161516; }
.table-header h2 { margin: 0; font-size: 1.22rem; }
#close-table { font: inherit; font-size: 1.6rem; line-height: 1; border: 1px solid #484345; border-radius: 50%; color: #fff; background: #252326; width: 44px; height: 44px; cursor: pointer; }
/* The branded backdrop sits behind the pieces, keeping faces and pips readable. */
.play-surface { background: linear-gradient(110deg,#160b10de,#310b12a6),url("/assets/tpower/official/backdrop-red.webp") center/cover; border-block: 1px solid #94633c; padding: 12px 14px 17px; }
.score-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; padding-inline: 5px; font-size: .83rem; color: #e7d9c9; }
.score-line strong { color: #ffdf9e; font-size: 1rem; margin-inline-start:4px; font-variant-numeric:tabular-nums; }
#board { min-height: clamp(145px,26vh,236px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.table-controls { padding: 13px 18px 18px; }
.table-hint { margin: 0; color: #cecaca; font-size: .92rem; }
#outcome { margin: 0; font-weight: 750; }
#outcome:not(:empty) { margin-top: 6px; }
#outcome.won { color: #ffe39a; }
#moves { display: flex; flex-wrap: wrap; gap: 9px; }
#moves:not(:empty) { margin-top: 10px; }
.move-button { min-height: 44px; padding: 8px 20px; font: inherit; font-weight: 700; color: white; background: var(--brand); border: 1px solid #f44a4a80; border-radius: 8px; cursor: pointer; }
.move-button:hover { background: var(--brand-bright); }
.move-button[data-move=black],.move-button[data-move=outside],.move-button[data-move=stand] { background: #292a2d; border-color: #616267; }
.hand-row { display: grid; justify-items: center; gap: 3px; width: 100%; }
.row-label,.board-caption { color: #ffecb7; font-weight: 700; font-size: .88rem; }
.card-line,.token-line { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(3px,.8vw,8px); }
.playing-card { display: flex; flex-direction: column; justify-content: space-between; width: clamp(35px,8.3vw,57px); aspect-ratio: 5/7; padding: 4px 6px; border: 1px solid #fff3d0; border-radius: 7px; background: linear-gradient(135deg,#fffdf5,#e9dfc7); color: #23252a; line-height: 1; box-shadow: 0 3px 7px #001a; font-family: Georgia,serif; }
.playing-card b { font-size: 1.18rem; }
.playing-card i { font-size: 1.58rem; font-style: normal; align-self: center; }
.playing-card.red-suit { color: #ac1025; }
.playing-card.face-down { justify-content: center; align-items: center; color: #f2d59c; background: repeating-linear-gradient(48deg,#69232d 0 3px,#83303a 3px 5px); box-shadow: inset 0 0 0 3px #8b544c; }

@media (max-width: 760px) { .arcade-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .card-caption { padding: 8px 10px; } }
@media (max-width: 440px) { .arcade-grid { gap: 10px; } .play-mark { width: 26px; height: 26px; font-size: .68rem; } }
@media (max-height: 500px) and (min-width: 520px) { #table[open] { display: grid; grid-template-columns: 1fr 1fr; } .table-header { grid-column: span 2; } .play-surface { padding-block: 4px; } #board { min-height: 120px; } .playing-card { width: 32px; } }
.play-surface { position: relative; isolation: isolate; overflow: hidden; }
.play-surface::before { content: ''; position: absolute; z-index: -1; inset: 7px; pointer-events: none; border: 1px solid #f6dea52b; border-radius: 12px; background: repeating-linear-gradient(35deg,transparent 0 3px,#fff1 3px 3.2px); }
#board { position: relative; padding: 7px 0; }
.table-controls { display: grid; gap: 9px; }
#moves:not(:empty),#outcome:not(:empty) { margin: 0; }
#moves:empty,#outcome:empty { display: none; }
.table-hint { line-height: 1.45; }
.move-button { flex: 1 1 auto; box-shadow: inset 0 1px #fff3,0 3px 0 #550714; }
.move-button:active { transform: translateY(2px); }
.move-button:disabled { cursor: wait; opacity: .72; }
#table [data-choice] { outline: 2px solid #f5d792; outline-offset: 1px; }
.round-pass { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; border-top: 1px solid #49403b; padding: 9px 18px; background: #211c1b; font-size: .88rem; color: #f5dfae; }
.round-pass progress { width: 56px; height: 7px; accent-color: #edbb5f; }
.round-pass [hidden] { display: none; }
.card-line { perspective: 700px; }
.playing-card { position: relative; justify-content: flex-start; border-radius: 6px; overflow: hidden; box-shadow: 0 4px 0 #17372a,0 6px 9px #0007; }
.playing-card b { font-size: clamp(1rem,3.5vw,1.35rem); }
.playing-card i { flex: 1; display: grid; place-content: center; font-size: clamp(1.35rem,4.6vw,2.05rem); }
.playing-card.face-down { border: 3px solid #dbbb8a; box-shadow: inset 0 0 0 1px #411b25,0 4px 8px #0005; }
.card-veil { position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(45deg,#632033 0 2px,#85354a 2px 5px); border: 3px double #e0bf89; pointer-events: none; }
.row-label { font-variant-numeric: tabular-nums; }
.wheel-rig { position: relative; box-sizing: content-box; width: clamp(156px,min(44vw,28vh),215px); aspect-ratio: 1; padding: 5px; border-radius: 50%; border: 3px solid #936f43; background: linear-gradient(130deg,#856034,#ffedac 27%,#79502e 57%,#e6bc74); box-shadow: 0 6px 0 #40291e,0 9px 13px #0007; }
.wheel-rig::after { content: ''; position: absolute; top:-5px; left:calc(50% - 7px); border: 7px solid transparent; border-top: 15px solid #ffecb8; filter: drop-shadow(0 2px 1px #422); }
.wheel-face { display: block; width:100%; height:100%; border-radius:50%; }
.wheel-center { position:absolute; inset: 32%; display:grid; place-items:center; border: 4px double #dab982; border-radius:50%; background:radial-gradient(at 38% 26%,#6d4c32,#31241f); box-shadow:0 3px 7px #000a; color:#ffe6a7; font: bold clamp(1.6rem,6vw,2.6rem) Georgia,serif; }
.wheel-center[data-color=red] { background:#a52632; }.wheel-center[data-color=black] { background:#182322; }.wheel-center[data-color=green] { background:#1d634b; }
.ball-orbit { position:absolute; inset:5px; pointer-events:none; }
.wheel-ball { position:absolute; left:calc(50% - 4px); top:2%; width:9px; height:9px; border-radius:50%; box-shadow: 0 1px 3px #210d00; background:radial-gradient(at 33% 27%,white,#fff9da 35%,#8c7752); }
.roulette-rig::after { display:none; }
.dice-tray { --edge: clamp(42px,10vw,57px); display:flex; justify-content:center; align-items:center; gap: clamp(30px,8vw,54px); padding: 42px 25px 25px; }
.die-space { width:var(--edge); height:var(--edge); perspective:400px; }
.die-cube { width:100%; height:100%; transform-style:preserve-3d; }
.cube-face { position:absolute; inset:0; display:grid; grid-template:repeat(3,1fr)/repeat(3,1fr); gap:5%; padding:13%; backface-visibility:hidden; border:1px solid #c0ab83; border-radius:17%; background:linear-gradient(130deg,#fffdf2,#e1ceab); }
.pip { display:block; border-radius:50%; background:radial-gradient(at 55% 65%,#3b3540,#160e16); box-shadow:inset 0 1px 2px #0009; }
.pip-1 {grid-area:1/1}.pip-3 {grid-area:1/3}.pip-4 {grid-area:2/1}.pip-5 {grid-area:2/2}.pip-6 {grid-area:2/3}.pip-7 {grid-area:3/1}.pip-9 {grid-area:3/3}
.cube-face.face-1 {transform:translateZ(calc(var(--edge) / 2))}.face-1 .pip,.face-4 .pip { background:#a30f24; }
.cube-face.face-2 {transform:rotateY(90deg) translateZ(calc(var(--edge) / 2))}
.cube-face.face-3 {transform:rotateX(90deg) translateZ(calc(var(--edge) / 2))}
.cube-face.face-4 {transform:rotateX(-90deg) translateZ(calc(var(--edge) / 2))}
.cube-face.face-5 {transform:rotateY(-90deg) translateZ(calc(var(--edge) / 2))}
.cube-face.face-6 {transform:rotateY(180deg) translateZ(calc(var(--edge) / 2))}
.coin-stage { width:clamp(80px,22vw,115px); aspect-ratio:1; perspective:600px; margin:26px 0 8px; }
.toss-coin { transform-style:preserve-3d; width:100%; height:100%; }
.coin-side { position:absolute; inset:0; display:grid; align-content:center; justify-items:center; color:#70481a; border:6px double #966421; border-radius:50%; background:radial-gradient(at 34% 23%,#ffedb0,#edc06e 55%,#b77e2d); box-shadow:inset 0 0 0 2px #f4d38e,0 3px 0 #91682f,0 8px 10px #0005; backface-visibility:hidden; transform:translateZ(2px); }
.coin-side.reverse { transform:rotateX(180deg) translateZ(2px); background:radial-gradient(at 35% 20%,#fff0bb,#c78c42); }
.coin-emblem { font: bold clamp(2.2rem,9vw,3.35rem)/1 Georgia,serif; text-shadow:0 1px #fff6be; }
.coin-legend {font:700 .72rem/1.45 Georgia,serif; letter-spacing:.04em; text-transform:uppercase;}
.scratch-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; padding:12px; border-radius:13px; border:2px solid #a87c44; background:linear-gradient(130deg,#762737,#411b2f); box-shadow:0 5px 0 #2d1018,0 8px 12px #0005; }
.scratch-tile { position:relative; overflow:hidden; display:grid; place-items:center; width:clamp(52px,15vw,78px); aspect-ratio:1.25; min-height:44px; border:2px solid #c2a472; border-radius:6px; cursor:pointer; touch-action:none; user-select:none; background:#fae6bc; color:#a61930; }
.scratch-icon {font: 800 clamp(1.6rem,5vw,2.5rem) Georgia,serif;}
.scratch-cover { position:absolute; inset:0; display:grid; place-content:center; color:#4f535f; font-size:1.5rem; text-shadow:0 1px #fff; background:repeating-linear-gradient(128deg,transparent 0 3px,#fff2 3px 4px),linear-gradient(125deg,#a3a3ad,#e4e6e9 38%,#a3a5ae 62%,#caccd6); }
.scratch-tile:disabled { opacity:1; cursor:default; }
.scratch-tile.sealed:disabled .scratch-cover { filter:brightness(.62); }
@media (max-height:500px) and (min-width:520px) { .round-pass { grid-column:1/-1; } .wheel-rig { width:125px; } .table-controls { align-content:center; } }

.round-pass.earned { position:relative; margin:0 15px 13px; border:1px solid #c49958; border-radius:6px; gap:3px 12px; padding:10px 14px; color:#432319; background:repeating-linear-gradient(135deg,transparent 0 5px,#c2824019 5px 6px),linear-gradient(115deg,#ffe3a6,#d8ab6b 85%,#f3d08e); }
.round-pass.earned::before { content:'✦'; font-size:1.3rem; line-height:1; }
.round-pass.earned { flex-wrap:nowrap; min-height:44px; }
.pass-copy { flex:1; min-width:0; }
.round-pass.earned #pass-label { display:block; font-weight:800; line-height:1.25; }
#pass-note { font-size:.76rem; line-height:1.2; }
#pass-register { padding:6px 12px; border-radius:6px; background:#801523; color:#fff; font-weight:750; line-height:1.25; }
#pass-register::after { content:''; position:absolute; inset:0; border-radius:6px; }
#pass-register:hover { background:#a5192b; }
#pass-register:focus-visible::after { outline:3px solid white; outline-offset:2px; }
@media (prefers-reduced-motion:no-preference) {
  .round-pass.just-earned { animation: ticket-stamp .5s ease-out; }
  @keyframes ticket-stamp { from { opacity:0; transform:translateY(9px) rotate(-1.5deg) scale(.96); } 65% { transform:translateY(-2px) scale(1.015); } to { opacity:1; transform:none; } }
  .slot-machine.is-spinning .lever-knob { animation: lever-throw .35s ease-out; }
  .slot-machine.is-spinning .lever-rod { animation: rod-throw .35s ease-out; }
  @keyframes lever-throw { 36% { top:84.1%; } }
  @keyframes rod-throw { 36% { transform:translateX(-50%) scaleY(-.35); } }
}
@media (prefers-reduced-motion:no-preference) {
  .slot-machine.lever-released.is-spinning .lever-knob { animation-name:knob-return; }
  .slot-machine.lever-released.is-spinning .lever-rod { animation-name:rod-return; }
  @keyframes knob-return { from { top:calc(22% + 62.1% * var(--release,1)); } }
  @keyframes rod-return { from { transform:translateX(-50%) scaleY(calc(1 - var(--release,1)*1.35)); } }
}
@media (max-width:400px) and (max-height:640px) {
  .play-surface { padding:6px 10px 9px; }
  #board { min-height:135px; padding:2px 0; }
  .table-controls { padding:8px 13px 12px; gap:6px; }
  #table .slot-machine { margin-block:3px; }
}

/* The lobby uses the original character and red stage artwork from TPower. */
.arcade-hero {
  position:relative; isolation:isolate; overflow:hidden;
  display:flex; align-items:center; min-height:clamp(190px,23vw,255px);
  padding:clamp(16px,3.7vw,44px); border:1px solid #80433e; border-radius:16px;
  background:linear-gradient(100deg,#210c11 5%,#41090ddb 44%,#6f030642 82%),
             url("/assets/tpower/official/backdrop-red.webp") 54% 48%/cover;
  box-shadow:inset 0 1px #e99c7233;
}
.arcade-hero::before { content:""; position:absolute; z-index:-1; inset:-40% -4% -120% 55%; transform:rotate(-25deg); border:1px solid #fdc68a3d; border-radius:50%; box-shadow:0 0 0 10px #ffca9209,0 0 0 46px #ffca9208; }
.arcade-host { position:absolute; z-index:-1; right:clamp(12px,8%,90px); bottom:-2%; height:104%; width:40%; object-fit:contain; object-position:center; filter:drop-shadow(0 9px 9px #2d050b6b); }
.arcade-intro { max-width:60%; }
.arcade-hero h1 { font-size:clamp(2rem,4.7vw,3.5rem); }
.arcade-totals { display:flex; align-items:baseline; gap:8px; margin:12px 0 0; }
.arcade-totals dt { color:#f5d7be; font-size:.83rem; }
.arcade-totals dd { margin:0; color:#ffdc91; font-variant-numeric:tabular-nums; font-weight:800; font-size:clamp(1.55rem,3vw,2.15rem); line-height:1.12; }
.arcade-history { margin:8px 2px 14px; font-size:.9rem; }
.arcade-history summary { width:fit-content; min-height:44px; align-content:center; color:#e6d2b6; cursor:pointer; }
.arcade-history summary:focus-visible { outline:2px solid #efc67a; outline-offset:2px; }
.arcade-history[open] { padding-bottom:9px; border-bottom:1px solid var(--line); }
.arcade-history p,#storage-alert { margin:6px 0; font-size:.85rem; color:var(--muted); }
#round-history { padding:0; margin:0; list-style:none; max-width:440px; }
#round-history li { display:flex; justify-content:space-between; gap:12px; padding:4px 12px; border-inline-start:2px solid #79413a; }
.earned-score { color:#ffd88e; }
.arcade-card > button { background:linear-gradient(105deg,#261619,#171416); border-color:#654140; }
.card-caption { border-top:1px solid #c392584f; }
.caption-name { line-height:1.2; overflow-wrap:anywhere; }
.played-mark:not([hidden]) { display:inline-grid; vertical-align:middle; place-items:center; margin-inline-start:5px; width:16px; height:16px; border-radius:50%; background:#cda86f; color:#30180e; font-size:11px; font-weight:800; }
.table-header { background:linear-gradient(110deg,#300f15,#161216 80%); }
.slot-wordmark { width:auto; height:clamp(20px,4.5vw,31px); filter:drop-shadow(0 1px 2px #18050d); }
.coin-wordmark { width:68%; height:auto; object-fit:contain; align-self:center; filter:drop-shadow(0 1px 1px #540b11); }
.coin-side.obverse { background:radial-gradient(ellipse at 33% 24%,#91402e,#4a1821 62%,#633020); color:#ffe4a2; }

.playing-card.face-down,.card-veil {
  background:url("/assets/tpower/official/brand-logo.webp") center/80% auto no-repeat,
             repeating-linear-gradient(45deg,#43101d 0 3px,#5a1728 3px 5px);
  color:transparent;
}
@media (max-width:600px) {
  .arcade-hero { padding:16px; min-height:183px; }
  .arcade-intro { max-width:65%; }
  .arcade-host { right:0; width:38%; height:78%; bottom:4%; }
  .arcade-history { margin-block:2px 6px; }
}
@media (max-width:375px) {
  .arcade-totals dt {font-size:.78rem;}
}
@media (prefers-reduced-motion:no-preference) {
  #outcome.won { animation:win-pulse .42s ease-out; }
  @keyframes win-pulse { from {color:white;transform:translateY(3px);} to {color:#ffe39a;transform:none;} }
}

.slot-strip .slot-symbol[data-symbol=chip],
.scratch-icon[data-symbol=chip] {
  color:transparent; text-shadow:none;
  background:url("/assets/tpower/official/category-24.webp") center/65% auto no-repeat;
}
.scratch-icon[data-symbol=chip] { width:100%; height:100%; }
@media (max-width:440px) {
  .card-caption { position:relative; }
  .played-mark:not([hidden]) { position:absolute; inset-inline-end:6px; top:-20px; margin:0; box-shadow:0 1px 4px #160b08; }
}
.round-caption { min-height:1.35em; text-align:center; font-variant-numeric:tabular-nums; }
.playing-card.current-card { outline:2px solid #e4bb6b; outline-offset:2px; }
.pocket-history { display:flex; justify-content:center; gap:5px; }
.pocket { display:grid; place-items:center; width:27px; height:25px; border:1px solid #d7ae785e; border-radius:5px; color:white; font-weight:700; font-size:.85rem; }
.pocket.red { background:#911826; } .pocket.black { background:#1f2025; } .pocket.green { background:#146745; }
#table :is([data-move=odd],[data-move=even],[data-move=playerPair],[data-move=bankerPair],[data-move=toClassic],[data-move=toBonus]) { background:#32282a; border-color:#856a65; }
#table [data-move=zero] { background:#175e45; }
@media(max-width:460px) {
  #table:is([data-game=baccarat],[data-game=roulette],[data-game=dice-seven]) .move-button { padding-inline:10px; }
}
@media(max-height:500px) and (min-width:520px) { .scratch-tile {width:52px;} }
@media (max-height:600px) {
  #table .table-header { padding-block:3px; }
  #table .round-pass.earned { margin:0 8px 5px; padding:4px 9px; }
}
@media (max-width:400px) and (max-height:600px) {
  #table[data-game=fruit-reels] .table-controls { padding-block:6px 8px; gap:4px; }
}
.table-header h2 { min-width:0; line-height:1.2; }
.table-tools { display:flex; align-items:center; flex:none; gap:6px; }
#table-sound:not([hidden]) { display:inline-flex; align-items:center; justify-content:center; gap:5px; min-height:44px; padding:3px 9px; border-radius:12px; border:1px solid #76604b; color:#ffdfaa; background:#342722; cursor:pointer; font:inherit; font-size:.85rem; }
#table-sound[aria-pressed=false] { color:#d2c7c3; background:#242122; border-color:#514748; }
#table-sound[aria-pressed=true] .sound-cross,#table-sound[aria-pressed=false] .sound-waves { display:none; }
@media(max-width:360px) { #table-sound:not([hidden]) { width:44px; padding:3px; } #table-sound .sound-label { display:none; } }

.move-detail { display:block; color:#ffe3b2; font-size:.8rem; font-variant-numeric:tabular-nums; line-height:1.25; }
.active-hand .row-label { color:#25160b; background:#f5d590; border-radius:4px; padding:2px 8px; }
.spread-track { display:flex; width:min(100%,410px); gap:2px; margin-top:4px; }
.spread-track span { flex:1; min-width:0; text-align:center; border-radius:3px; color:#c6b7aa; background:#392b2d; font:700 clamp(.75rem,2.8vw,1rem)/1.8 Georgia,serif; }
.spread-track .post-rank { background:#e2b56b; color:#2f1711; }
.spread-track .inside-rank { background:#21594c; color:#fff; }
.spread-track .drawn-rank { outline:2px solid white; outline-offset:1px; }
.scratch-meter { display:flex; align-items:center; gap:6px; color:#ffdd94; font-size:.88rem; }
.scratch-meter .scratch-icon { display:inline-grid; place-items:center; width:26px; height:26px; background-color:#ffedcc; border-radius:50%; color:#9c1825; font-size:18px; }
.scratch-meter .scratch-icon[data-symbol=chip] { color:transparent; background:#ffedcc url("/assets/tpower/official/category-24.webp") center/70% auto no-repeat; }
.scratch-count { border-inline-start:1px solid #bba17c; margin-inline-start:5px; padding-inline-start:10px; font-variant-numeric:tabular-nums; }
.scratch-tile.bonus-hit { outline:2px solid #ffe097; outline-offset:2px; }
