@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700&family=Righteous&display=swap');

:root {
  /* Project Color Palette based on reference */
  --c-navy: #030304; /* Mapped to Off-Black background */ 
  --c-electric-blue: #14658e; /* Mapped to Blue */
  --c-retro-green: #43602a; /* Mapped to Green */
  --c-retro-orange: #e7573a; /* Mapped to Orange-Red */
  --c-vintage-yellow: #eaa22a; /* Mapped to Mustard Yellow */
  --c-white: #dfc9ae; /* Mapped to Beige / Sand text */
  --c-black: #030304; /* Mapped to Off-Black elements */
  --c-grey-blue: #93acab; /* Added Grey-Blue for future use */

  /* Typography */
  --font-heading: 'Righteous', cursive;
  --font-body: 'Outfit', sans-serif;

  /* UI Tokens */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 32px;
  --shadow-retro: 4px 4px 0px var(--c-black);
  --shadow-neon: 0 0 15px rgba(67, 96, 42, 0.5);
  
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  background-color: var(--c-navy);
  color: var(--c-white);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  /* Retro Grain/Noise Overlay */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1.1;
  text-wrap: balance;
}

h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  text-shadow: var(--shadow-retro);
  color: var(--c-vintage-yellow);
}

h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  color: var(--c-electric-blue);
  margin-bottom: 1.5rem;
  text-shadow: 4px 4px 4px rgba(0,0,0,0.45);
}

p {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  color: rgba(255,255,255,0.9);
}

/* Layout */
main {
  flex: 1;
  width: 100%;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 4rem 0;
}

/* Navigation */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(10, 25, 47, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--c-retro-orange);
  padding: 1rem 0;
  transition: padding 0.3s ease;
  transform: translateZ(0);
  will-change: padding;
}

.main-nav.nav-scrolled {
  padding: 0.35rem 0;
}
.main-nav.nav-scrolled .logo {
  height: 50px;
}
.main-nav.nav-scrolled .btn-primary {
  padding: 0.5rem 1.2rem;
  font-size: 1rem;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  height: 80px;
  filter: drop-shadow(2px 2px 0px var(--c-black));
  transition: height 0.3s ease;
  transform: translateZ(0);
  will-change: height;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--c-white);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  transition: var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--c-retro-green);
  text-shadow: 0 0 8px rgba(67, 96, 42, 0.5);
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  padding: 1rem 2rem;
  font-size: 1.25rem;
  text-decoration: none;
  border-radius: 0;
  transition: var(--transition-fast);
  cursor: pointer;
  border: none;
  text-transform: uppercase;
}

.btn-primary {
  background-color: var(--c-retro-orange);
  color: #fff;
  box-shadow: var(--shadow-retro);
  border: 2px solid var(--c-black);
}

.btn-primary:hover {
  background-color: var(--c-vintage-yellow);
  color: #fff;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px var(--c-black);
}

.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--c-black);
}

/* Override nav-links a:hover specificity (0,2,1) for btn-primary in nav */
.nav-links a.btn-primary {
  color: #fff;
}
.nav-links a.btn-primary:hover {
  background-color: var(--c-vintage-yellow);
  color: #fff;
}

.btn-neon {
  background-color: transparent;
  color: var(--c-retro-green);
  border: 2px solid var(--c-retro-green);
  box-shadow: 0 0 10px rgba(67, 96, 42, 0.2), inset 0 0 10px rgba(67, 96, 42, 0.2);
}

.btn-neon:hover {
  background-color: var(--c-retro-green);
  color: var(--c-black);
  box-shadow: 0 0 20px rgba(67, 96, 42, 0.6);
}

/* Footer */
.main-footer {
  background-color: var(--c-black);
  border-top: 4px solid var(--c-electric-blue);
  padding: 3rem 0;
  text-align: center;
}

.footer-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.25rem;
}

.footer-logo {
  height: 46px;
  opacity: 0.9;
  transition: opacity 0.3s;
}

.footer-logo:hover {
  opacity: 1;
}

.footer-logo-lenya {
  height: 87px;
}

.main-footer p {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
}

