*{box-sizing:border-box}body.source-page{--bg:#050505;--ink:#ededeb;--muted:#949490;--gold:#e6c780;--gold-bright:#ffe0a0;--line:#ffffff20;background:#050505}button,input,summary{font:inherit}button{cursor:pointer;border:1px solid #ffffff36;background:transparent;color:#ededeb;padding:14px 24px;letter-spacing:.12em}button:hover{border-color:#e6c780;background:#ffffff06}button.primary{background:#e6c780;color:#050505;border-color:#e6c780;font-weight:700;min-width:200px;display:inline-flex;justify-content:space-between;gap:36px}button:disabled{opacity:.5;cursor:wait}[hidden]{display:none!important}.source-main{max-width:520px;margin:auto;min-height:620px;padding:36px 0}.kicker,.hud{font:11px/1.5 Consolas,monospace;letter-spacing:.2em;color:#949490}.title-screen{text-align:center;position:relative;padding-top:24px}.source-page .title-screen h1{font-family:Arial,sans-serif;font-weight:700;font-size:clamp(64px,15vw,96px);letter-spacing:-.075em;margin:22px 0}.tagline{font-size:16px;line-height:1.85;margin:24px 0 32px}.tagline span{color:#949490}.title-art{max-width:260px;margin:30px auto 0}.small{font-size:12px;color:#949490;line-height:1.8;white-space:pre-line}.hud{display:flex;justify-content:space-between;padding-bottom:14px}.hud #timer{color:#e6c780;font-variant-numeric:tabular-nums;min-width:55px;text-align:right}.arena{position:relative;width:min(100%,max(200px,calc((100svh - 340px)*.8)));margin:auto;aspect-ratio:4/5;background:#050505;border:1px solid #ffffff18;overflow:hidden;touch-action:manipulation}.arena canvas{display:block;width:100%;height:100%}.particle-controls{position:absolute;inset:0;pointer-events:none}.source-page .particle-controls button{position:absolute;width:44px;height:44px;min-height:44px;padding:0;border:0;border-radius:50%;background:transparent;transform:translate(-50%,-50%);pointer-events:auto;letter-spacing:0}.particle-controls button:focus-visible{outline:1px dashed #e6c780;outline-offset:0}.reveal{position:absolute;top:12%;width:100%;text-align:center;pointer-events:none;font:bold clamp(24px,6vw,40px)/1 Arial,sans-serif;letter-spacing:.12em;color:#e6c780}.status{text-align:center;font-size:13px;min-height:24px;line-height:1.7;color:#aaa;margin:18px 0 10px}.next{width:100%;border-color:#ffffff24;font-size:12px}.result-screen{text-align:center;padding:70px 0 32px}.result-screen h2{font:bold clamp(28px,8vw,48px)/1.1 Arial,sans-serif;letter-spacing:-.04em;margin:28px 0 12px}.total{font:24px/1.5 Consolas,monospace;color:#e6c780}.marks{letter-spacing:.4em;font-size:24px; margin:32px 0}.result-actions{display:grid;gap:12px;max-width:330px;margin:auto}.result-actions button.primary{display:block;width:100%}details{position:relative}summary{cursor:pointer;min-height:44px;padding:12px}details[open]{padding:12px;border:1px solid #ffffff20}details label{display:block;padding:8px}textarea{width:100%;height:210px;background:#111;color:#eee;padding:14px;border:1px solid #555}footer{align-items:start}.source-page .source-tools{margin-top:20px}@media(max-width:600px){.source-page>.shell{padding-inline:18px}.source-main{padding:22px 0;min-height:0}.title-screen{padding-top:28px}.result-screen{padding-top:45px}.source-page .source-tools{margin-top:12px}}@media(orientation:landscape) and (max-height:650px){.source-main{max-width:360px;padding-top:12px}.arena{width:240px;margin:auto}.title-art{display:none}.title-screen{padding-top:0}.source-page .title-screen h1{margin:12px}.tagline{margin:12px}.result-screen{padding-top:15px}}

.hud #stop-practice{min-height:24px;padding:2px 10px;font-size:10px;letter-spacing:0}.hud{align-items:center}

body.viewport-game { --accent: #efd49a; --guide-panel: #173b45; margin: 0; height: 100dvh; min-height: 0; overflow: hidden; overscroll-behavior: none; }
html:has(body.viewport-game) { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.viewport-game > .shell { height: 100%; max-width: 1440px; padding: 0 max(12px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(12px,env(safe-area-inset-left)); display: flex; flex-direction: column; }
body.viewport-game .site-header { min-height: 36px; padding: 3px 0; gap: 4px 12px; flex: none; }
body.viewport-game .site-brand { min-height: 28px; font-size: 10px; }
body.viewport-game .site-header-right { flex-basis: auto; gap: 8px; }
body.viewport-game .site-page-details { font-size: 10px; gap: 6px; }
body.viewport-game .site-header .site-nav { font-size: 10px; gap: 10px; }
body.viewport-game .site-header .site-nav a { min-height: 28px; }

body.source-page{background:var(--bg);--bg:#102c37;--ink:#eee9dd;--muted:#a8bdba;--gold:#efd49a;--line:#ede8d82e}
body.source-page .source-main{max-width:none;width:100%;margin:0;min-height:0;flex:1;padding:8px 0;display:flex;flex-direction:column;overflow:hidden}
.source-main>section{min-height:0;flex:1;overflow:auto}.source-main #play-screen{display:flex;flex-direction:column;overflow:hidden;container-type:size}.source-page .arena{flex:none;width:min(100cqw,calc((100cqh - 100px)*.8));height:auto;min-height:0;background:var(--deep)}
.source-page .hud{flex:none;padding:4px 8px;background:var(--deep)}.source-page .status{flex:none;margin:5px 0;min-height:24px;font-size:12px}.source-page .next{flex:none;min-height:44px;padding:6px;visibility:visible}.source-page .next[hidden]{display:block!important;visibility:hidden}
.source-page .title-screen,.source-page .result-screen{padding:10px 0;text-align:center}.source-page .title-screen h1{margin:12px 0;font-size:clamp(40px,9vh,80px)}.source-page .tagline{margin:12px 0;font-size:14px}.source-page .title-art{max-width:180px;margin:12px auto}.source-page .result-screen h2{margin:12px 0}.source-page .marks{margin:12px 0}.source-page .source-tools{flex:none;position:relative;margin:0;padding:0;min-height:44px;align-items:center;font-size:10px}.source-page details[open]{position:absolute;bottom:0;right:0;z-index:4;background:var(--deep);max-height:50dvh;overflow:auto}.source-page #save-status:empty{display:none}
.source-page button{color:var(--ink);border-color:var(--line);border-radius:3px;min-height:44px;touch-action:manipulation;letter-spacing:.04em}.source-page button.primary{color:var(--deep);background:var(--gold);border-color:var(--gold)}
.source-page>.shell>.footer-ad{flex:none;display:flex;align-items:flex-start;justify-content:center;min-height:50px;max-height:clamp(50px,16dvh,100px);min-width:0;margin:0;overflow:hidden;text-align:center}.footer-ad-content{flex:none;width:max-content;transform-origin:top center}
.tutorial{flex:none;padding:6px 10px;background:var(--panel);border:1px solid var(--gold)}.tutorial-heading{display:flex;justify-content:space-between;align-items:center;font-size:10px}.source-page .tutorial-heading button{min-height:32px;padding:4px 8px;font-size:11px}.tutorial-progress{display:flex;gap:4px;font-size:10px}.tutorial-progress span{flex:1;text-align:center;border-bottom:2px solid var(--line)}.tutorial-progress .current{background:var(--gold);color:var(--deep)}.tutorial-progress .done{border-color:var(--gold)}.tutorial h2{font-size:14px;margin:4px 0}.tutorial p{font-size:11px;line-height:1.5;margin:4px 0}.source-page .tutorial>button{padding:4px 12px;min-height:36px;font-size:12px}.tutorial-focus{outline:2px solid var(--gold);outline-offset:-2px}
dialog{color:var(--ink);background:var(--panel);border:1px solid var(--gold);border-radius:6px;padding:24px;width:min(560px,calc(100vw - 28px));max-height:calc(100dvh - clamp(50px,16dvh,100px) - 24px);overflow:auto;position:fixed;inset:12px 0 calc(clamp(50px,16dvh,100px) + 12px);margin:auto}dialog::backdrop{background:linear-gradient(to bottom,#020b12cc calc(100% - clamp(50px,16dvh,100px)),transparent calc(100% - clamp(50px,16dvh,100px)))}dialog p{font-size:13px;line-height:1.8}.tutorial-choice-actions{display:flex;flex-wrap:wrap;gap:10px}.tutorial-choice-actions button{flex:1 1 180px}
@media(max-width:700px){body.viewport-game .site-header-right{flex-basis:100%;gap:2px 8px}}
@media(max-height:500px) and (orientation:landscape){.source-page .source-main #play-screen:has(.tutorial:not([hidden])){display:grid;grid-template-columns: minmax(200px,1fr) 1fr;grid-template-rows:28px 1fr 24px 44px;gap:2px 8px}.tutorial{grid-column:1;grid-row:1/5;overflow:auto}.source-page .title-art{display:none}.source-page .tagline{margin:6px 0}.source-page .result-actions{display:flex;max-width:none;justify-content:center}.source-page .result-actions button{min-width:0;font-size:11px}.source-page .marks,.source-page .total{margin:4px 0}}

@media(max-height:500px) and (orientation:landscape){
.source-page .source-main #play-screen:not(:has(.tutorial:not([hidden]))){display:grid;grid-template-columns:1fr 1fr;grid-template-rows:32px 1fr 44px;gap:4px 12px;align-items:center}
.source-page #play-screen:not(:has(.tutorial:not([hidden]))) .hud{grid-column:1;grid-row:1}.source-page #play-screen:not(:has(.tutorial:not([hidden]))) .status{grid-column:1;grid-row:2}.source-page #play-screen:not(:has(.tutorial:not([hidden]))) .next{grid-column:1;grid-row:3}

}

.source-tools{display:flex;justify-content:space-between;gap:12px;border-top:1px solid var(--line);color:var(--muted)}

/* Size the 4:5 board from the space left by the actual guide and controls. */
.arena-space{flex:1;min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;container-type:size;overflow:hidden}
.source-page .source-main #play-screen .arena{width:min(100cqw,calc(100cqh * .8));height:min(100cqh,calc(100cqw * 1.25));margin:0;flex:none;max-height:none}
@media(max-height:500px) and (orientation:landscape){
.source-page .source-main #play-screen:has(.tutorial:not([hidden])){grid-template-rows:28px 1fr}
#play-screen:has(.tutorial:not([hidden])) .tutorial{grid-row:1/3}
#play-screen:has(.tutorial:not([hidden])) .arena-space{grid-column:2;grid-row:2}
#play-screen:has(.tutorial:not([hidden])) .status,#play-screen:has(.tutorial:not([hidden])) .next[hidden]{display:none!important}
#play-screen:not(:has(.tutorial:not([hidden]))) .arena-space{grid-column:2;grid-row:1/4;align-self:stretch}
}

.source-page #play-screen:has(.tutorial:not([hidden])) .next[hidden]{display:none!important}

/* Match the typography, controls and alignment of the other viewport games. */
.source-page .kicker{color:var(--gold);font:10px/1.6 Consolas,monospace;letter-spacing:.06em;margin:0}
.source-page .hud{border:1px solid var(--line);font:12px/1.5 Consolas,monospace;color:var(--muted);letter-spacing:.04em;gap:8px;padding:7px 12px}
.source-page .hud #timer{color:var(--gold)}
.source-page button{font:12px/1.4 var(--sans,system-ui);padding:8px 14px;min-width:48px;min-height:48px;background:var(--deep);letter-spacing:.04em;text-align:center}
.source-page button.primary{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-width:0;background:var(--gold);color:var(--deep)}
.source-page #play{width:min(240px,100%)}
.source-page .title-screen,.source-page .result-screen{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:16px 12px}
.source-page .title-screen h1{font:700 clamp(36px,7vh,64px)/1.1 var(--sans,system-ui);letter-spacing:-.04em;margin:0}
.source-page .tagline{margin:0;font-size:14px;line-height:1.8;color:var(--ink)}
.source-page .tagline span,.source-page .small,.source-page .status{color:var(--muted)}
.source-page .small{margin:0;max-width:100%;overflow-wrap:anywhere}
.source-page .title-art{width:min(180px,100%);margin:0}
.source-page .result-screen h2{font:700 clamp(24px,5vh,40px)/1.3 var(--sans,system-ui);margin:0;color:var(--gold);letter-spacing:-.04em}
.source-page .total{font:24px/1.4 Consolas,monospace;color:var(--gold);margin:0}
.source-page .marks{margin:0;letter-spacing:.2em}
.source-page .result-actions{width:min(330px,100%);margin:0;gap:8px}
.source-page .result-actions button.primary{display:flex}
.source-page #comparison{margin:0;font-size:12px;line-height:1.8;color:var(--muted);white-space:pre-line}
.source-page dialog h2{margin:12px 0;font:700 24px/1.4 var(--sans,system-ui);letter-spacing:0}
.source-page dialog p{color:var(--muted)}
.source-page .tutorial{padding:10px 12px;border-color:var(--line)}
.source-page .tutorial-heading{gap:8px;color:var(--gold)}
.source-page .tutorial-progress span{padding:3px;color:var(--muted)}
.source-page .tutorial-progress .current{color:var(--deep);border-color:var(--gold);font-weight:700}
.source-page .tutorial-progress .done{color:var(--gold)}
.source-page .tutorial h2{font:700 15px/1.4 var(--sans,system-ui);margin:6px 0 3px}
.source-page .tutorial p{color:var(--muted)}
.source-page .tutorial>button{margin-top:4px}
.source-page .source-tools{padding:5px 0;min-height:44px}
.source-page summary{font-size:11px;padding:8px 12px}
.source-page details[open]{border-color:var(--line)}
.source-page textarea{background:var(--deep);color:var(--ink);border-color:var(--line)}
@media(max-width:700px){
.source-page .hud{font-size:10px;padding:4px 8px}
.source-page dialog{padding:18px}.source-page dialog h2{font-size:19px}.source-page dialog p{font-size:12px}
.source-page .tutorial{padding:6px 8px}.source-page .tutorial h2{font-size:13px}.source-page .tutorial p{font-size:10px}.source-page .tutorial-progress span{font-size:9px}
}
@media(max-height:500px){
.source-page .title-screen,.source-page .result-screen{justify-content:flex-start;gap:6px;padding:6px}
.source-page .title-screen h1{font-size:28px}.source-page .tagline{font-size:12px}.source-page .title-art{display:none}
.source-page .result-screen h2{font-size:24px}.source-page .total{font-size:18px}.source-page .marks{font-size:18px}
.source-page .result-actions{width:100%;flex-wrap:wrap}.source-page .result-actions button{padding:6px 10px}
}
.source-page .particle-controls button{min-width:44px}

@media(max-height:500px) and (orientation:landscape){
.source-page .result-screen{gap:4px}
.source-page .result-screen .small{font-size:10px;line-height:1.4}
.source-page .result-actions{display:flex;flex-wrap:nowrap}
.source-page .result-actions button{flex:1;min-width:0;width:auto;min-height:44px}
}

.source-page :is(#target,#share-status):empty{display:none}
