/* WARGRID — field-command interface */
@font-face { font-family: 'Saira Stencil One'; src: url('/fonts/saira-stencil-one-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --bg: #121510;
  --panel: rgba(28, 33, 26, 0.95);
  --panel-solid: #1f241c;
  --panel-2: #283023;
  --panel-3: #33402c;
  --line: rgba(235, 230, 214, 0.11);
  --line-2: rgba(235, 230, 214, 0.22);
  --ink: #ebe6d6;
  --ink-2: #bdb7a4;
  --ink-3: #8b8775;
  --signal: #e8b923;
  --signal-2: #f3cd52;
  --signal-ink: #1f1a08;
  --hostile: #d64533;
  --good: #7cae5a;
  --warn: #d9a42c;
  --r-s: 5px; --r: 9px; --r-l: 14px;
  --display: 'Saira Stencil One', 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --ui: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
body { overflow: hidden; touch-action: manipulation; }
#app { position: fixed; inset: 0; z-index: 2; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--signal); }
h1, h2, h3 { font-family: var(--ui); font-weight: 600; letter-spacing: 0.01em; margin: 0; line-height: 1.15; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.08rem; color: var(--ink-2); font-weight: 600; margin: 1.1rem 0 0.5rem; }
small { color: var(--ink-3); }
.hidden { display: none !important; }
.dim { color: var(--ink-3); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.row.gap { gap: 0.6rem; } .row.end { justify-content: flex-end; } .row.wrap { flex-wrap: wrap; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

.ico { display: inline-flex; width: 1.25em; height: 1.25em; flex: none; }
.ico svg { width: 100%; height: 100%; }
.ico.ok { color: var(--good); } .ico.bad { color: var(--hostile); }

/* ---------- buttons & inputs ---------- */
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 44px; padding: 0.45rem 1.05rem; border-radius: var(--r-s); border: 1px solid transparent; font-family: var(--ui); font-weight: 600; font-size: 1.08rem; letter-spacing: 0.02em; background: var(--panel-3); color: var(--ink); transition: background .15s, transform .08s, border-color .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--signal); color: var(--signal-ink); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.18); }
.btn.primary:hover { background: var(--signal-2); }
.btn.ghost { background: rgba(235,230,214,0.06); border-color: var(--line-2); }
.btn.ghost:hover { background: rgba(235,230,214,0.11); }
.btn.danger { background: var(--hostile); color: #fff4ef; }
.btn.danger-text { color: #f08a78; }
.btn.lg { min-height: 54px; font-size: 1.25rem; padding: 0.6rem 1.4rem; }
.btn.sm { min-height: 36px; padding: 0.25rem 0.7rem; font-size: 0.98rem; }
.btn.block { width: 100%; justify-content: flex-start; margin-top: 0.4rem; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r-s); border: 0; background: transparent; color: var(--ink); }
.icon-btn:hover { background: rgba(235,230,214,0.08); }
.icon-btn .ico { width: 24px; height: 24px; }
.badge { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--hostile); color: #fff; font: 700 12px/18px var(--ui); text-align: center; }
.input { width: 100%; min-height: 46px; padding: 0.55rem 0.8rem; border-radius: var(--r-s); border: 1px solid var(--line-2); background: rgba(10,12,9,0.55); color: var(--ink); outline: none; }
.input:focus { border-color: var(--signal); }
.input.sm { min-height: 38px; padding: 0.35rem 0.6rem; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2rem; }
.field { display: block; margin-bottom: 0.9rem; }
.field-label { display: block; font-family: var(--ui); font-weight: 600; color: var(--ink-2); font-size: 1rem; margin-bottom: 0.3rem; }
.field-hint { display: block; margin-top: 0.25rem; }
.seg { display: flex; gap: 3px; padding: 3px; border-radius: var(--r-s); background: rgba(10,12,9,0.55); border: 1px solid var(--line); flex-wrap: wrap; }
.seg-opt { flex: 1 1 auto; min-height: 40px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-2); font-family: var(--ui); font-weight: 600; font-size: 1.02rem; padding: 0 0.7rem; }
.seg-opt.on { background: var(--panel-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg-sm .seg-opt { min-height: 34px; font-size: 0.95rem; }
.switch { display: flex; align-items: center; gap: 0.8rem; padding: 0.55rem 0; cursor: pointer; }
.switch-text { flex: 1; display: flex; flex-direction: column; font-family: var(--ui); font-weight: 600; font-size: 1.04rem; }
.switch-input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { width: 46px; height: 26px; border-radius: 13px; background: rgba(235,230,214,0.15); position: relative; transition: background .15s; flex: none; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-2); transition: transform .15s, background .15s; }
.switch-input:checked + .switch-ui { background: var(--signal); }
.switch-input:checked + .switch-ui::after { transform: translateX(20px); background: var(--signal-ink); }
.switch-input:focus-visible + .switch-ui { outline: 2px solid var(--signal); outline-offset: 2px; }
input[type=range] { width: 100%; accent-color: var(--signal); }

/* ---------- toasts, modals ---------- */
.toasts { position: fixed; top: calc(var(--st) + 64px); left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { pointer-events: auto; display: flex; gap: 0.8rem; align-items: center; padding: 0.55rem 0.95rem; border-radius: var(--r-s); background: rgba(22,26,20,0.96); border: 1px solid var(--line-2); border-left: 4px solid var(--ink-3); font-family: var(--ui); font-weight: 500; font-size: 1.05rem; box-shadow: 0 6px 20px rgba(0,0,0,0.35); opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s; max-width: 100%; }
.toast.in { opacity: 1; transform: none; }
.toast-good { border-left-color: var(--good); } .toast-bad { border-left-color: var(--hostile); } .toast-warn { border-left-color: var(--warn); }
.toast-btn { border: 0; background: var(--signal); color: var(--signal-ink); border-radius: 4px; font-weight: 700; padding: 0.25rem 0.7rem; font-family: var(--ui); }
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(6,8,5,0.6); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; padding: 0 0 var(--sb); }
.modal-back.in { opacity: 1; }
.modal { width: min(100%, 520px); max-height: 88vh; overflow: auto; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--r-l) var(--r-l) 0 0; padding: 1.1rem 1.1rem calc(1.1rem + var(--sb)); transform: translateY(24px); transition: transform .22s; }
.modal-back.in .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.7rem; }
.confirm p { font-size: 1.05rem; margin: 0.2rem 0 1rem; }
@media (min-width: 700px) { .modal-back { align-items: center; } .modal { border-radius: var(--r-l); } }

