:root{color-scheme:dark;--bg:#0c1423;--gold:#e9c686;--muted:#91a3bb;--blue:#77bcf4;--red:#ec8791;--jade:#80d8b0;--line:#b0c7e226}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 40% 15%,#21395566,transparent 60%),var(--bg);color:#e9f0f5;font-family:'Segoe UI',Arial,sans-serif;overscroll-behavior:none}button,a{touch-action:manipulation;-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer}button:focus-visible,a:focus-visible{outline:2px solid var(--gold);outline-offset:3px}[hidden]{display:none!important}.shell{width:min(100%,530px);height:100svh;min-height:620px;margin:auto;padding:14px 18px calc(10px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:11px}header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding-bottom:10px}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:#eff1e7;letter-spacing:3px;font-size:19px;font-weight:650}.brand img{width:32px;height:32px;border-radius:50%;object-fit:cover}.brand small{display:block;font-size:6px;letter-spacing:1.8px;color:var(--muted);font-weight:400;margin-top:5px}#sound{border:1px solid var(--line);border-radius:4px;min-height:32px;font-size:7px;letter-spacing:.7px;padding:8px;background:#17263b}.campaign>div{display:flex;justify-content:space-between;align-items:center;margin-bottom:7px}.campaign b{font-size:9px;letter-spacing:1.7px;color:var(--gold)}.campaign small{font-size:8px;color:var(--muted)}#level-map{display:flex;gap:7px}#level-map button{flex:1;min-height:30px;border:1px solid #7994b13d;background:#182a40;border-radius:4px;font-size:10px}#level-map button[aria-pressed=true]{color:#fbe2ae;border-color:#dfbb7b;background:#473e3044}#level-map button:disabled:not([aria-pressed=true]){opacity:.3}.runners{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.runners>div{border:1px solid var(--line);background:#152338;border-radius:5px;padding:9px 8px;border-top:2px solid currentColor}.runners .azure{color:var(--blue)}.runners .ember{color:var(--red)}.runners .jade{color:var(--jade)}.runners span{display:block;font-size:7px;letter-spacing:.7px}.runners b{display:block;font-size:16px;font-weight:500;margin:5px 0 3px;letter-spacing:-.2px}.runners small{display:block;font-size:7px;letter-spacing:.7px;color:#8fa4b9}.runners>div.active{background:linear-gradient(135deg,#24405c,#142238);box-shadow:inset 0 0 14px #9ac9ff0c}.board-area{position:relative;flex:1;min-height:230px;border:1px solid #91accb2f;border-radius:10px;overflow:hidden;background:radial-gradient(ellipse at center,#21344b66,#101c2d);touch-action:none;user-select:none}canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}.board-top{position:absolute;top:8px;left:11px;right:8px;display:flex;align-items:center;justify-content:space-between;pointer-events:none}#turn-label{font-size:7px;letter-spacing:1px;background:#101c2be0;padding:6px 8px;border-radius:3px;color:#c5d8ea}#pause{pointer-events:auto;min-height:30px;min-width:30px;border:1px solid var(--line);border-radius:4px;background:#192a3d;font-size:13px}.overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:linear-gradient(145deg,#14263aea,#0e1828ec);backdrop-filter:blur(7px);padding:17px}#overline{font-size:7px;letter-spacing:2px;color:var(--gold)}.crest{font-size:43px;color:#a5c8df;margin-top:15px;line-height:1}h1{font-size:38px;line-height:1.06;letter-spacing:-1.7px;font-weight:600;margin:14px 0}h1 em{font-style:normal;color:var(--gold)}#brief{font-size:11px;color:#9dafc1;line-height:1.7;max-width:325px;margin:0 0 17px}.primary{min-height:46px;min-width:230px;font-size:9px;letter-spacing:1.2px;font-weight:700;border:1px solid #f6dcaa;border-radius:4px;padding:13px 16px;background:linear-gradient(120deg,#efd6a5,#c8a973);color:#263040}.secondary{border:0;background:none;color:#829ab4;font-size:7px;letter-spacing:1px;min-height:29px;margin-top:7px}.commands{flex:none;padding:10px;border:1px solid var(--line);border-radius:7px;background:#122137}.mode-row{display:grid;grid-template-columns:1fr 1.1fr 1.1fr .8fr;gap:5px}.mode-row button{min-height:39px;border:1px solid #8ea9c238;border-radius:4px;background:#182b42;font-size:8px;letter-spacing:.5px;padding:6px 2px}.mode-row button[aria-pressed=true]{border-color:#d7b77c;color:#f1d598;background:#49402d44}.mode-row button:disabled{opacity:.4;cursor:default}#status{font-size:8px;line-height:1.6;min-height:26px;margin:8px 0 6px;color:#9db6c9}.commit{display:flex;align-items:center;justify-content:space-between;gap:6px}.commit small{font-size:7px;letter-spacing:1px;color:#7f96ad}.commit button{min-height:36px;border:1px solid #d9b57499;border-radius:4px;background:#d9bd83;color:#192938;font-size:8px;padding:8px 12px;letter-spacing:.6px}.commit button:disabled{opacity:.28;cursor:default}footer{display:flex;align-items:center;justify-content:space-between;font-size:6px;letter-spacing:.7px;color:#647d98}footer a{color:#8da8c2;text-decoration:none}
@media(max-height:740px){.shell{min-height:0;padding:7px 12px;gap:7px}header{padding-bottom:6px}.brand{font-size:16px}.brand img{width:25px;height:25px}.brand small{font-size:5px}.campaign>div{margin-bottom:4px}#level-map button{min-height:27px}.runners>div{padding:5px 6px}.runners span,.runners small{font-size:6px}.runners b{font-size:13px;margin:3px 0}.board-area{min-height:200px}.commands{padding:7px}.mode-row button{min-height:36px;font-size:7px}#status{font-size:7px;min-height:22px;margin:5px 0}.commit button{min-height:32px;font-size:7px}.crest{display:none}h1{font-size:28px;margin:9px 0}#brief{font-size:9px;line-height:1.5;margin-bottom:10px}.primary{min-height:44px}.secondary{margin-top:3px;min-height:24px}footer{display:none}}
@media(max-width:380px){.brand{font-size:15px;letter-spacing:2px}.mode-row{gap:4px}.commands{padding:6px}.mode-row button{font-size:6px}.runners span{letter-spacing:.4px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

@media(max-width:600px){.mode-row button,.commit button{min-height:44px}}
@media(max-height:740px){.overlay{padding:10px}.overlay h1{font-size:26px;margin:7px 0}.overlay #brief{font-size:8.5px;line-height:1.4}.overlay .secondary{min-height:24px;margin-top:3px}}

.mode-picker{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;flex:none}.mode-picker button{min-height:38px;padding:7px 3px;background:#14263b;border:1px solid #87a5c13b;border-radius:4px;font-size:8px;letter-spacing:.8px}.mode-picker button[aria-pressed=true]{color:#f7d99f;border-color:#d2b073;background:#4c402d55}.mode-picker button:disabled{cursor:default}.goal-rule{font-size:7px;letter-spacing:.8px;text-align:center;color:#d7bf92;padding:2px 0}.runners{flex:none}
@media(max-height:740px){.shell{gap:6px}.board-area{min-height:180px}.mode-picker button{min-height:34px}.goal-rule{font-size:6px;padding:0}.overlay h1{font-size:24px;margin:6px 0}.overlay #brief{font-size:8px;line-height:1.4}.overlay .secondary{display:none}}
/* COSMOS Strategy Collection — obsidian, enamel and brushed brass. */
:root{--bg:#080f14;--gold:#d8bd88;--muted:#8b9d9e;--line:#c6b99025;--blue:#91c8d8;--red:#dc9b96}
body{background:radial-gradient(ellipse at 50% 0,#34464370,transparent 65%),repeating-linear-gradient(120deg,#ffffff02 0 1px,transparent 1px 5px),#080f14;color:#ecebdd}
.shell{width:min(100%,610px);padding-top:18px;gap:12px}
header{border-color:#c6b99035;padding-bottom:13px}.brand{font-family:Georgia,'Times New Roman',serif;font-weight:400;letter-spacing:3.8px;font-size:23px}.brand small{font-family:'Segoe UI',Arial,sans-serif;color:#b9aa8b;letter-spacing:2px;font-size:6px}.brand img{border:1px solid #b99c64;padding:2px;width:36px;height:36px}
#sound{background:#142126;border-color:var(--line);color:#c7cbbd;min-height:36px}
.campaign b{font-size:10px;font-weight:500;letter-spacing:2px}.campaign small{font-variant-numeric:tabular-nums;color:#acb9ae}
#level-map button{background:linear-gradient(#203035,#142126);border-color:#91a29e30;border-radius:2px;color:#a0b3b0;min-height:32px}#level-map button[aria-pressed=true]{background:linear-gradient(#c4aa76,#8f7952);color:#101b20;border-color:#dbc492;box-shadow:0 2px 9px #0005}
.mode-picker{gap:1px;border:1px solid var(--line);padding:3px;background:#101a1e;border-radius:4px}.mode-picker button{border:0;background:transparent;color:#8c9f9f;font-weight:600}.mode-picker button[aria-pressed=true]{background:linear-gradient(140deg,#33433d,#222e2b);box-shadow:inset 0 0 0 1px #bfa77b65;color:#eddbb6;border-radius:2px}
.goal-rule{color:#b9b49e;letter-spacing:1.25px}
.runners>div{position:relative;border-radius:3px;border:1px solid #91b4bf27;border-left:3px solid currentColor;background:linear-gradient(130deg,#213039,#111e25);padding:10px 12px;box-shadow:0 4px 10px #0002}
.runners .azure{color:#91c8d8}.runners .ember{color:#dc9b96}.runners .jade{color:#a5ccaa}.runners span{letter-spacing:1.2px;font-size:8px}.runners b{font-family:Georgia,serif;font-size:19px;font-weight:400;padding-bottom:7px;background-image:linear-gradient(currentColor,currentColor);background-repeat:no-repeat;background-position:left bottom;transition:background-size .3s}.runners small{font-size:7px;color:#98aaa8;margin-top:6px}.runners>div.active{background:linear-gradient(125deg,#2c4145,#16252c);box-shadow:inset 0 0 0 1px #b7d6cb25,0 5px 18px #0003}
.board-area{border-radius:5px;border:1px solid #b79d6b65;background:radial-gradient(ellipse at 50% 35%,#334647,#132128 70%);box-shadow:0 14px 35px #0005,inset 0 0 50px #0004;min-height:240px}
#turn-label{background:#0c191ee8;border:1px solid #9ba99330;color:#d6d9c5;letter-spacing:1px}#pause{background:#1c2a2c;border-color:#b7a67c50;color:#d8c397}
.overlay{background:radial-gradient(ellipse at 50% 25%,#304343d9,#0b171df2 80%);backdrop-filter:blur(4px)}.crest{margin-top:8px;width:58px;height:58px;line-height:54px;border:1px solid #bba26c66;border-radius:50%;font-size:35px;color:#d9c18d;box-shadow:0 0 0 6px #bba26c09}h1{font-family:Georgia,'Times New Roman',serif;font-size:42px;font-weight:400;letter-spacing:-1.3px;line-height:1.12;margin:16px 0}h1 em{color:#d8bd88}#brief{color:#b6c0b9;font-size:11px;line-height:1.8;max-width:340px}#overline{color:#c5b18a;letter-spacing:2px;font-size:8px}
.primary{background:linear-gradient(135deg,#e7d4aa,#bba06b);border-radius:2px;border:1px solid #ecdbb5;color:#172126;box-shadow:0 5px 18px #0004;min-height:46px}.secondary{color:#b2b6a4;letter-spacing:1.4px}
.commands{border-radius:4px;background:linear-gradient(145deg,#1a292e,#101d23);border-color:#a899702e;padding:11px;box-shadow:0 5px 20px #0002}.mode-row button{background:#17262c;border-color:#91a69f35;min-height:42px;border-radius:2px;color:#aebfbb}.mode-row button[aria-pressed=true]{background:linear-gradient(#3a4438,#29362f);border-color:#c1ab7f;color:#f0deb6}.mode-row button:disabled{opacity:.35}#status{font-size:8px;color:#b5c2b9;min-height:26px}.commit button{border-radius:2px;background:linear-gradient(#d8c399,#b89e6e);color:#142025;min-height:40px}.commit small{color:#9eac9e}footer{color:#8a968b;letter-spacing:1px}footer a{color:#bbac8e}
@media(min-width:800px) and (min-height:740px){.shell{border-left:1px solid #c6b99015;border-right:1px solid #c6b99015;padding-left:26px;padding-right:26px;background:#0c151933}}
@media(max-height:740px){.shell{padding:7px 12px;gap:6px}.brand{font-size:18px;letter-spacing:2px}.brand img{width:27px;height:27px}header{padding-bottom:6px}.mode-picker{padding:2px}.mode-picker button{min-height:32px}#level-map button{min-height:27px}.runners>div{padding:5px 8px}.runners span{font-size:6px}.runners b{font-size:14px;padding-bottom:4px;margin:3px 0}.runners small{font-size:6px;margin-top:3px}.board-area{min-height:180px}.commands{padding:6px}.mode-row button,.commit button{min-height:44px}#status{min-height:22px;font-size:7px;margin:5px 0}.overlay h1{font-size:28px;margin:7px 0}.overlay #brief{font-size:8.5px;line-height:1.5;margin-bottom:10px}.overlay .crest{display:none}.primary{min-height:44px}.goal-rule{font-size:6px;letter-spacing:.7px}}
@media(max-width:380px){.brand{font-size:16px}.brand small{font-size:5px;letter-spacing:1.3px}.runners span{letter-spacing:.6px}.mode-picker button{font-size:7px}#overline{font-size:6px}}

/* A phone gets a full-width board, never a board shrunk to the leftover screen height. */
#expand{pointer-events:auto;flex:none;min-width:36px;min-height:32px;margin-left:auto;margin-right:6px;background:#17282e;border:1px solid #b6a07870;border-radius:3px;color:#e1c897;font:20px Georgia,serif}
.board-top{gap:5px}body.maze-focus{overflow:hidden}
@media(max-width:700px), (max-height:500px) and (max-width:1000px){
 .shell{width:100%;max-width:none;height:auto;min-height:100svh;padding:6px max(4px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left));gap:6px}
 header{padding:0 7px 5px;min-height:42px}.brand{font-size:18px;letter-spacing:2px}.brand img{width:28px;height:28px}.brand small{font-size:6px}#sound{min-height:36px;font-size:8px}
 .campaign,.mode-picker,.runners{margin-left:5px;margin-right:5px}.mode-picker button{min-height:36px;font-size:9px}.campaign b{font-size:10px}.campaign small{font-size:9px}#level-map button{min-height:30px;font-size:11px}
 .goal-rule{font-size:8px;letter-spacing:.4px;padding:1px 3px}
 .runners>div{display:grid;grid-template-columns:1fr auto;gap:3px 6px;padding:6px 8px}.runners span{grid-column:1/-1;font-size:8px;letter-spacing:.5px}.runners b{font:15px Georgia,serif;margin:0;padding:0;background:none}.runners small{align-self:center;font-size:9px;margin:0;letter-spacing:0}
 .board-area{display:flex;flex-direction:column;flex:none;min-height:0;overflow:hidden;width:100%;border-radius:4px;touch-action:pan-x pan-y pinch-zoom}
 .board-area canvas{position:static;inset:auto;display:block;width:100%;height:auto;aspect-ratio:1;object-fit:contain;touch-action:pan-x pan-y pinch-zoom}
 .board-top{position:static;order:-1;min-height:44px;padding:4px 6px;border-bottom:1px solid #b8a47326}#turn-label{font-size:9px;padding:5px 4px;letter-spacing:.4px;border:0;background:none}#expand,#pause{min-height:36px;min-width:40px}#pause{font-size:16px}
 .shell[data-phase="playing"] .campaign,.shell[data-phase="paused"] .campaign{display:none}
 .shell[data-phase="playing"]>header,.shell[data-phase="paused"]>header{min-height:36px;padding-bottom:3px}
 .shell[data-phase="playing"] .goal-rule,.shell[data-phase="paused"] .goal-rule{display:none}
 .shell[data-phase="playing"] .runners>div,.shell[data-phase="paused"] .runners>div{padding-top:4px;padding-bottom:4px}
 .commands{padding:8px;margin:0 4px;border-color:#b39e7355;box-shadow:0 -8px 25px #02080dcc}
 .mode-row{grid-template-columns:1fr 1fr 1fr .85fr;gap:5px}.mode-row button{min-height:46px;font-size:10px;letter-spacing:0}
 #status{font-size:10px;line-height:1.5;min-height:30px;margin:7px 0}.commit small{font-size:9px}.commit button{min-height:44px;font-size:10px;padding:9px 13px}
 .commands{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}.mode-row{grid-column:1/-1}
 #status{font-size:9px;min-height:38px;margin:0;align-self:center}.commit{grid-column:2}.commit small{display:none}.commit button{min-height:40px;font-size:9px;padding:8px}
 .shell[data-phase="playing"],.shell[data-phase="paused"]{padding-bottom:calc(164px + env(safe-area-inset-bottom))}
 .shell[data-phase="playing"] .commands,.shell[data-phase="paused"] .commands{position:fixed;bottom:0;left:0;right:0;z-index:10;margin:0;padding-bottom:max(8px,env(safe-area-inset-bottom));background:#14252c}
 .overlay{padding:20px}.overlay .crest{display:none}.overlay h1{font-size:32px;margin:10px 0}.overlay #brief{font-size:12px;line-height:1.6;margin-bottom:16px}.overlay #overline{font-size:9px}.overlay .primary{min-height:48px;font-size:11px;min-width:210px}.overlay .secondary{display:block;font-size:9px;min-height:32px}
 footer{display:none}
}
.shell.is-focused{position:fixed;inset:0;z-index:5000;width:100%;max-width:none;height:100dvh;min-height:0;overflow-y:auto;padding:4px 4px calc(166px + env(safe-area-inset-bottom));margin:0;gap:6px;background:#08141b;border:0}
.shell.is-focused>header,.shell.is-focused .campaign,.shell.is-focused .mode-picker,.shell.is-focused .runners,.shell.is-focused .goal-rule,.shell.is-focused footer{display:none!important}
.shell.is-focused .board-area{display:flex;flex-direction:column;flex:none;min-height:0;width:min(100%,calc(100dvh - 176px));margin:0 auto;overflow:hidden;touch-action:pan-x pan-y pinch-zoom}
.shell.is-focused .board-top:before{content:'';display:block;flex:none;width:24px;height:24px;background:url('assets/cosmos-logo.jpg') center/cover;border:1px solid #b8a47355;border-radius:50%}
.shell.is-focused .board-area canvas{position:static;inset:auto;display:block;width:100%;height:auto;aspect-ratio:1;touch-action:pan-x pan-y pinch-zoom}
.shell.is-focused .board-top{position:static;order:-1;min-height:44px;padding:4px 6px}.shell.is-focused .commands{position:fixed;bottom:0;left:0;right:0;z-index:10;margin:0;padding-bottom:max(8px,env(safe-area-inset-bottom));background:#14252c}
@media(orientation:landscape) and (max-height:600px){
 .shell.is-focused{display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,240px);align-items:center;gap:8px;padding:4px max(4px,env(safe-area-inset-right)) 4px max(4px,env(safe-area-inset-left));overflow:hidden}
 .shell.is-focused .board-area{width:min(100%,calc(100dvh - 56px))}.shell.is-focused .commands{position:static;align-self:center;width:100%}
}
