:root {
  --primary-red: #8b0000;
  --secondary-red: #dc143c;
  --dark-bg: #1a1a1a;
  --card-bg: #2d2d2d;
  --text-light: #ffffff;
  --text-gray: #cccccc;
  --accent-gold: #ffd700;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Performance optimizations */
html {
  scroll-behavior: smooth;
}

body {
  font-display: swap;
}

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

body {
  font-family: "Orbitron", monospace;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
  color: var(--text-light);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  border-bottom: 2px solid var(--primary-red);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  font-family: "Creepster", cursive;
  font-size: 2rem;
  color: var(--accent-gold);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-menu a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.3s ease;
  position: relative;
}

.nav-menu a:hover {
  color: var(--secondary-red);
}

.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary-red);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after {
  width: 100%;
}

/* Hero Section */
.hero {
  padding: 140px 0 100px;
  text-align: center;
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect fill="%231a1a1a" width="1200" height="600"/><circle fill="%238B0000" cx="200" cy="150" r="3" opacity="0.3"/><circle fill="%23DC143C" cx="400" cy="200" r="2" opacity="0.4"/><circle fill="%23FFD700" cx="600" cy="100" r="2" opacity="0.2"/><circle fill="%238B0000" cx="800" cy="250" r="3" opacity="0.3"/><circle fill="%23DC143C" cx="1000" cy="180" r="2" opacity="0.4"/></svg>');
  background-size: cover;
  background-position: center;
  margin-top: 20px;
}

.hero h1 {
  font-family: "Creepster", cursive;
  font-size: 4rem;
  margin-bottom: 1rem;
  color: var(--accent-gold);
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8), 0 0 20px var(--accent-gold);
  }
  to {
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8), 0 0 30px var(--accent-gold),
      0 0 40px var(--accent-gold);
  }
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: var(--text-gray);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-button {
  display: inline-block;
  background: linear-gradient(45deg, var(--primary-red), var(--secondary-red));
  color: var(--text-light);
  padding: 15px 30px;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(220, 20, 60, 0.4);
  border-color: var(--accent-gold);
}

/* Games Section */
.games-section {
  padding: 80px 0;
  background: var(--dark-bg);
}

.section-title {
  text-align: center;
  font-family: "Creepster", cursive;
  font-size: 3rem;
  margin-bottom: 3rem;
  color: var(--accent-gold);
}

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

.game-card {
  background: var(--card-bg);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.game-card:hover {
  transform: translateY(-10px);
  border-color: var(--secondary-red);
  box-shadow: 0 10px 30px rgba(220, 20, 60, 0.3);
}

.game-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(45deg, var(--primary-red), var(--secondary-red));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-light);
  position: relative;
  overflow: hidden;
}

.game-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.game-image:hover img {
  transform: scale(1.05);
}

.game-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 3rem;
  color: var(--text-light);
}

.game-content {
  padding: 1.5rem;
}

.game-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent-gold);
}

.game-description {
  color: var(--text-gray);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.game-features {
  list-style: none;
  margin-bottom: 1.5rem;
}

.game-features li {
  color: var(--text-light);
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.5rem;
}

.game-features li::before {
  content: "🎮";
  position: absolute;
  left: 0;
}

.play-button {
  width: 100%;
  background: linear-gradient(45deg, var(--primary-red), var(--secondary-red));
  color: var(--text-light);
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.play-button:hover {
  background: linear-gradient(45deg, var(--secondary-red), var(--primary-red));
  transform: scale(1.05);
}

/* Features Section */
.features-section {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--dark-bg) 100%);
}

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

.feature-card {
  text-align: center;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-title {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--accent-gold);
}

.feature-description {
  color: var(--text-gray);
  line-height: 1.6;
}

/* Footer */
footer {
  background: var(--dark-bg);
  padding: 3rem 0 2rem;
  border-top: 2px solid var(--primary-red);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: var(--accent-gold);
  margin-bottom: 1rem;
}

.footer-section a {
  color: var(--text-gray);
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--secondary-red);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-gray);
}

/* Responsive Design */
/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ======================================== */

