/* Warbot — game client UI. Dark by design. */

:root {
  --bg: #05070b;
  --bg-2: #0a0e15;
  --glass: rgba(14, 20, 30, 0.74);
  --glass-2: rgba(22, 30, 44, 0.82);
  --glass-hi: rgba(32, 42, 60, 0.9);
  --line: rgba(130, 160, 200, 0.14);
  --line-2: rgba(130, 160, 200, 0.26);
  --text: #e8eef7;
  --muted: #8d9cb1;
  --dim: #5c6a7e;
  --accent: #ff6b2c;
  --accent-2: #ffb02e;
  --accent-ink: #1a0b03;
  --cyan: #38d6f0;
  --good: #34d399;
  --bad: #fb7185;
  --k-move: #38bdf8;
  --k-fire: #ff7a3d;
  --k-ability: #a78bfa;
  --cut: 10px;
  --display: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --top: 60px;
  --gutter: clamp(14px, 2.4vw, 28px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font: 400 14px/1.5 var(--body);
  background:
    radial-gradient(1100px 620px at 78% -12%, rgba(255, 107, 44, 0.09), transparent 60%),
    radial-gradient(900px 640px at -10% 110%, rgba(56, 214, 240, 0.06), transparent 60%),
    linear-gradient(rgba(130, 160, 200, 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(130, 160, 200, 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}
img, svg, canvas { display: block; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: 0.02em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
h1:focus, h2:focus { outline: none; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; font-weight: 600; }
.skip-link:focus { top: 12px; }

.muted { color: var(--muted); }
.eyebrow { font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent-2); }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico-sm { width: 14px; height: 14px; }
.cut { clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 24px; padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(5, 7, 11, 0.94), rgba(5, 7, 11, 0.78));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
body[data-view="home"] .topbar, body[data-view="arena"] .topbar { display: none; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: 0.18em; }
.brand-mark { width: 28px; height: 28px; }
.brand-mark rect:nth-child(1) { fill: var(--accent); }
.brand-mark rect:nth-child(2), .brand-mark rect:nth-child(3) { fill: #2a3547; }
.brand-mark circle { fill: #1a0b03; stroke: var(--accent-2); stroke-width: 2; }
.brand-mark rect:nth-child(5) { fill: var(--accent-2); }
.nav { display: flex; height: 100%; gap: 4px; margin-right: auto; }
.nav a {
  position: relative; display: grid; place-items: center; padding: 0 18px; text-decoration: none;
  font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.coin-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 9px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 176, 46, 0.16), rgba(255, 176, 46, 0.06)); border: 1px solid rgba(255, 176, 46, 0.35);
  font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; color: #ffd28a; white-space: nowrap;
}
.coin-chip .ico { color: var(--accent-2); }
.pilot-chip {
  display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 6px; text-decoration: none;
  background: var(--glass-2); border: 1px solid var(--line); border-radius: 999px;
}
.pilot-chip:hover { border-color: var(--line-2); }
.pc-text { display: grid; line-height: 1.15; }
.pc-text b { font-family: var(--display); font-size: 13px; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-text small { font-size: 11px; color: var(--accent-2); letter-spacing: 0.06em; }

/* ---------- buttons & inputs ---------- */

.btn {
  --cut: 9px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border: 0; cursor: pointer; white-space: nowrap; text-decoration: none;
  font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: background 0.15s, color 0.15s, filter 0.15s, transform 0.1s;
}
.btn:focus-visible { outline-offset: -4px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #ff8a4a, var(--accent) 55%, #e8561c); color: var(--accent-ink); }
.btn-primary::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%);
  transform: translateX(-110%); transition: transform 0.55s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08) drop-shadow(0 0 12px rgba(255, 107, 44, 0.6)); }
.btn-primary:hover:not(:disabled)::after { transform: translateX(110%); }
.btn-ghost { background: var(--glass-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: var(--glass-hi); box-shadow: inset 0 0 0 1px rgba(255, 176, 46, 0.5); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; --cut: 7px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 14px; --cut: 11px; }
.btn-xl { height: 58px; padding: 0 34px; font-size: 18px; letter-spacing: 0.16em; --cut: 13px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--glass-2); font-size: 18px; line-height: 1;
}
.icon-btn:hover:not(:disabled) { background: var(--glass-hi); border-color: rgba(255, 176, 46, 0.5); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.icon-btn-sm { width: 28px; height: 28px; border-radius: 7px; }
.icon-btn-sm .ico { width: 14px; height: 14px; }
.icon-btn-lg { width: 48px; height: 48px; border-radius: 10px; }
.icon-btn.danger:hover:not(:disabled) { color: var(--bad); border-color: var(--bad); }
.link-btn { background: none; border: 0; padding: 4px 6px; color: var(--accent-2); font-weight: 600; font-size: 12px; cursor: pointer; border-radius: 6px; }
.link-btn:hover { background: var(--glass-hi); }

.input { height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(5, 8, 12, 0.7); min-width: 0; }
.input:hover { border-color: rgba(130, 160, 200, 0.4); }
.input:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 0; border-color: transparent; }
select.input {
  padding-right: 28px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat;
}
select.input option, select.input optgroup { background: #0e141e; color: var(--text); }
.input-num { width: 70px; padding: 0 8px; text-align: right; font-variant-numeric: tabular-nums; }
.field { display: grid; gap: 6px; min-width: 0; }
.field small { font-size: 12px; }
.field-label { font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: rgba(5, 8, 12, 0.7); border: 1px solid var(--line-2); border-radius: 10px; }
.seg-full { display: flex; }
.seg-full .seg { flex: 1; justify-content: center; }
.seg {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.seg:hover:not(:disabled) { color: var(--text); background: var(--glass-2); }
.seg[aria-pressed="true"], .seg[aria-checked="true"], .seg[aria-selected="true"] { background: var(--glass-hi); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2), inset 0 -2px 0 var(--accent); }

.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 4px; vertical-align: middle;
  font-family: var(--display); font-weight: 700; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  background: rgba(255, 176, 46, 0.16); color: var(--accent-2);
}
.tag-boss { background: rgba(255, 107, 44, 0.18); color: var(--accent); margin-left: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 5px; background: rgba(5, 8, 12, 0.6); border: 1px solid var(--line); font-size: 12px; color: #c4cfdd; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; display: inline-block; box-shadow: 0 0 10px var(--c, var(--accent)); }
.progress { height: 6px; background: rgba(130, 160, 200, 0.14); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; width: calc(var(--p) * 100%); background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 10px var(--accent); }

.panel {
  position: relative; padding: 16px;
  background: linear-gradient(180deg, rgba(20, 28, 40, 0.78), rgba(11, 16, 24, 0.78));
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.panel-aside { color: var(--muted); font-size: 12px; }
.points { color: var(--accent-2); font-family: var(--display); font-weight: 600; letter-spacing: 0.06em; }
.points.spent { color: var(--muted); }
.col-title { font-size: 24px; letter-spacing: 0.16em; text-transform: uppercase; display: flex; align-items: baseline; gap: 10px; }
.col-count { font-size: 13px; color: var(--muted); letter-spacing: 0.08em; }

/* ---------- world overlay labels ---------- */

.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.lbl { position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 3px; will-change: transform; }
.lbl-name { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: 0.06em; color: #fff; text-shadow: 0 1px 3px #000, 0 0 10px rgba(0, 0, 0, 0.8); white-space: nowrap; }
.lbl-hp { width: 46px; height: 5px; background: rgba(0, 0, 0, 0.7); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 2px; overflow: hidden; }
.lbl-hp i { display: block; height: 100%; width: calc(var(--hp, 1) * 100%); background: var(--c); box-shadow: 0 0 8px var(--c); }
.labels.compact .lbl-name { display: none; }
.labels.compact .lbl-hp { width: 30px; height: 4px; }
.ftxt { position: absolute; left: 0; top: 0; font-family: var(--display); font-weight: 700; font-size: 15px; text-shadow: 0 1px 3px #000, 0 0 8px rgba(0, 0, 0, 0.9); will-change: transform, opacity; }

/* ---------- main menu ---------- */

.view-menu { position: relative; height: 100dvh; overflow: hidden; isolation: isolate; }
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.stage-canvas.flat { inset: auto; left: 50%; top: 50%; width: max(100%, 150dvh); height: auto; aspect-ratio: 3 / 2; transform: translate(-50%, -50%); }
.menu-shade {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 75% at 50% 48%, rgba(5, 7, 11, 0.86) 0%, rgba(5, 7, 11, 0.62) 45%, rgba(5, 7, 11, 0.18) 78%, rgba(5, 7, 11, 0.4) 100%),
    linear-gradient(0deg, rgba(5, 7, 11, 0.85) 0%, transparent 26%);
}
.menu {
  position: relative; z-index: 3; height: 100%; width: min(680px, 100%); margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; padding: 40px 20px; text-align: center;
}
.menu-brand { display: grid; justify-items: center; }
.logo {
  margin-top: 10px; font-size: clamp(64px, 10vw, 136px); font-weight: 700; line-height: 0.86; letter-spacing: 0.02em;
  text-shadow: 0 0 40px rgba(255, 107, 44, 0.18), 0 6px 0 rgba(0, 0, 0, 0.5);
}
.logo span { color: var(--accent); text-shadow: 0 0 34px rgba(255, 107, 44, 0.55), 0 6px 0 rgba(80, 20, 0, 0.6); }
.tagline { margin-top: 16px; font-size: 17px; color: #c4cfdd; letter-spacing: 0.02em; }
.menu-list { display: grid; gap: 2px; justify-items: center; }
.menu-item {
  position: relative; display: grid; justify-items: center; padding: 9px 34px 11px; text-decoration: none; cursor: pointer;
  background: transparent; border: 0; border-radius: 10px; transition: background 0.2s, transform 0.2s;
}
.menu-item::after {
  content: ''; position: absolute; left: 50%; bottom: 3px; width: 0; height: 2px; transform: translateX(-50%);
  background: var(--accent); box-shadow: 0 0 12px var(--accent); transition: width 0.2s;
}
.menu-item:hover, .menu-item:focus-visible { background: radial-gradient(ellipse at center, rgba(255, 107, 44, 0.18), transparent 72%); transform: scale(1.05); outline: none; }
.menu-item:hover::after, .menu-item:focus-visible::after { width: 56%; }
.mi-t { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.1; }
.mi-d { font-size: 13px; color: var(--muted); }
.menu-item.is-primary .mi-t { color: var(--accent); text-shadow: 0 0 22px rgba(255, 107, 44, 0.45); }
.menu-coins { position: absolute; top: 20px; right: var(--gutter); z-index: 3; }
.domain-sale {
  position: absolute; right: var(--gutter); bottom: 20px; z-index: 3; display: grid; justify-items: end; gap: 2px; text-decoration: none;
  padding: 10px 16px; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; backdrop-filter: blur(10px);
  transition: border-color 0.15s, background 0.15s;
}
.domain-sale:hover, .domain-sale:focus-visible { border-color: rgba(255, 176, 46, 0.6); background: var(--glass-2); }
.ds-k { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ds-t { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 0.06em; color: var(--accent-2); }

/* ---------- battle select ---------- */

.view-play { min-height: calc(100dvh - var(--top)); }
.play { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--gutter); padding: var(--gutter); max-width: 1500px; margin: 0 auto; }
.play-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--top) + var(--gutter)); align-self: start; }
.modes { display: grid; gap: 8px; }
.mode {
  --cut: 12px; display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-align: left; cursor: pointer; border: 0;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--line);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: background 0.15s, box-shadow 0.15s;
}
.mode:focus-visible { outline-offset: -4px; }
.mode:hover { background: var(--glass-2); }
.mode[aria-selected="true"] { background: linear-gradient(90deg, rgba(255, 107, 44, 0.22), rgba(20, 28, 40, 0.8)); box-shadow: inset 0 0 0 1px rgba(255, 107, 44, 0.6), inset 3px 0 0 var(--accent); }
.mode-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: rgba(5, 8, 12, 0.6); color: var(--accent-2); flex: none; }
.mode[aria-selected="true"] .mode-ico { color: var(--accent-ink); background: var(--accent); box-shadow: 0 0 18px rgba(255, 107, 44, 0.6); }
.mode-text { display: grid; }
.mode-text b { font-family: var(--display); font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; }
.mode-text small { color: var(--muted); font-size: 12px; }
.pilot-box { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; }
.pilot-field { display: grid; gap: 4px; flex: 1; min-width: 0; }
.pilot-field .input { width: 100%; }
.play-main { min-width: 0; }
.panel-body { display: grid; gap: 18px; }
.pm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pm-head h2 { font-size: clamp(28px, 3.4vw, 40px); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }
.pm-progress { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.pm-progress .progress { width: 200px; }

.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.card {
  --cut: 12px; position: relative; width: 100%; display: grid; justify-items: center; gap: 6px; padding: 14px 10px 12px; cursor: pointer; border: 0; text-align: center;
  background: linear-gradient(180deg, rgba(24, 33, 48, 0.85), rgba(10, 14, 21, 0.85)); box-shadow: inset 0 0 0 1px var(--line);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}
.card:focus-visible { outline-offset: -4px; }
.card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line-2); }
.card[aria-pressed="true"] { background: linear-gradient(180deg, rgba(255, 107, 44, 0.22), rgba(12, 16, 24, 0.9)); box-shadow: inset 0 0 0 1px var(--accent), inset 0 -3px 0 var(--accent); }
.card.locked .bot-canvas { filter: grayscale(1) brightness(0.45); }
.card.locked .card-name { color: var(--dim); }
.card-num {
  position: absolute; top: 8px; left: 10px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 5px;
  font-family: var(--display); font-weight: 700; font-size: 12px; background: rgba(5, 8, 12, 0.7); color: var(--muted);
}
.card.done .card-num { color: var(--good); background: rgba(52, 211, 153, 0.15); }
.card.next .card-num { color: var(--accent-ink); background: var(--accent); box-shadow: 0 0 12px rgba(255, 107, 44, 0.6); }
.card-name { font-family: var(--display); font-size: 15px; letter-spacing: 0.04em; }
.card .tag-boss { margin: 0; position: absolute; top: 8px; right: 8px; }

.detail {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 20px 24px;
  background: linear-gradient(110deg, rgba(255, 107, 44, 0.1), rgba(14, 20, 30, 0.85) 40%); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.detail-art { display: grid; place-items: center; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 107, 44, 0.16), transparent 70%); }
