* { box-sizing: border-box; }

:root {
  --yellow: #ffe45c;
  --orange: #ff9d00;
  --hot: #ff3d6e;
  --cyan: #5ad1ff;
  --magenta: #ff5ad1;
  --purple: #1a1030;
  --ink: #e8f6ff;
  --panel: rgba(16, 10, 32, 0.88);
  --line: rgba(122, 92, 200, 0.35);
  --display: 'Press Start 2P', ui-monospace, monospace;
  --body: 'Chakra Petch', ui-monospace, 'Courier New', monospace;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: #05030a;
  color: var(--ink);
  font-family: var(--body);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Animated synthwave backdrop ─────────────────────────── */
.bg-fx {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 780px;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, #2a1550 0%, #140a28 46%, #05030a 82%);
  pointer-events: none;
}
/* fade the backdrop into the solid page so content below sits on clean dark */
.bg-fx::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(5, 3, 10, 0.7) 66%, #05030a 100%);
}
.bg-fx .sun {
  position: absolute;
  left: 50%;
  top: 8%;
  width: min(70vw, 520px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--yellow) 0%, var(--orange) 38%, var(--hot) 66%, var(--magenta) 100%);
  filter: blur(0.5px);
  -webkit-mask-image: repeating-linear-gradient(180deg, #000 0 10px, transparent 10px 15px);
          mask-image: repeating-linear-gradient(180deg, #000 0 10px, transparent 10px 15px);
  opacity: 0.55;
  box-shadow: 0 0 120px 40px rgba(255, 61, 110, 0.25);
}
.bg-fx .grid {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -10%;
  height: 70vh;
  background-image:
    linear-gradient(rgba(90, 209, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 90, 209, 0.28) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: perspective(340px) rotateX(68deg);
  transform-origin: bottom center;
  animation: grid-run 1.6s linear infinite;
  -webkit-mask-image: linear-gradient(transparent 0%, #000 55%);
          mask-image: linear-gradient(transparent 0%, #000 55%);
}
@keyframes grid-run {
  from { background-position: 0 0; }
  to   { background-position: 0 44px; }
}

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 960px;
  padding: 18px 20px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(13px, 2.6vw, 20px);
  line-height: 1;
  letter-spacing: 1px;
  color: var(--yellow);
  text-shadow: 0 0 8px var(--orange), 0 2px 0 #7a2a00;
}
.logo span { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); margin-left: 0.35em; }
.topbar-link {
  font-family: var(--display);
  font-size: 9px;
  color: var(--magenta);
  text-decoration: none;
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(255, 90, 209, 0.6);
  white-space: nowrap;
}
.topbar-link:hover { color: #fff; }

/* ── Stage ───────────────────────────────────────────────── */
.stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 960px;
  padding: 6px 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tagline {
  margin: 10px 0 18px;
  text-align: center;
  font-size: clamp(15px, 3.2vw, 22px);
  font-weight: 500;
  color: #cfe8ff;
  letter-spacing: 0.5px;
}
.tagline em {
  font-style: normal;
  color: var(--yellow);
  text-shadow: 0 0 12px rgba(255, 228, 92, 0.5);
}

/* ── Cabinet / CRT screen ────────────────────────────────── */
.cabinet {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#screen-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 480 / 270;
  background: #000;
  border: 6px solid #3a3a4a;
  border-radius: 12px;
  box-shadow:
    0 0 0 3px #0a0a12 inset,
    0 0 26px 4px rgba(90, 209, 255, 0.4),
    0 0 70px rgba(255, 90, 209, 0.28),
    0 24px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}
#scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.18) 0px,
    rgba(0, 0, 0, 0.18) 1px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0) 3px
  );
  mix-blend-mode: multiply;
}
#scanlines::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.05) 0%, rgba(0,0,0,0.35) 100%);
}
.cab-hint {
  margin: 14px 0 0;
  font-size: clamp(11px, 2.4vw, 14px);
  color: #9be8ff;
  letter-spacing: 0.5px;
}

/* ── Key chips ───────────────────────────────────────────── */
.key {
  display: inline-block;
  font-family: var(--display);
  font-size: 0.72em;
  line-height: 1;
  padding: 5px 7px;
  color: #05030a;
  background: var(--cyan);
  border-radius: 4px;
  box-shadow: 0 2px 0 #2a7ea0;
  vertical-align: middle;
}

/* ── Controls row ────────────────────────────────────────── */
.controls {
  margin-top: 22px;
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  backdrop-filter: blur(6px);
}
.ctrl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ctrl-lbl {
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #cfe8ff;
}
.ctrl-lbl.accent { color: var(--yellow); }

/* ── Features ────────────────────────────────────────────── */
.features {
  margin-top: 26px;
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.feat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 18px;
  backdrop-filter: blur(6px);
}
.feat-icon { font-size: 26px; margin-bottom: 8px; }
.feat h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 11px;
  line-height: 1.4;
  color: var(--yellow);
  text-shadow: 0 0 8px rgba(255, 157, 0, 0.4);
}
.feat p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #b9c8e8;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-foot {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 960px;
  margin-top: auto;
  padding: 22px 20px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #7c8aa8;
}
.site-foot a {
  color: var(--cyan);
  text-decoration: none;
}
.site-foot a:hover { color: #fff; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 720px) {
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .controls { gap: 8px 14px; }
  .ctrl-lbl { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-fx .grid { animation: none; }
}
