/* ==========================================================================
   MEME ARCADE — NEON PIXEL CLUB
   Modern Indie Gaming Platform & Arcade Editorial Design System
   ========================================================================== */

:root {
  /* Core Surface Tones (Deep Ink) */
  --npc-ink-950: #07080d;
  --npc-ink-900: #0c0e15;
  --npc-ink-850: #121520;
  --npc-ink-800: #181c2b;
  --npc-ink-750: #202538;
  --npc-border: rgba(255, 255, 255, 0.08);
  --npc-border-hover: rgba(255, 255, 255, 0.2);

  /* Neon Accent Palette */
  --npc-lime: #c6ff00;
  --npc-lime-glow: rgba(198, 255, 0, 0.35);
  --npc-coral: #ff3366;
  --npc-coral-glow: rgba(255, 51, 102, 0.35);
  --npc-violet: #8b5cf6;
  --npc-violet-glow: rgba(139, 92, 246, 0.35);
  --npc-cyan: #00f0ff;
  --npc-cyan-glow: rgba(0, 240, 255, 0.35);
  --npc-amber: #ffb703;
  --npc-amber-glow: rgba(255, 183, 3, 0.35);
  --npc-white: #fafafa;
  --npc-text-muted: #8e9bb0;

  /* Typography */
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-pixel: 'Press Start 2P', monospace;

  /* Transitions */
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset & Smooth Scroll */
html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(ellipse at 50% -18%, rgba(139, 92, 246, 0.14), transparent 48%),
    var(--npc-ink-950);
  color: var(--npc-white);
  font-family: var(--font-body);
  letter-spacing: -0.01em;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Subtle Pixel Dot Matrix Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* Typography Utility Classes */
.font-display {
  font-family: var(--font-display) !important;
  letter-spacing: -0.03em;
}

.font-body {
  font-family: var(--font-body) !important;
}

.font-pixel {
  font-family: var(--font-pixel) !important;
  letter-spacing: -0.05em;
}

.text-lime { color: var(--npc-lime) !important; }
.text-coral { color: var(--npc-coral) !important; }
.text-violet { color: var(--npc-violet) !important; }
.text-cyan { color: var(--npc-cyan) !important; }
.text-amber { color: var(--npc-amber) !important; }
.text-muted-custom { color: var(--npc-text-muted) !important; }

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.npc-navbar {
  background: rgba(12, 14, 21, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--npc-border);
  z-index: 1030;
  transition: all 0.25s var(--ease-smooth);
}

.npc-brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.npc-brand-emblem {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--npc-lime), var(--npc-cyan));
  color: var(--npc-ink-950);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 0 15px var(--npc-lime-glow);
  transform: rotate(-3deg);
  transition: transform 0.2s var(--ease-spring);
}

.npc-brand-wrap:hover .npc-brand-emblem {
  transform: rotate(0deg) scale(1.08);
}

.npc-brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.02em;
}

.npc-brand-badge {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  padding: 0.2rem 0.45rem;
  background: rgba(198, 255, 0, 0.12);
  border: 1px solid var(--npc-lime);
  color: var(--npc-lime);
  border-radius: 4px;
  letter-spacing: 0;
  display: inline-block;
  margin-top: 2px;
}