.footer-legal {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-legal a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.footer-legal a:hover {
  color: var(--c-electric-blue);
}

.footer-legal span {
  color: rgba(255,255,255,0.25);
  font-size: 0.8rem;
}

/* ================================ */
/* Hamburger Menu                   */
/* ================================ */
.hamburger-toggle {
  display: none; /* hidden on desktop */
}
.hamburger-btn {
  display: none; /* hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 200;
  position: relative;
}
.hamburger-btn span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--c-vintage-yellow);
  border-radius: 3px;
  margin: 5px 0;
  transition: all 0.3s ease;
}

.hero-video-section {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 82vh;
  overflow: hidden;
  background-color: var(--c-navy);
}

.video-container {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.hero-bg-vid.active {
  opacity: 1;
}

/* Left gradient — darkens left side for text legibility */
.hero-gradient-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to right,
    rgba(3, 3, 4, 0.88) 0%,
    rgba(3, 3, 4, 0.65) 35%,
    rgba(3, 3, 4, 0.2)  60%,
    transparent         80%
  );
  /* Fade to transparent before bottom edge — no gradient bleed into next section */
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 0%, black 75%, transparent 100%);
  pointer-events: none;
}

/* Content overlay — left aligned, vertically centered */
.hero-content-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 5%;
  max-width: 54%;
}

/* Animated logo */
@keyframes hero-logo-in {
  from { opacity: 0; transform: translateY(-18px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0)      scale(1); }
}

@keyframes hero-logo-float {
  0%, 100% { transform: translateY(0);    filter: drop-shadow(0 0 14px rgba(20, 101, 142, 0.55)); }
  50%       { transform: translateY(-8px); filter: drop-shadow(0 0 28px rgba(20, 101, 142, 0.9)); }
}

.hero-logo-animated {
  height: clamp(80px, 12vw, 160px);
  width: auto;
  margin-bottom: 1.5rem;
  animation:
    hero-logo-in    0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    hero-logo-float 5s  ease-in-out 0.8s infinite;
}

