/* =====================================================
   SchoolBros — Design System & Global Styles v2.0
   Premium Gaming UI
   ===================================================== */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;500;600&display=swap');

/* ── CSS Custom Properties ── */
:root {
  --bg:           #0d0f18;
  --surface:      #161924;
  --surface-alt:  #1e2130;
  --surface-high: #272b3c;
  --accent:       #c084fc;
  --accent-glow:  #a855f7;
  --accent-dim:   #4c1d95;
  --secondary:    #38bdf8;
  --tertiary:     #fbbf24;
  --gold:         #fbbf24;
  --gold-dim:     #92400e;
  --green:        #34d399;
  --text:         #f1f0fa;
  --text-muted:   #8b83a3;
  --text-soft:    #c4bcd6;
  --border:       rgba(196, 188, 214, 0.12);
  --border-glow:  rgba(168, 85, 247, 0.4);
  --glass-bg:     rgba(13, 15, 24, 0.75);
  --glass-border: rgba(255, 255, 255, 0.07);
  --shadow-card:  0 4px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow:  0 0 32px rgba(168, 85, 247, 0.25);
  --shadow-gold:  0 0 24px rgba(251, 191, 36, 0.35);
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    18px;
  --radius-xl:    24px;
  --radius-2xl:   32px;
  --nav-h:        72px;
  --transition:   all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  --transition-spring: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1rem, 2vw, 1.3rem); }
h4 { font-size: 1.05rem; }

p { color: var(--text-soft); }
a { color: inherit; text-decoration: none; transition: var(--transition-fast); }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* ── Utility Classes ── */
.font-display { font-family: 'Space Grotesk', system-ui, sans-serif; }
.font-mono    { font-family: 'Space Mono', monospace; }
.text-gradient {
  background: linear-gradient(135deg, var(--accent-glow) 0%, #e879f9 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-accent  { color: var(--accent-glow); }
.text-gold    { color: var(--gold); }
.text-muted   { color: var(--text-muted); }
.text-secondary { color: var(--secondary); }
.glow-text-secondary { text-shadow: 0 0 12px rgba(56, 189, 248, 0.6); }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: var(--accent-dim) var(--surface); }

/* ── Page Loader ── */
#page-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 1.5rem;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem; font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent-glow), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: pulse-glow 1.5s ease-in-out infinite;
}
.loader-bar { width: 180px; height: 2px; background: var(--surface-alt); border-radius: 2px; overflow: hidden; }
.loader-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-glow), var(--gold));
  animation: loader-progress 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes loader-progress { from { width: 0%; } to { width: 100%; } }

/* ── Navigation ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000; height: var(--nav-h);
  display: flex; align-items: center; padding: 0 1.5rem;
  background: rgba(13, 15, 24, 0.88);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04), 0 4px 24px rgba(0,0,0,0.4);
  transition: var(--transition);
}
.nav.scrolled {
  background: rgba(13, 15, 24, 0.95);
  border-bottom-color: rgba(196, 188, 214, 0.1);
}
.nav-inner {
  width: 100%; max-width: 1400px;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em;
  color: var(--text); text-decoration: none;
}
.logo-icon {
  width: 32px; height: 32px; display: block; flex-shrink: 0;
}
.logo-text { display: block; }
.nav-logo::after { display: none !important; }

.nav-links {
  display: flex; align-items: center; gap: 0.25rem; list-style: none;
}
.nav-links a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
  padding: 0.5rem 0.9rem; border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.nav-links a.active { color: var(--accent); background: rgba(168, 85, 247, 0.1); }

.nav-cta {
  background: linear-gradient(135deg, var(--accent-glow), #7c3aed) !important;
  color: white !important; font-weight: 700 !important;
  padding: 0.5rem 1.25rem !important;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-sm) !important;
}
.nav-cta:hover {
  box-shadow: 0 0 32px rgba(168, 85, 247, 0.5) !important;
  transform: translateY(-1px);
  background: none !important;
}

.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 0.5rem; border: none;
  background: none; margin-left: 0.5rem;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-soft); border-radius: 2px;
  transition: var(--transition);
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: translateX(-10px); }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-drawer {
  display: none; position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: rgba(13, 15, 24, 0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 1.5rem 1.5rem;
  z-index: 999; animation: slideDown 0.2s ease;
}
.nav-drawer.open { display: block; }
.nav-drawer .nav-links { flex-direction: column; align-items: stretch; gap: 0.2rem; }
.nav-drawer .nav-links a { display: block; padding: 0.75rem 1rem; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Hero Section ── */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
  padding: var(--nav-h) 1.5rem 5rem;
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.5; }
.hero-bg-gradient {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 20%, rgba(124, 58, 237, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 15% 85%, rgba(56, 189, 248, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 85%, rgba(251, 191, 36, 0.05) 0%, transparent 60%),
    linear-gradient(180deg, transparent 50%, var(--bg) 100%);
}
.hero-content {
  position: relative; z-index: 2; max-width: 860px;
  animation: fadeInUp 0.8s ease 0.2s both;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: var(--accent); padding: 0.45rem 1.1rem;
  border-radius: 999px; font-size: 0.8rem;
  font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  margin-bottom: 1.75rem;
  animation: fadeInUp 0.8s ease 0s both;
}
.hero-badge .dot {
  width: 6px; height: 6px;
  background: var(--green); border-radius: 50%;
  box-shadow: 0 0 6px var(--green);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0.3;} }