/* ---------- menu screens ---------- */
.bg-map { position: fixed; inset: 0; z-index: 0; }
.bg-map canvas { width: 100%; height: 100%; display: block; }
.bg-shade { position: fixed; inset: 0; z-index: 1; background: radial-gradient(ellipse at 50% 30%, rgba(18,21,16,0.35), rgba(18,21,16,0.86) 70%), linear-gradient(180deg, rgba(18,21,16,0.2), rgba(18,21,16,0.75)); pointer-events: none; }
.screen { position: absolute; inset: 0; z-index: 2; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(var(--st) + 0.75rem) calc(var(--sr) + 1rem) calc(var(--sb) + 5.6rem) calc(var(--sl) + 1rem); }
.screen.no-nav { padding-bottom: calc(var(--sb) + 1.5rem); }
.col { max-width: 560px; margin: 0 auto; }
.col.wide { max-width: 760px; }
.topbar { display: flex; align-items: center; gap: 0.5rem; min-height: 48px; margin-bottom: 0.6rem; }
.topbar h1 { font-size: 1.6rem; flex: 1; }
.logo { font-family: var(--display); font-weight: 400; letter-spacing: 0.04em; line-height: 0.9; color: var(--ink); }
.logo-lg { font-size: clamp(3.2rem, 15vw, 5.6rem); }
.logo-sm { font-size: 1.7rem; }
.claim { font-family: var(--ui); font-weight: 500; font-size: 1.25rem; color: var(--signal); letter-spacing: 0.04em; margin-top: 0.4rem; }
.hero { padding: 6vh 0 1.4rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.panel + .panel { margin-top: 0.8rem; }
.panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.7rem; }
.panel-title h2 { font-size: 1.25rem; }
.stack { display: flex; flex-direction: column; gap: 0.6rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.home-head { display: flex; align-items: center; gap: 0.8rem; margin: 0.3rem 0 1.1rem; }
.home-head .logo { flex: 1; }
.me-chip { display: flex; align-items: center; gap: 0.55rem; padding: 0.3rem 0.65rem 0.3rem 0.35rem; border-radius: 30px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.me-chip .rank { font-family: var(--ui); font-size: 0.9rem; color: var(--ink-2); line-height: 1.1; }
.me-chip strong { font-family: var(--ui); font-size: 1.05rem; display: block; line-height: 1.1; }
.avatar { display: inline-flex; flex: none; }
.avatar svg { width: 100%; height: 100%; }
.big-action { display: flex; align-items: center; gap: 0.9rem; width: 100%; padding: 1rem 1.1rem; border-radius: var(--r); border: 0; background: var(--signal); color: var(--signal-ink); text-align: left; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.18); }
.big-action strong { font-family: var(--ui); font-weight: 700; font-size: 1.55rem; display: block; line-height: 1.05; }
.big-action span { font-size: 0.95rem; opacity: 0.8; }
.big-action .ico { width: 34px; height: 34px; }
.tile-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; padding: 0.85rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-align: left; min-height: 86px; }
.tile-btn:hover { border-color: var(--line-2); background: rgba(40,48,35,0.95); }
.tile-btn strong { font-family: var(--ui); font-weight: 600; font-size: 1.15rem; line-height: 1.1; }
.tile-btn small { font-size: 0.85rem; }
.tile-btn .ico { width: 26px; height: 26px; color: var(--signal); }
.match { display: flex; align-items: center; gap: 0.8rem; width: 100%; padding: 0.75rem 0.85rem; border-radius: var(--r-s); border: 1px solid var(--line); background: rgba(14,17,12,0.5); color: var(--ink); text-align: left; text-decoration: none; }
.match + .match { margin-top: 0.5rem; }
.match:hover { border-color: var(--line-2); }
.match.urgent { border-color: rgba(232,185,35,0.55); box-shadow: inset 4px 0 0 var(--signal); }
.match-main { flex: 1; min-width: 0; }
.match-main strong { font-family: var(--ui); font-weight: 600; font-size: 1.15rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-main small { display: block; }
.status { font-family: var(--ui); font-weight: 600; font-size: 0.95rem; padding: 0.15rem 0.5rem; border-radius: 4px; background: rgba(235,230,214,0.08); color: var(--ink-2); white-space: nowrap; }
.status.go { background: var(--signal); color: var(--signal-ink); }
.dots { display: flex; gap: 3px; margin-top: 0.3rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, #999); box-shadow: 0 0 0 1px rgba(0,0,0,0.4); }
.dot.lg { width: 14px; height: 14px; }
.dot.out { opacity: 0.3; }
.empty { color: var(--ink-3); margin: 0.4rem 0; }
.tabs-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center; background: rgba(16,19,14,0.96); border-top: 1px solid var(--line); padding: 0.3rem calc(var(--sr) + 0.5rem) calc(var(--sb) + 0.3rem) calc(var(--sl) + 0.5rem); backdrop-filter: blur(8px); }
.tabs-nav a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0.35rem 0; color: var(--ink-3); text-decoration: none; font-family: var(--ui); font-weight: 600; font-size: 0.88rem; }
.tabs-nav a .ico { width: 24px; height: 24px; }
.tabs-nav a.on { color: var(--signal); }
.auth-box { margin-top: 2vh; }
.auth-switch { background: none; border: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; padding: 0.6rem 0; }
.err { color: #f0907c; font-size: 0.95rem; min-height: 1.3em; margin: 0.2rem 0 0.4rem; }
.divider { display: flex; align-items: center; gap: 0.7rem; color: var(--ink-3); font-family: var(--ui); margin: 0.9rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.opt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.5rem; }
.opt-card { text-align: left; padding: 0.7rem 0.75rem; border-radius: var(--r-s); border: 1px solid var(--line); background: rgba(10,12,9,0.45); color: var(--ink); }
.opt-card strong { font-family: var(--ui); font-weight: 600; font-size: 1.08rem; display: block; }
.opt-card small { display: block; line-height: 1.3; margin-top: 0.15rem; }
.opt-card.on { border-color: var(--signal); background: rgba(232,185,35,0.1); box-shadow: inset 0 0 0 1px var(--signal); }
.stepper { display: flex; align-items: center; gap: 0.4rem; }
.stepper button { width: 44px; height: 44px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: rgba(235,230,214,0.06); font-size: 1.3rem; }
.stepper output { min-width: 2.6rem; text-align: center; font-family: var(--ui); font-weight: 700; font-size: 1.5rem; }
.sticky-cta { position: sticky; bottom: 0; padding: 0.8rem 0 0.2rem; background: linear-gradient(transparent, var(--bg) 40%); margin-top: 0.8rem; }
.sticky-cta .btn { width: 100%; }
.slot { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.7rem; border-radius: var(--r-s); border: 1px solid var(--line); background: rgba(10,12,9,0.45); }
.slot + .slot { margin-top: 0.45rem; }
.slot .swatch { width: 10px; align-self: stretch; border-radius: 3px; background: var(--c); flex: none; }
.slot-name { flex: 1; min-width: 0; }
.slot-name strong { font-family: var(--ui); font-weight: 600; font-size: 1.12rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot.open { border-style: dashed; }
.slot.open .slot-name strong { color: var(--ink-3); }
.slot select { width: auto; min-height: 36px; }
.ready-tag { font-family: var(--ui); font-weight: 600; font-size: 0.92rem; color: var(--ink-3); }
.ready-tag.on { color: var(--good); }
.invite { display: grid; grid-template-columns: 1fr auto; gap: 0.8rem; align-items: center; }
.code-big { font-family: var(--display); font-size: 2.2rem; letter-spacing: 0.12em; color: var(--signal); line-height: 1; }
.qr { width: 108px; height: 108px; border-radius: 6px; background: #e9e4d4; padding: 4px; }
.share-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }
.lb-row { display: grid; grid-template-columns: 2.4rem 34px 1fr auto; align-items: center; gap: 0.6rem; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.lb-row.me { background: rgba(232,185,35,0.08); }
.lb-pos { font-family: var(--ui); font-weight: 700; font-size: 1.15rem; color: var(--ink-3); text-align: right; }
.lb-row:nth-child(-n+3) .lb-pos { color: var(--signal); }
.lb-rating { font-family: var(--ui); font-weight: 700; font-size: 1.2rem; text-align: right; }
.lb-rating small { display: block; font-weight: 500; font-size: 0.8rem; }
.profile-top { display: flex; align-items: center; gap: 1rem; }
.profile-top .avatar { width: 76px; height: 76px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 0.9rem; }
.kpi { padding: 0.6rem; border-radius: var(--r-s); background: rgba(10,12,9,0.45); border: 1px solid var(--line); }
.kpi strong { display: block; font-family: var(--ui); font-weight: 700; font-size: 1.6rem; line-height: 1; }
.kpi small { font-size: 0.82rem; line-height: 1.2; display: block; margin-top: 0.2rem; }
.rank-line { font-family: var(--ui); font-weight: 600; color: var(--signal); font-size: 1.05rem; }
.avatar-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.4rem; }
.avatar-pick button { border: 1px solid var(--line); border-radius: var(--r-s); background: rgba(10,12,9,0.45); padding: 0.35rem; aspect-ratio: 1; }
.avatar-pick button.on { border-color: var(--signal); box-shadow: inset 0 0 0 1px var(--signal); }
.avatar-pick .avatar { width: 100%; height: 100%; }

/* ---------- game ---------- */
.game { position: fixed; inset: 0; overflow: hidden; background: var(--bg); user-select: none; -webkit-user-select: none; }
.game canvas.map { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.hud-top { position: absolute; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; gap: 0.4rem; padding: calc(var(--st) + 6px) calc(var(--sr) + 8px) 6px calc(var(--sl) + 6px); background: linear-gradient(180deg, rgba(14,17,12,0.92), rgba(14,17,12,0.72)); border-bottom: 1px solid var(--line); }
.hud-turn { display: flex; align-items: baseline; gap: 0.55rem; position: relative; padding: 0.15rem 0.2rem 0.4rem; min-width: 0; }
.hud-turn-n { font-family: var(--ui); font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.hud-timer { font-family: var(--ui); font-weight: 600; font-size: 1.05rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hud-timer-bar { position: absolute; left: 0.2rem; right: 0.2rem; bottom: 0; height: 3px; background: rgba(235,230,214,0.1); border-radius: 2px; overflow: hidden; }
.hud-timer-bar span { display: block; height: 100%; width: 0; background: var(--ink-2); transition: width .25s linear; }
.hud-turn.urgent .hud-timer { color: #ff8a6a; }
.hud-turn.urgent .hud-timer-bar span { background: var(--hostile); }
.hud-pips { display: flex; gap: 5px; align-items: center; flex: 1; justify-content: center; border: 0; background: none; padding: 0.4rem; min-height: 44px; overflow: hidden; }
.pip { position: relative; width: 18px; height: 18px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px rgba(0,0,0,0.5); display: inline-flex; align-items: center; justify-content: center; color: #111; flex: none; }
.pip.me { box-shadow: 0 0 0 2px rgba(0,0,0,0.5), 0 0 0 4px var(--ink); }
.pip.dead { opacity: 0.25; }
.pip .ico { width: 12px; height: 12px; }
.pip .ico svg { stroke-width: 3.2; }
.hud-top-right { display: flex; }
.minimap { position: absolute; z-index: 9; top: calc(var(--st) + 62px); right: calc(var(--sr) + 8px); padding: 3px; background: rgba(14,17,12,0.85); border: 1px solid var(--line-2); border-radius: var(--r-s); }
.minimap canvas { display: block; border-radius: 3px; cursor: pointer; touch-action: none; }
.hud-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; padding: 0 calc(var(--sr) + 8px) calc(var(--sb) + 8px) calc(var(--sl) + 8px); pointer-events: none; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.hud-bottom > * { pointer-events: auto; }
.hud-actions { display: flex; gap: 8px; justify-content: space-between; align-items: stretch; }
.hud-next { background: rgba(20,24,18,0.92); min-height: 52px; }
.hud-next .count { font-family: var(--ui); font-weight: 700; background: var(--panel-3); border-radius: 10px; padding: 0 0.45rem; font-size: 0.95rem; }
.hud-end { min-height: 52px; min-width: 46%; font-size: 1.22rem; flex-direction: column; gap: 0; line-height: 1.05; }
.hud-end small { color: inherit; opacity: 0.7; font-size: 0.85rem; font-weight: 600; }
.hud-end.waiting { background: rgba(20,24,18,0.94); color: var(--ink); border: 1px solid var(--line-2); box-shadow: none; }
.group-bar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.group-bar::-webkit-scrollbar { display: none; }
.chip-btn { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 36px; padding: 0.2rem 0.65rem; border-radius: 18px; border: 1px solid var(--line-2); background: rgba(20,24,18,0.92); color: var(--ink); font-family: var(--ui); font-weight: 600; white-space: nowrap; }
.chip-btn.on { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); }
.chip-btn.ghost { border-style: dashed; color: var(--ink-2); }
.chip-btn .count { font-size: 0.85rem; opacity: 0.7; }
.sheet { max-height: 46vh; overflow-y: auto; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 -6px 26px rgba(0,0,0,0.35); animation: sheetIn .18s ease-out; backdrop-filter: blur(6px); }
@keyframes sheetIn { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.card { padding: 0.6rem 0.75rem 0.7rem; }
.card.compact { padding: 0.6rem 0.75rem; }
.card-head { display: flex; align-items: center; gap: 0.7rem; }
.card-row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.card-title { flex: 1; min-width: 0; }
.title-line { display: flex; align-items: center; gap: 0.45rem; }
.title-line strong { font-family: var(--ui); font-weight: 700; font-size: 1.25rem; line-height: 1.1; }
.sub { color: var(--ink-3); font-size: 0.9rem; display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.sub .dot { width: 8px; height: 8px; }
.tag { font-family: var(--ui); font-weight: 600; font-size: 0.8rem; padding: 0.05rem 0.4rem; border-radius: 3px; background: var(--signal); color: var(--signal-ink); }
.vet { color: var(--signal); font-weight: 700; font-family: var(--ui); letter-spacing: -0.1em; font-size: 1.2rem; }
.u-ico-wrap { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle, rgba(235,230,214,0.12), rgba(235,230,214,0.03)); box-shadow: inset 0 0 0 2px var(--c); display: flex; align-items: center; justify-content: center; flex: none; }
.u-ico { width: 40px; height: 40px; display: block; }
.u-ico.sm { width: 36px; height: 36px; }
.hp { width: 82px; text-align: right; flex: none; }
.hp-bar { height: 7px; border-radius: 4px; background: rgba(235,230,214,0.12); overflow: hidden; }
.hp-bar span { display: block; height: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.45rem; }
.chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.5rem; border-radius: 4px; background: rgba(235,230,214,0.07); font-family: var(--ui); font-weight: 600; font-size: 0.98rem; }
.chip .ico { width: 16px; height: 16px; color: var(--ink-3); }
.note { margin: 0.5rem 0 0; font-size: 0.9rem; color: var(--ink-2); }
.note.warn { color: #f0a86c; }
.card-actions { display: flex; gap: 0.45rem; margin-top: 0.6rem; justify-content: flex-end; }
.card-row .card-actions { margin-top: 0; }
.card-actions.wrap { flex-wrap: wrap; justify-content: flex-start; }
.cargo { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.6rem; }
.cargo .label { font-family: var(--ui); font-weight: 600; color: var(--ink-2); margin-right: 0.2rem; }
.cargo-item { display: inline-flex; flex-direction: column; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-s); background: rgba(10,12,9,0.45); padding: 2px 4px; }
.cargo-item .u-ico { width: 34px; height: 34px; }
.cargo-item small { font-size: 0.72rem; line-height: 1; min-height: 0.72rem; }
.city-flag { width: 42px; height: 42px; border-radius: 8px; background: var(--c); color: rgba(20,20,14,0.85); display: flex; align-items: center; justify-content: center; flex: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2); }
.city-flag .ico { width: 24px; height: 24px; }
.city-flag.sm { width: 36px; height: 36px; }
.prod-now { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; padding: 0.35rem 0.45rem; border-radius: var(--r-s); background: rgba(10,12,9,0.45); }
.prod-info { flex: 1; min-width: 0; line-height: 1.15; }
.prod-info strong { font-family: var(--ui); font-weight: 600; }
.prod-bar { height: 6px; border-radius: 3px; background: rgba(235,230,214,0.12); overflow: hidden; margin: 3px 0; }
.prod-bar span { display: block; height: 100%; background: var(--signal); }
.mini-toggle { display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--ui); font-weight: 600; color: var(--ink-2); }
.mini-toggle input { accent-color: var(--signal); width: 18px; height: 18px; }
.build-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 0.3rem; margin-top: 0.5rem; }
.build { display: flex; flex-direction: column; align-items: center; padding: 0.25rem 0.15rem; border-radius: var(--r-s); border: 1px solid var(--line); background: rgba(10,12,9,0.45); color: var(--ink); min-height: 64px; }
.build.on { border-color: var(--signal); background: rgba(232,185,35,0.12); }
.build .u-ico { width: 32px; height: 32px; }
.b-name { font-family: var(--ui); font-weight: 600; font-size: 0.78rem; line-height: 1.05; text-align: center; overflow-wrap: anywhere; }
.b-turns { font-family: var(--ui); font-size: 0.8rem; color: var(--ink-3); }
.fc { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.fc-side { display: flex; flex-direction: column; align-items: center; min-width: 0; flex: 1; }
.fc-side strong { font-family: var(--ui); font-weight: 600; font-size: 1rem; line-height: 1.1; text-align: center; }
.fc-mid .ico { width: 30px; height: 30px; color: var(--hostile); }
.fc-rows { margin-top: 0.4rem; border-top: 1px solid var(--line); }
.fc-row { display: flex; justify-content: space-between; padding: 0.28rem 0.1rem; border-bottom: 1px solid var(--line); font-family: var(--ui); font-size: 1.02rem; }
.fc-row span { color: var(--ink-2); }
.fc-row strong.good { color: #a6d47e; } .fc-row strong.bad { color: #f08a78; }
.scrim { position: absolute; inset: 0; z-index: 20; background: rgba(6,8,5,0.5); }
.drawer { position: absolute; top: 0; bottom: 0; z-index: 21; width: min(88vw, 360px); background: var(--panel-solid); border: 1px solid var(--line-2); display: flex; flex-direction: column; padding: calc(var(--st) + 0.7rem) 0.9rem calc(var(--sb) + 0.8rem); transition: transform .22s ease; overflow-y: auto; }
.drawer-left { left: 0; transform: translateX(-104%); padding-left: calc(var(--sl) + 0.9rem); }
.drawer-right { right: 0; transform: translateX(104%); padding-right: calc(var(--sr) + 0.9rem); }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem; }
.drawer-foot { margin-top: auto; padding-top: 1rem; }
.plist { display: flex; flex-direction: column; gap: 0.3rem; }
.prow { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.5rem; border-radius: var(--r-s); border: 1px solid var(--line); background: rgba(10,12,9,0.4); text-align: left; color: var(--ink); }
.prow.dead { opacity: 0.45; }
.prow strong { font-family: var(--ui); font-weight: 600; display: block; line-height: 1.1; }
.prow small { display: block; font-size: 0.82rem; }
.pstat { display: inline-flex; align-items: center; gap: 0.15rem; font-family: var(--ui); font-weight: 600; color: var(--ink-2); }
.pstat .ico { width: 15px; height: 15px; }
.glist { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chat-list { flex: 1; overflow-y: auto; margin: 0.6rem 0; display: flex; flex-direction: column; gap: 0.35rem; min-height: 120px; }
.msg { font-size: 0.95rem; line-height: 1.35; padding: 0.35rem 0.5rem; border-radius: var(--r-s); background: rgba(235,230,214,0.05); word-wrap: break-word; }
.msg.mine { background: rgba(232,185,35,0.09); }
.msg-name { font-family: var(--ui); font-weight: 700; margin-right: 0.4rem; }
.msg-ch { font-family: var(--ui); font-size: 0.75rem; padding: 0 0.3rem; border-radius: 3px; background: rgba(235,230,214,0.12); margin-right: 0.35rem; color: var(--ink-2); }
.msg.sys { display: flex; gap: 0.4rem; color: var(--ink-2); background: transparent; font-size: 0.9rem; padding: 0.2rem 0.3rem; }
.msg.sys .ico { width: 16px; height: 16px; color: var(--signal); margin-top: 2px; }
.chat-form { display: flex; gap: 0.4rem; }
.chat-form select { width: 34%; }
.chat-form .btn { width: 48px; padding: 0; }
.cinema { position: absolute; inset: 0; z-index: 15; pointer-events: none; }
.cinema .bar { position: absolute; left: 0; right: 0; height: 9vh; background: #070806; transition: transform .3s ease; }
.cinema .bar.top { top: 0; transform: translateY(-100%); }
.cinema .bar.bottom { bottom: 0; transform: translateY(100%); }
.cinema.on .bar { transform: none; }
.cine-cap { position: absolute; left: 0; right: 0; bottom: calc(9vh + 1rem); text-align: center; opacity: 0; transition: opacity .25s; }
.cinema.on .cine-cap { opacity: 1; }
.cine-title { font-family: var(--display); font-size: clamp(1.8rem, 7vw, 2.8rem); color: var(--ink); text-shadow: 0 2px 12px rgba(0,0,0,0.8); letter-spacing: 0.05em; }
.cine-sub { font-family: var(--ui); font-weight: 600; font-size: 1.15rem; color: var(--signal); text-shadow: 0 1px 6px rgba(0,0,0,0.9); }
.turn-banner { position: absolute; top: 34%; left: 0; right: 0; z-index: 14; text-align: center; font-family: var(--display); font-size: clamp(2.4rem, 11vw, 4rem); color: var(--ink); text-shadow: 0 3px 16px rgba(0,0,0,0.8); opacity: 0; pointer-events: none; }
.turn-banner.show { animation: banner 1.6s ease-out; }
@keyframes banner { 0% { opacity: 0; transform: scale(1.12); letter-spacing: 0.3em; } 18% { opacity: 1; transform: none; letter-spacing: 0.08em; } 70% { opacity: 1; } 100% { opacity: 0; } }
.ctx { position: fixed; z-index: 30; width: min(92vw, 300px); background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--r); padding: 0.6rem; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.ctx-title { font-family: var(--ui); font-weight: 600; color: var(--ink-3); font-size: 0.9rem; margin: 0 0 0.4rem 0.2rem; }
.ctx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35rem; }
.ctx-ping { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.5rem 0.2rem; border-radius: var(--r-s); border: 1px solid var(--line); background: rgba(10,12,9,0.45); color: var(--ink); font-family: var(--ui); font-weight: 600; font-size: 0.92rem; }
.ctx-ping .ico { width: 24px; height: 24px; }
.ping-attack .ico, .ping-danger .ico { color: #ff6a4d; } .ping-defend .ico { color: #6aa8ff; } .ping-recon .ico, .ping-move .ico, .ping-support .ico { color: var(--signal); }
.ctx-list { display: flex; flex-direction: column; margin-top: 0.4rem; }
.ctx-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.4rem; border: 0; border-radius: var(--r-s); background: none; color: var(--ink); text-align: left; font-family: var(--ui); font-weight: 600; font-size: 1.02rem; }
.ctx-item:hover { background: rgba(235,230,214,0.07); }
.gameover { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, rgba(10,12,8,0.55), rgba(6,7,5,0.92)); padding: 1rem; animation: fadeIn .5s; }
@keyframes fadeIn { from { opacity: 0; } }
.go-box { text-align: center; width: min(100%, 440px); }
.go-title { font-family: var(--display); font-size: clamp(3.4rem, 18vw, 6rem); line-height: 1; letter-spacing: 0.04em; color: var(--ink); text-shadow: 0 4px 24px rgba(0,0,0,0.7); }
.gameover.win .go-title { color: var(--signal); }
.go-reason { font-family: var(--ui); font-size: 1.2rem; color: var(--ink-2); margin: 0.4rem 0 1.2rem; }
.go-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; margin-bottom: 1.3rem; }
.stat strong { display: block; font-family: var(--ui); font-weight: 700; font-size: 1.8rem; line-height: 1; }
.stat small { font-size: 0.8rem; }
.go-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.go-lesson { color: var(--ink-3); margin-top: 1.2rem; font-family: var(--ui); font-size: 1.05rem; }
.tut { position: absolute; z-index: 12; left: calc(var(--sl) + 8px); right: calc(var(--sr) + 8px); top: calc(var(--st) + 62px); max-width: 480px; margin: 0 auto; background: var(--panel); border: 1px solid rgba(232,185,35,0.55); border-radius: var(--r); padding: 0.7rem 0.8rem; display: flex; gap: 0.7rem; align-items: flex-start; box-shadow: 0 8px 22px rgba(0,0,0,0.4); }
.tut-n { font-family: var(--display); font-size: 1.6rem; color: var(--signal); line-height: 1; min-width: 1.4rem; }
.tut p { margin: 0; font-size: 0.98rem; }
.tut .tut-steps { display: flex; gap: 4px; margin-top: 0.4rem; }
.tut .tut-steps span { width: 18px; height: 4px; border-radius: 2px; background: rgba(235,230,214,0.18); }
.tut .tut-steps span.done { background: var(--signal); }
.loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem; color: var(--ink-2); font-family: var(--ui); z-index: 3; }
.loading .logo { font-size: 3rem; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(235,230,214,0.15); border-top-color: var(--signal); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.net-off { position: fixed; z-index: 95; top: calc(var(--st) + 4px); left: 50%; transform: translateX(-50%); padding: 0.25rem 0.8rem; border-radius: 14px; background: var(--hostile); color: #fff; font-family: var(--ui); font-weight: 600; display: flex; gap: 0.4rem; align-items: center; }
.net-off .ico { width: 16px; height: 16px; }

/* summary */
.sum-head { text-align: center; padding: 1rem 0 0.6rem; }
.sum-head .go-title { font-size: clamp(2.6rem, 13vw, 4.2rem); }
.front-wrap { position: relative; border-radius: var(--r-s); overflow: hidden; border: 1px solid var(--line-2); background: #0e110c; }
.front-wrap canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.front-ctrl { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.6rem; }
.front-ctrl output { font-family: var(--ui); font-weight: 700; min-width: 4.5rem; text-align: right; }
.chart { width: 100%; height: 150px; display: block; margin-top: 0.6rem; }
.res-table { width: 100%; border-collapse: collapse; font-family: var(--ui); font-size: 1rem; }
.res-table th { text-align: right; font-weight: 600; color: var(--ink-3); padding: 0.35rem 0.3rem; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.res-table th:first-child, .res-table td:first-child { text-align: left; }
.res-table td { text-align: right; padding: 0.4rem 0.3rem; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.res-table tr.me td { background: rgba(232,185,35,0.07); }
.table-scroll { overflow-x: auto; }
.place { font-weight: 700; color: var(--ink-3); margin-right: 0.3rem; }
.win-tag { color: var(--signal); }

@media (min-width: 900px) {
  .hud-bottom { left: auto; width: 440px; }
  .screen { padding-top: calc(var(--st) + 1.5rem); }
}
@media (orientation: landscape) and (max-height: 520px) {
  .sheet { max-height: 62vh; }
  .hud-bottom { left: auto; width: min(440px, 60vw); }
  .minimap { display: none; }
}

.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.sm .ico { width: 20px; height: 20px; }
.mini-toggle .ico { width: 18px; height: 18px; }
@media (max-width: 420px) { .sheet .note { font-size: 0.85rem; } .title-line strong { font-size: 1.12rem; } }
.game .hud-top, .game .hud-bottom, .game .tut, .game .minimap { transition: opacity .25s; }
.game.cine-on .hud-top, .game.cine-on .hud-bottom, .game.cine-on .tut, .game.cine-on .minimap { opacity: 0; pointer-events: none; }
