:root {
  --bg: #0b0c10;
  --panel: #14161c;
  --panel2: #0f1116;
  --line: #2a2d36;
  --ink: #f3f1ea;
  --mut: #9aa0ad;
  --acc: #7c8cff;
  --ember: #e23d28;
  --tide: #2ec4b6;
  --thorn: #3ddc84;
  --volt: #f4c430;
  --gold: #c9a45c;
  --good: #34a887;
  --danger: #c8302c;
  --hud: rgba(11, 12, 16, 0.86);
  --font: "Inter Tight", Inter, system-ui, sans-serif;
  --display: "Cormorant Garamond", Charter, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); overflow: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }
#world, #fx {
  position: fixed; inset: 0; width: 100%; height: 100%;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
#fx { pointer-events: none; }
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.hud > * { pointer-events: auto; }
.top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 10px;
  background: linear-gradient(to bottom, rgba(11,12,16,.92), transparent);
}
.brand {
  display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit;
  font-weight: 800; letter-spacing: -.02em;
}
.brand img { width: 22px; height: 22px; image-rendering: pixelated; }
.season {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mut);
}
.scores { display: flex; gap: 6px; margin-left: 6px; flex-wrap: wrap; }
.score {
  display: flex; align-items: center; gap: 6px;
  background: var(--hud); border: 1px solid var(--line); padding: 4px 8px; min-width: 72px;
}
.score i { width: 8px; height: 8px; display: block; }
.score b { font-variant-numeric: tabular-nums; font-size: 13px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill {
  background: var(--hud); border: 1px solid var(--line); color: var(--ink);
  padding: 7px 10px; font-weight: 700; font-size: 13px;
}
.pill.gold { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.pill.cmd { background: linear-gradient(90deg, #7c8cff, #c8302c); border: 0; color: #fff; }
.energy {
  width: min(220px, 28vw); height: 28px; background: #0a0b0f; border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.energy > span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--good), var(--volt));
  transition: width .25s linear;
}
.energy em {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-family: var(--mono); letter-spacing: .08em; font-style: normal; font-weight: 700;
}
.ticker {
  position: absolute; top: 52px; left: 50%; transform: translateX(-50%);
  max-width: min(720px, 92vw); text-align: center;
  font-size: 13px; color: var(--ink); text-shadow: 0 1px 0 #000;
  background: rgba(11,12,16,.55); padding: 4px 12px; pointer-events: none;
}
.bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: flex-end; gap: 10px;
  padding: 10px;
  background: linear-gradient(to top, rgba(11,12,16,.94), transparent);
}
.palette {
  display: flex; flex-wrap: wrap; gap: 3px; max-width: min(420px, 70vw);
  background: var(--hud); border: 1px solid var(--line); padding: 6px;
}
.swatch {
  width: 18px; height: 18px; border: 1px solid transparent; padding: 0;
}
.swatch.on { outline: 2px solid #fff; outline-offset: 1px; }
.swatch.lock { opacity: .35; }
.troops { display: flex; gap: 6px; }
.troop {
  background: var(--hud); border: 1px solid var(--line); color: var(--ink);
  min-width: 76px; padding: 8px 8px 6px; text-align: left;
}
.troop b { display: block; font-size: 12px; }
.troop span { color: var(--mut); font-size: 10px; font-family: var(--mono); }
.troop.on { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.minimap {
  margin-left: auto; width: 128px; height: 128px; border: 1px solid var(--line); background: #07080b;
  image-rendering: pixelated; cursor: pointer;
}
.feed {
  position: absolute; left: 10px; bottom: 118px; width: min(280px, 70vw);
  font-size: 12px; color: #d5d8e0; text-shadow: 0 1px 0 #000;
  display: flex; flex-direction: column; gap: 3px; pointer-events: none;
}
.intel {
  position: absolute; left: 10px; top: 52px;
  background: var(--hud); border: 1px solid var(--line); padding: 10px 12px; width: 170px;
  font-size: 12px;
}
.intel h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); font-weight: 800; }
.intel p { margin: 0 0 4px; display: flex; justify-content: space-between; }
.intel b { font-variant-numeric: tabular-nums; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 100vw);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border-left: 1px solid var(--line); transform: translateX(110%);
  transition: transform .22s ease; overflow: auto; padding: 18px 16px 40px;
  backdrop-filter: blur(10px);
}
.drawer.open { transform: none; }
.drawer h2 { font-family: var(--display); font-size: 32px; margin: 0 0 6px; }
.sku {
  border: 1px solid var(--line); background: var(--panel2); padding: 12px; margin: 8px 0;
}
.sku.hi { border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); }
.sku .row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.sku b { font-size: 15px; }
.sku em { font-style: normal; color: var(--gold); font-weight: 800; }
.sku p { margin: 6px 0 10px; color: var(--mut); font-size: 13px; }
.buy {
  background: var(--ink); color: #111; border: 0; font-weight: 800; padding: 8px 12px; width: 100%;
}
.buy:disabled { opacity: .45; }
.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); padding: 8px 12px; }
.close { float: right; background: transparent; border: 0; color: var(--ink); font-size: 20px; }
.overlay {
  position: fixed; inset: 0; z-index: 20;
  background:
    radial-gradient(900px 500px at 80% -10%, color-mix(in srgb, var(--acc) 28%, transparent), transparent 55%),
    radial-gradient(700px 400px at -10% 100%, color-mix(in srgb, var(--ember) 22%, transparent), transparent 50%),
    rgba(8,9,12,.92);
  overflow: auto;
}
.overlay.hidden { display: none; }
.hero {
  max-width: 1080px; margin: 0 auto; padding: 28px 20px 80px;
}
.hero-art {
  width: 100%; max-height: 280px; object-fit: cover; border: 1px solid var(--line);
  image-rendering: auto; margin: 18px 0 22px;
}
.kicker { font-family: var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--acc); font-size: 11px; font-weight: 800; }
h1 {
  font-family: var(--display); font-size: clamp(2.4rem, 7vw, 4.4rem);
  line-height: .95; margin: 8px 0 12px; letter-spacing: -.03em; font-weight: 700;
}
h1 em { font-style: italic; color: var(--volt); }
.lede { color: var(--mut); font-size: 1.12rem; max-width: 58ch; }
.factions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0; }
.fac {
  border: 1px solid var(--line); background: var(--panel); padding: 0; color: inherit; text-align: left; overflow: hidden;
}
.fac img { width: 100%; height: 110px; object-fit: cover; display: block; }
.fac div { padding: 10px 12px 12px; }
.fac b { display: block; font-size: 16px; }
.fac span { color: var(--mut); font-size: 12px; }
.fac:hover { border-color: #fff; }
.cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(90deg, var(--acc), var(--danger));
  color: #fff; font-weight: 800; padding: 12px 18px; border: 0;
}
.note { color: var(--mut); font-size: 13px; }
.tut {
  position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%);
  z-index: 8; background: var(--panel); border: 1px solid var(--acc);
  padding: 12px 14px; width: min(420px, 92vw); box-shadow: 0 20px 60px #000;
}
.tut.hidden { display: none; }
.shout {
  position: absolute; left: 50%; bottom: 108px; transform: translateX(-50%);
  display: flex; gap: 6px; width: min(420px, 80vw);
}
.shout input {
  flex: 1; background: var(--hud); border: 1px solid var(--line); color: var(--ink); padding: 8px 10px;
}
.err {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  background: #3a1212; border: 1px solid var(--ember); padding: 8px 12px; z-index: 12;
}
.err.hidden { display: none; }
.coords {
  position: absolute; right: 148px; bottom: 14px;
  font-family: var(--mono); font-size: 11px; color: var(--mut);
}
@media (max-width: 860px) {
  .factions { grid-template-columns: 1fr 1fr; }
  .intel { display: none; }
  .minimap { width: 88px; height: 88px; }
  .energy { width: 120px; }
  .season, .scores { display: none; }
  .troop span { display: none; }
  .shout { bottom: 96px; }
}