.npc-nav-link {
  color: var(--npc-text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.npc-nav-link:hover, .npc-nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.npc-token-pill {
  background: rgba(255, 183, 3, 0.1);
  border: 1px solid rgba(255, 183, 3, 0.4);
  color: var(--npc-amber);
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 0 12px rgba(255, 183, 3, 0.15);
}

/* Nav Control Buttons */
.npc-btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--npc-ink-850);
  border: 1px solid var(--npc-border);
  color: var(--npc-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.npc-btn-icon:hover {
  background: var(--npc-ink-800);
  border-color: var(--npc-border-hover);
  color: var(--npc-lime);
  transform: translateY(-1px);
}

.npc-btn-icon:active {
  transform: translateY(1px);
}

/* ==========================================================================
   BUTTONS & MICRO-INTERACTIONS
   ========================================================================== */
.btn-npc-primary {
  background: var(--npc-lime);
  color: var(--npc-ink-950);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.75rem 1.6rem;
  border-radius: 10px;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  box-shadow: 0 4px 18px var(--npc-lime-glow);
  transition: all 0.2s var(--ease-spring);
  text-decoration: none;
  cursor: pointer;
}

.btn-npc-primary:hover {
  background: #d8ff33;
  color: var(--npc-ink-950);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--npc-lime-glow);
}

.btn-npc-primary:active {
  transform: translateY(1px);
}

.btn-npc-secondary {
  background: var(--npc-ink-850);
  color: #fff;
  border: 1px solid var(--npc-border);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}

.btn-npc-secondary:hover {
  background: var(--npc-ink-800);
  border-color: var(--npc-border-hover);
  color: var(--npc-white);
  transform: translateY(-2px);
}

.btn-npc-coral {
  background: var(--npc-coral);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: 10px;
  border: none;
  box-shadow: 0 4px 18px var(--npc-coral-glow);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  transition: all 0.2s var(--ease-spring);
  text-decoration: none;
  cursor: pointer;
}

.btn-npc-coral:hover {
  background: #ff4d7a;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--npc-coral-glow);
}

/* ==========================================================================
   EDITORIAL HERO SECTION
   ========================================================================== */
.npc-hero {
  position: relative;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(24, 28, 43, 0.7) 0%, rgba(12, 14, 21, 0.95) 100%);
  border: 1px solid var(--npc-border);
  padding: 4rem 3rem;
  margin-bottom: 4rem;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.npc-hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.npc-hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: 10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(198, 255, 0, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.npc-hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.npc-hero-headline .highlight-lime {
  color: var(--npc-lime);
  display: inline-block;
  text-shadow: 0 0 25px var(--npc-lime-glow);
}

.npc-hero-headline .highlight-coral {
  color: var(--npc-coral);
  display: inline-block;
  text-shadow: 0 0 25px var(--npc-coral-glow);
}

.npc-hero-lead {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--npc-text-muted);
  max-width: 540px;
  margin-bottom: 2.2rem;
}

/* Hero Interactive Teaser / Preview Card */
.npc-hero-teaser {
  position: relative;
  background: var(--npc-ink-900);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  z-index: 1;
  transition: transform 0.3s var(--ease-smooth);
}

.npc-hero-teaser:hover {
  transform: translateY(-4px);
  border-color: var(--npc-border-hover);
}

.npc-teaser-screen {
  background: #000;
  border-radius: 12px;
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.npc-pixel-stage {
  font-size: 4.5rem;
  animation: floatTeaser 3s ease-in-out infinite;
}

@keyframes floatTeaser {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); }
}