/* Headline */
.hero-headline {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  color: var(--c-vintage-yellow);
  text-shadow: 3px 3px 0 rgba(0,0,0,0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.1;
  margin-bottom: 1rem;
}

/* Subtitle paragraph */
.hero-desc {
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
  justify-content: flex-start;
}

/* Utility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Banner below video (kept for other pages) */
.intro-banner {
  padding: 4rem 0;
  background: linear-gradient(180deg, #050d1a 0%, var(--c-navy) 100%);
  border-bottom: 2px solid rgba(255, 255, 255, 0.05);
}

.hero-subtitle {
  color: var(--c-vintage-yellow);
  text-shadow: 2px 2px 0 var(--c-black);
  margin-bottom: 2.5rem;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

/* Steam Button */
.btn-steam {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #171a21 0%, #1b2838 100%);
  color: #c7d5e0;
  font-family: var(--font-heading);
  padding: 1.25rem 2.5rem;
  font-size: 1.5rem;
  text-decoration: none;
  border-radius: 0;
  border: 2px solid #66c0f4;
  box-shadow: 0 0 20px rgba(102, 192, 244, 0.3);
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.btn-steam:hover {
  background: linear-gradient(135deg, #2a475e 0%, #66c0f4 100%);
  color: white;
  box-shadow: 0 0 30px rgba(102, 192, 244, 0.6);
  transform: translateY(-3px) scale(1.02);
}

.steam-icon {
  width: 32px;
  height: 32px;
}

/* Responsive */
@media (max-width: 768px) {
  .logo {
    height: 50px;
  }
  .hamburger-btn {
    display: block;
    margin-left: auto;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 75%;
    max-width: 320px;
    height: 100vh;
    background: rgba(3, 3, 4, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 0.5rem;
    align-items: flex-start;
    z-index: 150;
    border-left: 2px solid var(--c-retro-orange);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                visibility 0.4s;
    overflow-y: auto;
    transform: translateX(100%);
    visibility: hidden;
  }

  .hamburger-toggle:checked ~ nav .nav-links {
    transform: translateX(0);
    visibility: visible;
  }

  /* Animate hamburger to X */
  .hamburger-toggle:checked ~ .hamburger-btn span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }
  .hamburger-toggle:checked ~ .hamburger-btn span:nth-child(2) {
    opacity: 0;
  }
  .hamburger-toggle:checked ~ .hamburger-btn span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  .nav-links li {
    width: 100%;
  }
  .nav-links a {
    display: block;
    padding: 0.75rem 0;
    font-size: 1.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .nav-links .btn-primary {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
  }

  /* Overlay behind menu */
  .menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 140;
  }
  .hamburger-toggle:checked ~ .menu-overlay {
    display: block;
  }

  /* Hero video - mobile */
  .hero-video-section {
    max-height: 90vh;
  }

  .hero-content-overlay {
    max-width: 100%;
    padding: 2rem 1.5rem;
    justify-content: flex-end;
    padding-bottom: 2.5rem;
  }

  .hero-logo-animated {
    height: 70px;
  }

  .hero-headline {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }

  .hero-desc {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* Sections tighter padding */
  .section {
    padding: 3rem 0;
  }

  /* Features grid single column */
  .features-grid {
    grid-template-columns: 1fr;
  }

  /* Steam button smaller */
  .btn-steam {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    width: 100%;
    justify-content: center;
  }
}

/* Light mode hamburger */
[data-theme="light"] .hamburger-btn span {
  background: var(--c-electric-blue);
}
[data-theme="light"] .nav-links {
  /* On mobile the panel bg should adapt */
}
@media (max-width: 768px) {
  [data-theme="light"] .nav-links {
    background: rgba(223, 201, 174, 0.97);
    border-left-color: var(--c-retro-orange);
  }
}

/* --- Features Section --- */
.features-section {
  position: relative;
  background: var(--c-navy);
}

.text-center {
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 2.5rem 2rem;
  text-align: center;
  transition: var(--transition-smooth);
  backdrop-filter: blur(10px);
}

.feature-card:hover {
  transform: translateY(-10px);
  border-color: var(--c-retro-green);
  box-shadow: 0 10px 30px rgba(67, 96, 42, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.feature-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.feature-card h3 {
  color: var(--c-electric-blue);
  margin-bottom: 1rem;
  font-size: 1.75rem;
}

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--c-navy), #050d1a);
  border-top: 2px solid rgba(255, 255, 255, 0.05);
}

/* --- Page Transitions --- */
.page-transition {
  animation: fadeInPage 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes fadeInPage {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}


/* Arcade Monitor Wrapper */
    .arcade-monitor {
      position: relative;
      background: #000;
      border: 10px solid #222;
      border-radius: 20px;
      padding: 10px;
      box-shadow: 
        inset 0 0 20px rgba(0,0,0,1),
        0 0 20px rgba(20, 101, 142, 0.5),
        0 0 0 4px var(--c-electric-blue);
      margin: 2rem 0;
      overflow: hidden;
    }
    .arcade-monitor video {
      width: 100%;
      border-radius: 10px;
      display: block;
      filter: contrast(1.1) brightness(1.1);
    }
    .scanlines {
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
      background-size: 100% 4px, 6px 100%;
      pointer-events: none;
      border-radius: 10px;
      box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
    }

/* ================================ */
/* Theme Toggle Button              */
/* ================================ */
.theme-toggle {
  background: none;
  border: 2px solid var(--c-vintage-yellow);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--c-vintage-yellow);
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--c-vintage-yellow);
  color: var(--c-black);
  transform: rotate(30deg) scale(1.1);
  box-shadow: 0 0 14px rgba(234, 162, 42, 0.5);
}
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: inline; }

/* ================================ */
/* Light Theme Overrides            */
/* ================================ */
[data-theme="light"] {
  --c-navy: #dfc9ae;       /* Beige as main bg */
  --c-black: #f5edd9;      /* Lighter beige for elements */
  --c-white: #1a1a1a;      /* Near-black for text */
}

[data-theme="light"] body {
  background-color: #dfc9ae;
  color: #1a1a1a;
  background-image: none;
}

[data-theme="light"] p {
  color: #2c2c2c;
}

/* Nav */
[data-theme="light"] .main-nav {
  background-color: #14658e;
  border-bottom-color: var(--c-retro-orange);
}
[data-theme="light"] .nav-links a {
  color: #fff;
}
[data-theme="light"] .nav-links a:hover,
[data-theme="light"] .nav-links a.active {
  color: #e7573a;
  text-shadow: none;
}

/* Headings in light */
[data-theme="light"] h1 {
  color: var(--c-retro-orange);
  text-shadow: 2px 2px 0px rgba(0,0,0,0.15);
}
[data-theme="light"] h2 {
  color: var(--c-electric-blue);
}

/* Buttons — light mode: game style */
[data-theme="light"] .btn-primary {
  background-color: var(--c-retro-orange);
  color: #fff;
  border-color: #000;
  box-shadow: 4px 4px 0px #000;
}
[data-theme="light"] .btn-primary:hover {
  background-color: #eaa22a;
  color: #fff;
  border-color: #000;
  box-shadow: 6px 6px 0px #000;
}
/* Override [data-theme="light"] .nav-links a:hover specificity (0,3,1) */
[data-theme="light"] .nav-links a.btn-primary {
  color: #fff;
}
[data-theme="light"] .nav-links a.btn-primary:hover {
  background-color: #eaa22a;
  color: #fff;
}
[data-theme="light"] .btn-neon {
  background-color: var(--c-retro-green);
  color: #fff;
  border-color: #000;
  box-shadow: 4px 4px 0px #000;
}
[data-theme="light"] .btn-neon:hover {
  background-color: #eaa22a;
  color: #fff;
  border-color: #000;
  box-shadow: 6px 6px 0px #000;
}

/* Feature cards */
[data-theme="light"] .feature-card {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .feature-card:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--c-retro-green);
}
[data-theme="light"] .feature-card h3 {
  color: var(--c-electric-blue);
}

/* Sections with explicit dark bg */
[data-theme="light"] .trailer-section {
  background: #dfc9ae !important;
}
[data-theme="light"] .cta-section {
  background: #f5edd9 !important;
}

/* Footer */
[data-theme="light"] .main-footer {
  background-color: #c4ad8e;
  border-top-color: var(--c-electric-blue);
}
[data-theme="light"] .main-footer p {
  color: rgba(0,0,0,0.5);
}
[data-theme="light"] .footer-logo {
  filter: brightness(0);
}

[data-theme="light"] .footer-legal a {
  color: rgba(0,0,0,0.45);
}

[data-theme="light"] .footer-legal a:hover {
  color: var(--c-electric-blue);
}

[data-theme="light"] .footer-legal span {
  color: rgba(0,0,0,0.2);
}

/* Hero subtitle (legacy) */
[data-theme="light"] .hero-subtitle {
  color: var(--c-retro-orange);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

/* Hero overlay keeps dark gradient in light mode (video is dark) */
[data-theme="light"] .hero-desc {
  color: rgba(255, 255, 255, 0.9);
}

/* Features section bg */
[data-theme="light"] .features-section {
  background: #dfc9ae;
}

/* Arcade monitor in light */
[data-theme="light"] .arcade-monitor {
  border-color: #999;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 0 0 20px rgba(20, 101, 142, 0.3), 0 0 0 4px var(--c-electric-blue) !important;
}

/* Steam button stays mostly the same for brand consistency */

/* Intro banner */
[data-theme="light"] .intro-banner {
  background: linear-gradient(180deg, #c9b495 0%, #dfc9ae 100%);
}

/* Glossary styles */
[data-theme="light"] .alphabet-index-container {
  background: rgba(223, 201, 174, 0.95);
}
[data-theme="light"] .alphabet-index a {
  background: var(--c-retro-orange);
  color: #fff;
  border-color: #000;
  box-shadow: 2px 2px 0px #000;
}
[data-theme="light"] .alphabet-index a:hover {
  background: #eaa22a;
  color: #fff;
  box-shadow: 3px 3px 0px #000;
}
[data-theme="light"] .alphabet-index span.disabled {
  color: rgba(0, 0, 0, 0.25);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: none;
}
[data-theme="light"] .term-details {
  background: rgba(255, 255, 255, 0.4);
}
[data-theme="light"] .term-details:hover {
  background: rgba(231, 87, 58, 0.06);
}
[data-theme="light"] .term-content {
  color: #333;
}

/* Toggle icon swap in light mode */
[data-theme="light"] .theme-toggle {
  border-color: #fff;
  color: #fff;
}
[data-theme="light"] .theme-toggle:hover {
  background: #fff;
  color: var(--c-electric-blue);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.4);
}
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: inline; }

/* Help page in light mode */
[data-theme="light"] .help-sidebar {
  background: rgba(0,0,0,0.05);
  border-color: var(--c-retro-orange);
}
[data-theme="light"] .help-tab {
  color: #fff;
  background: var(--c-retro-orange);
  border-color: #000;
  box-shadow: 2px 2px 0px #000;
}
[data-theme="light"] .help-tab:hover {
  background: #eaa22a;
  color: #fff;
  border-color: #000;
  box-shadow: 3px 3px 0px #000;
}
[data-theme="light"] .help-tab.active {
  background: #eaa22a;
  color: #fff;
  border-color: #000;
  box-shadow: 3px 3px 0px #000;
}
[data-theme="light"] .faq-details {
  background: rgba(255,255,255,0.4);
  border-color: var(--c-electric-blue);
}
[data-theme="light"] .faq-details summary {
  color: #1a1a1a;
}
[data-theme="light"] .faq-details p {
  color: #333;
  border-top-color: rgba(0,0,0,0.1);
}

/* Light-mode fixes for refactored components */
[data-theme="light"] .mode-note {
  color: #333 !important;
}
[data-theme="light"] .help-list {
  color: #2c2c2c !important;
}

/* Dark bg blocks inside light mode */
[data-theme="light"] .rule-box {
  background: rgba(0,0,0,0.06) !important;
}
[data-theme="light"] .char-stats {
  background: rgba(0,0,0,0.06) !important;
}

/* Courses Interactive Grid */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  align-items: start;
}

.course-interactive-card {
  border: 2px solid var(--c-electric-blue);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(10, 25, 47, 0.6);
  display: flex;
  flex-direction: column;
}

/* Carousel */
.carousel-container {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.carousel-img {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  pointer-events: none;
}

.carousel-img.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  font-size: 1.5rem;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  color: var(--c-retro-orange);
}

.carousel-btn.prev { left: 0; border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.carousel-btn.next { right: 0; border-top-left-radius: 4px; border-bottom-left-radius: 4px; }

/* Details Section */
.course-details-wrap {
  padding: 1rem;
}

.course-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  list-style: none; /* Hide default arrow */
}

.course-summary::-webkit-details-marker {
  display: none;
}

.expand-icon {
  font-size: 1.2rem;
  color: var(--c-electric-blue);
  transition: transform 0.3s ease;
}

.course-details-wrap[open] .expand-icon {
  transform: rotate(180deg);
}

.course-hidden-text {
  margin-top: 1rem;
  font-size: 1rem;
  color: #ddd;
  line-height: 1.5;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1rem;
}

[data-theme="light"] .course-interactive-card {
  background: #fff;
}

[data-theme="light"] .course-hidden-text {
  color: #444;
  border-top: 1px solid rgba(0,0,0,0.1);
}

/* Home Page Gallery */
.gallery-nav {
  position: relative;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.65);
  color: var(--c-vintage-yellow);
  border: 2px solid var(--c-vintage-yellow);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.gallery-arrow:hover {
  background: var(--c-vintage-yellow);
  color: var(--c-black);
}

.gallery-prev { left: 0.5rem; }
.gallery-next { right: 0.5rem; }

.marquee-wrapper {
  overflow-x: auto;
  width: 100%;
  scrollbar-width: none;
}

.marquee-wrapper::-webkit-scrollbar {
  display: none;
}

.marquee-track {
  display: flex;
  gap: 1rem;
  padding: 0 1rem;
}

.marquee-track img {
  height: 250px;
  width: auto;
  border-radius: var(--radius-sm);
  border: 2px solid var(--c-electric-blue);
  object-fit: cover;
  transition: transform 0.3s ease, border-color 0.3s ease;
  flex-shrink: 0;
}

.marquee-track img:hover {
  transform: scale(1.03);
  border-color: var(--c-retro-orange);
  cursor: zoom-in;
}

/* Game Modes Grid */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.mode-card {
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--c-retro-green);
  border-radius: var(--radius-sm);
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mode-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3), inset 0 0 15px rgba(0, 255, 170, 0.2);
}

