@font-face{font-family:Inter;src:url(assets/inter.woff2) format('woff2');font-display:swap}@font-face{font-family:'Space Grotesk';src:url(assets/space-grotesk.woff2) format('woff2');font-display:swap}
:root{font-family:Inter,system-ui,sans-serif;color:#f6efdc;background:#0e2425;color-scheme:dark}*{box-sizing:border-box}body{margin:0;height:100svh;overflow:hidden;background:radial-gradient(ellipse at 50% 30%,#284643,#10292a 75%)}button{font:inherit;touch-action:manipulation;cursor:pointer;color:inherit;background:#253f40;border:1px solid #62776b;border-radius:12px;min-height:44px;padding:8px 12px;font-weight:650;box-shadow:0 3px 0 #081919}button:focus-visible{outline:3px solid #fff1a7;outline-offset:2px}button:active:not(:disabled){transform:translateY(2px)}button:disabled{opacity:.42;cursor:default}[hidden]{display:none!important}.shell{grid-template-columns:minmax(0,1fr);height:100%;max-width:1050px;margin:auto;padding:8px 12px;display:grid;grid-template-rows:45px minmax(0,1fr) auto;gap:6px}.hud{display:flex;align-items:center;gap:22px;max-width:760px;width:100%;margin:auto}.hud div{min-width:52px}.hud div:nth-child(3){margin-right:auto}.hud span{display:block;font-size:9px;color:#c3d9cb;letter-spacing:.05em}.hud strong{font-family:'Space Grotesk',sans-serif;font-size:24px;line-height:1.1;font-variant-numeric:tabular-nums}.tool{min-width:44px;padding:5px;font-size:19px}.map-wrap{display:flex;align-items:center;justify-content:center;min-height:0}.map{position:relative;width:min(100%,calc((100svh - 225px)*1.36));aspect-ratio:680/500;flex-shrink:0;border-radius:18px;box-shadow:0 8px 24px #03151688;overflow:hidden;outline:1px solid #71958766}canvas{display:block;width:100%;height:100%}#pads{position:absolute;inset:0}.pad{position:absolute;transform:translate(-50%,-50%);width:44px;height:44px;min-height:44px;border:0;background:transparent;box-shadow:none;font-size:13px;color:#efe7ca;text-shadow:0 1px 3px #061a18;padding:0;border-radius:50%}.pad[aria-pressed=true]{outline:2px solid #fff0a5;outline-offset:-3px}.pad:active:not(:disabled){transform:translate(-50%,-50%)}.pad.occupied{color:transparent;text-shadow:none}.controls{width:min(100%,760px);margin:auto}.controls>p{margin:0 0 5px;font-size:12px;color:#d7e3d7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.build-row{display:flex;gap:7px;min-height:49px;align-items:stretch}.build-row button{flex:1;min-width:0;padding:5px 7px;text-align:left;border-top:3px solid #eabc58}.build-row button[data-kind=frost]{border-top-color:#65ded0}.build-row button[data-kind=prism]{border-top-color:#c5a0ff}.build-row b{font-size:12px;display:flex;gap:4px;align-items:center;justify-content:space-between}.build-row small{font-size:10px;color:#d0ded2}.build-row b span{font-size:11px;color:#fff0b7}.build-row #tower-detail{flex:1;font-size:11px;align-self:center}.wave-row{display:flex;align-items:center;gap:8px;margin-top:7px}.primary{background:linear-gradient(#f7cf78,#dfaa49);color:#152b2b;border-color:#ffe2a1;font-weight:800}.wave-row>.primary{min-width:140px}.wave-row p{font-size:11px;color:#cbdccb;line-height:1.35;margin:0}.controls>.message{margin:6px 0 0;min-height:15px;font-size:11px;color:#fff0b7}.overlay{position:fixed;inset:0;display:grid;place-items:center;padding:14px;z-index:5;background:#061d20dc;backdrop-filter:blur(5px);overflow:auto}.menu{background:linear-gradient(90deg,#071c23ed,#102b30a6),url(assets/cover.webp) center/cover}.sheet{width:min(100%,450px);padding:24px;border-radius:22px;background:#102a2be8;border:1px solid #709285;box-shadow:0 20px 80px #03131988;text-align:center}.sheet h1,.sheet h2{font-family:'Space Grotesk',sans-serif;font-size:clamp(26px,5vw,42px);margin:4px 0 12px;letter-spacing:-.04em;line-height:1}.sheet p{line-height:1.5;font-size:14px;color:#dce5d4}.sheet .eyebrow{font-size:10px;letter-spacing:.15em;color:#f7d07f;font-weight:800;margin-top:0}.sheet>button{display:block;width:100%;margin:9px 0}.sheet .instructions,.sheet .save-note{font-size:11px;margin-bottom:0}.sheet .save-note{color:#b2cbbb}.missions{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:18px 0}.missions button{font-size:11px;line-height:1.35;padding:8px 3px}.missions button[aria-pressed=true]{border-color:#f7cf78;background:#3a5145}.missions small{display:block;color:#f4d17c;margin-top:5px}.result{font-size:30px!important;color:#f7cf78!important;letter-spacing:6px}
@media(max-width:420px){.shell{padding:6px;gap:4px}.hud{gap:15px}.map{border-radius:12px}.sheet{padding:18px}.build-row{gap:5px}.build-row button{padding:4px}.build-row b{font-size:10px;gap:2px}.build-row small{font-size:9px}.build-row b span{font-size:10px}.wave-row p{font-size:10px}.wave-row>.primary{min-width:125px}.controls>p{font-size:11px}.controls>.message{font-size:10px}}
@media(max-height:450px) and (min-width:600px){.shell{max-width:none;grid-template-columns:minmax(0,1fr) 245px;grid-template-rows:40px minmax(0,1fr);padding:5px;gap:4px 10px}.hud{grid-column:1/-1}.map-wrap{grid-column:1}.map{width:min(100%,calc((100svh - 55px)*1.36))}.controls{grid-column:2;grid-row:2}.build-row{flex-direction:column;gap:5px}.build-row button{min-height:44px}.build-row small{display:none}.wave-row{flex-wrap:wrap}.wave-row p{width:100%}.controls>.message{white-space:normal;line-height:1.4}.sheet{padding:15px}.missions{margin:10px 0}.sheet h1{font-size:28px}.sheet p{margin:8px 0}.sheet .save-note{font-size:10px}.sheet .instructions{display:none}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* Reserve the portal's fullscreen tools; keep runtime pause reachable on the left. */
.hud{padding-right:96px;gap:12px}.hud div:nth-child(3){margin-right:0}.hud div:last-child{margin-right:auto}
@media(max-width:420px){.hud{gap:8px}.hud div{min-width:32px}.hud strong{font-size:20px}.hud span{font-size:8px}}

.build-row #upgrade-button,.build-row #sell-button{font-size:12px;white-space:nowrap}
.sheet h1{color:#ffe2a1;text-shadow:0 2px 2px #061d20}
#tower-detail{font-size:10px;line-height:1.35;margin:5px 0 0;color:#d0ded2}
#target-button{font-size:11px;white-space:nowrap}
#target-button[aria-pressed=true]{border-color:#c5a0ff;background:#3c3452}
@media(max-width:420px){.build-row #upgrade-button,.build-row #sell-button,#target-button{font-size:10px}}

/* Prevent long tower/coach text from setting the grid intrinsic width on phones. */
.controls,#tower-controls,.build-row{min-width:0}
#wave{white-space:nowrap}