.npc-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--npc-lime);
  background: rgba(198, 255, 0, 0.1);
  border: 1px solid rgba(198, 255, 0, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.npc-pulse-dot {
  width: 7px;
  height: 7px;
  background: var(--npc-lime);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--npc-lime);
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

/* ==========================================================================
   FEATURED SPOTLIGHT GAME (EDITORIAL ASYMMETRIC BANNER)
   ========================================================================== */
.npc-featured-spotlight {
  background: linear-gradient(135deg, rgba(24, 28, 43, 0.8) 0%, rgba(18, 21, 32, 0.95) 100%);
  border: 1px solid var(--npc-border);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 4rem;
  position: relative;
  transition: border-color 0.25s ease;
}

.npc-featured-spotlight:hover {
  border-color: var(--npc-cyan);
}

.npc-spotlight-art {
  height: 100%;
  min-height: 320px;
  background: radial-gradient(circle at center, #1b2238 0%, #0d101d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.npc-spotlight-icon {
  font-size: 7.5rem;
  transition: transform 0.4s var(--ease-spring);
}

.npc-featured-spotlight:hover .npc-spotlight-icon {
  transform: scale(1.12) rotate(3deg);
}

/* ==========================================================================
   GAME LIBRARY & FILTER CONTROLS
   ========================================================================== */
.npc-section-header {
  margin-bottom: 2rem;
}

.npc-section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.03em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.npc-section-tag {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--npc-violet);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
}

/* Filter Pills Bar */
.npc-filter-pill {
  background: var(--npc-ink-850);
  border: 1px solid var(--npc-border);
  color: var(--npc-text-muted);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.npc-filter-pill:hover {
  background: var(--npc-ink-800);
  color: #fff;
  border-color: var(--npc-border-hover);
}

.npc-filter-pill.active {
  background: var(--npc-lime);
  color: var(--npc-ink-950);
  border-color: var(--npc-lime);
  box-shadow: 0 0 14px var(--npc-lime-glow);
}

/* Search & Sort Controls */
.npc-search-wrap {
  position: relative;
  min-width: 260px;
}

.npc-search-input {
  background: var(--npc-ink-850);
  border: 1px solid var(--npc-border);
  color: #fff;
  font-size: 0.88rem;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  border-radius: 10px;
  width: 100%;
  transition: all 0.2s ease;
}

.npc-search-input:focus {
  background: var(--npc-ink-800);
  border-color: var(--npc-cyan);
  outline: none;
  box-shadow: 0 0 12px var(--npc-cyan-glow);
}

.npc-search-icon {
  position: absolute;
  top: 50%;
  left: 0.85rem;
  transform: translateY(-50%);
  color: var(--npc-text-muted);
  pointer-events: none;
}

.npc-sort-select {
  background: var(--npc-ink-850);
  border: 1px solid var(--npc-border);
  color: var(--npc-text-muted);
  font-size: 0.88rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  cursor: pointer;
}

.npc-sort-select:focus {
  outline: none;
  border-color: var(--npc-border-hover);
}

/* ==========================================================================
   GAME CARDS (ASYMMETRIC & POLISHED)
   ========================================================================== */
.npc-game-card {
  background: var(--npc-ink-850);
  border: 1px solid var(--npc-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s var(--ease-spring);
  position: relative;
  height: 100%;
}

.npc-game-card:hover {
  transform: translateY(-6px);
  border-color: var(--card-accent, var(--npc-cyan));
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.5), 0 0 20px var(--card-glow, rgba(0, 240, 255, 0.15));
}

.npc-card-art {
  height: 165px;
  background: radial-gradient(circle at center, #1b2034 0%, #0d101a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.npc-card-art-icon {
  font-size: 4.6rem;
  transition: transform 0.3s var(--ease-spring);
  user-select: none;
}

.npc-game-card:hover .npc-card-art-icon {
  transform: scale(1.15) rotate(4deg);
}

.npc-badge-genre {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(12, 14, 21, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--npc-border);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
}

.npc-badge-score {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(198, 255, 0, 0.12);
  border: 1px solid var(--npc-lime);
  color: var(--npc-lime);
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

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

.npc-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.npc-card-subtitle {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--card-accent, var(--npc-cyan));
  margin-bottom: 0.75rem;
}

.npc-card-desc {
  font-size: 0.85rem;
  color: var(--npc-text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.npc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--npc-border);
}

.npc-card-meta {
  font-size: 0.78rem;
  color: var(--npc-text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.npc-btn-play {
  background: var(--card-accent, var(--npc-lime));
  color: var(--npc-ink-950);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.npc-btn-play:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px var(--card-glow, var(--npc-lime-glow));
}

/* Wide Horizontal Card Variant */
.npc-game-card-wide {
  grid-column: span 2;
  flex-direction: row;
}

.npc-game-card-wide .npc-card-art {
  width: 40%;
  height: auto;
  min-height: 190px;
}

.npc-game-card-wide .npc-card-body {
  width: 60%;
}

@media (max-width: 991px) {
  .npc-game-card-wide {
    grid-column: span 1;
    flex-direction: column;
  }
  .npc-game-card-wide .npc-card-art {
    width: 100%;
    height: 165px;
  }
  .npc-game-card-wide .npc-card-body {
    width: 100%;
  }
}

/* ==========================================================================
   SUPPORTING SECTIONS (TRENDING, RECENT, PERSONAL BESTS)
   ========================================================================== */
.npc-stat-pill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.2rem;
  border-radius: 12px;
  background: var(--npc-ink-850);
  border: 1px solid var(--npc-border);
  margin-bottom: 0.65rem;
  transition: all 0.15s ease;
}

.npc-stat-pill-row:hover {
  background: var(--npc-ink-800);
  border-color: var(--npc-border-hover);
}

.npc-progress-bar-wrap {
  background: var(--npc-ink-900);
  border: 1px solid var(--npc-border);
  border-radius: 20px;
  height: 12px;
  overflow: hidden;
  position: relative;
}

.npc-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--npc-lime), var(--npc-cyan));
  border-radius: 20px;
  transition: width 0.6s ease;
}

/* Closing CTA Card */
.npc-closing-cta {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(198, 255, 0, 0.1) 100%), var(--npc-ink-900);
  border: 1px solid var(--npc-border);
  border-radius: 24px;
  padding: 3.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-top: 5rem;
}