.mode-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-family: 'Righteous', cursive;
  letter-spacing: 1px;
}

.mode-card p {
  font-size: 1.1rem;
  line-height: 1.5;
  color: #ddd;
}

[data-theme="light"] .mode-card {
  background: #fff;
}

[data-theme="light"] .mode-card p {
  color: #444;
}

/* Lightbox Modal */
html.no-scroll,
body.no-scroll {
  overflow: hidden !important;
}

.lightbox-modal {
  display: none;
  position: absolute; /* Bypass all browser fixed bugs */
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  padding: 1rem;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-modal.show {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  display: block;
  margin: auto;
  position: relative;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 2px solid var(--c-electric-blue);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 30px rgba(0, 255, 170, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox-modal.show .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: var(--c-white);
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

.lightbox-close:hover {
  color: var(--c-retro-orange);
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.lightbox-arrow:hover {
  background: rgba(20, 101, 142, 0.85);
  border-color: #fff;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

@media (max-width: 768px) {
  .gallery-arrow {
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* =========================================================
   Utility & component classes
   (refactored out of inline style="" attributes)
   ========================================================= */

/* Background helpers */
.bg-navy { background-color: var(--c-navy); }
.bg-black { background-color: var(--c-black); }

/* Text color helpers (use palette vars, no hardcoded hex) */
.text-yellow { color: var(--c-vintage-yellow); }
.text-blue { color: var(--c-electric-blue); }
.text-green { color: var(--c-retro-green); }
.text-neon-green { color: var(--c-neon-green); }

/* Spacing helpers */
.mb-sm { margin-bottom: 1rem; }
.mb-md { margin-bottom: 1.5rem; }
.mb-lg { margin-bottom: 2rem; }
.mt-lg { margin-top: 2rem; }

/* Typography */
.lead { font-size: 1.25rem; }

/* Centered section intro paragraph */
.section-intro {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem auto;
}
.section-intro--narrow { max-width: 600px; }
.section-intro--wide { max-width: 800px; }

/* Section divider top borders */
.section-divider-dashed {
  border-top: 4px dashed var(--c-retro-orange);
  overflow: hidden;
}
.section-divider-solid {
  border-top: 2px solid rgba(223, 201, 174, 0.1);
}

/* Two-column split layout (image + text) */
.split-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4rem;
}
.split-col { flex: 1; min-width: 300px; }
.split-col--wide { flex: 1.5; min-width: 300px; text-align: center; }

/* Course accordion heading */
.course-summary h3 {
  color: var(--c-electric-blue);
  margin: 0;
}

/* Scorecard image (CSS hover replaces inline JS handlers) */
.scorecard-img {
  width: 100%;
  max-width: 700px;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.8));
  transform: rotate(-2deg);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.scorecard-img:hover { transform: rotate(1deg) scale(1.02); }

/* Framed media (tournaments table image) */
.media-framed {
  width: 100%;
  max-width: 1100px;
  border-radius: var(--radius-md);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
  border: 4px solid var(--c-navy);
}

/* Buttons that fill their container */
.btn-block { width: 100%; margin-top: 1rem; }

/* --- Press kit cards --- */
.press-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}
.press-card {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--c-retro-green);
  padding: 2rem;
  border-radius: var(--radius-sm);
  text-align: center;
}
.press-card--orange { border-color: var(--c-retro-orange); }
.press-card--blue { border-color: var(--c-electric-blue); }
.press-card h3 { color: var(--c-white); }
.press-card p { margin: 2rem 0; }
.press-logo {
  width: 100%;
  max-width: 200px;
  margin: 1rem auto;
  display: block;
}
.press-thumb {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  margin: 1rem auto;
  display: block;
  border-radius: 4px;
}

/* --- Help page --- */
.help-section {
  background-color: var(--c-navy);
  min-height: 80vh;
}
.help-list {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.8;
  margin-left: 1.5rem;
}
.rule-box {
  background: rgba(0, 0, 0, 0.5);
  padding: 1.5rem;
  border-left: 4px solid var(--c-retro-orange);
  margin-top: 1.5rem;
}
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}
.mode-card {
  border: 1px solid var(--c-electric-blue);
  padding: 1.5rem;
  border-radius: 8px;
}
.mode-card--green { border-color: var(--c-neon-green); }
.mode-note {
  font-size: 0.9rem;
  color: #ccc;
}

/* Trailer variant of the arcade monitor (centered, orange glow) */
.arcade-monitor--trailer {
  max-width: 900px;
  margin: 0 auto;
  box-shadow: 0 0 30px rgba(255, 107, 0, 0.4), inset 0 0 20px rgba(0, 0, 0, 1);
}

/* --- Glossary page --- */
.container-narrow { max-width: 900px; }
.glossary-title {
  text-align: center;
  color: var(--c-electric-blue);
  margin-bottom: 2rem;
  text-shadow: 4px 4px 4px rgba(0, 0, 0, 0.45);
  font-size: clamp(2rem, 5vw, 4rem);
}
