@font-face {
  font-family: 'Space Grotesk';
  src: url('/space-grotesk.woff2') format('woff2');
  font-display: swap;
  font-weight: 300 700;
}
:root {
  color-scheme: dark;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: #09131a;
  color: #effaf7;
  --mint: #a7ffd0;
  --mint-strong: #8efcc0;
  --muted: #a0b5b6;
  --line: #294249;
  --panel: #101e25;
  --warm: #ffb380;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
.shell { height: 100vh; height: 100dvh; min-height: 410px; display: grid; grid-template-rows: 68px minmax(0, 1fr) 49px; padding: 0 clamp(12px, 2vw, 28px); }
.topbar, .footer { display: flex; align-items: center; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 1.18rem; letter-spacing: -.07em; white-space: nowrap; }
.brand-accent { color: var(--mint); }
.brand-mark { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #568d79; border-radius: 6px; color: var(--mint); }
.brand-mark i { width: 14px; height: 14px; border: 1px solid currentColor; transform: rotate(45deg); }
.brand-mark::after { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ''; }
.game-type { margin-left: 17px; border-left: 1px solid var(--line); padding-left: 17px; font: 500 .75rem var(--mono); letter-spacing: .12em; color: var(--muted); }
.topbar nav { margin-left: auto; display: flex; gap: 8px; }
.tool, .secondary {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0d1b22;
  color: #dce9e8;
  padding: 8px 13px;
  font-weight: 600;
  font-size: .875rem;
}
.tool:hover, .secondary:hover { background: #1b3036; border-color: #5b7c7b; }
#sound[aria-pressed="true"] { color: var(--mint); }
.board { isolation: isolate; position: relative; overflow: hidden; border: 1px solid #2d4b50; background: #14272b; }
#arena { position: absolute; display: block; width: 100%; height: 100%; touch-action: none; }
.board[data-view="playing"] #arena { cursor: none; }
.edge { position: absolute; width: 16px; height: 16px; border: solid #7ba998; pointer-events: none; }
.top-left { left: 0; top: 0; border-width: 2px 0 0 2px; }
.top-right { right: 0; top: 0; border-width: 2px 2px 0 0; }
.bottom-left { left: 0; bottom: 0; border-width: 0 0 2px 2px; }
.bottom-right { right: 0; bottom: 0; border-width: 0 2px 2px 0; }
.sector, .match-status, .map-panel, .feed { position: absolute; z-index: 2; margin: 0; }
.sector { top: 22px; left: 24px; }
.sector p { margin: 0; }
.sector p + p { margin-top: 6px; color: #d3e7e3; font-size: 1.18rem; font-weight: 700; letter-spacing: -.035em; }
.label, .eyebrow, .map-title, .map-legend, .network { font: 600 .75rem var(--mono); letter-spacing: .13em; }
.label, .eyebrow { color: var(--mint); }
.signal { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 9px #95ffc478; margin-right: 6px; vertical-align: 2px; }
.map-panel { right: 22px; top: 22px; width: 176px; padding: 9px; background: #0b181ded; border: 1px solid #355453; border-radius: 4px; }
.map-title, .map-legend { color: #c3d9d5; font-size: .65rem; display: flex; align-items: center; justify-content: space-between; }
.map-north { color: var(--mint); }
#minimap { display: block; width: 100%; height: auto; margin: 7px 0; background: #15282d; }
.map-legend { justify-content: flex-start; gap: 6px; color: var(--muted); }
.legend-line { display: inline-block; width: 14px; height: 0; border-top: 1px dashed var(--mint); }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; overflow: auto; z-index: 3; padding: 20px; background: radial-gradient(ellipse at center, #061116de 7%, #09191bbb 36%, #0a191d22 79%); }
.lobby { text-align: center; width: min(100%, 630px); padding: 42px 0; }
.eyebrow { margin: 0 0 12px; font-size: .8rem; display: flex; align-items: center; justify-content: center; gap: 12px; }
.eyebrow > span { width: 22px; height: 1px; background: #6aa890; }
h1 { font-size: clamp(3.4rem, 9.4vw, 9rem); line-height: .87; letter-spacing: -.095em; margin: 0 0 15px -.04em; font-weight: 700; text-shadow: 0 6px 36px #061018b0; }
h1 span { color: var(--mint); }
.tagline { color: #e0eae9; font-size: clamp(.98rem, 1.45vw, 1.13rem); margin: 23px auto 34px; max-width: 29rem; line-height: 1.45; }
.join { width: min(100%, 305px); display: grid; margin: 0 auto; text-align: left; gap: 8px; }
.join label, .health-title, .score span { color: #c2d2d3; font: 600 .72rem var(--mono); letter-spacing: .12em; }
.join input { width: 100%; padding: 11px 13px; font-size: 1rem; color: #eef8f6; background: #0b181fef; border: 1px solid #476569; border-radius: 5px; }
.join input::placeholder { color: #9aabb0; }
.primary { display: flex; justify-content: center; align-items: center; gap: 11px; width: 100%; min-height: 48px; border: 1px solid #c1ffdc; border-radius: 5px; background: var(--mint-strong); box-shadow: 0 5px 18px #061e19ad; color: #09251b; font-weight: 700; font-size: 1.05rem; }
.primary:hover { background: #c6ffdd; }
.play-icon { width: 0; height: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.lobby-status { color: #a9bec0; margin: 16px 0 0; font-size: .875rem; }
.lobby-status.error { color: var(--warm); }
.queue, .results { text-align: center; width: min(100%, 375px); padding: 26px; background: #0b181eeb; border: 1px solid #4e7270; border-radius: 8px; }
.countdown { font-size: clamp(3rem, 11vw, 5.5rem); line-height: 1; font-weight: 700; letter-spacing: -.09em; }
.queue p:not(.eyebrow) { color: #d2e1e1; }
.queue button { margin-top: 9px; }
.results h2 { margin: .2em 0 0; font-size: clamp(1.9rem, 5vw, 3.1rem); line-height: 1; letter-spacing: -.065em; }
.results .secondary { margin-top: 9px; width: 100%; }
.score { margin: 20px 0; display: grid; grid-template-columns: 1fr 1fr; }
.score div { display: grid; gap: 2px; }
.score div + div { border-left: 1px solid var(--line); }
.score strong { font-size: 2rem; }
.match-status { left: 22px; top: 22px; display: grid; gap: 6px; min-width: 145px; }
.tally { display: flex; background: #0a181de8; border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; }
.tally div { display: grid; min-width: 63px; text-align: center; gap: 1px; }
.tally div + div { border-left: 1px solid var(--line); }
.tally span { font-size: 1.36rem; font-weight: 700; line-height: 1; }
.tally small { color: var(--muted); font: .63rem var(--mono); letter-spacing: .12em; }
.zone-status { background: #0b181de8; border: 1px solid var(--line); border-radius: 4px; display: flex; justify-content: space-between; gap: 8px; padding: 6px 9px; font-size: .81rem; }
.zone-status strong { color: var(--mint); font-family: var(--mono); }
.zone-status.closing strong, .danger { color: var(--warm); }
.danger { position: absolute; z-index: 2; top: 17px; left: 50%; transform: translateX(-50%); padding: 9px 11px; margin: 0; background: #211713ee; border: 1px solid #a56b4d; border-radius: 4px; white-space: nowrap; font: 600 .72rem var(--mono); letter-spacing: .08em; }
.feed { top: 111px; left: 22px; padding: 0; list-style: none; color: #d4e0df; font: .78rem var(--mono); pointer-events: none; }
.feed li { width: fit-content; max-width: 215px; background: #0b191fd9; border-left: 2px solid #5c8c7b; margin: 5px 0; padding: 6px 8px; overflow-wrap: anywhere; }
.hud { position: absolute; z-index: 2; bottom: 17px; left: 50%; transform: translateX(-50%); width: min(94%, 472px); display: grid; gap: 7px; }
.health-ui { position: relative; padding: 7px 53px 8px 9px; background: #0b181deb; border: 1px solid var(--line); border-radius: 5px; }
.health-title { display: flex; justify-content: space-between; }
.health-track { width: 100%; height: 7px; margin-top: 4px; background: #2a3c41; border-radius: 2px; overflow: hidden; }
#health { height: 100%; width: 100%; background: var(--mint); transform-origin: left; transition: transform .14s linear; }
.health-action { background: none; color: #e2ecea; border: 0; border-left: 1px solid var(--line); position: absolute; top: 5px; bottom: 5px; right: 4px; display: flex; align-items: center; gap: 3px; }
.health-action strong { color: var(--mint); }
.health-action kbd { border: none; padding: 0; }
.gear { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 6px; }
.slot, .ammo, .pickup, .touch-actions button { color: #dceae9; background: #0b181ded; border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; }
.slot { display: flex; align-items: center; gap: 6px; text-align: left; font-weight: 600; font-size: .85rem; }
.slot.active { border-color: #83c8a9; color: var(--mint); }
.ammo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font: .78rem var(--mono); white-space: nowrap; }
.ammo b { color: #fff; font-size: .95rem; }
#reload-label { font-size: .63rem; color: var(--muted); }
.ammo kbd { border: 0; padding: 0; }
.pickup { justify-self: center; display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: .86rem; color: var(--mint); }
.touch-actions { position: absolute; right: 18px; bottom: 115px; z-index: 3; }
.touch-actions button { padding: 12px 16px; min-height: 44px; border-color: #80b39e; }
.footer { justify-content: space-between; gap: 8px; color: var(--muted); font-size: .81rem; }
.desktop-hint { display: flex; align-items: center; gap: 4px; }
.desktop-hint span { margin: 0 12px 0 2px; }
.touch-hint { display: none; }
kbd { border: 1px solid #3b535a; background: #14242c; border-radius: 3px; padding: 2px 5px; color: #e0edea; font: 500 .69rem var(--mono); }
.network { white-space: nowrap; font-size: .67rem; display: flex; align-items: center; }
.network .signal { width: 5px; height: 5px; }
dialog { width: min(450px, calc(100vw - 24px)); padding: 20px; border: 1px solid #547b72; border-radius: 7px; background: #101f27; color: #effaf7; }
dialog::backdrop { background: #030b10af; }
.dialog-top, dialog dl div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dialog-top h2 { margin: 0; font-size: 1.5rem; }
dialog dl { margin: 14px 0; }
dialog dl div { padding: 8px 0; border-bottom: 1px solid var(--line); }
dialog dd { margin: 0; }
dialog p { color: #c0d0d1; line-height: 1.4; }
@media (pointer: coarse) {
  .desktop-hint { display: none; }
  .touch-hint { display: block; }
}
@media (max-width: 660px) {
  .shell { grid-template-rows: 54px minmax(0, 1fr) 39px; padding: 0 8px; }
  .game-type, .sector, .map-legend { display: none; }
  .map-panel { width: 104px; right: 9px; top: 9px; padding: 5px; }
  .map-title { font-size: .54rem; letter-spacing: .05em; }
  #minimap { margin: 4px 0 0; }
  .tool { padding: 7px 8px; font-size: .76rem; }
  .brand { gap: 5px; font-size: .98rem; }
  .brand-mark { width: 25px; height: 25px; }
  .brand-mark i { width: 12px; height: 12px; }
  .match-status { left: 8px; top: 8px; min-width: 101px; }
  .tally { padding: 5px; }
  .tally div { min-width: 43px; }
  .tally span { font-size: 1.12rem; }
  .zone-status { font-size: .68rem; padding: 4px; }
  .feed { top: 90px; left: 8px; font-size: .67rem; }
  .feed li { max-width: 145px; }
  .danger { top: 91px; font-size: .61rem; }
  .hud { bottom: 8px; }
  .network { letter-spacing: .05em; font-size: .57rem; }
  .footer { font-size: .69rem; }
  .desktop-hint span { margin-right: 3px; }
}
@media (max-height: 530px) {
  .shell { grid-template-rows: 43px minmax(0, 1fr) 27px; min-height: 295px; }
  .lobby { padding: 12px 0; }
  h1 { font-size: clamp(2.9rem, 14vh, 5.5rem); }
  .tagline { margin: 9px auto 12px; }
  .join { gap: 5px; }
  .join input { padding: 6px 9px; }
  .primary { min-height: 38px; }
  .lobby-status { margin-top: 8px; }
  .eyebrow { margin-bottom: 7px; }
  .map-panel { width: 106px; right: 9px; top: 9px; }
  .map-legend { display: none; }
  .touch-actions { bottom: 88px; }
}
