@media (max-width: 768px) {
  .scene-wrapper > * {
    max-width: 95%;
  }
}
?
 
#shooter-scene .game-container,
#learning-scene > div,
#card-scene .card-grid {
  transform: scale(0.75);
  transform-origin: center;
}

@media (max-width: 768px) {
  #shooter-scene .game-container,
  #learning-scene > div,
  #card-scene .card-grid {
    transform: scale(0.8);
  }
}

:root {
  --color-bg: #050505;
  --color-surface: #111111;
  --color-cyan: #00ffff;
  --color-purple: #bb00ff;
  --color-text: #e0e0e0;
  --color-muted: #888888;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', 'Orbitron', sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.text-cyan { color: var(--color-cyan); }
.text-purple { color: var(--color-purple); }
.bg-surface { background-color: var(--color-surface); }

.navbar {
  background: rgba(5, 5, 5, 0.8) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar-brand {
  font-weight: 900;
  letter-spacing: 3px;
  color: white !important;
}

.nav-link {
  color: var(--color-text) !important;
  transition: color 0.3s;
}

.nav-link:hover { color: var(--color-cyan) !important; }

.btn-cyan {
  background-color: var(--color-cyan);
  color: #000;
  font-weight: bold;
  border: none;
  border-radius: 0;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
  transition: all 0.3s;
}

.btn-cyan:hover {
  background-color: #fff;
  color: #000;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.6);
}

.btn-outline-purple {
  border: 1px solid var(--color-purple);
  color: var(--color-purple);
  font-weight: bold;
  border-radius: 0;
  transition: all 0.3s;
}

.btn-outline-purple:hover {
  background-color: var(--color-purple);
  color: #fff;
  box-shadow: inset 0 0 15px rgba(187, 0, 255, 0.5);
}

.card-surface {
  background-color: var(--color-surface);
  border: 1px solid #222;
  transition: border-color 0.3s;
}

.card-surface:hover { border-color: var(--color-cyan); }

/* Global Neon Grid Background */
.neon-grid {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(128,128,128,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(128,128,128,0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

.hero-gradient {
  position: absolute;
  top: -20%; left: 50%;
  transform: translateX(-50%);
  width: 100vw; height: 50vh;
  background: radial-gradient(ellipse at center, rgba(0,255,255,0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
/* --- Scene Framework Overrides --- */
.snap-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.scene-wrapper {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* 1. Shooter Scene */
#shooter-scene .crosshair {
    position: absolute;
    width: 32px; height: 32px;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 50;
    mix-blend-mode: difference;
    transition: transform 0.1s;
}
#shooter-scene .crosshair.flash { transform: translate(-50%, -50%) scale(1.5); }
#shooter-scene .crosshair::after { content: ''; position: absolute; top: 50%; left: 50%; width: 4px; height: 4px; background: white; border-radius: 50%; transform: translate(-50%, -50%); }
#shooter-scene .target {
    position: absolute;
    border-radius: 50%;
    border: 2px solid #ef4444;
    background: rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    cursor: crosshair;
}
#shooter-scene .bullet { width: 12px; height: 40px; border: 1px solid #ef4444; transition: all 0.2s; }
#shooter-scene .bullet.loaded { background: #ef4444; box-shadow: 0 0 10px #ef4444; }
#shooter-scene .ammo-container.reloading { opacity: 0.5; animation: pulse 1s infinite; }

/* 2. Card Scene */
.card-grid { perspective: 1000px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; z-index: 10;}
.memory-card {
    width: 80px; height: 120px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}
@media (min-width: 768px) { .memory-card { width: 110px; height: 160px; } }
.memory-card.flipped, .memory-card.matched { transform: rotateY(180deg); }
.card-inner { width: 100%; height: 100%; position: absolute; transform-style: preserve-3d; }
.card-front, .card-back {
    position: absolute; width: 100%; height: 100%;
    backface-visibility: hidden; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.card-front { background: #1a1a1a; border: 1px solid #444; }
.card-front::after { content: ''; width: 30px; height: 40px; border: 1px solid #666; border-radius: 4px; }
.card-back {
    background: rgba(234, 179, 8, 0.1);
    border: 2px solid #eab308;
    transform: rotateY(180deg);
    color: #eab308;
    font-size: 2.5rem;
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.4);
}
.memory-card.matched .card-back { color: white; background: rgba(255,255,255,0.1); border-color: white; }

/* 3. Learning Scene */
#learning-scene .letter-box {
    display: inline-flex; width: 40px; height: 50px;
    border-bottom: 4px solid #3b82f6;
    align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 900; color: white;
    margin: 0 5px;
}
@media (min-width: 768px) { #learning-scene .letter-box { width: 60px; height: 80px; font-size: 3rem; } }
.integrity-block { width: 16px; height: 8px; margin-right: 4px; transition: background 0.3s; }
.integrity-block.safe { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }
.integrity-block.corrupted { background: #333; }

/* 4. Horror Scene */
#horror-scene.is-active { cursor: none; }
#horror-scene .flashlight-mask {
    position: absolute; inset: 0; z-index: 20;
    background: #020202; pointer-events: none;
    transition: opacity 0.1s;
}
#horror-scene.flicker-active .flashlight-mask { opacity: 0.3; }
#horror-scene .ghost {
    position: absolute; z-index: 10; color: white;
    font-family: monospace; font-weight: 900; font-size: 6rem;
    transform: translate(-50%, -50%); mix-blend-mode: difference;
    pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
#horror-scene.flicker-active::after {
    content: ''; position: absolute; inset: 0; z-index: 50;
    background: white; mix-blend-mode: overlay; opacity: 0.3;
    pointer-events: none;
}

/* 5. Baseball Scene */
#baseball-scene .bat {
    position: absolute; z-index: 40; width: 16px; height: 160px;
    background: linear-gradient(to bottom, #a16207, #713f12);
    border-radius: 9999px; transform-origin: bottom center;
    transform: rotateZ(-20deg); transition: transform 0.1s cubic-bezier(0.4, 0, 1, 1);
    pointer-events: none; left: 100px;
}
#baseball-scene .bat.swinging { transform: rotateZ(120deg) translateX(50px); }
#baseball-scene .field-grid {
    position: absolute; inset: 0; z-index: 0; opacity: 0.3;
    background-image: linear-gradient(to right, rgba(34,197,94,0.1) 1px, transparent 1px), linear-gradient(to bottom, rgba(34,197,94,0.1) 1px, transparent 1px);
    background-size: 100px 40px; transform: perspective(500px) rotateX(60deg);
    transform-origin: bottom; pointer-events: none;
}