/* ==========================================================================
   ACTIVE GAMEPLAY SHELL & CABINET
   ========================================================================== */
.npc-game-shell {
  background: var(--npc-ink-900);
  border: 1px solid var(--npc-border);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  position: relative;
}

.npc-shell-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--npc-border);
}

/* HUD Panel */
.npc-hud-bar {
  background: rgba(7, 8, 13, 0.9);
  border-bottom: 1px solid var(--npc-border);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.npc-hud-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.npc-hud-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--npc-text-muted);
  text-transform: uppercase;
}

.npc-hud-value {
  font-family: var(--font-pixel);
  font-size: 0.95rem;
  font-weight: bold;
}

/* Canvas Stage Frame */
.npc-canvas-frame {
  position: relative;
  background: #040509;
  border: 2px solid var(--npc-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 0, 0, 0.5);
  max-width: 860px;
  margin: 0 auto;
}

#game-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  touch-action: none;
}

/* CRT Scanline Filter */
.npc-crt-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.28) 50%),
              linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 3px, 4px 100%;
}

.crt-active .npc-crt-layer {
  opacity: 1;
}

/* Dedicated Game Guide / Instructions Accordion */
.npc-guide-card {
  background: var(--npc-ink-850);
  border: 1px solid var(--npc-border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
}

/* Keyboard Key Graphic */
.npc-kbd {
  background: var(--npc-ink-750);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 3px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  display: inline-block;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Mobile Virtual D-Pad & Controls */
.npc-mobile-pad {
  background: var(--npc-ink-900);
  border-top: 1px solid var(--npc-border);
  padding: 1rem;
  user-select: none;
  touch-action: manipulation;
}

.npc-pad-btn {
  background: var(--npc-ink-800);
  border: 1px solid var(--npc-border);
  color: #fff;
  border-radius: 10px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
  cursor: pointer;
  touch-action: manipulation;
}

.npc-pad-btn:active {
  background: var(--npc-lime);
  color: var(--npc-ink-950);
  transform: scale(0.93);
}

.npc-action-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s ease;
  border: none;
}

.npc-action-btn.btn-a {
  background: var(--npc-coral);
  color: #fff;
  box-shadow: 0 4px 15px var(--npc-coral-glow);
}

.npc-action-btn.btn-b {
  background: var(--npc-amber);
  color: var(--npc-ink-950);
  box-shadow: 0 4px 15px var(--npc-amber-glow);
}

.npc-action-btn:active {
  transform: scale(0.9);
}

/* ==========================================================================
   MODALS (LEADERBOARD, ACHIEVEMENTS, SETTINGS, HOW TO PLAY, GAME OVER)
   ========================================================================== */
.modal-content.npc-modal {
  background-color: var(--npc-ink-900);
  border: 1px solid var(--npc-border);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  color: #fff;
}

.npc-modal .modal-header {
  border-bottom: 1px solid var(--npc-border);
  padding: 1.4rem 1.8rem;
}

.npc-modal .modal-body {
  padding: 1.8rem;
}

.npc-modal .modal-footer {
  border-top: 1px solid var(--npc-border);
  padding: 1.2rem 1.8rem;
}

/* Achievement Item Row */
.npc-ach-item {
  background: var(--npc-ink-850);
  border: 1px solid var(--npc-border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  transition: all 0.2s ease;
}

.npc-ach-item.unlocked {
  border-color: rgba(198, 255, 0, 0.4);
  background: rgba(198, 255, 0, 0.04);
}

.npc-ach-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--npc-ink-800);
  border: 1px solid var(--npc-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--npc-text-muted);
}