/* Mobile Navigation - Hamburger Menu */
@media (max-width: 768px) {
  .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    position: relative;
    min-height: 70px;
  }

  .logo {
    font-size: 1.5rem;
    flex-shrink: 0;
    z-index: 1001;
  }

  /* Hamburger Menu Button - Right aligned */
  .mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    position: relative;
    margin-left: auto;
    order: 2;
  }

  .mobile-menu-toggle:hover {
    color: var(--secondary-red);
  }

  /* Hide desktop menu on mobile */
  .nav-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(26, 26, 26, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .nav-menu.active {
    display: flex;
    opacity: 1;
    visibility: visible;
  }

  .nav-menu li {
    margin: 0;
  }

  .nav-menu a {
    display: block;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(45, 45, 45, 0.8);
    border: 2px solid rgba(139, 0, 0, 0.3);
    min-width: 200px;
    color: var(--text-light);
  }

  .nav-menu a:hover {
    background: rgba(220, 20, 60, 0.3);
    border-color: var(--secondary-red);
    transform: scale(1.05);
  }

  /* Ensure content is not covered by menu */
  .hero {
    padding: 120px 0 80px;
    position: relative;
    z-index: 1;
    margin-top: 20px;
  }

  /* Main content spacing */
  main {
    position: relative;
    z-index: 1;
    margin-top: 10px;
  }

  /* Add extra spacing for all sections */
  .games-section {
    padding: 100px 0 80px;
  }

  .features-section {
    padding: 100px 0 80px;
  }

  /* Header z-index fix */
  header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
  }

  /* Ensure hamburger button is above menu */
  .mobile-menu-toggle {
    z-index: 1002;
  }

  .hero h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }

  .hero p {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .cta-button {
    padding: 12px 24px;
    font-size: 1rem;
  }

  /* Section titles */
  .section-title {
    font-size: 2rem;
  }

  /* Games grid */
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .game-card {
    padding: 1rem;
  }

  .game-card h3 {
    font-size: 1rem;
  }

  /* Container padding */
  .container {
    padding: 0 15px;
  }
}

/* Small Mobile (320px - 480px) */
@media (max-width: 480px) {
  .header-content {
    padding: 0.8rem 0;
    min-height: 60px;
  }

  .logo {
    font-size: 1.25rem;
  }

  .mobile-menu-toggle {
    font-size: 1.2rem;
    padding: 0.4rem;
  }

  .hero {
    padding: 100px 0 60px;
    margin-top: 15px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 0.9rem;
  }

  .games-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .game-card {
    padding: 0.75rem;
  }

  .game-card h3 {
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 10px;
  }
}

/* Tablet (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .header-content {
    padding: 0.75rem 0;
    gap: 1.5rem;
  }

  .logo {
    font-size: 1.75rem;
  }

  .nav-menu {
    gap: 1.5rem;
    flex-wrap: nowrap;
  }

  .nav-menu a {
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    min-width: auto;
    max-width: none;
  }

  .hero h1 {
    font-size: 3.5rem;
  }

  .games-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Hide mobile menu toggle on desktop */
.mobile-menu-toggle {
  display: none;
}

/* Mobile menu toggle positioning */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
    order: 2;
    margin-left: auto;
    background: rgba(45, 45, 45, 0.8);
    border: 1px solid rgba(139, 0, 0, 0.3);
    border-radius: 4px;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu-toggle:hover {
    background: rgba(220, 20, 60, 0.2);
    border-color: var(--secondary-red);
  }
}

/* Desktop Navigation - Show normal menu */
@media (min-width: 769px) {
  .nav-menu {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    position: static;
    width: auto;
    height: auto;
    background: none;
    backdrop-filter: none;
    opacity: 1;
    visibility: visible;
    transition: none;
  }

  .nav-menu li {
    margin: 0;
  }

  .nav-menu a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    text-align: center;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: none;
    border: none;
    min-width: auto;
    color: var(--text-light);
  }

  .nav-menu a:hover {
    color: var(--secondary-red);
    background: none;
    border: none;
    transform: none;
  }
}

/* Extra small screens (320px - 360px) */
@media (max-width: 360px) {
  .header-content {
    padding: 0.6rem 0;
    min-height: 55px;
  }

  .logo {
    font-size: 1.1rem;
  }

  .mobile-menu-toggle {
    font-size: 1rem;
    padding: 0.3rem;
  }

  .hero {
    padding: 90px 0 50px;
    margin-top: 10px;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for accessibility */
a:focus,
button:focus {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-red);
  color: var(--text-light);
  padding: 8px;
  text-decoration: none;
  z-index: 1001;
}

.skip-link:focus {
  top: 6px;
}

/* Loading animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Game Modal Styles */
.game-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.game-modal-container {
  background: var(--card-bg);
  border-radius: 15px;
  width: 95vw;
  height: 90vh;
  max-width: 1400px;
  max-height: 900px;
  overflow: hidden;
  animation: slideIn 0.3s ease;
  border: 2px solid var(--primary-red);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.game-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--primary-red);
  background: var(--dark-bg);
}

.game-modal-title {
  color: var(--accent-gold);
  margin: 0;
  font-size: 1.5rem;
  font-weight: bold;
}

.game-modal-controls {
  display: flex;
  gap: 1rem;
}

.fullscreen-btn,
.close-btn {
  background: var(--primary-red);
  border: none;
  color: var(--text-light);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-btn:hover,
.close-btn:hover {
  background: var(--secondary-red);
  transform: scale(1.1);
}

.game-modal-content {
  height: calc(100% - 80px);
  padding: 0;
  position: relative;
}

.game-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

/* Fullscreen styles */
.game-modal-container:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  max-width: none;
  max-height: none;
}

.game-modal-container:fullscreen .game-modal-content {
  height: calc(100vh - 80px);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
