.arcade-section { max-width: none; padding: clamp(32px,3.5vw,55px) 0 clamp(48px,5vw,74px); }
.arcade-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 23px; }
.arcade-section .arcade-kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 7px; }
.ticket-cut { background: #edcb77; color: #443e28; padding: 0 7px; font: 14px/17px Georgia,serif; transform: rotate(-8deg); }
.arcade-section h2 { margin: 0; font-size: clamp(35px,4.1vw,61px); }
.arcade-section h2 em { color: var(--rose); font-family: Georgia,serif; }
.arcade-heading>p { max-width: 250px; margin: 0 0 3px; color: #53604f; font: 15px/1.5 var(--sans); }
.game-shelf { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(13px,2vw,26px); }
.game-tile {
  display: flex; flex-direction: column; padding: 0; overflow: hidden; color: var(--ink); text-align: left;
  background: #fffaed; border: 1.5px solid #4b5345; border-radius: 6px; box-shadow: 3px 4px 0 #c3b9a1;
  transition: transform .18s, box-shadow .18s;
}
.game-tile:hover, .game-tile:focus-visible { transform: translateY(-4px) rotate(-.45deg); box-shadow: 4px 8px 0 #baae93; }
.game-tile:nth-child(2):hover { transform: translateY(-4px) rotate(.45deg); }
.game-poster { display: block; width: 100%; border-bottom: 1.5px solid #4b5345; }
.game-poster canvas { display: block; width: 100%; height: auto; }
.game-ticket { position: relative; display: flex; flex: 1; width: 100%; flex-direction: column; padding: 15px clamp(12px,1.6vw,22px) 17px; }
.game-ticket small { font: 800 10px/1.45 var(--sans); text-transform: uppercase; letter-spacing: .14em; color: #7d4144; }
.shoe-tile small { color: #365c4b; } .total-tile small { color: #7a5428; }
.game-ticket strong { font: 800 clamp(22px,2.1vw,33px)/1.15 var(--display); letter-spacing: -.065em; margin: 4px 0 7px; }
.game-blurb { font: 14px/1.45 var(--sans); color: #505a4e; margin-bottom: 14px; }
.play-stamp { display: inline-flex; margin-top: auto; align-self: flex-start; align-items: center; gap: 14px; font: bold 13px/1.15 var(--sans); border-bottom: 1px solid; padding-bottom: 2px; }
#arcade-machine {
  --machine-bg: #30483e; --accent: #f1ce7b;
  width: min(760px,96vw); max-width: 96vw; max-height: 95dvh; padding: 0; overflow: auto; overscroll-behavior: contain;
  color: var(--ink); background: var(--paper); border: 2px solid #263e34; border-radius: 10px; box-shadow: 5px 7px 0 #20362dc9;
}
#arcade-machine [hidden] { display: none !important; }
#arcade-machine::backdrop { background: #172b24d9; }
body:has(#arcade-machine[open]) { overflow: hidden; }
.machine-top, .machine-controls, .score-strip { display: flex; align-items: center; gap: 12px; padding: 13px 19px; }
.machine-top { justify-content: space-between; }
.machine-label { font: 800 10px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .16em; color: #84494b; }
#machine-title { margin: 2px 0 0; font: bold clamp(22px,3vw,34px)/1 var(--display); letter-spacing: -.06em; }
.machine-close, #slip-close, .machine-controls button, #machine-start { color: var(--ink); border: 1px solid #677568; border-radius: 4px; background: #fffbed; font: bold 14px/1.3 var(--sans); cursor: pointer; }
.machine-close, #slip-close { font-size: 26px; line-height: 1; min-width: 44px; min-height: 44px; }
.score-strip { justify-content: space-between; min-height: 35px; background: var(--machine-bg); color: #fff5d9; padding-block: 8px; font: 700 13px/1.3 var(--sans); font-variant-numeric: tabular-nums; }
.score-strip b { color: #ffe093; }
.machine-stage { width: 100%; aspect-ratio: var(--stage-ratio,720/420); position: relative; overflow: hidden; background: #263d34; }
#game-screen { display: block; width: 100%; height: 100%; touch-action: none; }
#game-screen:focus { outline-offset: -4px; }
#machine-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: #1c332b8c; overflow: auto; }
.overlay-sheet { margin: 8px; width: min(88%,390px); padding: clamp(13px,2.5vw,25px); text-align: center; background: #fff7e3; color: var(--ink); border: 2px solid var(--ink); border-radius: 5px; box-shadow: 4px 5px 0 #172d27aa; }
.overlay-sheet .machine-label { margin: 0; color: #864648; }
.overlay-sheet h3 { font: bold clamp(24px,3.3vw,37px)/1.05 var(--display); letter-spacing: -.06em; margin: 7px 0 9px; }
.overlay-sheet p:not(.machine-label) { font: 15px/1.45 var(--sans); margin: 4px 0 13px; }
#machine-start { color: #fffbed; background: #284e3e; border: 0; padding: 10px 18px; }
.machine-controls { flex-wrap: wrap; padding-block: 10px; gap: 8px; }
.machine-controls button { padding: 8px 12px; min-height: 40px; }
.machine-controls button:disabled { opacity: .5; cursor: default; }
#machine-hint { color: #52604f; font: 12px/1.45 var(--sans); flex: 1 1 170px; margin-left: auto; }
#machine-pulse { background: #f2cf7c; }
#pie-steering { display: none; }
@media (pointer: coarse), (max-width: 760px) {
  #pie-steering { display: flex; flex: 1 0 100%; min-width: 0; width: 100%; align-items: center; gap: 12px; padding: 0 10px; background: #e7ebdc; border-radius: 5px; }
  #pie-steering span { color: #254735; font: bold 13px/1.2 var(--sans); white-space: nowrap; }
  #gaz-dial { display: block; flex: 1; min-width: 0; width: 0; margin: 0; height: 46px; accent-color: #a4444b; touch-action: none; cursor: ew-resize; }
  #gaz-dial:focus-visible { outline-offset: -3px; }
  .machine-controls button, .machine-close, #machine-start { min-height: 44px; min-width: 44px; }
}
#shoe-board { position: absolute; inset: 0; display: grid; align-content: center; justify-content: center; grid-template-columns: repeat(var(--columns),minmax(0,1fr)); grid-auto-rows: minmax(0,1fr); gap: clamp(5px,1.5vw,10px); padding: clamp(10px,2.5vw,22px); }
.shoe-card { position: relative; min-height: 0; padding: 0; background: #31594b; border: 2px solid #ead5a5; border-radius: 5px; color: #f8dfab; box-shadow: 2px 2px 0 #172f28; }
.shoe-card::before { content: "✦"; position: absolute; display: grid; place-items: center; inset: 5px; border: 1px dashed #cfbf90; font-size: clamp(18px,4vw,36px); }
.shoe-card.showing { background: #fcf2d5; }
.shoe-card.matched { background: #d2e4c9; box-shadow: none; border-color: #95b09b; }
.shoe-card.showing::before { display: none; }
.shoe-card canvas { width: 100%; height: 100%; max-height: 100%; object-fit: contain; visibility: hidden; }
.shoe-card.showing canvas { visibility: visible; }
.shoe-card.matched::after { content: "✓"; color: #23513b; font-weight: bold; position: absolute; right: 5px; bottom: 1px; }
.sr-arcade { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#arcade-leaderboard { margin-top: 24px; background: #fffaed; border: 1px solid #9caa94; border-radius: 5px; scroll-margin-top: 12px; }
#arcade-leaderboard summary { cursor: pointer; padding: 12px 16px; color: var(--ink); }
#arcade-leaderboard summary strong { font: bold 20px var(--display); }
#score-scope { margin-left: 12px; font: 13px var(--sans); }
.leaderboard-body { border-top: 1px dashed #b9b7a2; padding: 14px 16px; }
.leaderboard-body label, #sign-score label { font: bold 14px var(--sans); }
#rank-game, #score-nickname { min-height: 44px; font: 16px var(--sans); padding: 6px 9px; color: var(--ink); background: #fffdf4; border: 1px solid #818d78; border-radius: 4px; }
#rank-game { margin-left: 6px; max-width: 100%; }
.rank-list { max-height: 285px; overflow-y: auto; margin-top: 14px; }
.rank-list table { width: 100%; border-collapse: collapse; font: 15px/1.4 var(--sans); text-align: left; }
.rank-list th, .rank-list td { padding: 8px; border-bottom: 1px solid #d9d5bf; overflow-wrap: anywhere; }
.rank-list th { position: sticky; top: 0; background: #e6ebdc; }
.rank-list :is(th,td):last-child { text-align: right; font-variant-numeric: tabular-nums; }
#rank-empty { margin-bottom: 0; font: 14px/1.5 var(--sans); }
#claim-best, #round-save, #view-ranks, #score-slip .slip-primary { min-height: 44px; border-radius: 4px; border: 1px solid #64765e; background: #fff9e8; color: var(--ink); padding: 8px 13px; font: bold 14px/1.3 var(--sans); }
#claim-best { margin-top: 12px; } #round-save { background: #f4d383; margin-bottom: 3px; }
#score-slip { width: min(410px,94vw); max-height: 90dvh; overflow-y: auto; padding: 20px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); border-radius: 8px; }
#score-slip::backdrop { background: #182e25cf; }
#score-slip [hidden], #arcade-leaderboard [hidden] { display: none !important; }
.slip-heading { display: flex; justify-content: space-between; align-items: center; }
#slip-title { margin: 8px 0 4px; font: bold 30px/1.1 var(--display); letter-spacing: -.06em; }
#slip-game { margin: 4px 0; font: bold 16px var(--sans); }
.slip-points { border-block: 1px dashed #b0ae96; margin: 13px 0; padding: 8px 0; font: 16px var(--sans); }
.slip-points strong { font: bold 34px var(--display); }
#score-nickname { display: block; width: 100%; margin-top: 5px; }
#slip-help, #slip-status { font: 14px/1.5 var(--sans); overflow-wrap: anywhere; }
#slip-status:empty { margin: 0; }
#score-slip .slip-primary { color: #fff9ed; background: #294c3e; }
#slip-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media(max-width: 760px) {
  .arcade-heading { display: block; } .arcade-heading>p { margin: 8px 0 0; max-width: none; }
  .game-shelf { grid-template-columns: 1fr; gap: 14px; }
  .game-tile { flex-direction: row; } .game-poster { width: 38%; flex: none; border: none; border-right: 1px solid #4b5345; }
  .game-poster canvas { width: 100%; height: 100%; object-fit: cover; }
  .game-ticket { padding: 12px 14px; } .game-ticket strong { font-size: 24px; }
  .game-blurb { font-size: 13px; margin-bottom: 8px; }
  .machine-top, .machine-controls, .score-strip { padding-inline: 12px; }
  .score-strip { gap: 6px; font-size: 12px; }
}
@media(max-height: 570px) and (min-aspect-ratio: 7/5) {
  #arcade-machine[open] {
    --rail-width: clamp(138px,22vw,185px);
    display: grid; grid-template-columns: minmax(0,1fr) var(--rail-width); grid-template-rows: auto auto 1fr;
    width: min(95vw,calc((94dvh - 57px) * var(--board-aspect,1.715) + var(--rail-width)));
  }
  .machine-top { grid-column: 1/-1; padding: 4px 12px; }
  .machine-stage { grid-column: 1; grid-row: 2/4; }
  .score-strip { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-content: start; padding: 8px; font-size: 11px; min-height: min-content; }
  #machine-progress { grid-column: 1/-1; grid-row: 2; } #machine-vitals { grid-column: 1/-1; grid-row: 3; }
  .machine-controls { grid-column: 2; grid-row: 3; display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); align-content: start; align-items: center; gap: 5px; padding: 6px; }
  .machine-controls button { padding-inline: 3px; font-size: 12px; }
  #pie-steering, #machine-pulse, #machine-hint { grid-column: 1/-1; }
  #pie-steering { gap: 4px; padding-inline: 4px; } #pie-steering span { font-size: 11px; }
  #machine-hint { margin: 0; font-size: 11px; }
  .machine-label { font-size: 9px; } #machine-title { font-size: 20px; }
  .overlay-sheet { padding: 8px 12px; } .overlay-sheet h3 { font-size: 21px; margin-block: 3px; }
}
@media(max-width: 540px) and (orientation: portrait) {
  .arcade-heading { margin-bottom: 18px; }
  .game-shelf { gap: 20px; }
  .game-tile { display: grid; grid-template-rows: auto 1fr; }
  .game-poster { width: 100%; border: 0; border-bottom: 1px solid #4b5345; }
  .game-poster canvas { width: 100%; height: auto; }
  .game-ticket { padding: 12px 15px 15px; display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; }
  .game-ticket small, .game-ticket strong, .game-blurb { grid-column: 1; margin: 0; }
  .game-ticket strong { font-size: clamp(23px,6vw,29px); }
  .game-blurb { margin-top: 3px; }
  .play-stamp { grid-column: 2; grid-row: 1/4; align-self: center; margin: 0; gap: 4px; border: 1px solid #7c8e79; padding: 6px 8px; border-radius: 4px; }
  .score-strip { padding-inline: 9px; }
  .machine-controls { padding: 8px 10px max(8px,env(safe-area-inset-bottom)); }
  #machine-hint { flex: 1 1 105px; }
}
