:root { --accent:#ffd84d; --accent-ink:#11171b; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible { outline:2px solid var(--accent);outline-offset:4px; }
button:disabled { cursor:not-allowed;opacity:.5; }
input[type=checkbox] { accent-color:var(--accent);width:18px;height:18px; }
#title.overlay { padding:0;background:#10171ded;overflow:hidden;display:block; }
.hub-shell { display:grid;grid-template-columns:196px minmax(0,1fr);height:100%;height:100dvh;width:100%; }
.hub-sidebar { display:flex;flex-direction:column;gap:42px;padding:32px 16px 24px;background:#10171f;border-right:1px solid #ffffff0e;min-height:0;overflow-y:auto; }
.hub-brand { display:flex;gap:11px;align-items:center;text-decoration:none;color:var(--text);font-size:16px;letter-spacing:2px;font-weight:900; }
.hub-brand small { display:block;font-size:8px;letter-spacing:2px;margin-top:5px;color:var(--muted); }
.brand-mark { display:flex;align-items:center;justify-content:center;position:relative;min-width:38px;height:43px;background:var(--accent);color:var(--accent-ink);border-radius:10px 10px 3px 10px;font-size:29px;letter-spacing:-3px; }
.brand-mark>span { font-size:7px;position:absolute;bottom:4px;right:6px;letter-spacing:1px; }
.hub-sidebar nav { display:flex;flex-direction:column;gap:7px; }
.hub-nav { display:flex;gap:13px;align-items:center;min-height:48px;border-radius:9px;background:transparent;color:#93a1ad;padding:11px 12px;text-align:left;font-size:12px;font-weight:650; }
.hub-nav>span:first-child { font-size:23px;width:24px;text-align:center;font-weight:400; }
.hub-nav:hover { background:#ffffff07;color:#edf2f5; }
.hub-nav.active { color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,transparent);box-shadow:inset 2px 0 var(--accent); }
.sidebar-foot { margin-top:auto;color:#abb6bd;font-size:11px;line-height:1.8;padding:12px 8px; }
.sidebar-foot small { display:block;color:#64727f;padding-left:13px;font-size:10px; }
.status-dot { display:inline-block;width:5px;height:5px;border-radius:50%;background:#83d9a5;margin-right:6px; }
.hub-main { overflow-y:auto;overflow-x:hidden;min-height:0;min-width:0;padding:28px clamp(22px,5vw,90px) 40px;touch-action:pan-y;overscroll-behavior:contain;background:radial-gradient(ellipse at 83% 0%,#2b3b3333,transparent 48%); }
.hub-topline { display:flex;justify-content:space-between;align-items:center;gap:12px;color:#71818d;font-size:9px;font-weight:750;letter-spacing:2px;padding-bottom:24px;border-bottom:1px solid #ffffff0b;margin-bottom:38px; }
.local-badge { display:inline-block;color:#94bca6;border:1px solid #8dbea02e;border-radius:20px;font-size:10px;line-height:1.4;padding:6px 10px;letter-spacing:.4px; }
.hub-page { width:100%;max-width:1200px;margin:0 auto; }
.home-hero { padding:0 0 26px;position:relative; }
.eyebrow { color:var(--accent);font-size:10px;letter-spacing:2.5px;font-weight:750;margin:0 0 17px; }
.home-hero h1 { font-size:clamp(40px,5.7vw,84px);line-height:1.01;letter-spacing:-3px;font-weight:850;margin:0 0 22px; }
.home-hero h1 span { color:var(--accent); }
.hero-copy { font-size:14px;color:#98a8b4;line-height:1.8;margin:0; }
.hero-meta { display:flex;flex-wrap:wrap;gap:20px;color:#778892;font-size:10px;margin-top:22px; }
.hero-meta span::before { content:'+';color:var(--accent);margin-right:7px; }
.section-heading { display:flex;align-items:center;justify-content:space-between;gap:10px;margin:20px 0 14px; }
.section-heading h2 { font-size:17px;font-weight:700;margin:0;letter-spacing:-.4px; }
.section-heading>span { font-size:11px;color:#73848f; }
.hub-main .maps { grid-template-columns:repeat(3,minmax(0,1fr));gap:14px; }
.hub-main .mapc { border-radius:12px;background:#19222b;padding:8px;transition:border-color .15s,background .15s;min-width:0; }
.hub-main .mapc:hover { background:#202c35; }
.hub-main .mapc.sel { border-color:var(--accent); }
.hub-main .mapc b { font-size:13px;margin:12px 5px 5px; }
.hub-main .mapc small { font-size:10px;line-height:1.6;margin:0 5px; }
.hub-main .mapc .best { font-size:10px;margin:9px 5px 3px; }
.launch-row { display:flex;align-items:flex-end;gap:24px;justify-content:space-between;margin-top:24px;flex-wrap:wrap; }
.difficulty-block { flex:1;min-width:200px;max-width:360px; }
.difficulty-block h3 { font-size:10px;font-weight:600;color:#80919d;text-transform:uppercase;letter-spacing:1.8px;margin:0 0 10px; }
.launch-actions { display:flex;gap:10px;flex-wrap:wrap; }
.launch-actions .primary.big { font-size:13px;padding:16px 22px; }
.launch-actions .primary span { margin-left:18px;font-size:18px; }
.hub-main .seg button { font-size:12px;min-height:42px; }
.hub-main .seg small { font-size:9px; }
.primary,.wavebtn:not(:disabled):not(.nudge) { background:var(--accent);color:var(--accent-ink);box-shadow:0 3px 0 color-mix(in srgb,var(--accent) 45%,#000); }
.primary:active,.wavebtn:active { box-shadow:0 1px 0 color-mix(in srgb,var(--accent) 45%,#000); }
.seg button.sel { background:var(--accent);color:var(--accent-ink); }
.seg button.sel small { color:inherit;opacity:.8; }
.card.sel { border-color:var(--accent);background:color-mix(in srgb,var(--accent) 13%,var(--panel2)); }
.chip .pth { background:var(--accent);color:var(--accent-ink); }
#dossier,.intel { border-color:color-mix(in srgb,var(--accent) 40%,transparent); }
#title .foot { text-align:left;color:#51636e;font-size:10px;margin-top:32px; }
#continueBox .cont { margin-bottom:24px; }
.page-heading { margin:0 0 18px;font-size:clamp(30px,4vw,50px);letter-spacing:-1.5px;line-height:1.12; }
.page-intro { color:#91a1ad;line-height:1.8;font-size:14px;max-width:680px;margin-bottom:32px; }
.setting-card { background:#19222bec;border:1px solid #ffffff0c;border-radius:16px;padding:24px;margin:18px 0;max-width:800px; }
.setting-card h2 { font-size:18px;margin:0 0 14px; }
.setting-card p { font-size:13px;line-height:1.85;color:#91a1ad;max-width:650px; }
.setting-card>label { display:flex;align-items:center;gap:14px;margin:14px 0;font-size:13px;flex-wrap:wrap; }
.accent-presets { display:flex;gap:12px;margin:22px 0; }
.accent-presets button { background:var(--swatch);width:36px;height:36px;border-radius:50%;border:3px solid #19222b;outline:1px solid transparent; }
.accent-presets button[aria-pressed=true] { outline-color:var(--swatch); }
input[type=color] { width:46px;height:34px;border:0;padding:2px;background:#ffffff18;border-radius:7px;cursor:pointer; }
.settings-options { display:flex;flex-direction:column;gap:20px;margin-top:24px; }
.settings-options label { display:flex;gap:12px;align-items:center;font-size:14px;color:#b9c3cb; }
.setting-card input:not([type=color]):not([type=file]),.setting-card select { background:#0e171d;border:1px solid #ffffff20;color:var(--text);font:inherit;padding:11px;border-radius:8px;max-width:100%;min-width:0; }
.setting-card .primary,.setting-card .ghost { font-size:12px; }
.preset-row { display:flex;align-items:center;gap:12px;flex-wrap:wrap; }
.preset-row>div { flex:1;min-width:150px; }
.preset-row h3 { margin:0;font-size:16px; }
.preset-row p { margin:4px 0; }
.backup-actions { display:flex;gap:10px;flex-wrap:wrap;margin:24px 0 8px; }
.file-button { display:inline-flex;align-items:center;cursor:pointer;font-size:12px; }
.file-button input { position:absolute;width:1px;height:1px;opacity:0;overflow:hidden; }
.file-button:focus-within { outline:2px solid var(--accent);outline-offset:3px; }
#backup-status { color:var(--accent); }
.multiplayer-card .local-badge { margin-bottom:20px; }
.multiplayer-card button { margin:12px 8px 0 0; }
/* A bounded horizontal tray in every orientation. Its real height drives the map. */
#tray { top:auto;left:0;right:0;bottom:0;width:auto;padding:0 calc(8px + var(--safe-r)) calc(10px + var(--safe-b)) calc(8px + var(--safe-l));border-left:0; }
#tray .tray-row { display:flex;flex-direction:row;height:auto;min-height:0;gap:8px;padding-top:10px;align-items:stretch; }
.tower-carousel { display:grid;grid-template-columns:22px minmax(0,1fr) 22px;gap:3px;flex:1;min-width:0;min-height:0; }
.tray-scroll { background:#ffffff09;color:var(--muted);border-radius:7px;padding:0;font-size:25px;min-width:0; }
.tray-scroll:hover { color:var(--accent);background:#ffffff15; }
#cards { flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:#687987 #172029;touch-action:pan-x;align-content:normal;gap:6px;min-height:0;padding:4px 2px 9px; }
#cards::-webkit-scrollbar { display:block;height:5px; }
#cards::-webkit-scrollbar-thumb { background:#687987;border-radius:10px; }
#cards .card:hover { transform:none; }
#tray .abil { width:104px;height:auto;flex-direction:column;flex:none; }
#tray .abil .air { width:100%;height:auto;flex:1;min-height:0; }
#tray .wavebtn { width:auto;min-width:128px;height:auto;align-self:stretch;transform:none; }
#tray .wavebtn.pulse,#tray .wavebtn.nudge { animation:tray-pulse 1.2s infinite; }
@keyframes tray-pulse { 50% { filter:brightness(1.12); } }
#buildHint { position:static;max-width:100%;width:fit-content; }
@media(max-width:1000px) { .hub-shell{grid-template-columns:170px minmax(0,1fr)}.hub-sidebar{padding:26px 12px}.hub-main{padding:24px}.hub-brand{font-size:13px;letter-spacing:1px}.hub-nav{font-size:11px;gap:9px}.home-hero h1{font-size:58px}.launch-row{gap:20px}.hub-topline{margin-bottom:26px} }
@media(max-width:760px) { .hub-shell{grid-template-columns:74px minmax(0,1fr)}.hub-sidebar{padding:20px 7px;gap:30px}.hub-brand{justify-content:center}.hub-brand>span:last-child,.sidebar-foot{display:none}.hub-nav{flex-direction:column;gap:5px;padding:10px 2px;font-size:8px;min-height:62px;text-align:center}.hub-nav>span:first-child{font-size:22px}.hub-main{padding:20px}.hub-topline{letter-spacing:1px;font-size:8px}.hub-topline .local-badge{display:none}.home-hero h1{font-size:44px;letter-spacing:-1.8px}.hero-meta{gap:12px;font-size:9px}.hero-copy{font-size:12px}.eyebrow{font-size:8px;letter-spacing:1.5px}.hub-main .maps{grid-template-columns:1fr}.hub-main .mapc{display:grid;grid-template-columns:100px minmax(0,1fr);gap:0 7px}.hub-main .mapc canvas{grid-row:span 3}.hub-main .mapc small{min-height:0}.hub-main .mapc b{margin-top:2px}.hub-main .mapc .best{margin-top:3px}.section-heading>span{display:none}.section-heading h2{font-size:15px}.launch-actions{width:100%}.launch-actions .primary.big{flex:1;padding:13px 10px}.launch-actions .primary span{display:none}.difficulty-block{max-width:none}.setting-card{padding:18px}.setting-card input{max-width:100%}.setting-card h2{font-size:16px}.page-heading{font-size:32px}.hero-meta span:last-child{display:none}#tray .abil{width:48px}#tray .wavebtn{min-width:82px}#tray .abil .air .air-lbl{display:none}#inspector{right:8px!important;left:8px!important;top:auto!important;bottom:calc(var(--tray-h) + 8px)!important;width:auto!important;max-height:45dvh!important} }
@media(max-width:360px) { .hub-shell{grid-template-columns:64px minmax(0,1fr)}.hub-main{padding:16px 12px}.home-hero h1{font-size:35px}.hub-topline{font-size:7px}.hub-nav{font-size:7px}.hub-main .mapc{grid-template-columns:75px minmax(0,1fr)}.hub-main .mapc small{font-size:9px}.hub-main .mapc b{font-size:11px}.launch-actions .primary.big{font-size:11px} }
@media(max-height:500px) and (orientation:landscape) { .hub-sidebar{gap:14px;padding-top:14px}.hub-sidebar nav{gap:2px}.hub-nav{min-height:38px}.hub-main{padding-top:16px}.hub-topline{margin-bottom:18px;padding-bottom:12px}.home-hero h1{font-size:44px}.hub-main .maps{grid-template-columns:repeat(3,minmax(0,1fr))}.hub-main .mapc{display:block}.hub-main .mapc small{display:none}#tray .card{width:62px;height:58px}#tray .card img{width:36px;height:36px}#tray .abil{width:52px}#tray .abil .air .air-lbl{display:none}#tray .wavebtn{min-width:96px}#inspector{top:calc(var(--hud-h) + 6px)!important;bottom:calc(var(--tray-h) + 6px)!important;right:8px!important;left:auto!important;width:260px!important;max-height:none!important} }
@media(prefers-reduced-motion:reduce) { *{animation:none!important;scroll-behavior:auto!important} }
/* Compact in-game panels: decisions first, optional detail on demand. */
#inspector { width:280px;padding:12px;border-radius:12px; }
.ins-head { gap:8px;margin-bottom:9px; }.ins-head h3{font-size:15px}.ins-head img{width:40px;height:40px}.ins-stats{font-size:12px;padding:7px 9px;margin-bottom:8px}.ins-btns{gap:6px}.ibtn{font-size:12px;padding:9px}.ibtn.branch{gap:4px}.ibtn.branch small{font-size:11px}.ins-branch-title{font-size:10px}.ins-more{margin:6px 0 10px;font-size:11px;color:var(--muted)}.ins-more summary{cursor:pointer;padding:4px}.ins-more .ins-stats{margin-top:6px}.panel.end{width:min(360px,100%);padding:20px}.end h2{font-size:25px;margin-bottom:16px}.endstats{font-size:12px;padding:10px}.endreport{font-size:12px}.report-details summary{cursor:pointer;color:var(--muted);padding:8px 0}.report-details .rrow{margin-top:8px}.end .primary{font-size:14px}.end .ghost{font-size:12px}.end .stars:empty{display:none}
#victory-note{position:fixed;right:16px;bottom:calc(var(--tray-h) + 16px);z-index:16;max-width:min(360px,calc(100vw - 32px));display:flex;align-items:flex-start;gap:12px;background:#18352ef5;border:1px solid #7de2ac66;border-radius:12px;padding:14px 16px;box-shadow:0 8px 30px #0005}#victory-note strong{display:block;color:#a8edc3;font-size:15px}#victory-note span{display:block;color:#acc2b8;font-size:12px;line-height:1.7;margin-top:5px}#victory-note button{background:transparent;color:#acc2b8;font-size:22px;padding:0 2px}
/* Restore the original system font treatment and give the logo its own space. */
.hub-shell{font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}.home-hero h1{font-weight:900;letter-spacing:.025em;line-height:1.14;font-size:clamp(32px,4.5vw,68px)}.page-heading{letter-spacing:0;font-weight:800}.hub-brand{min-width:0;gap:10px;letter-spacing:.06em;font-size:14px;line-height:1.4}.hub-brand>span:last-child{min-width:0}.hub-brand small{font-size:8px;letter-spacing:.12em;line-height:1.6;white-space:normal}.brand-mark{flex:none;min-width:36px;width:36px;letter-spacing:0;font-size:26px}.hub-sidebar{gap:28px;overflow:hidden;padding-bottom:16px}.hub-sidebar nav{min-height:0;overflow-y:auto;flex:0 1 auto}.settings-nav{margin-top:auto;flex-shrink:0}.sidebar-foot{margin-top:0;padding:0 8px}.saved-run{display:flex;align-items:center;gap:20px;max-width:100%}.saved-run>div{flex:1;min-width:0}.saved-run h2{overflow-wrap:anywhere}.saved-run small{color:var(--muted);font-size:11px}.run-rename{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}.run-rename input{width:210px;max-width:100%;min-width:0}.run-rename button{font-size:11px}.saved-run>.primary{flex:none}
@media(max-width:760px){.home-hero h1{font-size:clamp(27px,5.5vw,42px);letter-spacing:0;line-height:1.2}.hub-sidebar{gap:20px}.hub-nav{min-height:56px}.settings-nav{margin-top:auto;width:100%}.saved-run{align-items:stretch;flex-direction:column;gap:14px}.run-rename input{width:100%}.saved-run>.primary{width:100%}}
@media(max-height:500px){.hub-sidebar{gap:10px;padding-top:10px;padding-bottom:10px}.hub-nav{min-height:34px}.hub-brand{flex-shrink:0}.sidebar-foot{display:none}.home-hero h1{line-height:1.2}.settings-nav{min-height:42px}}

.coop-stage { width:100%; overflow:hidden; border-radius:12px; background:#18201b; }
#coop-canvas { display:block; position:static; touch-action:manipulation; }
.coop-controls { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
#coop-selection button { margin:6px; }
#room-code { width:min(100%,340px); font-family:monospace; }
#online-login { display:inline-block; text-decoration:none; padding:12px 18px; border-radius:10px; }
#online-login.hidden { display:none; }