.npc-ach-item.unlocked .npc-ach-icon {
  background: rgba(198, 255, 0, 0.15);
  border-color: var(--npc-lime);
  color: var(--npc-lime);
}

/* Form switch controls */
.form-check-input:checked {
  background-color: var(--npc-lime);
  border-color: var(--npc-lime);
}

/* ==========================================================================
   RESPONSIVENESS & ACCESSIBILITY
   ========================================================================== */
.npc-navbar > .container-fluid {
  width: min(100% - 2rem, 1480px);
  margin-inline: auto;
}

main.container-fluid {
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
}

.npc-hero {
  padding: clamp(2rem, 5vw, 4rem);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.npc-featured-spotlight {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

#game-grid.row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 0;
}

#game-grid > [class*="col-"] {
  width: auto;
  min-width: 0;
  padding: 0;
}

.npc-game-card,
.npc-card-body {
  min-width: 0;
}

.npc-game-card-wide {
  grid-column: auto;
  flex-direction: column;
}

.npc-game-card-wide .npc-card-art {
  width: 100%;
  height: 180px;
  min-height: 180px;
}

.npc-game-card-wide .npc-card-body {
  width: 100%;
}

.npc-card-art {
  height: 180px;
  background:
    radial-gradient(circle at 50% 65%, color-mix(in srgb, var(--card-accent, var(--npc-cyan)) 18%, transparent), transparent 62%),
    radial-gradient(circle at center, #1b2034 0%, #0d101a 100%);
}

.npc-card-body {
  padding: 1.25rem;
}

.npc-card-title {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.npc-card-desc {
  min-height: 5.1rem;
}

.npc-search-wrap {
  min-width: min(260px, 100%);
}

.npc-sort-select {
  max-width: 100%;
}

.npc-section-header {
  gap: 1rem;
}

.npc-game-shell {
  padding: clamp(0.75rem, 2.5vw, 1.5rem);
}

.npc-shell-header > .d-flex:first-child {
  min-width: 0;
}

#hud-game-title {
  overflow-wrap: anywhere;
}

.npc-canvas-frame {
  width: 100%;
}

.npc-guide-card > .d-flex > div {
  flex-wrap: wrap;
}

@media (max-width: 991.98px) {
  #game-grid.row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .npc-navbar .navbar-collapse {
    padding-block: 0.75rem 0.25rem;
  }

  .npc-navbar .navbar-nav {
    align-items: flex-start;
  }
}