.hero h1 { margin-bottom: 1.25rem; }
.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--accent-glow) 0%, #e879f9 50%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  max-width: 580px; margin: 0 auto 2.5rem;
  color: var(--text-soft); line-height: 1.7;
}
.hero-actions {
  display: flex; gap: 1rem; justify-content: center;
  flex-wrap: wrap; animation: fadeInUp 0.8s ease 0.4s both;
}
.hero-stats {
  display: flex; justify-content: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  margin-top: 4.5rem; flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.6s both;
}
.stat { text-align: center; }
.stat-num {
  display: block; font-size: clamp(1.6rem, 4vw, 2.25rem); font-weight: 800;
  background: linear-gradient(135deg, var(--accent-glow), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1.1; margin-bottom: 0.25rem;
}
.stat-label { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; letter-spacing: 0.03em; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem; border-radius: var(--radius-md);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem; font-weight: 700; cursor: pointer; border: none;
  transition: var(--transition-spring); text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-glow), #7c3aed);
  color: white; box-shadow: 0 4px 24px rgba(168, 85, 247, 0.4);
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 36px rgba(168, 85, 247, 0.55);
}
.btn-secondary {
  background: var(--surface-alt); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-high); border-color: rgba(168,85,247,0.3);
  transform: translateY(-2px);
}
.btn-ghost { background: transparent; color: var(--text-soft); border: 1px solid var(--glass-border); }
.btn-ghost:hover { color: var(--text); background: var(--surface); }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 0.95rem 2.25rem; font-size: 1.05rem; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  color: #1a0f00; box-shadow: 0 4px 20px rgba(251, 191, 36, 0.3);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(251, 191, 36, 0.45); }

/* ── Section Layout ── */
.section { padding: 5rem 1.5rem; }
.section-inner { max-width: 1400px; margin: 0 auto; }
.section-header {
  display: flex; align-items: flex-end;
  justify-content: space-between; gap: 1rem; margin-bottom: 2.5rem;
}
.section-title { display: flex; flex-direction: column; gap: 0.3rem; }
.section-eyebrow {
  font-size: 0.75rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--accent-glow);
}
.section-title h2 { color: var(--text); }

/* ── Game Cards ── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.game-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.07);
  overflow: hidden; cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.game-card:hover {
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(168,85,247,0.15), var(--shadow-glow);
}
.game-card-thumb {
  position: relative; height: 190px; overflow: hidden;
  background: var(--surface-alt);
}
.game-card-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, transparent 50%);
  z-index: 1; pointer-events: none;
}
.game-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.4,0,0.2,1);
}
.game-card:hover .game-card-thumb img { transform: scale(1.08); }

/* Thumbnail placeholder */
.game-card-thumb::before {
  content: '🎮';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; opacity: 0.15; z-index: 0;
}

