/* A fitted arcade cabinet: the play surface owns the available space. */
.play-region{display:flex;flex-direction:column;min-width:0;min-height:0}.play-region>.game-viewport{flex:1}.fullscreen-button{width:auto!important;min-width:44px;gap:7px;padding:0 10px}.fullscreen-button span{font-size:.875rem;font-weight:600}.game-help{position:relative;flex:1;min-width:0}.game-help summary{font-size:.875rem;color:#b9c6e8;cursor:pointer;min-height:32px;padding:7px 0;list-style:none}.game-help summary:before{content:'?';display:inline-grid;place-items:center;border:1px solid #54679a;width:21px;height:21px;border-radius:50%;margin-right:8px}.game-help[open]>p{position:absolute;z-index:12;bottom:calc(100% + 10px);left:0;width:min(400px,calc(100vw - 46px));max-width:none!important;background:#1e2537;border:1px solid #7687b4;border-radius:12px;padding:17px!important;font-size:1rem!important;color:#e8ecf8;box-shadow:0 12px 30px #0008}.game-bottom{position:relative;flex-shrink:0;padding-top:5px;padding-bottom:5px;align-items:center}.room-details-button{border:1px solid #526495;background:#283048;border-radius:9px;padding:9px 13px;font-size:.875rem;min-height:44px;color:#edf0f9;white-space:nowrap}.game-controls .icon-button{min-width:44px;min-height:44px}.mode-button{min-height:62px}.game-overlay .instructions{font-size:.875rem}.game-overlay .play-primary{min-height:48px}
.touch-controls{touch-action:none;user-select:none;-webkit-user-select:none}.touch-controls:not([hidden]),.rally-touch{align-items:stretch;gap:10px;padding:10px 12px}.touch-controls button,.rally-touch button{height:auto;min-width:48px;min-height:52px;width:auto;display:flex;align-items:center;justify-content:center;gap:7px;padding:10px 14px;border:1px solid #596da2;background:#252d42;color:#f4f6fb;border-radius:13px;font-size:1rem;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.touch-controls button.is-pressed,.rally-touch button.is-pressed{background:#4e5f8d;border-color:#c9d3ed;box-shadow:inset 0 0 0 2px #b0bee5}.touch-controls .touch-action,.rally-touch .touch-action{background:#a3b4e0;color:#263216;border-color:#a3b4e0;font-weight:750}.touch-controls .touch-action.is-pressed,.rally-touch .touch-action.is-pressed{background:#7f8fb9;border-color:#cfd8ef}.touch-action>span{font-size:.875rem}.touch-track{border:1px solid #4b5b88;border-radius:14px;display:flex;align-items:center;justify-content:center;gap:9px;background:linear-gradient(120deg,#1f2537,#29324b);color:#c2cdeb;font-size:.875rem;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;min-height:60px;min-width:0;flex:1}.touch-track>span:first-child{font-size:1.8rem;color:#a3b3e0}.touch-track.is-pressed{background:#384466;border-color:#abbae3}.touch-track-move{min-height:82px}.touch-track-move+button{flex-direction:column;min-width:91px;font-size:1.5rem}.touch-dpad{display:grid;grid-template-columns:repeat(3,46px);grid-template-rows:repeat(3,44px);gap:4px;flex-shrink:0}.touch-dpad .touch-key{min-width:0;min-height:0;padding:0;font-size:1.4rem;border-radius:11px}.pad-up{grid-area:1/2}.pad-left{grid-area:2/1}.pad-right{grid-area:2/3}.pad-down{grid-area:3/2}.touch-actions{display:flex;flex-direction:column;justify-content:center;gap:10px;flex:1;max-width:190px}.touch-actions .touch-action{min-height:65px}.touch-caption{font-size:.8125rem;line-height:1.45;text-align:center;color:#97a9dc}.touch-controls[data-game=snake]{justify-content:space-evenly}.touch-controls[data-game=fusion]{justify-content:center}.touch-controls[data-game=fusion] button{flex:1;max-width:74px}.touch-controls .touch-pulse{width:100%;font-size:1.25rem;min-height:62px}.touch-steer,.touch-pedals{display:flex;align-items:stretch;gap:8px}.touch-steer{margin-right:auto}.touch-steer button{min-width:58px;font-size:1.6rem}.touch-pedals .touch-recover{min-width:44px;font-size:1.3rem;padding:8px}.rally-touch button{margin:0}.touch-controls[data-game=rally],.rally-touch{justify-content:space-between}
#board-game{min-width:0;min-height:0}.fusion-board,.memory-board{width:min(100%,var(--board-edge,440px),520px);height:min(var(--board-edge,440px),520px);max-height:100%;aspect-ratio:1;flex-shrink:0}.fusion-board{gap:8px;padding:8px}.fusion-cell{font-size:clamp(22px,calc(var(--board-edge,440px)/12),42px)}.memory-board{gap:8px}.memory-cell{font-size:clamp(27px,calc(var(--board-edge,440px)/10),50px);touch-action:manipulation}.mines-wrap{display:flex;flex-direction:column;width:100%;height:100%;gap:10px;min-height:0}.mines-pan{display:flex;width:100%;flex:1;min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y;scrollbar-width:thin}.mines-board{width:var(--board-edge,360px);height:var(--board-edge,360px);max-height:none;max-width:none;gap:3px;margin:auto;flex-shrink:0}.mines-board.is-zoomed{width:max(390px,calc(var(--board-edge,360px)*1.5));height:max(390px,calc(var(--board-edge,360px)*1.5))}.mine-cell{touch-action:pan-x pan-y;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;font-size:clamp(15px,calc(var(--board-edge,360px)/23),24px)}.mines-options{display:flex;flex-direction:row;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;flex:0 0 auto}.flag-toggle,.mine-zoom{min-height:44px;font-size:.875rem;padding:10px 16px;border:1px solid #55689b;border-radius:9px;background:#262e44;color:#eaeef8}.mine-zoom[aria-pressed=true]{background:#3b476a}.mines-options p{flex-basis:100%;max-width:none;text-align:center;font-size:.8125rem;line-height:1.4}.board-wide .mines-wrap{flex-direction:row}.board-wide .mines-options{width:130px;flex-direction:column;align-self:center}.board-wide .mines-options p{flex-basis:auto}.board-wide .mines-pan{height:100%}
#game-dialog.is-expanded{position:fixed;inset:0;margin:0;width:100%;max-width:none;height:var(--screen-height,100dvh);max-height:none;border-radius:0;border:0;overflow:hidden;background:#11141e;isolation:isolate;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
#game-dialog.is-expanded .game-shell{height:100%;display:flex;flex-direction:column;min-height:0;max-width:1400px;margin:auto}#game-dialog.is-expanded .play-region{flex:1;min-height:0}#game-dialog.is-expanded .game-viewport{min-height:0;max-height:none;aspect-ratio:auto}#game-dialog.is-expanded canvas{max-height:none}#game-dialog.is-expanded .multiplayer-panel{flex:1;min-height:0;overflow:auto}
#game-dialog.is-expanded>.game-shell:fullscreen{position:fixed;inset:0;display:flex;flex-direction:column;align-items:stretch;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;border:0;overflow:hidden;background:#11141e;color:var(--ink);padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
#game-dialog.is-expanded>.game-shell::backdrop{background:#11141e}
body.game-expanded{overflow:hidden}body.game-expanded>.site-header,body.game-expanded>main,body.game-expanded>footer{visibility:hidden;pointer-events:none}
#game-dialog.is-expanded .game-header,#game-dialog.is-expanded .game-hud{flex-shrink:0}
#game-dialog.is-expanded.is-live .multiplayer-panel{display:flex;flex-direction:column;overflow:hidden}
#game-dialog.is-expanded.is-live :is(#rally-online,#fugaz-online,#chispa-online),#game-dialog.is-expanded.is-live .rally-session,#game-dialog.is-expanded.is-live .rally-race{display:flex;flex-direction:column;flex:1;min-height:0}
#game-dialog.is-expanded.is-live .rally-stage{position:relative;flex:1;min-height:0;aspect-ratio:auto;overflow:hidden}
#game-dialog.is-expanded.is-live :is(#rally-canvas,#fugaz-canvas,#chispa-canvas){position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto}
#game-dialog.is-expanded.is-live .rally-room-bar,#game-dialog.is-expanded.is-live .rally-grid,#game-dialog.is-expanded.is-live .rally-session-bottom{display:none}
#game-dialog.is-expanded.is-live .rally-hud{flex-shrink:0}
#game-dialog.is-expanded.is-live.show-room .rally-race{display:none}#game-dialog.is-expanded.is-live.show-room .rally-session{overflow:auto}#game-dialog.is-expanded.is-live.show-room .rally-room-bar,#game-dialog.is-expanded.is-live.show-room .rally-session-bottom{display:flex}#game-dialog.is-expanded.is-live.show-room .rally-grid{display:grid;padding:18px}
@media(max-width:900px),(pointer:coarse){
 #game-dialog{position:fixed;inset:0;margin:0;width:100%;max-width:none;height:var(--screen-height,100dvh);max-height:none;border:0;border-radius:0;overflow:hidden;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
 #game-dialog .game-shell{height:100%;display:flex;flex-direction:column;min-height:0;max-width:none}
 .game-header{padding:5px 9px;min-height:54px;gap:8px;flex-shrink:0}.game-mark,.game-heading p{display:none}.game-heading{min-width:0;flex:1}.game-heading h2{font-size:1.0625rem;line-height:1.15;overflow-wrap:normal}.game-controls{gap:3px;flex-shrink:0}.game-controls .icon-button{width:44px;height:44px;min-width:44px;min-height:44px}.game-controls .icon-button svg{width:19px;height:19px}.close-game{margin-left:0}.game-hud{padding:7px 12px;min-height:34px;font-size:.8125rem;line-height:1.5;flex-wrap:wrap;flex-shrink:0;gap:4px 12px}
 .play-region{flex:1;min-height:0;overflow:hidden}.game-viewport,#game-dialog.is-rally .game-viewport,#game-dialog.is-rally .game-viewport:has(#game-overlay:not([hidden])),#game-dialog.is-rally .game-viewport:not(:has(#game-overlay:not([hidden]))){aspect-ratio:auto;min-height:0;max-height:none;min-width:0;flex:1}.game-viewport canvas{max-height:none;height:100%;width:100%;object-fit:contain}.game-viewport:has(.mines-board){min-height:0}
 .game-overlay{padding:24px 18px;justify-content:safe center}.game-overlay .overlay-icon{font-size:35px;margin-bottom:12px}.game-overlay h3{font-size:clamp(26px,6vw,34px)}.game-overlay .eyebrow{font-size:.75rem;margin-bottom:10px}.game-overlay>p:not(.eyebrow){font-size:1rem;line-height:1.55;max-width:510px}.game-overlay .instructions{font-size:.875rem;margin:14px 0;line-height:1.5}.game-overlay .mode-choices{margin-top:17px;gap:8px}.mode-button strong{font-size:.9375rem}.mode-button>span{font-size:.8125rem}.game-overlay>.play-primary{font-size:1rem;min-height:48px}.game-overlay>.quiet-button{font-size:.875rem;min-height:42px}
 .game-bottom{padding:3px 12px;min-height:40px;gap:12px;border-top:1px solid #2f3a56}.game-bottom .text-button{min-height:38px;font-size:.875rem}.game-bottom p{max-width:none}.game-help>summary{min-height:36px;font-size:.875rem;padding:6px 0}.touch-controls:not([hidden]){display:flex;flex:0 0 auto;padding:8px 12px 9px;background:#181d2b;border-top:1px solid #3c496d}.touch-controls:empty{display:none}.touch-controls[data-game=orbit]{padding-top:10px;padding-bottom:10px}
 #game-dialog[data-phase=paused] .touch-controls,#game-dialog[data-phase=result] .touch-controls{display:none}
 #board-game{padding:8px}.memory-cell{border-radius:10px}.mines-board{gap:3px}.mines-wrap{gap:8px}.mines-options p{font-size:.8125rem}.mine-cell{border-radius:4px}
 .multiplayer-panel{padding:0 10px 10px;flex:1;min-height:0;overflow:auto}.multiplayer-toolbar{position:sticky;top:0;z-index:9;min-height:49px;background:#11141e;padding:3px 0;gap:8px;flex-shrink:0}.multiplayer-toolbar .text-button{font-size:.875rem;min-height:44px}.multiplayer-toolbar>span{font-size:.8125rem;margin-left:auto}.room-form input{min-height:48px;font-size:1rem}.room-form button{min-height:46px}.room-entry{margin-top:12px}.room-sidebar button{min-height:44px}.room-share-row{margin-top:4px}.room-share-row>.icon-button{width:44px;height:44px}
 #game-dialog.is-live .multiplayer-panel{display:flex;flex-direction:column;overflow:hidden;padding-bottom:6px}#game-dialog.is-live .multiplayer-toolbar>span{display:none}#game-dialog.is-live .room-details-button{margin-left:auto}
 #game-dialog.is-live .room-active{display:flex;flex:1;min-height:0;width:100%}#game-dialog.is-live .room-stage{padding:9px;min-height:0;flex:1;overflow:hidden;display:flex;flex-direction:column}#game-dialog.is-live .room-stage-heading{font-size:.75rem;min-height:23px;flex-shrink:0}#game-dialog.is-live .room-stage-heading>span:first-child{display:none}#game-dialog.is-live .room-stage-heading>span:last-child{margin-left:auto}#game-dialog.is-live .room-stage-copy{margin:3px 0 9px}#game-dialog.is-live .room-stage-copy .eyebrow{font-size:.75rem;margin:0 0 5px}#game-dialog.is-live .room-stage-copy h3{font-size:1.3rem;line-height:1.2;margin:0 0 6px}#game-dialog.is-live .room-stage-copy>p:last-child{font-size:.875rem;line-height:1.4}#game-dialog.is-live .online-memory-board{flex:1;min-height:0;max-height:430px;max-width:480px;width:100%;margin:auto;grid-template-rows:repeat(4,minmax(0,1fr));gap:8px}#game-dialog.is-live .online-memory-cell{aspect-ratio:auto;min-height:0;font-size:clamp(26px,7vw,42px)}#game-dialog.is-live .room-turn-note{font-size:.875rem;margin:9px 0 2px;flex-shrink:0}#game-dialog.is-live .room-sidebar{display:none}
 #game-dialog.is-live.show-room .room-stage{display:none}#game-dialog.is-live.show-room .room-sidebar{display:flex;flex:1;min-height:0;overflow:auto;border:0;padding:17px}.show-room .room-players{grid-template-columns:1fr}.show-room .room-actions{display:flex}
 :is(#rally-online,#fugaz-online,#chispa-online){min-width:0}#game-dialog.is-live :is(#rally-online,#fugaz-online,#chispa-online){flex:1;min-height:0;display:flex;flex-direction:column}#game-dialog.is-live .rally-session{flex:1;min-height:0;display:flex;flex-direction:column}#game-dialog.is-live .rally-room-bar,#game-dialog.is-live .rally-grid,#game-dialog.is-live .rally-session-bottom{display:none}#game-dialog.is-live .rally-race{display:flex;flex:1;min-height:0;flex-direction:column}#game-dialog.is-live .rally-hud{flex:0 0 auto;padding:7px 10px;gap:7px 12px;min-height:35px}.rally-stage{position:relative;min-height:0}#game-dialog.is-live .rally-stage{flex:1;overflow:hidden}#game-dialog.is-live :is(#rally-canvas,#fugaz-canvas,#chispa-canvas){position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto}.rally-hud meter{width:60px}.rally-driving-help{display:none}.rally-touch:not([hidden]){display:flex;flex:0 0 auto;background:#181d2b;padding:9px 10px;gap:8px}.rally-touch .touch-recover{font-size:1.3rem}
 #game-dialog.is-live.show-room .rally-race{display:none}#game-dialog.is-live.show-room .rally-session{overflow:auto}#game-dialog.is-live.show-room .rally-room-bar{display:flex}#game-dialog.is-live.show-room .rally-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:18px}#game-dialog.is-live.show-room .rally-session-bottom{display:flex;margin-top:auto;align-items:center}.rally-session-bottom button{min-height:44px}
}
@media(max-width:430px){.fullscreen-button span{display:none}.game-header{gap:6px;padding:5px 7px}.game-controls{gap:1px}.game-heading h2{font-size:1rem}.touch-controls button,.rally-touch button{padding:10px 11px}.touch-steer,.touch-pedals{gap:6px}.touch-steer button{min-width:50px}.touch-pedals button{font-size:.9375rem}.touch-pedals .touch-recover{min-width:44px;padding:7px}.rally-hud>label{font-size:.8125rem}}
@media(max-height:500px) and (orientation:landscape){
 #game-dialog .game-header{min-height:48px;padding-top:1px;padding-bottom:1px}.game-heading h2{font-size:1rem}.game-hud{min-height:29px;padding:3px 12px}.game-bottom{min-height:34px;padding-top:0;padding-bottom:0}.game-bottom .text-button,.game-help>summary{min-height:32px}.game-overlay{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,.8fr);align-content:safe center;align-items:center;column-gap:26px;row-gap:10px;padding:15px 25px;overflow:auto}.game-overlay .overlay-icon,.game-overlay>.eyebrow{display:none}.game-overlay h3{grid-column:1;grid-row:1;margin:0;font-size:1.6rem}.game-overlay>p:not(.eyebrow){grid-column:1;grid-row:2;font-size:.9375rem;line-height:1.45}.game-overlay .instructions{grid-column:1;grid-row:3/5;font-size:.8125rem;line-height:1.4;margin:0}.game-overlay .mode-choices{grid-column:2;grid-row:1/3;margin:0}.game-overlay .mode-button{padding:10px 8px}.game-overlay #start-game{grid-column:2;grid-row:3;margin:0;min-width:0}.game-overlay #back-to-catalog{grid-column:2;grid-row:4;margin:0;min-height:36px}#game-dialog[data-phase=paused] .game-overlay #start-game,#game-dialog[data-phase=result] .game-overlay #start-game{grid-row:2}
 #game-dialog.has-touch[data-game=snake][data-phase=playing] .play-region,#game-dialog.has-touch[data-game=orbit][data-phase=playing] .play-region,#game-dialog.has-touch[data-game=pulse][data-phase=playing] .play-region,#game-dialog.has-touch[data-game=fusion][data-phase=playing] .play-region{flex-direction:row}.touch-controls[data-game=snake]{flex-direction:column;width:168px;gap:8px;padding:8px;justify-content:center}.touch-controls[data-game=snake] .touch-actions{max-width:none}.touch-controls[data-game=snake] .touch-action{min-height:44px;flex-direction:row}.touch-controls[data-game=snake] .touch-caption{display:none}.touch-controls[data-game=orbit]{width:170px;flex-wrap:wrap}.touch-controls[data-game=orbit] .touch-track-move{flex-basis:100%;min-height:80px;flex-direction:column;font-size:.8125rem}.touch-controls[data-game=orbit] .touch-action{width:100%;min-height:44px;flex-direction:row}.touch-controls[data-game=pulse]{width:110px}.touch-controls[data-game=pulse] .touch-pulse{flex-direction:column}.touch-controls[data-game=fusion]{width:70px;flex-direction:column;padding:6px;gap:5px}.touch-controls[data-game=fusion] button{padding:2px;min-height:38px;max-width:none}.touch-controls[data-game=breakout]{padding:5px 15px}.touch-track-x{min-height:46px}.touch-controls[data-game=rally],.rally-touch{padding-top:5px;padding-bottom:5px}.touch-controls[data-game=rally] button,.rally-touch button{min-height:44px;padding-top:5px;padding-bottom:5px}
 #game-dialog.is-live .multiplayer-toolbar{min-height:44px}#game-dialog.is-live .room-stage-copy{margin:0 0 5px}#game-dialog.is-live .room-stage-copy .eyebrow,#game-dialog.is-live .room-stage-copy>p:last-child{display:none}#game-dialog.is-live .room-stage-heading{min-height:18px}#game-dialog.is-live .room-stage-copy h3{font-size:1rem;margin:0}#game-dialog.is-live .online-memory-board{max-width:540px;gap:5px}#game-dialog.is-live .online-memory-cell{font-size:24px}#game-dialog.is-live .room-turn-note{margin:4px 0 0;font-size:.8125rem}
}
@media(min-width:901px) and (pointer:fine){.touch-controls:not([hidden]){display:none}.rally-stage{aspect-ratio:8/5}.rally-stage canvas{height:100%!important;width:100%;object-fit:contain}.game-help[open] p{font-size:.9375rem!important}}
@media(prefers-reduced-motion:reduce){.touch-key{transition:none}}

/* Thumb-sized surfaces. Action games use the play area itself as a controller. */
@media (max-width:900px),(any-pointer:coarse){
 #game-dialog.has-touch .play-region{position:relative}
 #game-dialog.has-touch[data-game=rally][data-phase=playing] .touch-controls,
 #game-dialog.has-touch[data-game=orbit][data-phase=playing] .touch-controls,
 #game-dialog.has-touch .rally-stage .rally-touch:not([hidden]){display:block;position:absolute;inset:0;z-index:4;width:100%;height:100%;padding:0;border:0;background:none;pointer-events:none}
 #game-dialog.has-touch[data-game=orbit][data-phase=playing] .play-region{flex-direction:column}
 #game-dialog.has-touch .touch-steer{position:absolute;inset:0;display:grid;grid-template-columns:1fr 1fr;margin:0;gap:0;pointer-events:auto}
 #game-dialog.has-touch .touch-steer button{position:relative;width:100%;height:100%;min-width:0;min-height:0;padding:0;border:0;border-radius:0;background:linear-gradient(0deg,#181d2bd9,transparent 34%);box-shadow:none;color:#fff}
 #game-dialog.has-touch .touch-steer button+button{border-left:1px solid #ffffff14}
 #game-dialog.has-touch .touch-steer button.is-pressed{background:linear-gradient(0deg,#7485b377,#8ca1d912 65%,transparent);box-shadow:inset 0 -5px #bac6e8}
 #game-dialog.has-touch .touch-steer button>span{position:absolute;bottom:27px;font-size:40px;text-shadow:0 2px 12px #000}
 #game-dialog.has-touch .steer-left>span{left:18px}#game-dialog.has-touch .steer-right>span{right:18px}
 #game-dialog.has-touch .touch-pedals{position:absolute;left:50%;bottom:15px;transform:translateX(-50%);display:flex;gap:8px;align-items:center;pointer-events:auto}
 #game-dialog.has-touch .touch-pedals button{width:60px;min-width:60px;height:70px;min-height:70px;padding:4px;border:1px solid #8a98bf;border-radius:18px;background:#28314aed;box-shadow:0 5px 20px #0006;font-size:1.2rem;flex-direction:column;gap:2px}
 #game-dialog.has-touch .touch-pedals button span{font-size:1rem}#game-dialog.has-touch .touch-pedals .touch-action{width:72px;min-width:72px;background:#a3b4e0;color:#263216;border-color:#dae1f3;font-size:1.65rem}
 #game-dialog.has-touch .touch-pedals .touch-recover{width:44px;min-width:44px;height:58px;min-height:58px;font-size:1.75rem}
 #game-dialog.has-touch .touch-pedals button.is-pressed{transform:scale(.96);background:#6073a8}#game-dialog.has-touch .touch-pedals .touch-action.is-pressed{background:#8897be}
 .touch-joystick{position:absolute;inset:0;pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none}
 .stick-ring{position:absolute;left:80px;top:calc(100% - 90px);width:108px;height:108px;transform:translate(-50%,-50%);border:2px solid #b7c4e780;border-radius:50%;background:#29324b88;box-shadow:0 0 0 10px #a8b7e212;pointer-events:none}
 .stick-knob{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:grid;place-items:center;width:60px;height:60px;border-radius:50%;background:#98a5c799;color:#f1f4fa;border:1px solid #d7def2;font-size:30px}
 .touch-joystick.is-pressed .stick-ring{left:var(--stick-x);top:var(--stick-y);border-color:#d3dbf0;background:#414f758c}
 .touch-joystick.is-pressed .stick-knob{transform:translate(calc(-50% + var(--stick-dx,0px)),calc(-50% + var(--stick-dy,0px)));background:#98a5c7e0}
 .stick-caption{position:absolute;bottom:17px;left:22px;font-size:.875rem;color:#ced6ee;text-shadow:0 2px 5px #000;pointer-events:none}
 #game-dialog.has-touch[data-game=orbit] .touch-controls>.touch-action{position:absolute;bottom:18px;right:18px;width:86px;height:86px;min-width:86px;min-height:86px;border-radius:50%;display:flex;flex-direction:column;pointer-events:auto;box-shadow:0 4px 26px #0007;font-size:30px}
 #game-dialog.has-touch[data-game=snake][data-phase=playing] .play-region{flex-direction:column}
 #game-dialog.has-touch[data-game=snake] .touch-controls{width:100%;padding:10px;display:flex;flex-direction:row;justify-content:center;gap:0}
 .touch-directions{display:grid;grid-template-columns:1fr 1fr 1.25fr 1fr 1fr;width:min(100%,700px);gap:7px}
 #game-dialog.has-touch .touch-directions button{width:auto;min-width:0;height:80px;min-height:80px;padding:4px;font-size:34px;border-radius:15px;border-color:#93a0c4;background:#354060;box-shadow:inset 0 -4px #181d2b}
 #game-dialog.has-touch .touch-directions button.is-pressed{background:#7283b2;box-shadow:inset 0 3px #181d2b}
 #game-dialog.has-touch .touch-directions .touch-action{flex-direction:column;font-size:25px;background:#a3b4e0;gap:4px;color:#263216;box-shadow:inset 0 -4px #8baf4c}
 #game-dialog.has-touch[data-game=breakout] .touch-controls{padding:8px 12px}#game-dialog.has-touch .touch-track-x{min-height:96px;background:linear-gradient(110deg,#2d3651,#394567);border:1px solid #94a1c4;font-size:1rem;border-radius:20px}
 #game-dialog.has-touch .touch-track-x>span:first-child{font-size:38px}#game-dialog.has-touch .touch-track-x.is-pressed{background:#536597}
 #game-dialog.has-touch[data-game=pulse][data-phase=playing] .play-region{flex-direction:column}#game-dialog.has-touch[data-game=pulse] .touch-controls{width:100%;padding:9px 12px}#game-dialog.has-touch .touch-pulse{height:90px;min-height:90px;font-size:1.5rem;border-radius:20px;letter-spacing:1px}
 #game-dialog.has-touch .memory-board{width:var(--memory-width,100%);height:var(--memory-height,100%);max-height:100%;aspect-ratio:auto;grid-template-rows:repeat(4,minmax(0,1fr))}.memory-cell{min-height:0;aspect-ratio:auto}.memory-cell:active:not(:disabled),.online-memory-cell:active:not(:disabled){transform:scale(.97);border-color:#d8dff2}
 #game-dialog.has-touch .mines-options{width:100%;gap:8px}#game-dialog.has-touch .mines-options>button{flex:1;min-height:58px;padding:12px 10px;font-size:1rem}#game-dialog.has-touch .board-wide .mines-options{width:148px;flex-shrink:0}#game-dialog.has-touch .board-wide .mines-options>button{width:100%;flex:none}
 .mine-cell:active:not(:disabled){box-shadow:inset 0 0 0 3px #cbd4ee}
}
@media (max-height:500px) and (orientation:landscape){
 #game-dialog.has-touch .touch-directions button{height:64px;min-height:64px}
 #game-dialog.has-touch .touch-track-x{min-height:66px}#game-dialog.has-touch .touch-pulse{height:66px;min-height:66px}
 #game-dialog.has-touch .touch-pedals{bottom:10px}#game-dialog.has-touch .touch-pedals button{height:60px;min-height:60px;width:80px;min-width:80px}#game-dialog.has-touch .touch-pedals .touch-action{width:88px;min-width:88px}#game-dialog.has-touch .touch-pedals .touch-recover{width:50px;min-width:50px}
 #game-dialog.has-touch .touch-steer button>span{bottom:20px;font-size:44px}.stick-ring{top:calc(100% - 85px)}
}

@media(max-width:900px),(any-pointer:coarse){
 #game-dialog.has-touch[data-game=fugaz] .game-viewport,#game-dialog.has-touch[data-game=fugaz] .game-viewport:has(#game-overlay:not([hidden])){min-height:0;aspect-ratio:auto}
 #game-dialog.has-touch[data-game=chispa] .game-viewport,#game-dialog.has-touch[data-game=chispa] .game-viewport:has(#game-overlay:not([hidden])){min-height:0;aspect-ratio:auto}
 .touch-controls[data-game=fugaz]:not([hidden]){position:relative;display:flex;flex:0 0 126px;height:126px;min-height:126px;padding:12px;gap:12px;align-items:stretch;border-top:1px solid #475681;background:#181d2b}
 .touch-controls[data-game=chispa]:not([hidden]){position:relative;display:flex;flex:0 0 126px;height:126px;min-height:126px;padding:12px;gap:12px;align-items:stretch;border-top:1px solid #475681;background:#181d2b}
 .touch-controls[data-game=fugaz] .touch-joystick{position:relative;inset:auto;flex:1;border:1px solid #6274a8;border-radius:20px;background:#273048;overflow:hidden;min-width:0}
 .touch-controls[data-game=chispa] .touch-joystick{position:relative;inset:auto;flex:1;border:1px solid #6274a8;border-radius:20px;background:#273048;overflow:hidden;min-width:0}
 .touch-controls[data-game=fugaz] .stick-ring{left:50%;top:45%;width:64px;height:64px;background:#3e4b70}.touch-controls[data-game=fugaz] .stick-knob{width:38px;height:38px;font-size:25px}
 .touch-controls[data-game=chispa] .stick-ring{left:50%;top:45%;width:64px;height:64px;background:#3e4b70}.touch-controls[data-game=chispa] .stick-knob{width:38px;height:38px;font-size:25px}
 .touch-controls[data-game=fugaz] .touch-joystick.is-pressed .stick-ring{left:var(--stick-x);top:var(--stick-y)}
 .touch-controls[data-game=chispa] .touch-joystick.is-pressed .stick-ring{left:var(--stick-x);top:var(--stick-y)}
 .touch-controls[data-game=fugaz] .stick-caption{bottom:7px;left:0;width:100%;text-align:center;font-size:.875rem}
 .touch-controls[data-game=chispa] .stick-caption{bottom:7px;left:0;width:100%;text-align:center;font-size:.875rem}
 .touch-controls[data-game=fugaz] .touch-action{position:relative;min-width:100px;width:100px;border-radius:22px;flex-direction:column;font-size:30px}.touch-controls[data-game=fugaz] .touch-action span{font-size:1rem}
 .touch-controls[data-game=chispa] .touch-action{position:relative;min-width:100px;width:100px;border-radius:22px;flex-direction:column;font-size:30px}.touch-controls[data-game=chispa] .touch-action span{font-size:1rem}
}
@media(max-height:520px) and (orientation:landscape){
 #game-dialog.has-touch[data-game=fugaz][data-phase=playing] .play-region{flex-direction:row}
 #game-dialog.has-touch[data-game=chispa][data-phase=playing] .play-region{flex-direction:row}
 #game-dialog.has-touch[data-game=fugaz][data-phase=playing] .touch-controls{width:156px;height:auto;flex:0 0 156px;flex-direction:column;padding:8px;gap:8px;min-height:0}
 #game-dialog.has-touch[data-game=chispa][data-phase=playing] .touch-controls{width:156px;height:auto;flex:0 0 156px;flex-direction:column;padding:8px;gap:8px;min-height:0}
 #game-dialog.has-touch[data-game=fugaz][data-phase=playing] .touch-joystick{min-height:90px}#game-dialog.has-touch[data-game=fugaz][data-phase=playing] .touch-action{width:100%;min-height:60px;flex-direction:row}
 #game-dialog.has-touch[data-game=chispa][data-phase=playing] .touch-joystick{min-height:90px}#game-dialog.has-touch[data-game=chispa][data-phase=playing] .touch-action{width:100%;min-height:60px;flex-direction:row}
 #game-dialog.has-touch #fugaz-race{display:grid;grid-template-columns:minmax(0,1fr) 156px;grid-template-rows:auto minmax(0,1fr)}
 #game-dialog.has-touch #chispa-race{display:grid;grid-template-columns:minmax(0,1fr) 156px;grid-template-rows:auto minmax(0,1fr)}
 #fugaz-race>.rally-hud{grid-column:1/-1}#fugaz-race>.rally-stage{grid-column:1;grid-row:2;aspect-ratio:auto}#fugaz-controls{grid-column:2;grid-row:2}
 #chispa-race>.rally-hud{grid-column:1/-1}#chispa-race>.rally-stage{grid-column:1;grid-row:2;aspect-ratio:auto}#chispa-controls{grid-column:2;grid-row:2}
 #game-dialog.has-touch #fugaz-controls{height:auto;min-height:0;flex-direction:column;padding:8px}#fugaz-controls .touch-joystick{min-height:80px}#game-dialog.has-touch #fugaz-controls .touch-action{width:100%;min-height:60px;flex-direction:row}
 #game-dialog.has-touch #chispa-controls{height:auto;min-height:0;flex-direction:column;padding:8px}#chispa-controls .touch-joystick{min-height:80px}#game-dialog.has-touch #chispa-controls .touch-action{width:100%;min-height:60px;flex-direction:row}
}

#game-dialog.is-live.show-room #fugaz-race{display:none}
#game-dialog.is-live.show-room #chispa-race{display:none}

/* Pong keeps fingers in a separate control area, with the entire court visible. */
#game-dialog.has-touch[data-game=pong][data-phase=playing] .play-region{display:flex;flex-direction:column;gap:0;min-height:0}
#game-dialog.has-touch[data-game=pong][data-phase=playing] .game-viewport{width:100%;height:auto;min-height:0;flex:1}
#game-dialog.has-touch[data-game=pong] .touch-controls:not([hidden]){position:relative;inset:auto;display:flex;flex-direction:row;flex:0 0 148px;width:100%;height:148px;min-height:0;padding:10px 12px;gap:12px;background:#181d2c;border-top:1px solid #51617c}
#game-dialog.has-touch[data-game=pong][data-phase=paused] .touch-controls{display:none}
#game-dialog.has-touch[data-game=pong] .paddle-pad{--pad-color:#91e7ff;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;min-width:0;min-height:0;gap:4px;padding:12px 28px 12px 12px;overflow:hidden;border:1px solid #5689a8;border-radius:18px;background:linear-gradient(145deg,#223c53,#172a3e);color:#e2f5ff;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#game-dialog.has-touch[data-game=pong] .paddle-pad.right{--pad-color:#c2cceb;border-color:#6678ab;background:linear-gradient(145deg,#2b354f,#1e2537);color:#eff2fa}
.paddle-pad-arrow{font-size:30px;line-height:1;color:var(--pad-color)}.paddle-pad strong{font-size:1rem;line-height:1.4}.paddle-pad-hint{font-size:.875rem;line-height:1.4;color:inherit}
.paddle-pad-rail{position:absolute;right:13px;top:22px;bottom:22px;width:3px;border-radius:3px;background:#ffffff26;pointer-events:none}.paddle-pad-handle{position:absolute;left:50%;top:var(--paddle-position,50%);width:8px;height:18px;border-radius:4px;transform:translate(-50%,-50%);background:var(--pad-color)}
#game-dialog.has-touch[data-game=pong] .paddle-pad.is-pressed{border-color:var(--pad-color);box-shadow:inset 0 0 0 2px var(--pad-color);background:#34576c}#game-dialog.has-touch[data-game=pong] .paddle-pad.right.is-pressed{background:#3c496d}
@media(max-height:600px) and (orientation:portrait){
 #game-dialog.has-touch[data-game=pong] .touch-controls:not([hidden]){flex-basis:120px;height:120px;padding:8px 12px}.paddle-pad-arrow{font-size:24px}
}
@media(orientation:landscape){
 #game-dialog.has-touch[data-game=pong][data-phase=playing] .play-region{display:grid;grid-template-columns:clamp(88px,13vw,124px) minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:10px;padding:6px 10px}
 #game-dialog.has-touch[data-game=pong][data-mode=local][data-phase=playing] .play-region{grid-template-columns:clamp(88px,13vw,124px) minmax(0,1fr) clamp(88px,13vw,124px)}
 #game-dialog.has-touch[data-game=pong][data-phase=playing] .game-viewport{grid-column:2;grid-row:1;width:100%;height:100%;min-width:0}
 #game-dialog.has-touch[data-game=pong][data-phase=playing] .touch-controls:not([hidden]){display:contents}
 #game-dialog.has-touch[data-game=pong] .paddle-pad.left{grid-column:1;grid-row:1}#game-dialog.has-touch[data-game=pong] .paddle-pad.right{grid-column:3;grid-row:1}
 #game-dialog.has-touch[data-game=pong] .paddle-pad{padding:12px 17px 12px 7px;gap:8px;text-align:center;border-radius:15px}.paddle-pad-rail{right:8px}.paddle-pad-hint{max-width:80px}
}
