:root {
  --bg-1: #09121e;
  --bg-2: #13273d;
  --bg-3: #3f1d32;
  --text: #eefaff;
  --muted: #a8d4e6;
  --accent: #67f0ff;
  --accent-2: #ffb86c;
  --panel: rgba(7, 15, 25, 0.8);
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

body[data-color-mode="colorblind"] {
  --accent: #5dd6ff;
  --accent-2: #ffd766;
  --muted: #c3deea;
}

body[data-color-mode="high-contrast"] {
  --bg-1: #02050c;
  --bg-2: #061425;
  --bg-3: #141010;
  --text: #ffffff;
  --muted: #d3ecff;
  --border: rgba(255, 255, 255, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(103, 240, 255, 0.18), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(255, 184, 108, 0.16), transparent 24%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2) 52%, var(--bg-3));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 34px 34px;
}

body.reduced-motion * {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
}

.page-shell {
  width: min(1200px, calc(100% - 28px));
  margin: 0 auto;
  padding: 34px 0 54px;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.74rem;
  font-weight: 700;
}

h1,
h2 {
  font-family: "Orbitron", sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.hero-copy {
  margin: 14px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1rem;
}

.hero-wide {
  margin-bottom: 20px;
}

.home-jump,
.back-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.arcade-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.game-card {
  position: relative;
  overflow: hidden;
  min-height: 246px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.game-card::before {
  content: "";
  position: absolute;
  inset: auto -20% -35% 35%;
  height: 210px;
  border-radius: 50%;
  filter: blur(12px);
  opacity: 0.36;
}

.runner-card::before {
  background: radial-gradient(circle, rgba(103, 240, 255, 0.8), transparent 60%);
}

.platformer-card::before {
  background: radial-gradient(circle, rgba(255, 184, 108, 0.82), transparent 60%);
}

.breaker-card::before {
  background: radial-gradient(circle, rgba(178, 140, 255, 0.82), transparent 60%);
}

.apocalypse-card::before {
  background: radial-gradient(circle, rgba(255, 96, 132, 0.84), transparent 60%);
}

.hideout-card::before {
  background: radial-gradient(circle, rgba(120, 255, 210, 0.84), transparent 60%);
}

.search-card::before {
  background: radial-gradient(circle, rgba(141, 255, 176, 0.8), transparent 60%);
}

.card-tag {
  margin: 0 0 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
}

.game-card h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.game-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.play-link,
.panel-button,
.tiny-button {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.play-link {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-top: 16px;
  padding: 10px 15px;
  color: #07111f;
  background: linear-gradient(135deg, var(--accent), #ddfcff);
}

.alt-link {
  background: rgba(255, 255, 255, 0.08);
  color: #e9f7ff;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hub-layout {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1.1fr;
  gap: 14px;
}

.feature-stack,
.center-stage,
.side-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.panel-card {
  background: rgba(8, 14, 24, 0.8);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
}

.panel-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.name-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

input,
select,
textarea,
.panel-button,
.tiny-button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 9px 10px;
}

textarea {
  resize: vertical;
}

.panel-button {
  padding: 8px 14px;
  color: #07111f;
  background: linear-gradient(135deg, var(--accent), #ddfcff);
}

.tiny-button {
  display: inline-block;
  padding: 6px 11px;
  color: #07111f;
  background: linear-gradient(135deg, var(--accent-2), #ffe1b9);
}

.tiny-button:disabled,
.panel-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.stat-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stat-box,
.score-tile {
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.tiny-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.chip-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.76rem;
  color: var(--text);
}

.stack-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack-item {
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(0, 0, 0, 0.18);
  padding: 9px 10px;
}

.stack-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.row-meta {
  margin-top: 7px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.79rem;
}

.reward-pill {
  margin: 0;
  display: inline-block;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 11px;
  color: var(--text);
}

.challenge-copy {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.45;
}

.attract-screen {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(0, 0, 0, 0.22);
  padding: 12px;
}

.attract-title {
  margin: 0;
  font-family: "Orbitron", sans-serif;
}

.attract-copy {
  margin: 8px 0 0;
  color: var(--muted);
}

.now-playing {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.toggle-row {
  margin: 10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.keymap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .hub-layout {
    grid-template-columns: 1fr;
  }

  .arcade-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .page-shell {
    width: min(100%, calc(100% - 18px));
    padding-top: 24px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .game-card {
    min-height: 220px;
    border-radius: 18px;
  }

  .form-grid,
  .keymap-grid {
    grid-template-columns: 1fr;
  }
}