@media (max-width: 767px) {
  .npc-navbar > .container-fluid {
    width: calc(100% - 1.25rem);
  }

  main.container-fluid {
    padding-top: 1rem !important;
  }

  .npc-navbar .navbar-collapse > .d-flex {
    flex-wrap: wrap;
    padding-top: 0.75rem;
    border-top: 1px solid var(--npc-border);
  }

  .npc-token-pill {
    margin-right: auto;
  }

  .npc-hero {
    padding: 2rem 1.25rem;
    border-radius: 18px;
  }

  .npc-hero-headline {
    font-size: clamp(2.1rem, 10vw, 3.5rem);
    overflow-wrap: anywhere;
  }

  .npc-hero-lead {
    font-size: 1rem;
  }

  .npc-hero-teaser {
    padding: 1rem;
  }

  .npc-teaser-screen {
    height: 180px;
  }

  .npc-featured-spotlight {
    border-radius: 16px;
  }

  .npc-spotlight-art {
    min-height: 210px;
  }

  .npc-section-header {
    align-items: flex-start !important;
    margin-bottom: 1.25rem;
  }

  .npc-section-title {
    font-size: clamp(1.35rem, 6vw, 1.8rem);
  }

  .npc-section-tag {
    font-size: 0.52rem;
    white-space: nowrap;
  }

  #game-library-section > .npc-section-header {
    flex-direction: column;
    align-items: stretch !important;
  }

  #game-library-section > .npc-section-header > .d-flex {
    width: 100%;
  }

  .npc-search-wrap {
    flex: 1 1 100%;
    min-width: 0;
  }

  .npc-sort-select {
    flex: 1 1 100%;
    width: 100%;
  }

  #game-grid.row {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .npc-game-card,
  .npc-game-card-wide {
    flex-direction: column;
  }

  .npc-card-art,
  .npc-game-card-wide .npc-card-art {
    width: 100%;
    min-width: 0;
    height: 150px;
    min-height: 150px;
  }

  .npc-card-art-icon {
    font-size: 4rem;
  }

  .npc-card-body,
  .npc-game-card-wide .npc-card-body {
    width: 100%;
    padding: 1rem;
  }

  .npc-card-desc {
    min-height: 0;
    margin-bottom: 0.9rem;
  }

  .npc-card-footer {
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .npc-card-meta {
    flex-wrap: wrap;
  }

  .npc-btn-play {
    padding-inline: 0.75rem;
  }

  .npc-game-shell {
    border-radius: 16px;
  }

  .npc-shell-header {
    align-items: flex-start;
  }

  .npc-shell-header > .d-flex:first-child {
    align-items: flex-start !important;
    gap: 0.65rem !important;
    flex-wrap: wrap;
  }

  .npc-shell-header > .d-flex:first-child > div {
    min-width: 0;
    flex: 1 1 0;
  }

  .npc-shell-header > .d-flex:last-child {
    width: 100%;
    justify-content: flex-end;
  }

  #btn-back-hub {
    flex: 0 0 auto;
    font-size: 0.75rem;
    padding-inline: 0.65rem !important;
  }

  #hud-game-title {
    font-size: 1rem;
  }

  #hud-game-genre,
  #hud-game-difficulty {
    font-size: 0.65rem;
  }

  .npc-hud-bar {
    padding: 0.65rem;
    gap: 0.5rem;
  }

  .npc-hud-item {
    gap: 0.3rem;
  }

  .npc-hud-item > i {
    font-size: 1rem !important;
  }

  .npc-hud-label {
    font-size: 0.58rem;
  }

  .npc-hud-value {
    font-size: 0.7rem;
  }

  .npc-mobile-pad {
    padding: 0.75rem;
  }

  .npc-mobile-pad > div {
    max-width: none !important;
    padding-inline: 0 !important;
  }

  .npc-pad-btn {
    width: 42px !important;
    height: 38px !important;
  }

  .npc-action-btn {
    width: 48px;
    height: 48px;
  }

  .npc-mobile-pad .d-flex.gap-3 {
    gap: 0.5rem !important;
  }

  .npc-guide-card {
    padding: 0.9rem;
  }

  .npc-closing-cta {
    margin-top: 3rem;
    padding: 2.5rem 1.25rem;
  }

  .npc-modal .modal-header,
  .npc-modal .modal-body,
  .npc-modal .modal-footer {
    padding-inline: 1rem;
  }
}

@media (max-width: 420px) {
  .npc-brand-emblem {
    width: 34px;
    height: 34px;
  }

  .npc-brand-title {
    font-size: 0.95rem;
  }

  .npc-brand-badge {
    font-size: 0.45rem;
  }

  .npc-navbar .navbar-toggler {
    padding: 0.2rem;
  }

  .npc-card-body,
  .npc-game-card-wide .npc-card-body {
    padding: 0.9rem;
  }

  .npc-card-title {
    font-size: 1rem;
  }

  .npc-card-subtitle {
    font-size: 0.75rem;
  }

  .npc-card-desc {
    font-size: 0.78rem;
  }

  .npc-btn-icon {
    width: 34px;
    height: 34px;
  }

  .npc-token-pill {
    font-size: 0.68rem;
    padding: 0.3rem 0.65rem;
  }

  .npc-section-title {
    font-size: 1.3rem;
  }

  .npc-section-tag {
    font-size: 0.45rem;
    padding: 0.25rem 0.4rem;
  }

  .npc-hud-bar {
    justify-content: space-around;
  }

  .npc-hud-item {
    min-width: 0;
  }

  #hud-lives {
    letter-spacing: -0.15em;
  }

  .npc-modal .modal-title {
    font-size: 1rem;
    padding-right: 0.5rem;
  }

  .npc-modal .modal-footer {
    flex-wrap: wrap;
  }

  .npc-modal .modal-footer > * {
    max-width: 100%;
  }
}

