:root {
  --bg-0: #080312;
  --bg-1: #140b24;
  --bg-2: #27153a;
  --ink: #f7f1db;
  --muted: #c7bc9d;
  --panel: rgba(11, 8, 22, 0.78);
  --panel-strong: rgba(17, 11, 31, 0.92);
  --line: rgba(255, 196, 92, 0.32);
  --accent: #ffb84d;
  --select: #8cf6d4;
  --shadow: rgba(0, 0, 0, 0.44);
  --font-display: Consolas, "Lucida Console", "Courier New", monospace;
  --profile-portrait-rail-width: clamp(156px, 18vw, 196px);
  --profile-avatar-frame-size: clamp(144px, 16vw, 164px);
  --profile-avatar-image-size: clamp(112px, 13vw, 132px);
  --profile-avatar-frame-padding: clamp(8px, 1vw, 10px);
  --profile-radius-xs: 8px;
  --profile-radius-sm: 12px;
  --profile-radius-md: 16px;
  --profile-radius-lg: 22px;
  --profile-radius-pill: 999px;
  /* Shared layout grid tokens — used by both the live profile pages and the layout editor. */
  --profile-layout-row-height: clamp(56px, 6vw, 88px);
  --profile-layout-gap: clamp(8px, 1vw, 14px);
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--ink);
  font-family: var(--font-display);
  background:
    radial-gradient(circle at top, rgba(255, 184, 77, 0.12), transparent 30%),
    radial-gradient(circle at 20% 20%, rgba(140, 246, 212, 0.08), transparent 24%),
    linear-gradient(180deg, var(--bg-2), var(--bg-0) 55%);
  letter-spacing: 0.03em;
}

body::before,
.scanlines,
.crt-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  content: "";
}

body::before {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.02), transparent 32%),
    linear-gradient(300deg, rgba(255, 109, 87, 0.05), transparent 40%);
}

.scanlines {
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.05) 0,
      rgba(255, 255, 255, 0.01) 1px,
      transparent 3px,
      transparent 6px
    );
  opacity: 0.12;
}

.crt-overlay {
  background: radial-gradient(circle, transparent 42%, rgba(0, 0, 0, 0.3) 100%);
}

.arcade-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 0 44px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 40px 32px;

  background:
    radial-gradient(circle at 20% 10%, rgba(255, 184, 77, 0.25), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(140, 246, 212, 0.15), transparent 40%),
    linear-gradient(180deg, rgba(20, 12, 36, 0.98), rgba(6, 4, 14, 0.95));

  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);

  box-shadow:
    0 30px 80px rgba(0,0,0,0.7),
    0 0 40px rgba(255,184,77,0.15);
}

.hero h1,
.page-header h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow: 0 0 60px rgba(255, 184, 77, 0.3), 0 2px 0 rgba(0, 0, 0, 0.6);
}

.hero-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mode-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.mode-card,
.game-card,
.back-link,
.pager-button {
  color: inherit;
  text-decoration: none;
}

.mode-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 220px;
  padding: 22px;
  border: 1px solid rgba(255, 196, 92, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 184, 77, 0.06), transparent 32%),
    var(--panel);
  box-shadow: 0 20px 40px var(--shadow);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.mode-card::before {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  content: "";
}

.mode-card:hover,
.mode-card.gamepad-selected,
.game-card:hover,
.game-card.gamepad-selected,
.pager-button:hover,
.back-link:hover {
  transform: translateY(-4px);
  border-color: rgba(140, 246, 212, 0.55);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.55), 0 0 24px rgba(140, 246, 212, 0.08);
}

.game-card.featured:hover,
.game-card.featured.gamepad-selected {
  border-color: rgba(255, 184, 77, 0.65);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.55), 0 0 28px rgba(255, 184, 77, 0.14);
}

.mode-label,
.game-status,
.game-players,
.game-kicker,
.page-indicator {
  font-size: 0.78rem;
  text-transform: uppercase;
}

.mode-card h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1;
  text-transform: uppercase;
}

.mode-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.game-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mode-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.game-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.mode-badge-row,
.game-card-topline,
.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mode-badge-row {
  margin-top: auto;
}

.mode-badge {
  border: 1px solid rgba(255, 196, 92, 0.28);
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Mode card top-bar variants */
.mode-card--floor::after {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--select) 50%, transparent 95%);
  content: "";
}

.mode-card--cabinet::after {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--accent) 50%, transparent 95%);
  content: "";
}

.pixel-text__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pixel-text__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  shape-rendering: crispEdges;
}

.pixel-text__pixel {
  fill: #fff8ff;
}

@keyframes homeStageDrift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -8px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

@media (max-width: 700px) {
  .arcade-shell {
    width: min(1120px, calc(100vw - 18px));
    padding-top: 18px;
  }

  .hero,
  .mode-card {
    padding: 18px;
  }
}

