:root {
  --ink: #f4f7fb;
  --muted: #aeb7c8;
  --panel: #101725;
  --panel-2: #151d2d;
  --line: #2c3850;
  --void: #060910;
  --violet: #9b7cff;
  --cyan: #38dff0;
  --pink: #ff4f9a;
  --amber: #ffbd4a;
  --green: #87f26f;
  --red: #ff5d5d;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(56, 223, 240, 0.08), transparent 440px),
    radial-gradient(circle at 50% 0%, rgba(155, 124, 255, 0.16), transparent 380px),
    var(--void);
  font-family: "Space Mono", Consolas, monospace;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: screen;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(56, 223, 240, 0.26);
  background: rgba(6, 9, 16, 0.88);
  backdrop-filter: blur(14px);
}

.brand {
  font-family: "Press Start 2P", monospace;
  font-size: 0.8rem;
  color: var(--cyan);
  text-decoration: none;
}

.brand span {
  color: var(--pink);
}

.topbar nav {
  display: flex;
  gap: 20px;
}

.topbar nav a {
  color: var(--muted);
  font-size: 0.76rem;
  text-decoration: none;
}

.topbar nav a:hover,
.topbar nav a:focus-visible {
  color: var(--cyan);
}

.hero {
  position: relative;
  display: grid;
  min-height: calc(100vh - 64px);
  place-items: center;
  overflow: hidden;
  padding: 96px 24px;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  text-align: center;
}

.kicker {
  margin: 0 0 14px;
  color: var(--amber);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  line-height: 1.45;
}

h1 {
  color: white;
  font-size: clamp(2rem, 7vw, 5.6rem);
  text-shadow: 0 0 18px rgba(56, 223, 240, 0.42), 0 0 44px rgba(255, 79, 154, 0.24);
}

.hero-sub {
  width: min(720px, 100%);
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 2px solid var(--cyan);
  padding: 0 18px;
  color: var(--cyan);
  background: rgba(56, 223, 240, 0.08);
  font-family: "Press Start 2P", monospace;
  font-size: 0.62rem;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
.button:focus-visible {
  color: var(--void);
  background: var(--cyan);
  box-shadow: 0 0 24px rgba(56, 223, 240, 0.34);
}

.button.secondary {
  border-color: var(--pink);
  color: var(--pink);
  background: rgba(255, 79, 154, 0.08);
}

.button.secondary:hover,
.button.secondary:focus-visible {
  color: var(--void);
  background: var(--pink);
  box-shadow: 0 0 24px rgba(255, 79, 154, 0.34);
}

.button.full {
  width: 100%;
}

.section {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 78px 24px;
}

.section-head {
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(1.05rem, 3vw, 1.95rem);
}

.section-head p:last-child {
  width: min(760px, 100%);
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.85;
}

.arcade-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  align-items: start;
}

.cabinet {
  overflow: hidden;
  border: 2px solid rgba(56, 223, 240, 0.52);
  background: #000;
  box-shadow: 0 0 38px rgba(56, 223, 240, 0.16);
}

.cabinet-marquee,
.cabinet-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
}

.cabinet-marquee {
  border-bottom: 1px solid var(--line);
}

.cabinet-marquee strong {
  color: var(--cyan);
  font-family: "Press Start 2P", monospace;
  font-size: 0.74rem;
}

.cabinet-marquee span {
  color: var(--green);
  font-size: 0.78rem;
}

#game-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #05070c;
}

.cabinet-controls {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  flex-wrap: wrap;
}

.control-panel {
  display: grid;
  gap: 16px;
}

.mode-switch {
  display: grid;
  gap: 10px;
}

.mode-button {
  min-height: 42px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
  font-family: "Press Start 2P", monospace;
  font-size: 0.58rem;
  cursor: pointer;
}

.mode-button.active,
.mode-button:hover,
.mode-button:focus-visible {
  color: var(--void);
  border-color: var(--amber);
  background: var(--amber);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat,
.game-notes {
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.stat {
  min-height: 84px;
  padding: 14px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 10px;
  color: white;
  font-family: "Press Start 2P", monospace;
  font-size: 1rem;
  line-height: 1.4;
}

.game-notes {
  padding: 16px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.75;
}

.engine-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.engine-card {
  min-height: 250px;
  border: 1px solid var(--line);
  padding: 20px;
  background: var(--panel);
}

.engine-card.violet {
  border-top: 4px solid var(--violet);
}

.engine-card.green {
  border-top: 4px solid var(--green);
}

.engine-card.amber {
  border-top: 4px solid var(--amber);
}

.engine-card.blue {
  border-top: 4px solid var(--cyan);
}

.engine-tag {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.engine-card h3 {
  font-size: 0.84rem;
}

.engine-card p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.75;
}

.engine-card code,
.terminal {
  color: var(--green);
  font-family: "Space Mono", Consolas, monospace;
}

.engine-card code {
  display: block;
  margin-top: 18px;
  overflow-wrap: anywhere;
  font-size: 0.72rem;
}

.setup-section {
  padding-top: 36px;
}

.terminal {
  margin: 0;
  border: 1px solid rgba(135, 242, 111, 0.38);
  padding: 20px;
  overflow: auto;
  background: #000;
  line-height: 1.9;
}

footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 0.76rem;
}

footer span {
  color: var(--cyan);
}

@media (max-width: 980px) {
  .arcade-layout,
  .engine-grid {
    grid-template-columns: 1fr;
  }

  .engine-card {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .topbar nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    min-height: 720px;
    padding: 78px 18px;
  }

  .section {
    padding: 62px 18px;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cabinet-controls {
    align-items: flex-start;
    flex-direction: column;
  }
}
