:root {
  --bg: #0b0f17;
  --surface: #131a26;
  --surface-2: #1a2434;
  --border: #253349;
  --text: #e6edf7;
  --muted: #93a4bd;
  --accent: #38bdf8;
  --accent-2: #2dd4bf;
  --danger: #f87171;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1180px, 92vw); margin: 0 auto; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(11, 15, 23, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 14px 0;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; letter-spacing: 0.04em; color: var(--text); font-size: 1.1rem;
}
.brand:hover { text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 18px; }
.nav a { color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.nav a.active, .nav a:hover { color: var(--accent-2); text-decoration: none; }

.hero { padding: 36px 0 28px; }
.hero-head {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: flex-end; gap: 18px; margin-bottom: 20px;
}
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: rgba(56, 189, 248, 0.12); color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: 0.8rem; font-weight: 600; margin-bottom: 8px;
}
h1, h2, h3 { margin: 0 0 10px; line-height: 1.2; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
.lead { color: var(--muted); max-width: 680px; margin: 0; }

.arena-shell {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.hud-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
  margin-bottom: 12px; font-size: 0.92rem;
}
.hud-stats, .hud-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.stat-pill {
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 8px; font-variant-numeric: tabular-nums;
}
.stat-pill strong { color: var(--accent-2); }
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); padding: 7px 14px; border-radius: 8px;
  font-weight: 600; font-size: 0.88rem; cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #061018; border-color: transparent;
}
.btn-primary:hover { color: #061018; filter: brightness(1.08); }
select.ctrl-select {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  padding: 7px 10px; border-radius: 8px; font-size: 0.88rem;
}

.canvas-wrap {
  position: relative; width: 100%; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: #070a10;
}
canvas#arena-canvas {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; cursor: crosshair;
}
.arena-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  padding-top: 10px; color: var(--muted); font-size: 0.85rem;
}

.section { padding: 28px 0 42px; }
.grid-3 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px;
}
.grid-2 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.card img.preview {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border); margin-bottom: 12px;
}
.card p { color: var(--muted); margin: 0; }
.card ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:hover td { background: rgba(56, 189, 248, 0.05); }

.patch-item { margin-bottom: 18px; }
.patch-meta { color: var(--accent-2); font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }

.footer {
  border-top: 1px solid var(--border); padding: 24px 0 36px;
  color: var(--muted); font-size: 0.88rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px;
}
body.fullscreen-play .hero { padding: 16px 0; }
body.fullscreen-play .container.wide { width: min(1440px, 96vw); }