.detail-info { display: grid; gap: 10px; min-width: 0; }
.detail-info h2 { font-size: 30px; letter-spacing: 0.04em; }
.stat-line { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.stat-line span { display: grid; font-size: 11px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.stat-line b { font-family: var(--display); font-size: 20px; color: var(--text); letter-spacing: 0.02em; }
.detail-note { font-size: 13px; color: #ffd28a; }
.detail-cta { display: flex; gap: 10px; align-items: center; }
.opp-group { display: grid; gap: 10px; }
.group-title { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.opp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.opp { position: relative; }
.card-opp { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; text-align: left; padding: 10px 12px; gap: 10px; }
.card-text { display: grid; gap: 6px; min-width: 0; }
.card-check { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.opp-remove { position: absolute; top: 6px; right: 6px; }
.detail-ffa { grid-template-columns: minmax(0, 1fr) auto; }
.ffa-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.slot { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 10px; background: rgba(5, 8, 12, 0.5); border: 1px solid var(--line); text-align: center; min-width: 0; }
.slot b { font-family: var(--display); font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot small { color: var(--muted); font-size: 11px; }
.slot-me { border-color: rgba(255, 107, 44, 0.5); }
.slot.empty { border-style: dashed; color: var(--dim); }
.slot-q { display: grid; place-items: center; width: 72px; height: 72px; font-family: var(--display); font-size: 30px; color: var(--dim); }

/* ---------- garage (loadout screen) ---------- */

.garage { display: grid; grid-template-columns: 330px minmax(0, 1fr) 470px; gap: var(--gutter); padding: var(--gutter); height: calc(100dvh - var(--top)); }
.g-col { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(130, 160, 200, 0.25) transparent; }
.g-col .col-title { margin-bottom: 2px; }
.g-stage { position: relative; display: flex; flex-direction: column; min-height: 0; gap: 12px; }
.g-bots { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; justify-content: center; flex: none; scrollbar-width: thin; }
.g-bot {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; cursor: pointer; flex: none;
  background: var(--glass); border: 1px solid var(--line); font-family: var(--display); font-weight: 600; font-size: 13px;
}
.g-bot span { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-bot:hover { border-color: var(--line-2); }
.g-bot[aria-current="true"] { border-color: var(--accent); background: rgba(255, 107, 44, 0.14); box-shadow: 0 0 16px rgba(255, 107, 44, 0.25); }
.g-new { padding: 0; width: 42px; height: 42px; justify-content: center; }
.g-turntable {
  position: relative; flex: 1; min-height: 240px; border-radius: 16px; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 45% at 50% 62%, rgba(255, 107, 44, 0.16), transparent 70%),
    radial-gradient(ellipse at 50% 30%, rgba(56, 214, 240, 0.06), transparent 60%),
    linear-gradient(180deg, rgba(14, 20, 30, 0.6), rgba(5, 7, 11, 0.2));
  border: 1px solid var(--line);
}
.turntable { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.turntable:active { cursor: grabbing; }
.g-flat { position: absolute; inset: 0; display: grid; place-items: center; }
.g-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); pointer-events: none; }
.g-identity { display: grid; justify-items: center; gap: 10px; flex: none; }
.g-name {
  width: min(420px, 100%); height: 52px; text-align: center; border: 0; border-bottom: 2px solid var(--line-2); background: transparent;
  font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: 0.06em; text-transform: uppercase;
}
.g-name:hover { border-bottom-color: rgba(255, 176, 46, 0.5); }
.g-name:focus-visible { outline: none; border-bottom-color: var(--accent); box-shadow: 0 8px 18px -12px var(--accent); }
.g-summary { display: flex; gap: 18px; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.g-summary b { font-family: var(--display); font-size: 16px; color: var(--text); letter-spacing: 0.02em; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35); }
.swatch[aria-checked="true"] { border-color: var(--text); box-shadow: 0 0 0 3px var(--bg), 0 0 14px var(--c); }
.g-actions { display: flex; justify-content: center; gap: 8px; flex: none; }
.g-actions .btn-primary { min-width: 200px; }
.g-tabs { display: none; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tile {
  --cut: 8px; display: grid; justify-items: center; gap: 6px; padding: 12px 4px 10px; cursor: pointer; border: 0;
  background: rgba(5, 8, 12, 0.55); box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 0.04em;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.tile:focus-visible { outline-offset: -4px; }
.tile .ico { width: 24px; height: 24px; color: var(--muted); }
.tile:hover { background: var(--glass-2); }
.tile[aria-checked="true"] { background: linear-gradient(180deg, rgba(255, 107, 44, 0.26), rgba(255, 107, 44, 0.06)); box-shadow: inset 0 0 0 1px var(--accent); }
.tile[aria-checked="true"] .ico { color: var(--accent-2); filter: drop-shadow(0 0 6px rgba(255, 176, 46, 0.7)); }
.tile { position: relative; }
.tile-name { line-height: 1.15; }
.tile-lv { font-size: 10px; letter-spacing: 0.12em; color: var(--accent-2); }
.tile.locked { opacity: 0.85; }
.tile.locked .ico:first-child { color: var(--dim); }
.tile.locked .tile-name { color: var(--muted); }
.tile-price { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: #ffd28a; }
.tile-price .ico { color: var(--accent-2); width: 12px; height: 12px; }
.upgrade { margin-top: 12px; justify-content: flex-start; }
.upgrade .price { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: #ffd28a; }
.maxed { margin-top: 12px; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--good); letter-spacing: 0.08em; text-transform: uppercase; }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tile-blurb { margin-top: 10px; font-size: 13px; color: #c4cfdd; }
.bars { display: grid; gap: 6px; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: center; }
.bar-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; }
.bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.bar i { height: 6px; background: rgba(130, 160, 200, 0.14); transform: skewX(-20deg); }
.bar i.on { background: var(--accent-2); box-shadow: 0 0 6px rgba(255, 176, 46, 0.6); }
.stats { display: grid; gap: 10px; }
.stat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; }
.stat-name { display: grid; }
.stat-name b { font-family: var(--display); font-size: 15px; }
.stat-name small { color: var(--muted); font-size: 11px; }
.pips { display: flex; gap: 4px; }
.pip { width: 18px; height: 10px; background: rgba(130, 160, 200, 0.14); transform: skewX(-20deg); }
.pip.on { background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 0 8px rgba(255, 107, 44, 0.55); }

.brain { display: grid; gap: 14px; align-content: start; }
.brain-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brain-head .input { width: 170px; }
.howto { background: rgba(5, 8, 12, 0.5); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.howto summary { cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.howto ul { margin: 10px 0 2px; padding-left: 18px; color: #c4cfdd; display: grid; gap: 6px; font-size: 13px; }
.k-move { color: var(--k-move); }
.k-fire { color: var(--k-fire); }
.k-ability { color: var(--k-ability); }
.kind-move { --k: var(--k-move); }
.kind-fire { --k: var(--k-fire); }
.kind-ability { --k: var(--k-ability); }
.warnings { display: grid; gap: 6px; }
.warnings p { padding: 10px 12px; border-radius: 8px; background: rgba(255, 176, 46, 0.08); border: 1px solid rgba(255, 176, 46, 0.3); color: #ffd28a; font-size: 13px; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rule {
  display: grid; gap: 7px; padding: 10px 12px 12px; border-radius: 10px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--k) 10%, transparent), rgba(10, 14, 21, 0.85) 40%);
  border: 1px solid var(--line); border-left: 3px solid var(--k);
}
.rule.unreachable { opacity: 0.55; border-left-style: dashed; }
.rule-head { display: flex; align-items: center; gap: 10px; }
.rule-num { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--dim); letter-spacing: 0.06em; }
.kind-chip { font-family: var(--display); font-weight: 700; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; background: color-mix(in srgb, currentColor 16%, transparent); }
.rule-tools { display: flex; gap: 4px; margin-left: auto; }
.rule-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kw { width: 40px; flex: none; font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.kw-do { color: var(--k, var(--accent-2)); }
.input-sel { flex: 1 1 180px; min-width: 150px; }
.param { display: inline-flex; align-items: center; gap: 4px; }
.unit { color: var(--muted); font-size: 12px; }
.rule-note { font-size: 12px; color: #ffd28a; }

/* ---------- arena ---------- */

.view-arena { position: relative; height: 100dvh; overflow: hidden; background: #05070b; }
.arena { position: absolute; inset: 0; }
.arena-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.arena-canvas.flat { inset: auto; left: 50%; top: 52%; width: min(100%, calc((100dvh - 220px) * 1.5)); height: auto; aspect-ratio: 3 / 2; transform: translate(-50%, -50%); }
.hud { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hud-top { position: absolute; left: 0; right: 0; top: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 16px; padding: 14px var(--gutter) 0; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.plates { display: grid; gap: 8px; align-content: start; }
.plates-right { justify-items: end; }
.plate {
  --cut: 12px; width: min(380px, 100%); padding: 10px 14px 10px; display: grid; gap: 6px;
  background: linear-gradient(180deg, rgba(10, 14, 21, 0.86), rgba(10, 14, 21, 0.66));
  box-shadow: inset 0 0 0 1px var(--line);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  backdrop-filter: blur(6px);
}
.plates-left .plate { border-left: 3px solid var(--c); }
.plates-right .plate { border-right: 3px solid var(--c); text-align: right; }
.plate-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.plates-right .plate-top { flex-direction: row-reverse; }
.plate-name { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.plate-hp { margin-left: auto; font-family: var(--display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; color: var(--c); text-shadow: 0 0 12px var(--c); }
.plates-right .plate-hp { margin-left: 0; margin-right: auto; }
.plate-bar { position: relative; height: 12px; background: rgba(0, 0, 0, 0.6); transform: skewX(-20deg); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.plate-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: calc(var(--hp) * 100%); }
.plates-right .plate-bar i { left: auto; right: 0; }
.plate-fill { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 60%); box-shadow: 0 0 12px var(--c); transition: width 0.12s linear; }
.plate-ghost { background: #fff; opacity: 0.55; transition: width 0.5s ease-in 0.3s; }
.plate-bar::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0, 0, 0, 0.45) calc(10% - 1px) 10%); }
.plate.low .plate-fill { animation: low 0.8s infinite; }
@keyframes low { 50% { filter: brightness(1.8); } }
.plate.dead { opacity: 0.5; }
.plate.dead .plate-hp { color: var(--muted); text-shadow: none; }
.plate-meta { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.plates-right .plate-meta { justify-content: flex-end; }
.plate-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.plate-ab em { font-style: normal; font-weight: 600; }
.ab-ready em { color: var(--good); }
.ab-active em { color: var(--accent-2); }
.ab-cd em { color: var(--dim); }
.plate-brain { font-size: 12px; color: #c4cfdd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--display); letter-spacing: 0.04em; }
.plate-brain::before { content: 'BRAIN '; color: var(--dim); font-weight: 700; font-size: 10px; letter-spacing: 0.16em; }
.hud-center {
  --cut: 10px; display: grid; justify-items: center; gap: 2px; padding: 8px 22px 10px; min-width: 150px;
  background: linear-gradient(180deg, rgba(10, 14, 21, 0.88), rgba(10, 14, 21, 0.6)); box-shadow: inset 0 0 0 1px var(--line);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.hud-mode { font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent-2); }
.hud-clock { font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.hud-clock.warn { color: var(--bad); text-shadow: 0 0 16px rgba(251, 113, 133, 0.6); }
.hud-zone { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.hud-zone.warn { color: var(--bad); }
.killfeed { position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%); margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; justify-items: end; pointer-events: none; }
.killfeed li { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: rgba(10, 14, 21, 0.82); border-right: 2px solid var(--accent); font-size: 13px; font-family: var(--display); letter-spacing: 0.04em; animation: slide-in 0.25s ease-out; }
.kf-ico { color: var(--muted); }
.kf-zone { color: var(--bad); }
@keyframes slide-in { from { transform: translateX(20px); opacity: 0; } }
.banner {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap;
  font-family: var(--display); font-weight: 700; font-size: clamp(36px, 7vw, 88px); letter-spacing: 0.16em; text-transform: uppercase; font-style: italic;
  color: #fff; text-shadow: 0 0 30px rgba(255, 107, 44, 0.8), 0 6px 0 rgba(0, 0, 0, 0.5);
  animation: slam 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.banner.warn { color: #ffd0d8; text-shadow: 0 0 30px rgba(251, 113, 133, 0.85), 0 6px 0 rgba(0, 0, 0, 0.5); font-size: clamp(26px, 4.4vw, 56px); }
.banner.bad { color: var(--bad); }
.banner.count { font-size: clamp(80px, 14vw, 180px); font-style: normal; letter-spacing: 0; }
.banner.ko { color: #ffd28a; text-shadow: 0 0 40px rgba(255, 107, 44, 0.9), 0 6px 0 rgba(0, 0, 0, 0.5); }
.ftxt-big { font-size: 24px; }
@keyframes slam { from { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } }
.hud-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 0 var(--gutter) 16px; pointer-events: none; }
.hud-bottom > * { pointer-events: auto; }
.hud-exit { position: absolute; left: var(--gutter); bottom: 16px; }
.playback { display: flex; gap: 2px; padding: 4px; background: rgba(10, 14, 21, 0.82); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(6px); }
.pb-btn { display: grid; place-items: center; min-width: 44px; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--muted); }
.pb-btn:hover:not(:disabled) { background: var(--glass-2); color: var(--text); }
.pb-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.pb-btn:disabled { opacity: 0.35; cursor: default; }

.result { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(5, 7, 11, 0.6), rgba(5, 7, 11, 0.9)); backdrop-filter: blur(4px); animation: fade 0.35s ease-out; }
@keyframes fade { from { opacity: 0; } }
.result-card { position: relative; width: min(640px, 100%); max-height: 100%; overflow: auto; padding: 28px; text-align: center; background: linear-gradient(180deg, rgba(22, 30, 44, 0.92), rgba(10, 14, 21, 0.94)); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7); }
.result-head { font-size: clamp(54px, 9vw, 96px); text-transform: uppercase; letter-spacing: 0.08em; font-style: italic; line-height: 1; margin-top: 6px; animation: slam-in 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes slam-in { from { transform: scale(1.6); opacity: 0; } }
.tone-win .result-head { color: var(--accent-2); text-shadow: 0 0 40px rgba(255, 176, 46, 0.55), 0 6px 0 rgba(80, 30, 0, 0.6); }
.tone-loss .result-head { color: var(--bad); text-shadow: 0 0 40px rgba(251, 113, 133, 0.4); }
.tone-draw .result-head { color: var(--muted); }
.result-sub { color: #c4cfdd; margin-top: 10px; font-size: 15px; }
.reward { margin: 16px auto 0; display: grid; gap: 8px; justify-items: center; max-width: 360px; }
.reward-total { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 999px; background: rgba(255, 176, 46, 0.14); border: 1px solid rgba(255, 176, 46, 0.4); animation: slam-in 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) 0.25s backwards; }
.reward-total b { font-family: var(--display); font-size: 26px; color: #ffd28a; }
.reward-total span { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.reward-total .ico { color: var(--accent-2); width: 22px; height: 22px; }
.reward-lines { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.reward-lines li { display: flex; justify-content: space-between; gap: 12px; }
.reward-lines b { color: #ffd28a; font-family: var(--display); }
.cta-stack { display: grid; justify-items: center; gap: 8px; }
.cta-reward { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #ffd28a; letter-spacing: 0.04em; }
.cta-reward .ico { color: var(--accent-2); }
.buy { display: grid; gap: 12px; }
.buy-cost { display: flex; align-items: center; gap: 8px; }
.buy-cost b { font-family: var(--display); font-size: 26px; color: #ffd28a; }
.buy-cost span { margin-left: auto; font-size: 13px; color: var(--muted); }
.buy-cost .ico { color: var(--accent-2); width: 22px; height: 22px; }
.result-note { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(5, 8, 12, 0.6); border: 1px solid var(--line); color: #ffd28a; font-size: 13px; }
.result-table { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14px; font-variant-numeric: tabular-nums; }
.result-table th { font-family: var(--display); font-weight: 600; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); padding: 6px 8px; text-align: right; }
.result-table td { padding: 9px 8px; border-top: 1px solid var(--line); text-align: right; }
.result-table th:nth-child(-n+2), .result-table td:nth-child(-n+2) { text-align: left; }
.result-table td:nth-child(2) { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; letter-spacing: 0.04em; }
.result-table .place { font-family: var(--display); font-weight: 700; color: var(--dim); width: 28px; }
.result-table tr.me td { background: rgba(255, 107, 44, 0.08); }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.result-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; }
.result-close:hover { background: var(--glass-hi); color: var(--text); }

/* ---------- modal & toast ---------- */

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(3, 5, 8, 0.78); backdrop-filter: blur(5px); animation: fade 0.2s; }
.modal-card { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; display: grid; gap: 14px; padding: 24px; background: linear-gradient(180deg, rgba(22, 30, 44, 0.96), rgba(10, 14, 21, 0.97)); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7); }
.modal-card h2 { font-size: 22px; letter-spacing: 0.06em; text-transform: uppercase; }
.modal-card .input { width: 100%; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.import { display: flex; gap: 16px; align-items: center; }
.import > div { display: grid; gap: 10px; }
.howto-modal { display: grid; gap: 16px; }
.howto-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: #c4cfdd; }
.howto-steps b { font-family: var(--display); color: var(--text); letter-spacing: 0.04em; }
.sample-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: r; }
.sample-rules li { counter-increment: r; position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 9px 12px 9px 40px; border-radius: 8px; background: rgba(5, 8, 12, 0.6); border: 1px solid var(--line); border-left: 3px solid var(--k); font-size: 13px; color: #c4cfdd; }
.sample-rules li::before { content: counter(r); position: absolute; left: 14px; font-family: var(--display); font-weight: 700; color: var(--dim); }
.sample-rules .kw { width: auto; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%) translateY(20px); opacity: 0; max-width: min(92vw, 480px); padding: 12px 18px; border-radius: 10px; background: #1b2636; border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); font-size: 14px; transition: transform 0.25s, opacity 0.25s; }
.toast.show { transform: translateX(-50%); opacity: 1; }
.noscript { padding: 24px; text-align: center; }

/* ---------- responsive ---------- */

@media (max-width: 1280px) {
  .garage { grid-template-columns: 300px minmax(0, 1fr) 420px; }
  .track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .garage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto; height: auto; }
  .g-stage { grid-column: 1 / -1; order: -1; }
  .g-turntable { min-height: 320px; flex: none; height: 42vh; }
  .g-col { overflow: visible; padding-right: 0; }
  .play { grid-template-columns: minmax(0, 1fr); }
  .play-side { position: static; }
  .modes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail { grid-template-columns: auto minmax(0, 1fr); }
  .detail-cta { grid-column: 1 / -1; justify-content: flex-end; }
  .detail-ffa { grid-template-columns: minmax(0, 1fr); }
  .plate { width: min(320px, 100%); }
}

@media (max-width: 720px) {
  :root { --top: 54px; }
  body { font-size: 14px; }
  .topbar { gap: 12px; }
  .brand span { display: none; }
  .nav a { padding: 0 10px; font-size: 13px; letter-spacing: 0.12em; }
  .pc-text { display: none; }
  .pilot-chip { padding: 4px; }
  .menu { gap: 22px; padding: 70px 16px 40px; }
  .logo { font-size: clamp(56px, 18vw, 84px); }
  .mi-t { font-size: 22px; }
  .menu-item { padding: 6px 18px 8px; }
  .menu-coins { top: 14px; left: 14px; right: auto; }
  .domain-sale { top: 14px; bottom: auto; right: 14px; padding: 6px 10px; }
  .ds-t { font-size: 13px; }
  .garage { display: flex; flex-direction: column; padding: 12px; gap: 12px; }
  .g-turntable { height: 34vh; min-height: 220px; }
  .g-name { font-size: 24px; height: 44px; }
  .g-tabs { display: flex; align-self: stretch; }
  .g-tabs .seg { flex: 1; justify-content: center; height: 36px; }
  .garage[data-tab="loadout"] .g-brain, .garage[data-tab="brain"] .g-loadout { display: none; }
  .g-actions .btn-primary { min-width: 0; flex: 1; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule-line .kw { width: auto; }
  .input-sel { flex-basis: 100%; }
  .play { padding: 12px; gap: 14px; }
  .modes { grid-template-columns: minmax(0, 1fr); }
  .mode { padding: 10px 12px; }
  .track { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .track .bot-canvas { width: 56px !important; height: 56px !important; }
  .card-name { font-size: 13px; }
  .detail { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 16px; gap: 12px; }
  .detail-art { width: 120px; height: 120px; }
  .detail-art .bot-canvas { width: 120px !important; height: 120px !important; }
  .detail .chips, .stat-line { justify-content: center; }
  .detail-cta { justify-content: center; width: 100%; }
  .detail-cta .btn-xl { flex: 1; }
  .ffa-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opp-grid { grid-template-columns: minmax(0, 1fr); }
  .hud-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 8px 8px 0; gap: 6px; }
  .hud-center { grid-column: 1 / -1; grid-row: 1; justify-self: center; padding: 4px 14px 6px; min-width: 0; }
  .hud-clock { font-size: 22px; }
  .hud-zone { display: none; }
  .plate { padding: 7px 9px; gap: 4px; --cut: 8px; }
  .plate-name { font-size: 12px; }
  .plate-hp { font-size: 14px; }
  .plate-bar { height: 8px; }
  .plate-meta, .plate-brain, .plate .tag { display: none; }
  .arena.is-ffa .plates { gap: 4px; }
  .killfeed { top: auto; bottom: 74px; transform: none; right: 8px; }
  .killfeed li { font-size: 11px; padding: 4px 8px; }
  .hud-hint { display: none; }
  .hud-bottom { padding-bottom: 12px; justify-content: flex-end; }
  .hud-exit { bottom: 12px; left: 8px; }
  .pb-btn { min-width: 38px; height: 34px; padding: 0 6px; }
  .result-card { padding: 20px 14px; }
  .result-table th:nth-child(4), .result-table td:nth-child(4) { display: none; }
  .import { flex-direction: column; align-items: flex-start; }
}

/* Touch screens: fingertip-sized targets. */
@media (pointer: coarse), (max-width: 720px) {
  .swatch { width: 36px; height: 36px; }
  .seg { min-height: 40px; }
  .icon-btn-sm { width: 36px; height: 36px; }
  .brand { min-width: 44px; min-height: 44px; }
  .link-btn { padding: 8px 10px; }
  .pb-btn { min-height: 40px; }
}

/* Short screens (phones held sideways): compact HUD and menu so the arena gets the room. */
@media (max-height: 520px) {
  .hud-top { padding: 6px 10px 0; gap: 8px; }
  .plate { width: min(250px, 100%); padding: 6px 10px; gap: 4px; --cut: 8px; }
  .plate-name { font-size: 12px; }
  .plate-hp { font-size: 15px; }
  .plate-bar { height: 7px; }
  .plate-meta, .plate-brain, .plate .tag { display: none; }
  .hud-center { padding: 4px 12px 6px; min-width: 0; }
  .hud-mode, .hud-zone { font-size: 9px; }
  .hud-clock { font-size: 20px; }
  .hud-bottom { padding-bottom: 8px; }
  .hud-exit { bottom: 8px; }
  .pb-btn { min-height: 36px; height: 36px; min-width: 40px; }
  .killfeed li { font-size: 11px; padding: 4px 8px; }
  .banner { font-size: 40px; }
  .banner.count { font-size: 96px; }
  .menu { gap: 12px; padding: 14px 16px; }
  .logo { font-size: 54px; margin-top: 4px; }
  .tagline { margin-top: 6px; font-size: 14px; }
  .mi-t { font-size: 19px; }
  .mi-d { display: none; }
  .menu-item { padding: 4px 18px 6px; }
  .domain-sale { padding: 6px 10px; bottom: 10px; }
  .result-card { padding: 16px; }
  .result-head { font-size: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
