:root {
  color-scheme: dark;
  --ink: #0f1114;
  --panel: #171b20;
  --panel-strong: #20262e;
  --line: rgba(238, 244, 232, 0.14);
  --paper: #eef4e8;
  --muted: #aab6ad;
  --acid: #b7ff52;
  --coral: #ff6f59;
  --cyan: #4fd7c5;
  --amber: #ffbd54;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(79, 215, 197, 0.14), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(255, 111, 89, 0.15), transparent 34%),
    var(--ink);
  color: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.arena-shell {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 44px) 56px;
}

.arena-topbar,
.arena-hero,
.arena-grid,
.telemetry-layout,
.event-section {
  border-bottom: 1px solid var(--line);
}

.arena-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
}

.brand-link {
  font-weight: 900;
}

.arena-topbar nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.arena-topbar a:not(.brand-link) {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 11px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.arena-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.44fr);
  gap: 32px;
  align-items: end;
  padding: 64px 0 32px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--acid);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.92;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1;
}

.arena-hero p:not(.eyebrow),
.telemetry-layout p:not(.eyebrow),
.event-section p:not(.eyebrow) {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.scoreboard {
  display: grid;
  gap: 10px;
}

.scoreboard div,
.control-panel,
.telemetry-layout,
.event-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 27, 32, 0.78);
}

.scoreboard div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
}

.scoreboard span,
.slider-row span,
.toggle-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scoreboard strong {
  color: var(--paper);
  font-size: 1.45rem;
}

.arena-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 356px);
  gap: 22px;
  align-items: start;
  padding: 24px 0;
}

.arena-stage {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #0b0f12;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

canvas {
  display: block;
  width: 100%;
}

#arena-canvas {
  aspect-ratio: 1040 / 620;
}

.control-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

button {
  min-height: 44px;
  border: 1px solid rgba(183, 255, 82, 0.5);
  border-radius: 6px;
  background: var(--acid);
  color: #142007;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
}

button:nth-child(2) {
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--paper);
}

button:hover,
button:focus-visible,
.arena-topbar a:focus-visible,
.arena-topbar a:hover {
  outline: 2px solid rgba(79, 215, 197, 0.48);
}

.slider-row {
  display: grid;
  gap: 10px;
}

.toggle-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  min-height: 40px;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--acid);
}

input[type="range"] {
  width: 100%;
}

.state-readout {
  min-height: 210px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

@media (min-width: 1080px) {
  .control-panel {
    position: sticky;
    top: 18px;
  }

  #arena-canvas {
    min-height: 560px;
  }
}

.telemetry-layout,
.event-section {
  display: grid;
  gap: 18px;
  margin-top: 24px;
  padding: 22px;
}

#telemetry-canvas {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 11, 14, 0.82);
}

.event-log {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-log li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--muted);
  background: rgba(238, 244, 232, 0.04);
}

.event-log strong {
  color: var(--paper);
}

@media (max-width: 880px) {
  .arena-topbar,
  .arena-hero,
  .arena-grid {
    grid-template-columns: 1fr;
  }

  .arena-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .arena-hero {
    padding-top: 42px;
  }
}
