:root{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color-scheme:dark;background:#101923;color:#f0f4e5;font-synthesis:none}*{box-sizing:border-box}body{margin:0;padding:10px}main{max-width:580px;margin:auto;border:1px solid #3b5260;border-radius:22px;background:linear-gradient(150deg,#1a2c36,#16222e);padding:clamp(12px,3vw,24px)}header{display:flex;justify-content:space-between;align-items:center;gap:6px}.brand{font-size:.58rem;letter-spacing:.12em;font-weight:800;color:#b2d7d5;margin:0}#badge{font-size:.65rem;white-space:nowrap;color:#d7f3b0;padding:5px 8px;border:1px solid #526e5a;border-radius:99px}h1{font-size:clamp(1.7rem,6.5vw,2.45rem);letter-spacing:-.06em;line-height:1.14;margin:14px 0 5px}#intro{font-size:.82rem;color:#b8cdce;margin:0 0 12px}.setup{display:flex;align-items:center;gap:8px;font-size:.75rem}.setup label{color:#afc4c5}select,#reset{min-height:36px;padding:5px 9px;border:1px solid #526c70;border-radius:8px;background:#223c40;color:#f0f4e5;font:inherit}select:disabled{opacity:.65}#reset{background:transparent;margin-left:auto;cursor:pointer}.hud{display:flex;justify-content:space-between;padding:12px 2px 9px}.hud div{display:flex;flex-direction:column;gap:3px}.hud span{font-size:.64rem;color:#b1cbd0}.hud strong{font-size:1.2rem;line-height:1.1;font-variant-numeric:tabular-nums}.hud #points{color:#ffd68d}.hud div:last-child{text-align:right}#time span{font-size:.7rem;margin-left:3px}.arena{height:clamp(180px,43dvh,370px);position:relative;overflow:hidden;border:1px solid #486976;border-radius:14px;background:#142939;touch-action:none;user-select:none;-webkit-user-select:none}canvas{display:block;object-fit:contain;width:100%;height:100%;pointer-events:none}#overlay{position:absolute;inset:0;padding:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:10px;background:#102331e8;pointer-events:none}#overlay[hidden]{display:none}#overlay-label{font-size:.63rem;letter-spacing:.14em;color:#a8dbd4;margin:0}#overlay-title{font-size:clamp(1.6rem,6vw,2.3rem);line-height:1.12;letter-spacing:-.06em}#overlay-copy{font-size:.77rem;line-height:1.7;color:#c4dbd7;white-space:pre-line;margin:0}#action{width:100%;min-height:54px;margin-top:9px;border:1px solid #b4ebc8;border-radius:10px;background:#d5efb2;color:#152d2b;font:800 .95rem system-ui,sans-serif;cursor:pointer;user-select:none;-webkit-user-select:none;touch-action:none;-webkit-tap-highlight-color:transparent}#action[data-phase=running]{background:#244a53;color:#d5f3d6;border:1px dashed #83c9c3;cursor:grab}#action[data-phase=running]:active{cursor:grabbing;background:#2f6068}button:focus-visible,select:focus-visible{outline:3px solid #edeea4;outline-offset:3px}#status{min-height:2.8em;text-align:center;font-size:.73rem;line-height:1.45;color:#c8ddd7;margin:8px 0 0}.rule{font-size:.67rem;line-height:1.65;color:#a6bec0;white-space:pre-line;margin:5px 0 0}#results{border-top:1px solid #415d64;margin:12px 0;padding-top:10px}#results-label{font-size:.65rem;color:#b5d7c3}h2{font-size:1.3rem;margin:8px 0}#ranking{list-style:none;padding:0;display:grid;gap:7px}#ranking li{display:flex;justify-content:space-between;gap:8px;padding:11px;background:#223f48;border:1px solid #425f66;border-radius:8px;font-size:.78rem}#ranking li:first-child{border-color:#b5d992}#ranking strong{color:#e5efba;font-variant-numeric:tabular-nums}#ranking small{display:block;color:#efd498;font-size:.68rem;margin-top:3px}
@media(max-width:360px){body{padding:5px}main{padding:10px}.brand{font-size:.5rem}#badge{font-size:.57rem}h1{font-size:1.7rem;margin-top:11px}.setup{gap:6px}}
@media(max-height:600px){body{padding:5px}main{padding:10px}h1{font-size:1.7rem;margin-top:9px}#intro{font-size:.74rem;margin-bottom:8px}.hud{padding:8px 2px}.hud strong{font-size:1.05rem}.arena{height:clamp(170px,36dvh,240px)}#action{min-height:49px;margin-top:7px}#status{margin-top:6px}.rule{margin-top:2px}}
@media(max-height:420px) and (min-width:460px){main{display:grid;grid-template-columns:1fr 1.1fr;gap:6px 16px;max-width:800px}header,h1,#intro,.setup,.hud{grid-column:1;margin:0}.arena{grid-column:2;grid-row:1/7;height:226px}#action{grid-column:1;margin:0}#status,.rule,#results{grid-column:1/-1}.brand{font-size:.48rem}#badge{font-size:.53rem}.hud{padding:4px 2px}h1{font-size:1.6rem}}
/* Use the available width for the actual court rather than letterboxing a small canvas. */
main{max-width:760px;padding:clamp(10px,2vw,18px)}
.arena{height:auto;aspect-ratio:6/5}
@media(min-width:800px){
 main{max-width:1120px;display:grid;grid-template-columns:230px minmax(0,1fr);gap:10px 22px;align-content:start;grid-template-areas:"brand arena" "title arena" "intro arena" "setup arena" "hud arena" "rule arena" "status action" "results results"}
 header{grid-area:brand;flex-wrap:wrap}h1{grid-area:title;font-size:1.7rem;margin:8px 0 0}#intro{grid-area:intro;margin:0}.setup{grid-area:setup;flex-wrap:wrap;align-content:start}.hud{grid-area:hud;padding:4px 0}.rule{grid-area:rule;margin:0}.arena{grid-area:arena;min-width:0;max-height:calc(100dvh - 150px)}#action{grid-area:action;margin:0}#status{grid-area:status;margin:0;align-self:center}#results{grid-area:results}
}
@media(max-width:799px) and (max-height:650px){
 body{padding:4px}main{padding:8px;border-radius:15px}header,#intro{display:none}h1{font-size:1.3rem;margin:0 0 7px}.setup{font-size:.7rem}select,#reset{min-height:30px;padding:3px 7px}.hud{padding:7px 2px}.hud strong{font-size:1.05rem}.arena{height:auto;aspect-ratio:6/5}#action{min-height:43px;margin-top:6px;font-size:.8rem}#status{min-height:2.7em;font-size:.66rem;margin:5px 0 0}.rule{font-size:.6rem;margin-top:3px}
}
@media(max-width:799px) and (max-height:420px) and (min-width:460px){
 main{grid-template-columns:190px minmax(0,1fr);gap:6px 14px}h1{grid-row:1}.setup{grid-row:2}.hud{grid-row:3}.arena{grid-row:1/5;height:auto;aspect-ratio:6/5;max-height:calc(100dvh - 75px)}#action{grid-row:4;min-height:43px}.rule{display:none}#status{margin:0}
}