@media (max-width: 360px) {
  .npc-pad-btn {
    width: 38px !important;
    height: 36px !important;
  }

  .npc-action-btn {
    width: 42px;
    height: 42px;
  }

  .npc-mobile-pad .d-flex.gap-3 {
    gap: 0.4rem !important;
  }

  .npc-hud-label {
    font-size: 0.52rem;
  }

  .npc-hud-value {
    font-size: 0.62rem;
  }
}

@media (min-width: 992px) {
  .npc-mobile-pad {
    display: none;
  }
}

/* Keep dynamically rendered panels and dialogs usable at narrow widths. */
.npc-stat-pill-row,
#continue-playing-container > [class*="col-"] > .d-flex,
#leaderboard-list > .d-flex {
  min-width: 0;
  gap: 0.75rem;
}

.npc-stat-pill-row > *,
#continue-playing-container > [class*="col-"] > .d-flex > *,
#leaderboard-list > .d-flex > * {
  min-width: 0;
}

.npc-stat-pill-row > .d-flex:first-child,
#continue-playing-container > [class*="col-"] > .d-flex > .d-flex:first-child,
#leaderboard-list > .d-flex > .d-flex:first-child {
  flex: 1 1 auto;
}

.npc-stat-pill-row .font-pixel,
#leaderboard-list .font-pixel {
  overflow-wrap: anywhere;
  text-align: right;
}

.npc-ach-item {
  min-width: 0;
}

.npc-ach-item > .flex-grow-1,
.npc-ach-item .d-flex.justify-content-between {
  min-width: 0;
}

.npc-ach-item .badge {
  flex: 0 0 auto;
  white-space: normal;
}

.npc-modal {
  max-height: calc(100vh - 1rem);
  max-height: calc(100dvh - 1rem);
}

.npc-modal .modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.npc-modal .modal-title {
  overflow-wrap: anywhere;
}

.npc-modal .modal-footer {
  gap: 0.5rem;
}

.npc-filter-pill,
.npc-btn-icon,
.npc-pad-btn,
.npc-action-btn,
.npc-btn-play {
  -webkit-tap-highlight-color: transparent;
}

.npc-filter-pill {
  min-height: 42px;
}

.npc-btn-icon {
  flex: 0 0 auto;
  min-width: 40px;
  min-height: 40px;
}

.npc-search-input,
.npc-sort-select {
  min-height: 44px;
}

.npc-btn-play,
.btn-npc-primary,
.btn-npc-secondary {
  justify-content: center;
  min-height: 42px;
}

.npc-card-art {
  flex: 0 0 auto;
}

.npc-shell-header,
.npc-shell-header > .d-flex,
.npc-guide-card,
.npc-guide-card .d-flex {
  min-width: 0;
}

#hud-controls-tip {
  display: block;
  overflow-wrap: anywhere;
}

.npc-hud-value {
  overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
  .npc-navbar .navbar-collapse > .d-flex {
    gap: 0.5rem !important;
  }

  .npc-navbar .navbar-nav {
    gap: 0.25rem !important;
  }

  .npc-navbar .npc-nav-link {
    padding: 0.6rem 0.75rem;
  }

  .npc-spotlight-art {
    min-height: 260px;
  }

  .npc-section-title {
    font-size: clamp(1.45rem, 3vw, 2rem);
  }
}