.game-card-score {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  padding: 3px 9px; border-radius: 99px;
  font-family: 'Space Mono', monospace; font-size: 11px;
  color: var(--gold); border: 1px solid rgba(251,191,36,0.25);
  letter-spacing: 0.03em;
}

.game-card-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; flex-grow: 1; }

.game-card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 1rem;
  color: var(--text); margin-bottom: 0.35rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.game-card-meta {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.9rem; flex-wrap: wrap;
}
.badge-category {
  font-family: 'Space Mono', monospace;
  font-size: 10px; padding: 2px 7px;
  border: 1px solid rgba(56,189,248,0.4);
  color: var(--secondary); border-radius: 4px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.badge-playable {
  font-family: 'Space Mono', monospace;
  font-size: 10px; padding: 2px 7px;
  border: 1px solid rgba(52,211,153,0.4);
  color: var(--green); border-radius: 4px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.game-card-meta .year {
  font-family: 'Space Mono', monospace;
  font-size: 11px; color: var(--text-muted);
  margin-left: auto;
}
.btn-insert-coin {
  margin-top: auto; width: 100%;
  background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(124,58,237,0.25));
  color: var(--accent); border: 1px solid rgba(168,85,247,0.3);
  font-family: 'Space Mono', monospace; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 9px; border-radius: var(--radius-sm);
  cursor: pointer; text-align: center;
  transition: all 0.2s ease; font-weight: 700;
}
.btn-insert-coin:hover {
  background: linear-gradient(135deg, rgba(168,85,247,0.3), rgba(124,58,237,0.4));
  border-color: rgba(168,85,247,0.6);
  box-shadow: 0 0 16px rgba(168,85,247,0.2);
  color: white;
}

/* ── Category Filter ── */
.category-filter {
  display: flex; gap: 0.5rem; padding: 0.25rem 0 1.25rem;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.category-filter::-webkit-scrollbar { display: none; }
.filter-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1.1rem; border-radius: 999px;
  font-size: 0.825rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); transition: var(--transition);
  white-space: nowrap; flex-shrink: 0; letter-spacing: 0.01em;
}
.filter-pill:hover { border-color: rgba(168,85,247,0.3); color: var(--text); background: var(--surface-alt); }
.filter-pill.active {
  background: linear-gradient(135deg, var(--accent-glow), #7c3aed);
  border-color: transparent; color: white;
  box-shadow: 0 4px 16px rgba(168,85,247,0.35);
}

/* ── Search Bar ── */
.search-wrap { position: relative; max-width: 440px; }
.search-wrap svg {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-muted); pointer-events: none;
}
.search-input {
  width: 100%; padding: 0.7rem 1rem 0.7rem 2.65rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text);
  font-family: inherit; font-size: 0.9rem; transition: var(--transition); outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: rgba(168,85,247,0.5); box-shadow: 0 0 0 3px rgba(168,85,247,0.12); }

/* ── Player Page ── */
.player-page {
  padding-top: var(--nav-h); min-height: 100vh;
  display: grid; grid-template-columns: 1fr 300px;
}
.player-main { grid-column: 1; padding: 1.5rem 1.5rem 2rem 2rem; }
.player-sidebar {
  grid-column: 2; padding: 1.5rem 2rem 2rem 1rem;
  border-left: 1px solid var(--border);
}
.player-frame-wrap {
  position: relative; background: #000;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid rgba(168,85,247,0.2);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  aspect-ratio: 16/9; width: 100%;
}
.player-frame-wrap iframe { width: 100%; height: 100%; border: none; display: block; }

