@charset "UTF-8";
:root{color-scheme:dark;--bg:#111719;--panel:#1a2225;--line:#354246;--cream:#f4f0df;--muted:#a4b0b0;--lime:#cdfc70;--coral:#ff7a72;font-family:"Courier New",Courier,monospace;font-synthesis:none}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--cream)}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}button:disabled{cursor:wait;opacity:.7}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:3px solid var(--lime);outline-offset:5px}button{border:0}button[hidden],[hidden]{display:none!important}.arcade{max-width:1232px;margin:auto;padding:30px 40px 22px}.masthead{display:flex;align-items:center;gap:20px;padding:0 0 27px}.brand{font:900 27px/1.1 Arial,sans-serif;letter-spacing:-1.3px;color:var(--cream);text-decoration:none;display:flex;gap:10px;align-items:center}.brand-icon{color:var(--lime);font-size:34px}.brand-dot{color:var(--lime);margin-left:-10px}.edition{margin-left:auto;color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:2px}.utility{background:none;color:var(--cream);font-size:12px;padding:9px 0 9px 20px;white-space:nowrap}.masthead .utility{border-left:1px solid var(--line);margin-left:10px}.machine{border:1px solid var(--line);box-shadow:0 12px 0 #080d0e}.hud{display:grid;grid-template-columns:1fr 100px 1fr;gap:24px;padding:19px 24px;background:#172023;border-bottom:2px solid #05090a}.hud-label{color:var(--coral);font-size:11px;letter-spacing:1px;text-transform:uppercase}.player-hud{display:grid;grid-template-columns:28px 1fr;align-items:center;gap:4px 10px}.player-hud strong{font-size:21px;text-transform:uppercase;letter-spacing:1px}.player-hud #score{grid-column:2;color:var(--lime);font-size:14px;letter-spacing:2px}.timer-hud{text-align:center;display:flex;flex-direction:column;gap:3px}.timer-hud strong{font:bold 40px/.9 "Courier New",monospace;text-shadow:3px 2px #8e5a30;color:#fff3c4}.timer-hud strong.urgent{color:var(--coral)}.target-hud{align-self:center}.target-hud>div:first-child{display:flex;justify-content:space-between;margin-bottom:10px;gap:10px}.target-hud .hud-label{color:var(--muted)}.target-hud strong{font-size:13px;color:var(--lime)}.health-track{height:12px;background:#070c0e;border:1px solid #5c686a;padding:2px}.health-track>div{width:0;height:100%;background:var(--lime);transition:width .15s}.stage{position:relative;aspect-ratio:16/9;overflow:hidden;background:#111c24;isolation:isolate}.stage>canvas{display:block;width:100%;height:100%;image-rendering:pixelated;cursor:default;touch-action:none;outline-offset:-5px}.stage-label{position:absolute;bottom:17px;left:22px;display:flex;gap:12px;align-items:center;font-size:11px;text-transform:uppercase;letter-spacing:1px;color:#fff;text-shadow:1px 1px #000;pointer-events:none}.stage-label>span:first-child{color:var(--lime);background:#111719dc;padding:4px 7px}.overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:25px;background:#0a1116bf;backdrop-filter:blur(2px)}.menu-panel{width:min(660px,100%);text-align:center}.eyebrow{display:block;font-size:11px;letter-spacing:2px;color:var(--lime);text-transform:uppercase;margin-bottom:15px}h1{font:900 clamp(30px,4.1vw,54px)/.98 Arial,sans-serif;letter-spacing:-2px;margin:0 0 12px;text-shadow:3px 3px #121b20}h1 span{color:var(--lime)}.intro{font-size:13px;color:#d0d8d5;margin:0 0 22px;line-height:1.5}.era-picker{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:18px}.era{display:flex;flex-direction:column;align-items:center;background:#172124ef;border:1px solid #52605e;color:var(--cream);padding:12px 8px 13px;min-width:0;transition:border-color .15s,background .15s}.era:hover{background:#293932}.era.selected{border:2px solid var(--lime);padding:11px 7px 12px;background:#253329}.era canvas{width:140px;max-width:100%;height:auto;image-rendering:pixelated;margin-bottom:6px}.era>span{font:bold 19px/1.1 "Courier New",monospace}.era small{font-size:10px;color:#bdc8c4;margin-top:5px}.primary{background:var(--lime);color:#182112;font:bold 14px/1.3 "Courier New",monospace;min-width:195px;padding:15px 24px;border:1px solid #e5ffb5;box-shadow:0 4px 0 #6b9735;transition:transform .1s,background .1s}.primary:hover{background:#e3ffad}.primary:active{transform:translateY(3px);box-shadow:0 1px 0 #6b9735}.menu-note{font-size:10px;color:#bac4c1;margin:15px 0 0;min-height:12px}.announcement{position:absolute;top:38%;left:0;right:0;text-align:center;pointer-events:none;font:900 clamp(40px,7vw,90px)/1 Arial,sans-serif;color:#fff3c4;text-shadow:4px 4px #14222a,7px 7px #dd633a;letter-spacing:-3px;z-index:2}.game-strip{display:flex;align-items:center;justify-content:space-between;padding:9px 22px;background:#172023;min-height:42px;gap:10px}.game-strip>span{font-size:11px;text-transform:uppercase;letter-spacing:1px;color:var(--lime)}.game-strip .utility{padding:3px 0;color:var(--muted)}kbd{font:inherit;border:1px solid #4a5a5d;padding:2px 5px;border-radius:2px;margin-left:5px}.controls{display:flex;align-items:center;justify-content:center;gap:34px;padding:31px 0 24px}.controls>div{display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted)}.control-symbol{font-size:14px;color:var(--cream);border-bottom:1px solid var(--line);padding:5px 4px}.result-panel{text-align:center;width:min(500px,100%);padding:20px}.result-panel h2{font:900 clamp(40px,6vw,72px)/1 Arial,sans-serif;letter-spacing:-2px;color:var(--lime);margin:0 0 15px}.result-panel p{font-size:14px;line-height:1.7;color:#dce3de;max-width:390px;margin:0 auto 26px}.result-actions{display:flex;justify-content:center;gap:12px}.secondary{background:#213034;border:1px solid #72847c;color:var(--cream);padding:15px 20px;font-weight:bold;font-size:13px}.secondary:hover{background:#354546}.result-panel img{width:130px;height:130px;object-fit:contain;image-rendering:pixelated;margin:0 auto 18px}.text-button{display:block;margin:20px auto 0;background:none;color:var(--muted);font-size:12px;text-decoration:underline;text-underline-offset:4px}footer{display:flex;justify-content:space-between;border-top:1px solid var(--line);padding-top:20px;color:#859392;font-size:10px;gap:15px}.touch-controls{display:none;gap:8px;justify-content:space-between;margin-top:21px}.touch-controls button{background:#263237;border:1px solid #60716d;color:var(--cream);font-size:21px;min-width:48px;min-height:48px;touch-action:none;user-select:none}.touch-move{display:flex;gap:8px;margin-right:auto}.touch-controls #touch-attack{background:var(--lime);color:#17201a;font-size:15px;font-weight:bold;padding:0 16px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* The stage and its controls share a single frame. */
body{min-height:100dvh;display:grid;place-items:center;overflow:hidden}
.arcade{width:min(calc(100vw - 24px),calc((100dvh - 130px)*16/9),1600px);max-width:none;margin:0;padding:0}
.machine{box-shadow:none}
.hud{grid-template-columns:1fr 72px 1.3fr 88px;gap:20px;padding:14px 20px;min-height:78px}
.audio-controls{display:flex;flex-direction:column;justify-content:center;gap:5px;border-left:1px solid var(--line);padding-left:12px}
.audio-controls .utility{font-size:11px;padding:3px 0;text-align:right}
.controls{padding:0;gap:18px}.controls>div{gap:6px;font-size:10px}.control-symbol{padding:3px 0;font-size:11px;border:0}
.game-strip{min-height:42px;padding:7px 18px}.game-strip>span{font-size:10px;letter-spacing:0}.game-strip .utility{font-size:10px}
.overlay{z-index:10}.announcement{z-index:3}.touch-zones{display:none}
.rotate-overlay{position:fixed;inset:0;z-index:100;background:#070b0d;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:32px;text-align:center}
.rotate-symbol{font:72px/1 Arial,sans-serif;color:var(--lime);margin-bottom:22px}.rotate-overlay h2{font:bold 26px/1.2 Arial,sans-serif;max-width:300px;margin:0 0 16px}.rotate-overlay p{font-size:12px;line-height:1.6;color:var(--muted);max-width:290px;margin:0}
.touch-device .arcade{width:100%;height:100dvh;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.touch-device .machine{height:100%;display:grid;grid-template-rows:64px minmax(0,1fr) 48px;border:0}
.touch-device .stage{aspect-ratio:auto;min-height:0}
.touch-device .stage>canvas{object-fit:contain}
.touch-device .controls{display:none}
.touch-device .touch-controls{display:flex;margin:0;gap:7px}
.touch-controls button{min-height:34px;min-width:42px;font-size:18px;border-radius:3px}.touch-controls #touch-attack{font-size:12px;padding:0 14px}
.touch-device .stage.playing .touch-zones{display:block;position:absolute;inset:0;pointer-events:none;z-index:2}
.touch-zone{position:absolute;bottom:0;width:18%;height:72%;pointer-events:auto;background:transparent;color:#fff;touch-action:none;user-select:none;-webkit-user-select:none}
.touch-zone.left{left:0}.touch-zone.right{right:0}.touch-zone span{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);background:#0b151d9c;border:1px solid #a4b0b070;padding:4px 12px;font-size:22px;border-radius:4px}.touch-zone:active span{background:#cdfc7055}
.touch-device .stage-label{bottom:10px;left:21%;font-size:9px}.touch-device .game-strip{padding:6px 14px}
@media(max-width:1000px){
.hud{grid-template-columns:1fr 54px 1.1fr 76px;gap:12px;padding:10px 14px}.player-hud strong{font-size:18px}.player-hud #score{font-size:12px}.hud-label{font-size:9px}.timer-hud strong{font-size:32px}.target-hud strong{font-size:11px}.target-hud>div:first-child{margin-bottom:7px}.health-track{height:10px}.audio-controls{padding-left:9px}.audio-controls .utility{font-size:10px}
.controls{gap:10px}.controls>div{font-size:9px;gap:4px}.control-symbol{font-size:10px}.game-strip{padding:7px 10px}
.overlay{padding:14px}.eyebrow{font-size:10px;margin-bottom:10px}h1{font-size:40px}.intro{font-size:12px;margin-bottom:15px}.era-picker{margin-bottom:13px}.era{padding:8px 6px}.era.selected{padding:7px 5px}.era canvas{width:118px;height:49px;object-fit:contain}.era>span{font-size:17px}.era small{font-size:9px}.primary{padding:11px 20px}.menu-note{margin-top:12px}
}
@media(max-height:600px) and (orientation:landscape){
.touch-device .machine{grid-template-rows:48px minmax(0,1fr) 42px}.hud{padding:5px 12px;min-height:0;gap:12px}.player-hud{grid-template-columns:20px 1fr;gap:2px 5px}.player-hud strong{font-size:17px}.player-hud #score{font-size:10px}.timer-hud strong{font-size:27px}.hud-label{font-size:8px}.audio-controls{gap:2px}.audio-controls .utility{font-size:9px}.target-hud>div:first-child{margin-bottom:4px}
.menu-panel{width:min(530px,100%)}.overlay{padding:8px 16px;backdrop-filter:none}.eyebrow{font-size:8px;margin-bottom:6px}h1{font-size:30px;letter-spacing:-1px;margin-bottom:6px}.intro{font-size:10px;margin-bottom:8px}.era-picker{gap:8px;margin-bottom:9px}.era{padding:5px}.era.selected{padding:4px}.era canvas{height:32px;width:100px;margin-bottom:2px}.era>span{font-size:14px}.era small{font-size:8px;margin-top:3px}.primary{font-size:11px;min-width:150px;padding:8px 15px}.menu-note{font-size:8px;margin-top:8px;min-height:0}.result-panel{padding:4px}.result-panel h2{font-size:36px;margin-bottom:7px}.result-panel p{font-size:11px;line-height:1.4;margin-bottom:12px}.result-panel img{width:64px;height:64px;margin-bottom:5px}.secondary{font-size:11px;padding:8px 14px}.text-button{margin-top:10px;font-size:10px}.game-strip>span{font-size:9px}.game-strip .utility{font-size:9px}.touch-device .stage-label{font-size:8px;bottom:8px}
}
@media(max-width:600px) and (pointer:fine){.controls>div:nth-child(2),.controls>div:nth-child(3){display:none}.target-hud .hud-label{font-size:7px;letter-spacing:0}.hud{gap:6px;padding:10px 8px}.player-hud strong{font-size:14px}.player-hud{grid-template-columns:18px 1fr;gap:3px}.era small{font-size:7px}h1{font-size:26px}.intro{font-size:10px}.menu-note{font-size:8px}.era canvas{height:30px}.primary{font-size:10px;padding:8px 12px}.eyebrow{font-size:8px;margin-bottom:6px}.era-picker{margin-bottom:8px}.era{padding:4px}.era.selected{padding:3px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto;transition:none!important}.overlay{backdrop-filter:none}}

.bill-performance{position:relative;width:150px;margin:0 auto 8px}.result-panel .bill-performance img{display:block;margin:0 auto;width:130px;height:130px;transform-origin:50% 80%}.laugh-caption{display:none;position:absolute;top:8px;right:-40px;font:bold 11px/1.2 monospace;color:var(--lime);text-shadow:2px 2px #111719}.laughing img{animation:bill-laugh .48s steps(3,end) 8}.laughing .laugh-caption{display:block;animation:laugh-caption .48s steps(2,end) 8}.result-panel #bill-motion{font-size:9px;margin:0 auto 12px}
@keyframes bill-laugh{0%,100%{transform:translateY(0) rotate(-2deg)}45%{transform:translateY(-4px) rotate(3deg) scaleY(1.025)}75%{transform:translateY(1px) rotate(-1deg)}}@keyframes laugh-caption{0%,100%{opacity:.4;transform:translateY(0)}50%{opacity:1;transform:translateY(-3px)}}
@media(max-height:600px) and (orientation:landscape){.bill-performance{width:95px;margin-bottom:4px}.result-panel .bill-performance img{width:62px;height:62px}.laugh-caption{font-size:8px;right:-22px;top:4px}.result-panel #bill-motion{font-size:8px;margin-bottom:6px}}
@media(prefers-reduced-motion:reduce){.laughing img,.laughing .laugh-caption{animation:none}.laughing .laugh-caption{display:none}}

/* Mystery rounds keep the existing three-column menu, with a compact bonus row. */
h1{font-size:clamp(30px,4.1vw,54px)}.era.bonus{padding:7px 8px}.era.bonus canvas{height:32px;width:90px}.era.bonus>span{font-size:13px}.era.bonus small{font-size:9px}.era.locked{cursor:default;opacity:.65;border-style:dashed}.era.locked canvas{display:none}.era.locked>span{font-size:27px;line-height:32px;color:var(--muted)}.era.cleared{border-color:#719e59}.era.selected.cleared{border-color:var(--lime)}#next-bonus{margin-bottom:12px}.crying .laugh-caption{color:#9ad5ff}.crying.laughing img{animation:bill-laugh .8s steps(3,end) 8}
@media(max-height:600px) and (orientation:landscape){h1{font-size:28px}.era.bonus{padding:3px 5px}.era.bonus canvas{height:20px;width:60px}.era.bonus>span{font-size:10px;line-height:16px}.era.bonus small{font-size:7px;margin-top:1px}.era.locked>span{font-size:18px;line-height:20px}.era-picker{gap:5px}.intro{margin-bottom:7px}.menu-note{margin-top:6px}#next-bonus{margin-bottom:7px}}

/* Version 6 keeps the frame while centering the pixel clock and simplifying the menu. */
@font-face{font-family:ArcadePixel;src:url("assets/arcade-pixel.v6.ttf") format("truetype");font-display:swap}
:root{--lime:#c3e887;--coral:#db8f73;--panel:#1c2425}
.hud{position:relative;grid-template-columns:1fr 130px 88px;gap:20px}
.timer-hud{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);gap:8px}
.timer-hud strong{font:32px/1 ArcadePixel,monospace;color:var(--cream);text-shadow:2px 2px #765445}
.target-hud{width:130px;justify-self:end}.target-hud .hud-label{font-size:8px;letter-spacing:0}.target-hud strong{font-size:10px}.health-track{height:8px;padding:1px}.target-hud>div:first-child{margin-bottom:6px}
h1{font:52px/1.25 ArcadePixel,monospace;letter-spacing:-2px;color:var(--cream);margin-bottom:12px}
.menu-note:empty{display:none}.intro{margin-bottom:20px}
.announcement{font:clamp(24px,4.2vw,58px)/1.4 ArcadePixel,monospace;letter-spacing:-1px;text-shadow:3px 3px #14222a,5px 5px #b87556;top:35%}.announcement.digit{font-size:clamp(46px,7vw,94px)}
.result-panel h2{font:clamp(24px,3.1vw,42px)/1.4 ArcadePixel,monospace;letter-spacing:-1px}
.result-actions .primary{flex:1;min-width:0;max-width:195px}.result-actions .primary:focus-visible{outline:3px solid var(--cream);outline-offset:5px}
.bill-performance{width:150px}.bill-performance canvas{display:block;width:130px;height:130px;margin:auto;image-rendering:pixelated}.laughing img,.laughing .laugh-caption{animation:none}.laugh-caption{display:none!important}
@media(max-width:1000px){.hud{grid-template-columns:1fr 100px 76px;gap:12px}.target-hud{width:100px}.timer-hud strong{font-size:27px}h1{font-size:42px}}
@media(max-height:600px) and (orientation:landscape){.hud{grid-template-columns:1fr 90px 76px}.target-hud{width:90px}.timer-hud{gap:4px}.timer-hud strong{font-size:22px}.target-hud .hud-label{font-size:7px}h1{font-size:30px;line-height:1.25;margin-bottom:6px}.intro{margin-bottom:8px}.bill-performance canvas{width:62px;height:62px}.result-panel h2{font-size:25px;line-height:1.35}.result-actions .primary{max-width:150px}}
@media(max-width:600px) and (pointer:fine){.hud{grid-template-columns:1fr 72px 70px;gap:6px}.target-hud{width:72px}.timer-hud strong{font-size:21px}h1{font-size:26px}.target-hud .hud-label{font-size:6px}}

/* Hidden touch controller. The title retains the approved heading layout. */
#secret-title{font:inherit;color:inherit;letter-spacing:inherit;background:none;padding:0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#secret-controller{width:min(360px,calc(100vw - 32px));max-height:calc(100dvh - 24px);overflow:auto;padding:20px;background:var(--panel);color:var(--cream);border:2px solid var(--lime);box-shadow:6px 6px 0 #070b0d}
#secret-controller::backdrop{background:rgba(7,11,13,.88)}
.secret-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.secret-heading h2{font:14px/1.6 ArcadePixel,monospace;margin:0}
#secret-controller button{min-width:48px;min-height:48px;background:#263237;color:var(--cream);border:1px solid #60716d;touch-action:manipulation;font-weight:bold;font-size:24px}
#secret-controller button:active{background:var(--lime);color:#17201a}
#secret-close{font-size:28px!important}#secret-help{font-size:12px;line-height:1.5;margin:12px 0 16px}
.secret-pad{display:flex;align-items:center;justify-content:space-between;gap:24px}.secret-arrows{display:grid;grid-template-columns:repeat(3,48px);gap:6px}.secret-arrows button:first-child{grid-column:2}.secret-arrows button:nth-child(2){grid-column:1;grid-row:2}.secret-arrows button:nth-child(3){grid-column:2;grid-row:2}.secret-arrows button:nth-child(4){grid-column:3;grid-row:2}.secret-letters{display:flex;gap:8px}
#secret-progress{font-size:11px;min-height:16px;margin:16px 0 0;color:var(--lime)}
@media(max-width:370px){#secret-controller{padding:12px}.secret-pad{gap:12px}.secret-letters{flex-direction:column}}

/* Version 9: menu breathing room and keyboard keycaps. */
#menu{background:linear-gradient(#0a111675,#0a1116b0),url('assets/menu-landscape.v9.png') center/cover no-repeat;image-rendering:pixelated;backdrop-filter:none}.menu-panel h1{margin-bottom:16px;text-shadow:2px 2px #111719}.menu-panel .intro{margin-bottom:28px}.era-picker{margin-bottom:28px}
.game-strip{display:grid;grid-template-columns:minmax(130px,1fr) auto minmax(200px,1fr);gap:14px}.status-stack{min-width:0;color:var(--lime);font-size:10px}.status-stack>span{text-transform:uppercase;letter-spacing:.4px}.status-stack small{display:block;font-size:9px;line-height:1.4;margin-top:3px;letter-spacing:0;color:var(--muted)}.control-cluster{display:flex;align-items:center;justify-content:center;gap:14px}.control-cluster .controls{gap:12px}.control-cluster .utility{padding:6px 0;white-space:nowrap}.control-symbol{display:inline-flex;align-items:center;gap:3px;padding:0}
.control-symbol kbd,.control-cluster kbd{display:inline-block;margin:0;min-width:24px;text-align:center;padding:4px 5px;border-radius:4px;background:#253033;box-shadow:0 2px 0 #091012;font-size:10px}.control-cluster kbd{margin-left:4px}.mouse-key{flex-shrink:0}.project-credit{margin:0;text-align:right;color:var(--muted);font-size:10px;line-height:1.5}.project-credit a{color:var(--cream);text-decoration:none;white-space:nowrap}.project-credit a:hover{text-decoration:underline;text-underline-offset:3px}
@media(max-width:1100px){.game-strip{grid-template-columns:minmax(105px,1fr) auto minmax(175px,1fr);gap:8px}.control-cluster{gap:8px}.control-cluster .controls{gap:8px}.controls>div{gap:4px}.project-credit{font-size:9px}.control-symbol kbd,.control-cluster kbd{min-width:20px;font-size:9px;padding:3px}.control-cluster .utility{font-size:9px}}
@media(max-height:600px) and (orientation:landscape){.menu-panel h1{margin-bottom:8px}.menu-panel .intro{margin-bottom:14px}.era-picker{margin-bottom:18px}.game-strip{grid-template-columns:minmax(105px,1fr) auto minmax(135px,1fr);gap:6px}.project-credit{font-size:8px}.status-stack{font-size:8px}.status-stack small{font-size:7px;line-height:1.25}.control-cluster{gap:8px}.touch-device .machine{grid-template-rows:48px minmax(0,1fr) 48px}.game-strip .utility{font-size:8px}}
@media(max-width:600px) and (pointer:fine){.game-strip{grid-template-columns:1fr;justify-items:center}.status-stack,.project-credit{text-align:center}.menu-panel .intro{margin-bottom:16px}.era-picker{margin-bottom:18px}}

/* Version 10: consistent input symbols and a quiet playfield. */
.stage>canvas:focus,.stage>canvas:focus-visible{outline:none}
.control-symbol kbd,.control-cluster kbd{display:inline-flex;align-items:center;justify-content:center;min-height:24px;line-height:1;margin:0}
.arrow-key svg{display:block;width:14px;height:14px;flex-shrink:0}.arrow-key.left svg{transform:rotate(90deg)}.arrow-key.right svg{transform:rotate(-90deg)}.arrow-key.up svg{transform:rotate(180deg)}
.mouse-key{width:16px;height:22px}.mouse-key .left-click{fill:var(--lime)}
.control-cluster #pause-button{display:inline-flex;align-items:center;gap:6px}.result-panel h2:focus{outline:none}
#completion-confetti{position:absolute;inset:0;pointer-events:none;z-index:11;overflow:hidden}
#completion-confetti i{position:absolute;top:0;left:0;width:5px;height:8px;transform:translateY(-20px);will-change:transform}
.completion-banner{margin:0 auto 12px;color:var(--cream);font-size:10px;line-height:1.7}.completion-banner strong{display:block;font-family:ArcadePixel,monospace;font-size:11px}.completion-mark{color:var(--lime);letter-spacing:4px;font-size:14px}
@media(max-width:1100px){.control-symbol kbd,.control-cluster kbd{min-height:22px}.arrow-key svg{width:12px;height:12px}}
@media(max-height:600px) and (orientation:landscape){.completion-banner{margin:0 auto 5px;font-size:8px}.completion-banner strong{font-size:8px}.completion-mark{font-size:10px}}
@media(prefers-reduced-motion:reduce){#completion-confetti{display:none}}

@media(max-height:600px) and (orientation:landscape){.touch-device .completion-banner{display:none}.touch-device #menu.completed .intro{margin-bottom:8px}.touch-device #menu.completed .era-picker{margin-bottom:12px}}

/* Version 11: menu testing controls and round-only readouts. */
.machine:not(.in-round) .player-hud,.machine:not(.in-round) .timer-hud,.machine:not(.in-round) .target-hud{visibility:hidden;pointer-events:none}
.machine.in-round .player-hud,.machine.in-round .timer-hud,.machine.in-round .target-hud{animation:round-hud-enter .38s ease-out both}
.machine.in-round .timer-hud{animation-delay:.06s}.machine.in-round .target-hud{animation-delay:.12s}
@keyframes round-hud-enter{from{opacity:0;translate:0 -14px}to{opacity:1;translate:0 0}}
.status-heading{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.status-heading>span{text-transform:uppercase;letter-spacing:.4px}
.testing-controls{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;color:var(--muted)}
.testing-controls button{padding:4px 5px;min-height:24px;background:transparent;color:var(--cream);font:inherit;border:1px solid #53615b;border-radius:3px;touch-action:manipulation}
.testing-controls button:hover{background:#253033}.testing-controls button:disabled{opacity:.4}
.machine.in-round .testing-controls{display:none}
@media(max-height:600px) and (orientation:landscape){.status-heading{gap:4px}.testing-controls{gap:3px}.testing-controls button{padding:3px;min-height:22px}}
@media(prefers-reduced-motion:reduce){.machine.in-round .player-hud,.machine.in-round .timer-hud,.machine.in-round .target-hud{animation:none}}

/* Keep the disabled Pause label quiet while matching the Esc keycap to Space. */
.control-cluster #pause-button:disabled{opacity:1;cursor:default}.control-cluster #pause-button:disabled>span{opacity:.7}.control-cluster #pause-button kbd{color:var(--cream)}


/* Version 15: neutral arrival focus, grouped results and completion spacing. */
#menu-title:focus,#pause-title:focus{outline:none}
#result-message>span{display:block}#result-message>span+span{margin-top:8px}
#next-bonus{display:block;margin:18px auto 0}
.pause-actions{display:flex;justify-content:center;gap:12px}.pause-actions .primary{min-width:0}
#menu.completed .menu-panel{position:relative;padding-bottom:72px}
#menu.completed .completion-banner{position:absolute;left:0;right:0;bottom:14px;margin:0}
#menu.completed .completion-banner strong{font-size:16px;line-height:1.5}
#menu.completed #load-status{position:absolute;bottom:-13px;left:0;right:0;margin:0;min-height:0}
@media(max-height:600px) and (orientation:landscape){#next-bonus{margin-top:12px}#result-message>span+span{margin-top:4px}.pause-actions{gap:8px}#menu.completed .menu-panel{padding-bottom:50px}#menu.completed .completion-banner{bottom:12px}#menu.completed .completion-banner strong{font-size:11px}#menu.completed #load-status{bottom:-7px}.touch-device #menu.completed .completion-banner{display:block}}
@media(max-height:600px) and (orientation:landscape){.touch-device #menu.completed .menu-panel{padding-bottom:60px}.touch-device #menu.completed h1{font-size:26px}.touch-device #menu.completed .intro{margin-bottom:4px}.touch-device #menu.completed .era-picker{margin-bottom:8px}.touch-device #menu.completed .completion-banner{bottom:20px}.touch-device #menu.completed #load-status{bottom:0}}

/* Version 16: compact audio controls and readable countdown. */
body{-webkit-user-select:none;user-select:none}
.hud{height:78px;transition:height .32s ease,padding .32s ease;min-height:0}
.machine:not(.in-round) .hud{height:44px;padding-top:6px;padding-bottom:6px}
.audio-controls{display:flex;flex-direction:row;align-items:center;gap:8px;border-left:0;padding-left:0}
.audio-controls .utility{position:static;display:flex;align-items:center;gap:6px;height:25px;padding:4px 7px;border:1px solid #43514d;border-radius:4px;min-width:88px;color:var(--cream);background:#202b2b;transition:background .15s ease}
.audio-icon{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none;color:var(--lime)}
.audio-off{display:none}.audio-controls button[aria-pressed=false] .audio-icon{color:var(--muted)}.audio-controls button[aria-pressed=false] .audio-off{display:block}
.announcement.countdown-cue{background:none;padding:0;width:100%;left:0;right:0;top:32%;transform:none;font-size:clamp(38px,8vw,110px);line-height:1.2;text-shadow:3px 3px #14222a,5px 5px #b87556}.announcement.countdown-cue.digit{font-size:clamp(90px,14vw,180px)}
#next-bonus{color:#182124;background:#f1c46f;border:2px solid #fff0c9;box-shadow:0 4px 0 #936636,0 0 20px #f1c46f38;font-weight:bold;position:relative;padding-left:34px;padding-right:34px}
#next-bonus::before,#next-bonus::after{content:'✦';display:inline-block;color:#614217;margin:0 8px;font-size:18px}#next-bonus:hover{background:#ffdb92}
.credit-and-previews{display:flex;flex-direction:column;align-items:flex-end;gap:4px}.preview-controls{display:flex;align-items:center;gap:5px;font-size:9px;color:var(--muted)}.preview-controls button{background:#263232;color:var(--cream);border:1px solid #53615b;padding:3px 7px;border-radius:3px;font:inherit}.machine:not(.in-round) .preview-controls{display:none}
@media(max-height:600px) and (orientation:landscape){.touch-device .machine{grid-template-rows:44px minmax(0,1fr) 48px}.touch-device .machine.in-round{grid-template-rows:64px minmax(0,1fr) 48px}.touch-device .hud{height:64px}.touch-device .machine:not(.in-round) .hud{height:44px}.testing-controls #preview-completion{font-size:8px;max-width:130px}.touch-device .preview-controls{font-size:8px}.touch-device .credit-and-previews .project-credit{font-size:7px}}
@media(prefers-reduced-motion:reduce){.hud,.audio-controls,.audio-controls .utility{transition:none}}
@media(max-height:600px) and (orientation:landscape){.hud{grid-template-columns:1fr 90px 90px;gap:12px}.touch-device .hud{grid-template-columns:1fr 90px 90px;gap:12px}}
@media(max-width:600px) and (pointer:fine){.hud{grid-template-columns:1fr 72px 90px;gap:8px}}

/* Optional fullscreen keeps the same stage proportions and viewport fit. */
.header-tools{display:flex;align-items:center;align-self:center;justify-self:end;gap:8px}
.fullscreen-toggle{display:grid;place-items:center;width:25px;height:25px;padding:4px;border:1px solid #43514d;border-radius:4px;color:var(--cream);background:#202b2b;cursor:pointer}
.fullscreen-toggle[hidden]{display:none}
.fullscreen-toggle svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.fullscreen-toggle:hover{background:#35443d}
.fullscreen-toggle:focus-visible{outline:2px solid var(--cream);outline-offset:3px}
.hud{grid-template-columns:1fr 130px auto;grid-template-rows:minmax(0,1fr);align-items:center}
@media(max-width:900px){.hud,.touch-device .hud{grid-template-columns:1fr 90px auto}.audio-controls .audio-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.audio-controls .utility{min-width:25px;width:25px;padding:4px}.audio-controls,.header-tools{gap:8px}}

/* Fullscreen gives all remaining space to the arena. */
:fullscreen body{display:block}
:fullscreen .arcade{width:100%;height:100dvh;max-width:none;margin:0;padding:0}
:fullscreen .machine{height:100%;display:grid;grid-template-rows:44px minmax(0,1fr) auto;border:0}
:fullscreen .machine.in-round{grid-template-rows:78px minmax(0,1fr) auto}
:fullscreen .stage{aspect-ratio:auto;min-height:0}
:fullscreen .stage>canvas{object-fit:fill}
@media(max-height:600px) and (orientation:landscape){:fullscreen .touch-device .machine.in-round{grid-template-rows:64px minmax(0,1fr) 48px}}

/* Production starts without tester controls, including before scripts load. */
.testing-controls[hidden],.preview-controls[hidden]{display:none}

/* Paired rivals keep each portrait at the established loss portrait size. */
.bill-performance.paired{width:280px}
.bill-performance.paired canvas{width:260px;height:130px}
@media(max-height:600px) and (orientation:landscape){.bill-performance.paired{width:140px}.bill-performance.paired canvas{width:124px;height:62px}}

/* Version 37: menu-only admin tools and compact overlapping reactions. */
.menu-admin{position:absolute;left:20px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:2px;max-width:calc(100% - 260px);font-size:10px;z-index:1}
.menu-admin .testing-controls{min-height:24px}
.menu-admin #secret-note{font-size:9px;line-height:1.2;white-space:nowrap;color:var(--muted)}
.machine.in-round .menu-admin{display:none}
.keyboard-play,.keyboard-play *{cursor:none!important}
.bill-performance.paired{width:240px}
.bill-performance.paired canvas{width:216.667px;height:130px}
@media(max-width:900px){.menu-admin{left:12px;max-width:calc(100% - 110px)}}
@media(max-height:600px) and (orientation:landscape){.bill-performance.paired{width:120px}.bill-performance.paired canvas{width:103.333px;height:62px}.menu-admin{font-size:9px}.menu-admin #secret-note{font-size:8px}.menu-admin .testing-controls button{padding:2px 4px;min-height:20px}}

/* Version 38: one selection border and stable taller bonus cards. */
.era:focus-visible{outline:none;border-color:var(--lime)}
.era.bonus{padding:8px 9px}
.era.bonus.selected{padding:7px 8px}
@media(max-height:600px) and (orientation:landscape){.era.bonus{padding:4px 6px}.era.bonus.selected{padding:3px 5px}}

/* Version 39: pause menu action uses the standard green button. */
#pause-menu{display:block;margin:20px auto 0}
@media(max-height:600px) and (orientation:landscape){#pause-menu{margin-top:10px}}

/* Version 40: menu admin status precedes tools on one line. */
.menu-admin{flex-direction:row;align-items:center;gap:10px;white-space:nowrap}
@media(max-width:900px){.menu-admin{gap:7px}}

/* Version 41: result keyboard selection matches the mouse hover fill. */
#result.keyboard-menu .primary:focus-visible{background:#e3ffad}

/* Version 42: wider portrait canvas preserves scale with safe side margins. */
.bill-performance.paired canvas{width:232.917px;height:130px}
@media(max-height:600px) and (orientation:landscape){.bill-performance.paired canvas{width:111.083px;height:62px}}

/* Version 46: restrained, matching result hover and keyboard selection. */
#result.keyboard-menu .primary:focus,#pause.keyboard-menu .primary:focus,#result:not(.keyboard-menu) .primary:hover,#pause:not(.keyboard-menu) .primary:hover{background:#cdeb98;outline:1px solid var(--cream);outline-offset:3px}
#result.keyboard-menu #next-bonus:focus,#result:not(.keyboard-menu) #next-bonus:hover{background:#f1c46f}

/* Version 50: landscape mobile shell. Desktop rules stay unchanged. */
.mobile-only,#mobile-menu,.mobile-control-rail{display:none}
#mobile-options:not([open]){display:none}
body.mobile-layout{
  --mobile-safe-top:env(safe-area-inset-top,0px);--mobile-safe-right:env(safe-area-inset-right,0px);
  --mobile-safe-bottom:env(safe-area-inset-bottom,0px);--mobile-safe-left:env(safe-area-inset-left,0px);
  position:fixed;inset:0;overflow:hidden;overscroll-behavior:none;
}
.mobile-layout .arcade{position:fixed;inset:0;width:100%;height:var(--mobile-vh,100dvh);max-width:none;margin:0;padding:max(4px,var(--mobile-safe-top)) max(4px,var(--mobile-safe-right)) max(4px,var(--mobile-safe-bottom)) max(4px,var(--mobile-safe-left))}
.mobile-layout .machine,.mobile-layout .machine.in-round{width:100%;height:100%;max-width:none;display:grid;grid-template-columns:92px minmax(0,1fr) 80px;grid-template-rows:44px minmax(0,1fr);gap:6px;align-items:center;border:0;box-shadow:none;position:relative}
.mobile-layout .hud,.mobile-layout .machine:not(.in-round) .hud{grid-column:1/-1;grid-row:1;width:100%;height:44px;padding:4px 8px;grid-template-columns:1fr 110px 44px;gap:12px;transition:none;z-index:30;border:1px solid var(--line)}
.mobile-layout .player-hud{grid-template-columns:18px 1fr;gap:2px 5px}
.mobile-layout .player-hud strong{font-size:13px;letter-spacing:0}.mobile-layout .player-hud #score{font-size:9px;letter-spacing:1px}
.mobile-layout .player-hud .hud-label{font-size:8px}.mobile-layout .timer-hud{gap:1px}.mobile-layout .timer-hud strong{font-size:22px}.mobile-layout .timer-hud .hud-label{font-size:7px}
.mobile-layout .target-hud{width:110px}.mobile-layout .target-hud .hud-label{font-size:7px}.mobile-layout .target-hud strong{font-size:9px}.mobile-layout .health-track{height:7px}
.mobile-layout .header-tools{gap:0;justify-self:end}.mobile-layout #mobile-menu{display:inline-flex;align-items:center;justify-content:center;width:44px;min-height:36px;padding:0;background:#263232;color:var(--cream);border:1px solid #53615b;font-size:10px}
.mobile-layout .menu-admin{left:8px;max-width:calc(100% - 72px);gap:5px;font-size:8px}.mobile-layout .menu-admin #secret-note{font-size:8px}.mobile-layout .testing-controls{gap:3px}.mobile-layout .testing-controls button,.mobile-layout .testing-controls #preview-completion{font-size:8px;max-width:none;white-space:nowrap}
.mobile-layout .stage{grid-column:2;grid-row:2;width:var(--mobile-stage-width,100%);height:auto;aspect-ratio:16/9;justify-self:center;align-self:center;overflow:visible}
.mobile-layout .stage>canvas{width:100%;height:auto;aspect-ratio:16/9;cursor:default}.mobile-layout .stage-label{left:10px;bottom:8px;font-size:8px;gap:6px}
.mobile-layout .touch-zones{display:none}.mobile-layout .game-strip,.mobile-layout .control-cluster{display:contents}
.mobile-layout .status-stack,.mobile-layout .controls,.mobile-layout .touch-controls,.mobile-layout #pause-button,.mobile-layout .credit-and-previews{display:none}
.mobile-layout .mobile-control-rail:not([hidden]){display:grid;align-self:center;justify-self:center;gap:8px;touch-action:none;user-select:none}
.mobile-layout #mobile-left-controls{grid-column:1;grid-row:2;width:92px;grid-template-columns:repeat(2,44px);gap:8px 4px}
.mobile-layout #mobile-right-controls{grid-column:3;grid-row:2;width:80px;justify-items:center}
.mobile-layout .mobile-control-rail button{position:static;width:44px;height:52px;min-width:44px;min-height:44px;margin:0;padding:3px;background:#263237;color:var(--cream);border:1px solid #60716d;box-shadow:0 3px 0 #090f10;font:24px/1 Arial,sans-serif;touch-action:none;user-select:none;-webkit-touch-callout:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}
.mobile-layout .mobile-control-rail .mobile-only{display:block;font:9px/1.2 ArcadePixel,monospace;color:var(--muted)}
.mobile-layout #mobile-left-controls [data-key="ArrowDown"]{grid-column:1/-1;justify-self:center}.mobile-layout #mobile-right-controls [data-key="ArrowUp"]{width:56px}
.mobile-layout .mobile-control-rail #touch-attack{width:72px;height:72px;background:var(--lime);border-color:#e5ffb5;color:#182112;font:bold 15px/1.2 monospace;box-shadow:0 3px 0 #6b9735}
.mobile-layout .mobile-control-rail button.held{translate:0 2px;background:#3b5043;box-shadow:0 1px 0 #090f10}.mobile-layout .mobile-control-rail #touch-attack.held{background:#d0ee9b;box-shadow:0 1px 0 #6b9735}
.mobile-layout .mobile-control-rail button:focus-visible,.mobile-layout #mobile-menu:focus-visible{outline:1px solid var(--cream);outline-offset:3px}
.mobile-layout #menu,.mobile-layout #result,.mobile-layout #pause{position:fixed;left:max(4px,var(--mobile-safe-left));top:calc(max(4px,var(--mobile-safe-top)) + 50px);right:auto;bottom:auto;width:calc(100vw - max(4px,var(--mobile-safe-left)) - max(4px,var(--mobile-safe-right)));height:calc(var(--mobile-vh,100dvh) - max(4px,var(--mobile-safe-top)) - max(4px,var(--mobile-safe-bottom)) - 50px);padding:12px 16px;overflow:auto;z-index:20;backdrop-filter:none}
.mobile-layout #menu{background:linear-gradient(#0a111670,#0a1116bf),url('assets/menu-landscape.v9.png') center/cover;align-items:center}
.mobile-layout #menu .menu-panel,.mobile-layout #menu.completed .menu-panel{width:100%;max-width:900px;padding:0;position:static}
.mobile-layout #menu h1,.mobile-layout #menu.completed h1{font-size:28px;line-height:1.4;margin:0 0 4px}.mobile-layout #menu .intro,.mobile-layout #menu.completed .intro{font-size:12px;margin:0 0 8px}
.mobile-layout .era-picker{display:grid;grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:clamp(126px,22vw,168px);gap:10px;width:100%;overflow-x:auto;overscroll-behavior:contain;scroll-snap-type:x proximity;touch-action:pan-x;padding:4px 6px 8px;margin:0 0 8px;text-align:center}
.mobile-layout .era,.mobile-layout .era.bonus{height:104px;min-height:104px;padding:10px 8px;justify-content:center;scroll-snap-align:center}.mobile-layout .era.selected,.mobile-layout .era.bonus.selected{padding:9px 7px}
.mobile-layout .era canvas{width:120px;max-width:100%;height:50px;margin-bottom:6px;object-fit:contain}.mobile-layout .era>span{font-size:14px}.mobile-layout .era small{font-size:10px;line-height:1.3}.mobile-layout .era.locked>span{font-size:27px;line-height:32px}
.mobile-layout .primary{min-height:44px;font-size:12px;padding:11px 16px}.mobile-layout #start{min-width:220px}
.mobile-layout #menu.completed .completion-banner,.mobile-layout #menu.completed #load-status{position:static;width:auto;left:auto;right:auto;bottom:auto;margin:8px 0 0}.mobile-layout #menu.completed .completion-banner strong{font-size:11px}.mobile-layout #load-status{font-size:10px;line-height:1.4}
.mobile-layout #result,.mobile-layout #pause{background:#0a1116f2}.mobile-layout .result-panel{width:min(620px,100%);padding:8px 12px;max-height:100%;overflow:auto}
.mobile-layout .result-panel h2{font-size:clamp(22px,4vh,36px);line-height:1.4;margin-bottom:10px}.mobile-layout .result-panel p{font-size:12px;line-height:1.5;margin-bottom:16px}
.mobile-layout #result-message>span+span{margin-top:4px}.mobile-layout #next-bonus{margin-top:14px}.mobile-layout #mobile-pause-options{display:block;min-height:44px;margin:12px auto 0;color:var(--cream)}
.mobile-layout #mobile-options[open]{display:flex;position:fixed;inset:0 auto auto 0;width:100vw;height:var(--mobile-vh,100dvh);max-width:none;max-height:none;margin:0;padding:max(16px,var(--mobile-safe-top)) max(20px,var(--mobile-safe-right)) max(16px,var(--mobile-safe-bottom)) max(20px,var(--mobile-safe-left));border:0;background:#10191c;color:var(--cream);overflow:auto;overscroll-behavior:contain}
#mobile-options::backdrop{background:#080d10}.mobile-options-panel{width:min(720px,100%);margin:auto;display:flex;flex-direction:column;gap:14px}
.mobile-options-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.mobile-options-heading h2{font:22px/1.5 ArcadePixel,monospace;margin:0}.mobile-options-heading button{min-width:44px;min-height:44px;background:#263237;border:1px solid #60716d;color:var(--cream);font-size:26px}
.mobile-help h3{font:12px/1.5 ArcadePixel,monospace;color:var(--lime);margin:0 0 8px}.mobile-help p{font-size:13px;line-height:1.5;margin:5px 0}
#mobile-options-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.mobile-layout #mobile-options-tools .audio-controls{gap:12px}.mobile-layout #mobile-options-tools .utility,.mobile-layout #mobile-options-tools .fullscreen-toggle{width:auto;min-width:44px;min-height:44px;padding:8px 12px;gap:8px}
.mobile-layout #mobile-options-tools .audio-label{position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:nowrap;font-size:12px}
#mobile-menu-testing .preview-controls{justify-content:flex-start}#mobile-menu-testing .preview-controls button{min-width:56px;min-height:44px;font-size:12px}
#mobile-options-credit{border-top:1px solid var(--line);padding-top:12px}#mobile-options-credit .project-credit{font-size:10px;text-align:right;margin:0}
.mobile-layout .rotate-overlay{height:var(--mobile-vh,100dvh);padding:max(20px,var(--mobile-safe-top)) max(20px,var(--mobile-safe-right)) max(20px,var(--mobile-safe-bottom)) max(20px,var(--mobile-safe-left));background:#10191c}
@media(max-height:360px) and (orientation:landscape){.mobile-layout #menu h1,.mobile-layout #menu.completed h1{font-size:24px}.mobile-layout #menu .intro,.mobile-layout #menu.completed .intro{font-size:10px;margin-bottom:4px}.mobile-layout .era,.mobile-layout .era.bonus{height:88px;min-height:88px}.mobile-layout .era canvas{height:38px}.mobile-layout #load-status{font-size:9px}.mobile-layout .mobile-options-panel{gap:10px}.mobile-layout .mobile-options-heading h2{font-size:19px}.mobile-layout .mobile-help p{font-size:12px}}
.mobile-layout .mobile-control-rail .touch-zone span{position:static;transform:none;background:none;border:0;padding:0;font-size:24px;border-radius:0}
.mobile-layout .stage.playing .touch-zones{display:none}

.mobile-layout #mobile-menu{min-height:44px}
.mobile-layout #mobile-options button:focus-visible{outline:1px solid var(--cream);outline-offset:3px}

#rotate-title span{display:block}
#rotate-title span:first-child{white-space:nowrap}

:fullscreen .mobile-layout .machine,:fullscreen .mobile-layout .machine.in-round{grid-template-rows:44px minmax(0,1fr)}

/* Version 51: classic directional pad and a visually compact menu button. */
.mobile-direction-icon{display:none}
.mobile-layout .mobile-control-rail .desktop-direction-icon{display:none}
.mobile-layout .mobile-direction-icon{display:block;width:24px;height:24px;fill:var(--cream);shape-rendering:crispEdges;pointer-events:none}
.mobile-layout [data-key="ArrowLeft"] .mobile-direction-icon{transform:rotate(-90deg)}
.mobile-layout [data-key="ArrowRight"] .mobile-direction-icon{transform:rotate(90deg)}
.mobile-layout [data-key="ArrowDown"] .mobile-direction-icon{transform:rotate(180deg)}
.mobile-layout #mobile-left-controls{grid-template-rows:repeat(3,44px);gap:8px 4px}
.mobile-layout #mobile-left-controls button{width:44px;height:44px}
.mobile-layout #mobile-left-controls [data-key="ArrowUp"]{grid-column:1/-1;grid-row:1;justify-self:center}
.mobile-layout #mobile-left-controls [data-key="ArrowLeft"]{grid-column:1;grid-row:2}
.mobile-layout #mobile-left-controls [data-key="ArrowRight"]{grid-column:2;grid-row:2}
.mobile-layout #mobile-left-controls [data-key="ArrowDown"]{grid-column:1/-1;grid-row:3;justify-self:center}
/* Keep the 44-pixel touch area, with the visible rectangle inset vertically. */
.mobile-layout #mobile-menu{position:relative;isolation:isolate;background:none;border:0}
.mobile-layout #mobile-menu::before{content:"";position:absolute;inset:8px 0;background:#263232;border:1px solid #53615b;z-index:-1}
.mobile-layout #mobile-menu:focus-visible{outline:0}
.mobile-layout #mobile-menu:focus-visible::before{outline:1px solid var(--cream);outline-offset:3px}

/* Version 52: one main menu, separate settings and a roomier directional pad. */
body.mobile-layout{touch-action:pan-x pan-y}
.mobile-layout button,.mobile-layout a{touch-action:manipulation}
.mobile-layout #mobile-options,.mobile-layout .result-panel{touch-action:pan-y}
.mobile-layout .mobile-control-rail button{touch-action:none}
.mobile-layout .era-picker{scrollbar-width:none;-ms-overflow-style:none}
.mobile-layout .era-picker::-webkit-scrollbar{display:none;width:0;height:0}
.mobile-layout .machine,.mobile-layout .machine.in-round{grid-template-columns:108px minmax(0,1fr) 80px}
.mobile-layout #mobile-left-controls{width:108px;grid-template-columns:repeat(2,52px);grid-template-rows:repeat(3,52px)}
.mobile-layout #mobile-left-controls button{width:52px;height:52px}
.mobile-layout .mobile-direction-icon{width:28px;height:28px}
.mobile-layout #mobile-menu.menu-is-open{font:22px/1 Arial,sans-serif}
.mobile-layout #mobile-menu-testing{display:block;margin:12px auto 0;width:max-content;max-width:100%}
.mobile-layout #mobile-menu-testing .preview-controls{justify-content:center}
/* The selection screen has no empty HUD strip; Menu floats above its artwork. */
.mobile-layout .machine:not(.in-round){grid-template-rows:minmax(0,1fr)}
.mobile-layout .machine:not(.in-round) .hud{display:contents}
.mobile-layout .machine:not(.in-round) .player-hud,.mobile-layout .machine:not(.in-round) .timer-hud,.mobile-layout .machine:not(.in-round) .target-hud{display:none}
.mobile-layout .machine:not(.in-round) .stage{grid-row:1}
.mobile-layout .machine:not(.in-round) .header-tools{position:fixed;right:max(12px,var(--mobile-safe-right));top:max(4px,var(--mobile-safe-top));z-index:40}
.mobile-layout .machine:not(.in-round) .menu-admin{position:fixed;left:max(12px,var(--mobile-safe-left));top:max(12px,var(--mobile-safe-top));z-index:40}
.mobile-layout .machine:not(.in-round) #menu,.mobile-layout .machine:not(.in-round) #pause{top:max(4px,var(--mobile-safe-top));height:calc(var(--mobile-vh,100dvh) - max(4px,var(--mobile-safe-top)) - max(4px,var(--mobile-safe-bottom)))}
.mobile-layout #pause{z-index:25}
#rotate p span{display:block;white-space:nowrap}
#rotate p{width:100%;max-width:none;font-size:clamp(10px,2.8vw,12px)}

.mobile-layout #menu,.mobile-layout #pause,.mobile-layout #result,.mobile-layout #secret-controller{touch-action:pan-x pan-y}


/* Version 54: fill the left control strip with four non-overlapping targets. */
.mobile-direction-face{display:contents}
.mobile-layout #mobile-left-controls{height:100%;min-height:172px;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:minmax(52px,1fr) 68px minmax(52px,1fr);gap:0;align-self:stretch}
.mobile-layout #mobile-left-controls button{width:100%;height:100%;min-width:52px;min-height:52px;padding:0;background:transparent;border:0;box-shadow:none;translate:none}
.mobile-layout #mobile-left-controls [data-key="ArrowUp"]{justify-content:flex-end;padding-bottom:0}
.mobile-layout #mobile-left-controls [data-key="ArrowDown"]{justify-content:flex-start;padding-top:0}
.mobile-layout #mobile-left-controls [data-key="ArrowLeft"]{align-items:flex-start}
.mobile-layout #mobile-left-controls [data-key="ArrowRight"]{align-items:flex-end}
.mobile-layout #mobile-left-controls .mobile-direction-face{display:flex;align-items:center;justify-content:center;flex:none;width:52px;height:52px;padding:3px;background:#263237;border:1px solid #60716d;box-shadow:0 3px 0 #090f10;pointer-events:none}
.mobile-layout #mobile-left-controls button.held{background:transparent;box-shadow:none}
.mobile-layout #mobile-left-controls button.held .mobile-direction-face{translate:0 2px;background:#3b5043;box-shadow:0 1px 0 #090f10}
.mobile-layout #mobile-left-controls button:focus-visible{outline:none}
.mobile-layout #mobile-left-controls button:focus-visible .mobile-direction-face{outline:1px solid var(--cream);outline-offset:3px}

/* Version 60: readable mobile admin panel and a matching exit gesture. */
.mobile-layout .menu-admin.admin-active{transform:none;background:rgba(0,0,0,.92);padding:8px 10px;border:1px solid #39463d;border-radius:4px}
.mobile-layout .menu-admin.admin-active #secret-note{color:var(--cream)}

/* Version 61: centered mobile control groups and stepped triangle arrows. */
.mobile-layout .machine,.mobile-layout .machine.in-round{grid-template-columns:var(--mobile-left-width,132px) minmax(0,1fr) var(--mobile-right-width,88px);column-gap:0}
.mobile-layout #mobile-left-controls{width:100%;min-height:184px;grid-template-rows:minmax(52px,1fr) 80px minmax(52px,1fr)}
.mobile-layout #mobile-left-controls [data-key="ArrowLeft"]{align-items:flex-end;padding-right:6px}
.mobile-layout #mobile-left-controls [data-key="ArrowRight"]{align-items:flex-start;padding-left:6px}
.mobile-layout #mobile-right-controls{width:100%;height:100%;align-self:stretch;place-items:center}
.mobile-layout .mobile-direction-icon{fill:var(--lime);filter:drop-shadow(1px 1px 0 #090f10)}

/* Version 64: all level cards share the height of the tallest row. */
.era-picker{grid-auto-rows:1fr}.era{justify-content:center}

/* Center the three starting eras; revealed bonuses use the existing carousel. */
.mobile-layout .era-picker:not(.bonus-revealed){justify-content:center}

/* Desktop bonus previews match the established mobile preview size. */
body:not(.mobile-layout) .era.bonus canvas{width:120px;height:50px;object-fit:contain}
.music-versions{display:inline-flex;align-items:center;gap:3px;margin-left:4px;padding-left:7px;border-left:1px solid #53615b}
.testing-controls .music-versions button[aria-pressed="true"],.testing-controls #final-round-test[aria-pressed="true"]{border-color:var(--lime);color:var(--lime);background:#253329}

/* One selection at a time when switching between keyboard and mouse. */
#result .primary:focus,#pause .primary:focus,#pause .text-button:focus{outline:none}
#pause.keyboard-menu .text-button:focus{outline:1px solid var(--cream);outline-offset:3px}
#result.keyboard-menu .primary:hover:not(:focus),#pause.keyboard-menu .primary:hover:not(:focus){background:var(--lime)}
#result.keyboard-menu #next-bonus:hover:not(:focus){background:#f1c46f}

/* Version 82: stable touch sizing and a landscape Settings layout. */
html.mobile-viewport{-webkit-text-size-adjust:100%;text-size-adjust:100%}
.mobile-layout #mobile-options,.mobile-layout #mobile-options *{touch-action:pan-y}
.mobile-layout #mobile-options[open]{padding:max(16px,var(--mobile-safe-top)) max(24px,var(--mobile-safe-right)) max(16px,var(--mobile-safe-bottom)) max(24px,var(--mobile-safe-left))}
.mobile-layout .mobile-options-panel{width:min(100%,960px);min-height:100%;margin:auto;gap:16px}
.mobile-layout .mobile-options-heading{padding-bottom:10px;border-bottom:1px solid var(--line)}
.mobile-layout .mobile-settings-body{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(220px,1fr);gap:32px;flex:1;align-content:center}
.mobile-layout .mobile-settings-body h3{font:12px/1.5 ArcadePixel,monospace;color:var(--lime);margin:0 0 12px}
.mobile-layout .mobile-help-controls{display:grid;grid-template-columns:1fr 1fr;gap:12px 20px;margin:0 0 14px}
.mobile-layout .mobile-help-controls>div{display:flex;align-items:center;gap:12px;min-width:0}
.mobile-layout .mobile-help-controls dt{display:flex;align-items:center;justify-content:center;min-width:76px;min-height:40px;padding:6px;border:1px solid #53615b;color:var(--lime);font-size:12px;font-weight:bold}
.mobile-layout .mobile-help-controls dt span{font:bold 23px/1 monospace}
.mobile-layout .mobile-help-controls dd{margin:0;font-size:13px}
.mobile-layout .mobile-help p{font-size:12px;line-height:1.5}
.mobile-layout .mobile-help .mobile-help-note{color:var(--muted);font-size:11px}
.mobile-layout .mobile-settings-preferences{padding-left:28px;border-left:1px solid var(--line)}
.mobile-layout #mobile-options-tools{display:grid;grid-template-columns:1fr;gap:10px}
.mobile-layout #mobile-options-tools .audio-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px;width:100%}
.mobile-layout #mobile-options-tools .utility,.mobile-layout #mobile-options-tools .fullscreen-toggle{width:100%;min-height:44px;justify-content:center;margin:0;font-size:12px}
.mobile-layout #mobile-options-tools .fullscreen-toggle{display:flex}
.mobile-layout #mobile-options-tools .fullscreen-toggle::after{content:attr(aria-label)}
.mobile-layout #mobile-options-tools .audio-label{font-size:11px}
.mobile-layout #mobile-options-credit{padding-top:10px}
@media(max-width:700px){
 .mobile-layout .mobile-settings-body{grid-template-columns:minmax(0,1.3fr) minmax(190px,1fr);gap:18px}
 .mobile-layout .mobile-settings-preferences{padding-left:18px}
 .mobile-layout .mobile-help-controls{gap:8px 12px}
 .mobile-layout .mobile-help-controls>div{gap:8px}
 .mobile-layout .mobile-help-controls dt{min-width:64px;min-height:36px;font-size:10px}
 .mobile-layout .mobile-help-controls dd{font-size:12px}
}
@media(max-width:540px){
 .mobile-layout .mobile-settings-body{grid-template-columns:1fr}
 .mobile-layout .mobile-settings-preferences{padding:16px 0 0;border-left:0;border-top:1px solid var(--line)}
}

/* Version 84: quiet touch menus; keep pause/result defaults and keyboard focus. */
.mobile-layout.touch-ui button:focus,.mobile-layout.touch-ui button:focus-visible,
.mobile-layout.touch-ui a:focus,.mobile-layout.touch-ui a:focus-visible{outline:none!important}
.mobile-layout.touch-ui #mobile-menu:focus::before,.mobile-layout.touch-ui #mobile-menu:focus-visible::before{outline:none!important}
.mobile-layout.touch-ui .primary:is(:focus,:hover){background:var(--lime)!important}
.mobile-layout.touch-ui #next-bonus:is(:focus,:hover){background:#f1c46f!important}
.mobile-layout.touch-ui #pause .primary.touch-priority,.mobile-layout.touch-ui #result .primary.touch-priority{outline:1px solid var(--cream)!important;outline-offset:3px}
.mobile-layout.touch-ui .fullscreen-toggle:hover{background:#202b2b}
.mobile-layout.touch-ui .project-credit a:hover{text-decoration:none}

/* Version 87: a clear completion moment and a more readable closing line. */
#menu.completed #load-status{font-size:13px;line-height:1.5;bottom:-6px}
#menu.completed .completion-banner{bottom:22px}
.completion-dialog{width:min(680px,calc(100vw - 40px));max-height:calc(100dvh - 32px);overflow:auto;margin:auto;padding:clamp(24px,5vw,54px);border:1px solid var(--lime);background:#101a1e;color:var(--cream);text-align:center;box-shadow:0 12px 60px #0008}
.completion-dialog::backdrop{background:#061015d9}
.completion-dialog h2{font-family:ArcadePixel,monospace;font-size:clamp(30px,5vw,56px);line-height:1.35;color:var(--lime);margin:0 0 24px}
.completion-dialog p{font-size:clamp(14px,1.4vw,18px);line-height:1.7;margin:0 0 28px}
.completion-dialog p span{display:block}
.completion-dialog .primary:focus-visible{outline:1px solid var(--cream);outline-offset:4px}
.mobile-layout #menu.completed #load-status{font-size:12px;line-height:1.45}
@media(max-height:450px) and (orientation:landscape){.completion-dialog{width:min(620px,calc(100vw - 40px));padding:20px 30px}.completion-dialog h2{font-size:30px;margin-bottom:14px}.completion-dialog p{font-size:13px;margin-bottom:18px}.completion-dialog .primary{padding:10px 20px}.mobile-layout #menu.completed #load-status{font-size:11px}}
.mobile-layout #menu.completed .completion-banner,.mobile-layout #menu.completed #load-status{bottom:auto}

/* Completion headline and punchline stay readable on short landscape screens. */
.completion-dialog h2 .completion-pun{display:block;font-size:.3em;line-height:1.5;margin-top:8px;white-space:nowrap}

.mobile-layout .completion-dialog h2 .completion-pun{font-size:max(.3em,12px)}

/* Per-era action cues keep the complete short phrase inside the stage. */
.announcement.countdown-cue.action-cue{font-size:clamp(16px,3.6vw,50px);line-height:1.35;letter-spacing:-1px;padding:0 12px;box-sizing:border-box}

/* Admin review link shares the compact testing controls. */
.testing-controls .animation-review-link{display:inline-flex;align-items:center;min-height:24px;padding:4px 5px;border:1px solid #53615b;border-radius:3px;color:var(--cream);font:inherit;text-decoration:none;touch-action:manipulation}.testing-controls .animation-review-link:hover{background:#253033}.testing-controls .animation-review-link:focus-visible{outline:1px solid var(--lime);outline-offset:2px}
.mobile-layout .testing-controls .animation-review-link{min-height:20px;padding:2px 4px;font-size:8px}.mobile-layout .menu-admin.admin-active .testing-controls{flex-wrap:wrap;white-space:normal}

.animation-review-tools{display:inline-flex;align-items:center;margin-left:4px;padding-left:7px;border-left:1px solid #53615b}

/* Give the loss message priority over the resting player behind it. */
#result.loss-screen{background:rgba(10,17,22,.9);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
.mobile-layout #result.loss-screen{background:rgba(10,17,22,.97)}

/* Keep celebration above the opaque mobile menu across the whole viewport. */
.mobile-layout #completion-confetti{position:fixed;inset:0;z-index:21}

/* Separate the completed phone menu's button shadow from the Victory copy. */
.mobile-layout #menu.completed .completion-banner{margin-top:24px}
@media(max-height:360px) and (orientation:landscape){
 .mobile-layout #menu.completed .completion-banner{margin-top:18px}
}

/* Add breathing room around completed phone cards as viewport height allows. */
.mobile-layout #menu.completed .intro,
.mobile-layout #menu.completed .era-picker{margin-bottom:clamp(8px,calc(10dvh - 24px),20px)}

/* Give the completed tablet menu room without expanding small phone layouts. */
@media(min-width:768px) and (min-height:600px){
 .mobile-layout #menu.completed .intro{margin-bottom:24px}
 .mobile-layout #menu.completed .era-picker{margin-bottom:24px}
 .mobile-layout #menu.completed #start{margin-bottom:24px}
 .mobile-layout #menu.completed .completion-banner{margin-top:4px}
 .mobile-layout #menu.completed #load-status{margin-top:12px}
}