@media (max-width: 767px) {
  .npc-navbar .navbar-collapse {
    max-height: calc(100vh - 4.5rem);
    max-height: calc(100dvh - 4.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .npc-navbar .navbar-collapse > .d-flex {
    align-items: center !important;
  }

  .npc-nav-link {
    min-height: 42px;
  }

  .npc-hero-headline {
    line-height: 1.02;
  }

  .npc-hero .d-flex.flex-wrap > .btn-npc-primary,
  .npc-hero .d-flex.flex-wrap > .btn-npc-secondary {
    flex: 1 1 auto;
  }

  .npc-hero-teaser > .d-flex:first-child,
  .npc-hero-teaser > .d-flex:last-child {
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .npc-live-indicator {
    font-size: 0.55rem;
  }

  .npc-spotlight-art {
    min-height: 200px;
  }

  .npc-spotlight-art > .position-absolute {
    flex-wrap: wrap;
  }

  .npc-featured-spotlight .col-lg-7 {
    padding: 1.25rem !important;
  }

  .npc-featured-spotlight .col-lg-7 > div:first-child > .d-flex {
    align-items: flex-start !important;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .npc-featured-spotlight .display-6 {
    font-size: clamp(1.6rem, 7vw, 2.25rem);
    overflow-wrap: anywhere;
  }

  .npc-filter-pill {
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
  }

  .npc-stat-pill-row {
    padding: 0.75rem;
  }

  .npc-stat-pill-row > .d-flex:last-child {
    gap: 0.5rem !important;
  }

  .npc-stat-pill-row .font-pixel {
    font-size: 0.58rem !important;
  }

  .npc-ach-item {
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.85rem;
  }

  .npc-ach-icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
  }

  .npc-ach-item .d-flex.justify-content-between {
    align-items: flex-start !important;
    gap: 0.4rem;
  }

  .npc-ach-item .d-flex.justify-content-between > :first-child {
    overflow-wrap: anywhere;
  }

  .npc-game-shell {
    padding: 0.75rem;
  }

  .npc-shell-header {
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .npc-shell-header > .d-flex:first-child {
    flex: 1 1 100%;
  }

  .npc-shell-header > .d-flex:last-child {
    justify-content: flex-start;
  }

  .npc-canvas-frame {
    border-radius: 12px;
  }

  .npc-guide-card > .d-flex {
    align-items: flex-start !important;
  }

  .npc-guide-card > .d-flex > div {
    gap: 0.45rem !important;
  }

  .npc-modal {
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
  }

  .npc-modal .modal-header {
    gap: 0.75rem;
  }

  .npc-modal .modal-header .btn-close {
    flex: 0 0 auto;
  }

  .npc-modal .modal-footer {
    justify-content: stretch;
  }

  .npc-modal .modal-footer > button {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 575.98px) {
  .npc-navbar > .container-fluid {
    padding-inline: 0 !important;
  }

  main.container-fluid {
    padding-inline: 0.75rem !important;
  }

  #hub-view > .row.g-4.mt-2 {
    --bs-gutter-x: 0.75rem;
  }

  #hub-view > .row.g-4.mt-2 > [class*="col-"] > .p-4 {
    padding: 1rem !important;
  }

  .npc-section-header {
    flex-wrap: wrap;
  }

  .npc-section-tag {
    margin-left: auto;
  }

  .npc-hero {
    padding: 1.5rem 1rem;
  }

  .npc-hero .font-pixel.small {
    font-size: 0.55rem;
  }

  .npc-card-art,
  .npc-game-card-wide .npc-card-art {
    height: 135px;
    min-height: 135px;
  }

  .npc-card-body,
  .npc-game-card-wide .npc-card-body {
    padding: 0.9rem;
  }

  .npc-card-footer {
    align-items: flex-start;
  }

  .npc-card-meta {
    font-size: 0.7rem;
  }

  .npc-card-meta .badge {
    white-space: normal;
  }

  .npc-card-footer .npc-btn-play {
    flex: 0 0 auto;
  }

  .npc-shell-header > .d-flex:first-child {
    gap: 0.5rem !important;
  }

  #btn-back-hub {
    min-height: 40px;
  }

  #hud-game-icon {
    font-size: 1.25rem !important;
  }

  .npc-guide-card .npc-kbd {
    font-size: 0.65rem;
  }

  .npc-modal .modal-dialog {
    margin: 0.5rem;
  }

  .npc-modal .modal-header,
  .npc-modal .modal-body,
  .npc-modal .modal-footer {
    padding: 0.9rem;
  }

  #modalGameOver .modal-footer > button {
    flex: 1 1 100%;
  }
}