.player-controls {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.65rem 0.9rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  margin-top: 0.75rem;
}
.player-controls-left { display: flex; align-items: center; gap: 0.4rem; }
.player-controls-right { margin-left: auto; display: flex; align-items: center; gap: 0.4rem; }
.ctrl-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 0.35rem; padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm); font-family: inherit;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  border: none; background: var(--surface-alt); color: var(--text-soft);
  transition: var(--transition-fast);
}
.ctrl-btn:hover:not(:disabled) { background: var(--surface-high); color: var(--text); }
.ctrl-btn.fullscreen-btn {
  background: linear-gradient(135deg, var(--accent-glow), #7c3aed);
  color: white; min-width: 140px;
  box-shadow: 0 0 16px rgba(168,85,247,0.3);
}
.ctrl-btn.fullscreen-btn:hover:not(:disabled) {
  box-shadow: 0 0 28px rgba(168,85,247,0.5);
  transform: translateY(-1px);
}
.ctrl-btn.fullscreen-btn:disabled {
  opacity: 0.55; cursor: not-allowed;
  background: var(--surface-alt); color: var(--text-muted); box-shadow: none;
}
.fullscreen-countdown {
  font-size: 0.78rem; color: var(--text-muted);
  padding: 0.2rem 0.55rem; background: var(--surface-alt);
  border-radius: var(--radius-sm);
}
.ctrl-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Game Info ── */
.game-info { margin-top: 1.5rem; }
.game-info h1 { font-size: 1.7rem; margin-bottom: 0.6rem; color: var(--text); }
.game-info-meta {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  align-items: center; margin-bottom: 1rem;
}
.game-info p.desc { color: var(--text-soft); line-height: 1.75; margin-bottom: 1.5rem; }
.game-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  padding: 0.25rem 0.7rem;
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 999px; font-size: 0.78rem; color: var(--text-muted);
}

/* ── Player Sidebar ── */
.sidebar-section-title {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 0.85rem;
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--border);
}
.related-list { display: flex; flex-direction: column; gap: 0.6rem; }
.related-card {
  display: flex; gap: 0.75rem; align-items: center;
  padding: 0.6rem 0.75rem; border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--surface);
  transition: all 0.2s ease; text-decoration: none; color: inherit;
}
.related-card:hover {
  background: var(--surface-alt); border-color: rgba(168,85,247,0.25);
  transform: translateX(3px);
}
.related-thumb {
  width: 72px; height: 44px; border-radius: var(--radius-sm);
  overflow: hidden; flex-shrink: 0; background: var(--surface-alt);
}
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-title { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.related-meta { font-size: 0.73rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ── Ad Slots ── */
.ad-slot {
  background: var(--surface); border: 1px dashed rgba(100,116,139,0.15);
  border-radius: var(--radius-md); display: flex;
  align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.72rem;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.ad-leaderboard { width: 100%; height: 90px; margin: 1rem 0; }
.ad-sidebar { width: 100%; min-height: 250px; margin-bottom: 1.5rem; }
.ad-mid { width: 100%; height: 250px; margin: 2rem 0; }

/* ── Footer ── */
.footer { background: var(--surface); border-top: 1px solid var(--border); padding: 3.5rem 1.5rem 2rem; }
.footer-inner { max-width: 1400px; margin: 0 auto; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem; margin-bottom: 3rem;
}
.footer-brand p { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.75rem; line-height: 1.6; max-width: 280px; }
.footer-brand .footer-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent-glow), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.footer-col h4 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 1rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col ul a { font-size: 0.875rem; color: var(--text-soft); transition: var(--transition-fast); }
.footer-col ul a:hover { color: var(--accent-glow); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 2rem; border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-muted); gap: 1rem; flex-wrap: wrap;
}
.footer-donate {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: white; padding: 0.45rem 1rem; border-radius: 999px;
  font-size: 0.82rem; font-weight: 700; text-decoration: none; transition: var(--transition);
}
.footer-donate:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(239,68,68,0.4); }

/* ── Arcade Cards ── */
.arcade-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.arcade-card {
  position: relative; background: var(--surface);
  border-radius: var(--radius-xl); border: 1px solid var(--border);
  overflow: hidden; cursor: pointer; transition: var(--transition);
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}
.arcade-card:hover {
  border-color: rgba(168,85,247,0.35); transform: translateY(-8px);
  box-shadow: var(--shadow-glow), 0 20px 60px rgba(0,0,0,0.5);
}
.arcade-card-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--surface-alt); }
.arcade-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s ease; }
.arcade-card:hover .arcade-card-thumb img { transform: scale(1.06); }
.arcade-instant-badge {
  position: absolute; top: 0.75rem; right: 0.75rem;
  display: flex; align-items: center; gap: 0.3rem;
  background: rgba(52,211,153,0.85); color: #052e16;
  padding: 0.3rem 0.7rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; backdrop-filter: blur(6px);
}
.arcade-card-body { padding: 1.25rem 1.5rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.arcade-card-title { font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.arcade-card-desc { font-size: 0.875rem; color: var(--text-muted); flex: 1; margin-bottom: 1.25rem; line-height: 1.6; }
.arcade-play-btn {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 0.75rem;
  background: linear-gradient(135deg, var(--accent-glow), #7c3aed);
  color: white; border-radius: var(--radius-md); font-weight: 700;
  font-size: 0.9rem; transition: var(--transition); font-family: 'Space Grotesk', sans-serif;
}
.arcade-card:hover .arcade-play-btn { box-shadow: 0 0 24px rgba(168,85,247,0.5); }

/* ── Glass Card ── */
.glass-card {
  background: var(--glass-bg); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
}

/* ── Scroll Reveal ── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── No Results ── */
.no-results { grid-column: 1 / -1; text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.no-results svg { width: 48px; height: 48px; margin: 0 auto 1rem; opacity: 0.3; }

/* ── About / Content Pages ── */
.about-hero { padding: 8rem 1.5rem 4rem; text-align: center; }
.mission-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.mission-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem; transition: var(--transition);
}
.mission-card:hover { border-color: rgba(168,85,247,0.3); transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.mission-icon {
  width: 52px; height: 52px;
  background: rgba(168,85,247,0.1); border: 1px solid rgba(168,85,247,0.2);
  border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem; font-size: 1.5rem;
}
.mission-card h3 { margin-bottom: 0.5rem; }
.donate-section {
  background: linear-gradient(135deg, rgba(168,85,247,0.08), rgba(124,58,237,0.05));
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: var(--radius-xl); padding: 3rem; text-align: center; margin: 4rem 0;
}
.content-page { padding: calc(var(--nav-h) + 3rem) 1.5rem 5rem; max-width: 800px; margin: 0 auto; }
.content-page h1 { margin-bottom: 0.5rem; }
.content-page .subtitle { margin-bottom: 3rem; }
.content-page h2 { font-size: 1.25rem; margin-top: 2.5rem; margin-bottom: 0.75rem; color: var(--text); }
.content-page p, .content-page li { color: var(--text-soft); line-height: 1.8; margin-bottom: 0.75rem; }
.content-page ul, .content-page ol { padding-left: 1.5rem; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }
.form-label { font-size: 0.875rem; font-weight: 600; color: var(--text-soft); }
.form-input, .form-textarea {
  width: 100%; padding: 0.8rem 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text);
  font-family: inherit; font-size: 0.9rem; outline: none; transition: var(--transition);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-input:focus, .form-textarea:focus {
  border-color: rgba(168,85,247,0.5); box-shadow: 0 0 0 3px rgba(168,85,247,0.12);
}
.form-textarea { resize: vertical; min-height: 140px; }

/* ── Mobile Touch Gamepad ── */
#touch-gamepad {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 500;
  padding: 12px 16px 20px;
  background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 100%);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  user-select: none; -webkit-user-select: none;
  touch-action: none;
}
#touch-gamepad.visible { display: flex; }
.gamepad-layout {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; max-width: 600px; margin: 0 auto; width: 100%;
}
.gamepad-left, .gamepad-right { flex: 0 0 auto; }
.gamepad-center {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; gap: 8px;
}

/* D-Pad */
.dpad {
  position: relative; width: 120px; height: 120px;
}
.dpad-btn {
  position: absolute; width: 36px; height: 36px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s; color: rgba(255,255,255,0.7);
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.dpad-btn:active, .dpad-btn.pressed {
  background: rgba(168,85,247,0.4);
  border-color: rgba(168,85,247,0.7);
  color: white;
  box-shadow: 0 0 12px rgba(168,85,247,0.5);
}
.dpad-up    { top: 0; left: 50%; transform: translateX(-50%); }
.dpad-down  { bottom: 0; left: 50%; transform: translateX(-50%); }
.dpad-left  { left: 0; top: 50%; transform: translateY(-50%); }
.dpad-right { right: 0; top: 50%; transform: translateY(-50%); }
.dpad-center {
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.dpad-btn svg { width: 16px; height: 16px; pointer-events: none; }

/* Center meta buttons */
.gamepad-meta-row {
  display: flex; align-items: center; gap: 8px;
}
.meta-btn {
  height: 26px; padding: 0 10px; border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6); font-size: 9px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; transition: background 0.1s;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Space Grotesk', sans-serif;
}
.meta-btn:active, .meta-btn.pressed {
  background: rgba(255,255,255,0.2); color: white;
}

/* Action Buttons (ABXY) */
.action-buttons {
  position: relative; width: 120px; height: 120px;
}
.action-btn {
  position: absolute; width: 40px; height: 40px; border-radius: 50%;
  border: none; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800; font-size: 15px;
  transition: all 0.1s; box-shadow: 0 3px 10px rgba(0,0,0,0.5);
  -webkit-tap-highlight-color: transparent;
}
.action-btn:active, .action-btn.pressed {
  transform: scale(0.9);
  box-shadow: 0 0 16px currentColor;
  filter: brightness(1.3);
}
/* Cross (X) — bottom */
.btn-cross {
  bottom: 0; left: 50%; transform: translateX(-50%);
  background: #1a6bb5; color: white;
  box-shadow: 0 3px 10px rgba(26,107,181,0.5);
}
.btn-cross:active { box-shadow: 0 0 16px rgba(26,107,181,0.8); }
/* Circle (O) — right */
.btn-circle {
  right: 0; top: 50%; transform: translateY(-50%);
  background: #b51a1a; color: white;
  box-shadow: 0 3px 10px rgba(181,26,26,0.5);
}
.btn-circle:active { box-shadow: 0 0 16px rgba(181,26,26,0.8); }
/* Square — left */
.btn-square {
  left: 0; top: 50%; transform: translateY(-50%);
  background: #5a1ab5; color: white;
  box-shadow: 0 3px 10px rgba(90,26,181,0.5);
}
.btn-square:active { box-shadow: 0 0 16px rgba(90,26,181,0.8); }
/* Triangle — top */
.btn-triangle {
  top: 0; left: 50%; transform: translateX(-50%);
  background: #1ab57a; color: white;
  box-shadow: 0 3px 10px rgba(26,181,122,0.5);
}
.btn-triangle:active { box-shadow: 0 0 16px rgba(26,181,122,0.8); }

/* ── Scanlines effect (subtle) ── */
.scanlines::before {
  content: " "; display: block; position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 4px
  );
  z-index: 2; pointer-events: none;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 4rem 0;
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .games-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 1024px) {
  .player-page { grid-template-columns: 1fr; }
  .player-sidebar {
    grid-column: 1; border-left: none;
    border-top: 1px solid var(--border); padding: 1.5rem 2rem;
  }
  .player-main { padding: 1.5rem 1.5rem 1rem; }
  .arcade-grid { grid-template-columns: repeat(2, 1fr); }
  .mission-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --nav-h: 64px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
  .arcade-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.75rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 0.75rem; }
  .section { padding: 3.5rem 1.25rem; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .mission-grid { grid-template-columns: 1fr; }
  .player-main { padding: 1rem; }
  .player-sidebar { padding: 1rem 1.25rem; }
  #touch-gamepad.visible { display: flex; }
}

@media (max-width: 480px) {
  .games-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
  .nav { padding: 0 1rem; }
  .game-card-thumb { height: 170px; }
  .hero-stats { gap: 1.25rem; }
}

/* ── Touch-device only: show gamepad ── */
@media (pointer: coarse) {
  #touch-gamepad { display: none; } /* controlled by JS */
}
