@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root,
:root[data-theme="dark"] {
  --bg-main: #0b0d14;
  --bg-dark: #0b0d14;
  --bg-secondary: #08111d;
  --surface: #111827;
  --card: #171c2b;
  --card-bg: rgba(18, 22, 36, 0.85);
  --card-border: rgba(0, 217, 255, 0.15);

  --primary: #00f0ff;
  --secondary: #3b82f6;

  --text: #ffffff;
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --glass: rgba(18, 25, 40, 0.55);
  --border: rgba(0, 217, 255, 0.15);
  --shadow: 0 0 25px rgba(0, 217, 255, 0.08);

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'Inter', system-ui, sans-serif;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --primary-glow: #00f0ff;
  --secondary-glow: #3b82f6;
  --accent: #ff0077;
  --success: #00ff88;
  --warning: #ffb700;
  --glass-bg: rgba(18, 25, 40, 0.55);
  --glass-border: rgba(0, 217, 255, 0.15);
  --glass-blur: 18px;
  --surface-hover: rgba(27, 36, 56, 0.85);
  --surface-solid: #171c2b;
}

:root[data-theme="light"] {
  --bg-main: #f0f4f9;
  --bg-dark: #f0f4f9;
  --bg-secondary: #e2e8f0;
  --surface: #ffffff;
  --card: #ffffff;
  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, 0.1);

  --primary: #0078ff;
  --secondary: #2563eb;

  --text: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --glass: rgba(255, 255, 255, 0.85);
  --border: rgba(0, 0, 0, 0.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);

  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.1);
  --surface-hover: #e2e8f0;
  --surface-solid: #ffffff;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;

  background:
    radial-gradient(circle at top left, rgba(0, 217, 255, 0.15), transparent 35%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.12), transparent 35%),
    linear-gradient(180deg, #0b1324 0%, #08111d 40%, #05070d 100%) !important;

  color: #ffffff !important;
  font-family: var(--font-sans);
  transition: background 0.35s ease, color 0.35s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;

  background:
    radial-gradient(circle at 15% 20%, rgba(0, 217, 255, 0.18), transparent 30%),
    radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.12), transparent 35%);

  animation: bgFloat 18s ease-in-out infinite;
}

@keyframes bgFloat {
  0% { transform: translate(0, 0); }
  50% { transform: translate(40px, -25px); }
  100% { transform: translate(0, 0); }
}

:root[data-theme="light"] body::before,
body[data-theme="light"]::before {
  display: none;
}

#particle-canvas,
.card-glare,
.card-badge-top,
.featured-badge,
.hero-media-preview::before {
  pointer-events: none !important;
}

/* --------------------------------------------------------------------------
   HERO FEATURED CARD (Full-Width 320px + 1fr Grid Layout)
   -------------------------------------------------------------------------- */
.featured-section .container {
  width: 100% !important;
  max-width: 1400px !important;
}

.hero-featured-card,
.featured-card {
  display: grid !important;
  grid-template-columns: 320px 1fr !important;
  width: 100% !important;
  background: var(--card-bg, rgba(18, 22, 36, 0.85)) !important;
  border: 1px solid var(--card-border, rgba(0, 217, 255, 0.15)) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  align-items: center !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.hero-media-preview,
.featured-media {
  position: relative;
  width: 100% !important;
  height: 100% !important;
  min-height: 240px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-details,
.featured-info {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  padding: 2rem !important;
  width: 100% !important;
  min-width: 0 !important; /* Prevents flex overflow */
  gap: 1rem !important;
}

.hero-details h2,
.featured-title {
  font-size: clamp(1.6rem, 2.5vw, 2.2rem) !important;
  line-height: 1.3 !important;
  margin: 0 !important;
  color: var(--text-primary) !important;
}

.featured-desc {
  color: var(--text-secondary) !important;
  font-size: 1rem !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}

@media (max-width: 768px) {
  .hero-featured-card,
  .featured-card {
    grid-template-columns: 1fr !important;
  }
  .hero-details,
  .featured-info {
    padding: 1.25rem !important;
  }
}

/* Background Particle Canvas */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* Container Utility */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --------------------------------------------------------------------------
   3. REUSABLE UTILITIES & COMPONENTS
   -------------------------------------------------------------------------- */
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1.8rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  user-select: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-neon-primary);
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-main);
  border-color: var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--primary-glow);
  color: var(--primary-glow);
  transform: translateY(-2px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--secondary-glow));
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(255, 0, 119, 0.3);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-neon-accent);
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
}

.btn-sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
}

/* Button Ripple Animation Element */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple-effect 0.6s linear;
  pointer-events: none;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}

.badge-primary {
  background: rgba(0, 240, 255, 0.15);
  color: var(--primary-glow);
  border-color: rgba(0, 240, 255, 0.3);
}

.badge-accent {
  background: rgba(255, 0, 119, 0.15);
  color: var(--accent);
  border-color: rgba(255, 0, 119, 0.3);
}

.badge-warning {
  background: rgba(255, 183, 0, 0.15);
  color: var(--warning);
  border-color: rgba(255, 183, 0, 0.3);
}

.badge-success {
  background: rgba(0, 255, 136, 0.15);
  color: var(--success);
  border-color: rgba(0, 255, 136, 0.3);
}

/* Section Titles */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-main) 60%, var(--primary-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   4. HEADER & STICKY NAVIGATION
   -------------------------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 1000;
  background: rgba(8, 9, 17, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  transition: all var(--transition-normal);
}

.navbar.scrolled {
  height: 70px;
  background: var(--surface);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.5rem;
}

/* Brand Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.logo-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
  animation: logo-glow-pulse 3s infinite alternate;
}

.logo-icon svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

.logo-text span {
  color: var(--primary-glow);
}

/* Search Bar */
.search-container {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.8rem;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-main);
  outline: none;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: all var(--transition-normal);
}

.search-input:focus {
  border-color: var(--primary-glow);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
  background: var(--surface-hover);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: var(--text-secondary);
  pointer-events: none;
  transition: fill var(--transition-normal);
}

.search-input:focus + .search-icon {
  fill: var(--primary-glow);
}

/* Nav Actions & Links */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-glow);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--primary-glow);
  transition: width var(--transition-normal);
  border-radius: 2px;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* Dynamic Score Counter Pill */
.score-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-glow);
}

.score-pill svg {
  width: 16px;
  height: 16px;
  fill: var(--warning);
  animation: pulse-spin 6s linear infinite;
}

/* Hamburger Mobile Toggle */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  position: relative;
  z-index: 1100;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: all var(--transition-normal);
  position: absolute;
  left: 0;
}

.hamburger span:nth-child(1) { top: 6px; }
.hamburger span:nth-child(2) { top: 15px; }
.hamburger span:nth-child(3) { top: 24px; }

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 15px;
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 15px;
}

/* --------------------------------------------------------------------------
   5. HERO SECTION
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 160px 0 80px 0;
  overflow: hidden;
}

.hero-content {
  text-align: center;
  max-width: 900px;
  z-index: 2;
  position: relative;
}

.hero-badge {
  margin-bottom: 1.5rem;
  animation: float-anim 4s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(2.8rem, 6.5vw, 5.2rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.hero-title-glow {
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-glow) 50%, var(--secondary-glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hero-neon-glow 4s ease-in-out infinite alternate;
  display: block;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 2.5rem auto;
  font-weight: 400;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* Floating Gaming Elements */
.hero-floating-element {
  position: absolute;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  z-index: 1;
}

.floating-1 {
  top: 22%;
  left: 5%;
  animation: float-anim 5s ease-in-out infinite;
}

.floating-2 {
  bottom: 25%;
  right: 5%;
  animation: float-anim 6s ease-in-out 1s infinite;
}

.floating-3 {
  top: 65%;
  left: 8%;
  animation: float-anim 5.5s ease-in-out 0.5s infinite;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.scroll-indicator:hover {
  opacity: 1;
  color: var(--primary-glow);
}

.mouse-icon {
  width: 22px;
  height: 36px;
  border: 2px solid var(--glass-border);
  border-radius: 12px;
  position: relative;
}

.mouse-wheel {
  width: 4px;
  height: 8px;
  background-color: var(--primary-glow);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll-wheel 2s infinite;
}

/* --------------------------------------------------------------------------
   6. FEATURED GAME SECTION
   -------------------------------------------------------------------------- */
.featured-section {
  padding: 4rem 0;
  position: relative;
}

.featured-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.featured-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.featured-card:hover {
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.15);
}

.featured-media {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 320px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured-img-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, #1a0b2e, #091e3a);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--primary-glow);
  position: relative;
}

.featured-img-placeholder svg {
  width: 80px;
  height: 80px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 15px var(--primary-glow));
}

.featured-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.featured-title {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.rating {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--warning);
  font-weight: 700;
}

.rating svg {
  width: 18px;
  height: 18px;
  fill: var(--warning);
}

.featured-description {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.featured-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* --------------------------------------------------------------------------
   7. GAME SELECTION GRID & CARDS
   -------------------------------------------------------------------------- */
.arcade-section {
  padding: 4rem 0 6rem 0;
}

/* Filter Tags Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.filter-bar::-webkit-scrollbar {
  height: 4px;
}
.filter-bar::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 2px;
}

.filter-btn {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--primary-glow);
  color: #000000;
  border-color: var(--primary-glow);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
  font-weight: 700;
}

/* Grid Layout Required Snippet */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Game Card Required Snippet */
.game-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.game-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 16px 40px rgba(0, 240, 255, 0.2);
}

/* Favorite Toggle Button on Game Cards */
.fav-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 5;
  background: rgba(8, 9, 17, 0.7);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-normal);
}

.fav-btn:hover {
  background: rgba(255, 0, 119, 0.2);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.1);
}

.fav-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: fill var(--transition-fast), transform var(--transition-fast);
}

.fav-btn.active {
  background: rgba(255, 0, 119, 0.25);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 15px rgba(255, 0, 119, 0.4);
}

.fav-btn.active svg {
  fill: var(--accent);
  transform: scale(1.15);
}

/* Card Glare Reflection Effect */
.card-glare {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.game-card:hover .card-glare {
  opacity: 1;
}

.card-media {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--bg-subtle);
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.game-card:hover .card-img {
  transform: scale(1.06);
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.game-card:hover .card-thumb {
  transform: scale(1.08);
}

.card-badge-top {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 9, 17, 0.95) 0%, transparent 70%);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.game-card:hover .card-overlay {
  opacity: 1;
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-genre {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  margin-top: auto;
}

.tag-pill {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  color: var(--text-secondary);
}

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

/* --------------------------------------------------------------------------
   8. FOOTER
   -------------------------------------------------------------------------- */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--glass-border);
  padding: 4rem 0 2rem 0;
  margin-top: 4rem;
  position: relative;
  z-index: 10;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: var(--text-secondary);
  margin-top: 1rem;
  max-width: 320px;
  font-size: 0.9rem;
}

.footer-column h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary-glow);
}

.social-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* --------------------------------------------------------------------------
   9. MODAL DIALOG
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--surface-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 840px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--glass-bg);
  color: var(--accent);
}

.modal-body {
  padding: 2rem;
  text-align: center;
}

.modal-body-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem auto;
  background: rgba(0, 240, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-glow);
}

.modal-body-icon svg {
  width: 36px;
  height: 36px;
  fill: currentColor;
}

/* Merged Tile Animation & Game Tile Utilities */
.tile {
  position: absolute;
  transition: transform 150ms ease-in-out;
  will-change: transform; /* Signals GPU to optimize rendering layer */
}

@keyframes pop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.tile-merged {
  animation: pop 200ms ease-in-out;
}

/* --------------------------------------------------------------------------
   10. ANIMATION KEYFRAMES
   -------------------------------------------------------------------------- */
@keyframes logo-glow-pulse {
  0% { box-shadow: 0 0 15px rgba(0, 240, 255, 0.4); }
  100% { box-shadow: 0 0 25px rgba(112, 0, 255, 0.8); }
}

@keyframes hero-neon-glow {
  0% { filter: drop-shadow(0 0 15px rgba(0, 240, 255, 0.3)); }
  100% { filter: drop-shadow(0 0 30px rgba(255, 0, 119, 0.6)); }
}

@keyframes float-anim {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

@keyframes scroll-wheel {
  0% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 14px); }
}

@keyframes ripple-effect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes pulse-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Reveal on Scroll Animations */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   11. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .featured-card {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1.5fr repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .floating-1, .floating-2, .floating-3 {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .navbar-container {
    padding: 0 1rem;
  }
  .search-container {
    display: none; /* Accessible in mobile drawer */
  }
  .search-container.mobile-search {
    display: block;
    max-width: 100%;
    margin-bottom: 1.5rem;
  }
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 360px;
    height: 100vh;
    background: var(--surface-solid);
    flex-direction: column;
    align-items: flex-start;
    padding: 6rem 2rem 2rem 2rem;
    box-shadow: var(--shadow-lg);
    transition: right var(--transition-normal);
    z-index: 1050;
  }
  .nav-menu.active {
    right: 0;
  }
  .hamburger {
    display: block;
  }
  .hero {
    min-height: auto;
    padding: 140px 0 60px 0;
  }
  .featured-title {
    font-size: 1.8rem;
  }
  .section-title {
    font-size: 1.6rem;
  }
}

@media (max-width: 576px) {
  .hero-ctas {
    flex-direction: column;
    width: 100%;
  }
  .hero-ctas .btn {
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* ==========================================================
   EMERGENCY HERO CARD & TEXT OVERLAP HARD OVERRIDE
   ========================================================== */
/* Parent Hero Card Container */
.hero-featured-card, 
[class*="hero-featured"], 
[class*="spotlight-card"] {
  display: grid !important;
  grid-template-columns: minmax(260px, 320px) 1fr !important;
  width: 100% !important;
  max-width: 100% !important;
  background: var(--card-bg, #121624) !important;
  border: 1px solid var(--card-border, rgba(255,255,255,0.1)) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* Left Thumbnail Wrapper */
.hero-featured-card > div:first-child,
[class*="hero-media"],
[class*="card-preview"] {
  width: 100% !important;
  height: 100% !important;
  position: relative !important;
}

/* Right Text Content Column - Spans remaining space */
.hero-featured-card > div:last-child,
.hero-details,
[class*="hero-content"],
[class*="card-details"] {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: none !important; /* Removes hardcoded 400px limits */
  padding: 2rem !important;
  box-sizing: border-box !important;
  background: transparent !important; /* Removes internal nested black boxes */
}

/* Reset text positioning inside hero card to stop overlaps */
.hero-featured-card h1,
.hero-featured-card h2,
.hero-featured-card p,
.hero-details * {
  position: static !important;
  max-width: 100% !important;
  white-space: normal !important;
  margin-bottom: 0.75rem !important;
}

/* HIGH-SPECIFICITY LIGHT THEME OVERRIDES (Active ONLY in Light Mode) */
html[data-theme="light"],
body[data-theme="light"],
body.light-theme {
  background: #f0f4f9 !important;
  background-color: #f0f4f9 !important;
  color: #0f172a !important;
}

html[data-theme="light"] body::before,
body[data-theme="light"]::before,
body.light-theme::before {
  display: none !important;
}

html[data-theme="light"] header,
html[data-theme="light"] nav,
html[data-theme="light"] .navbar,
body[data-theme="light"] header,
body[data-theme="light"] nav,
body[data-theme="light"] .navbar,
body.light-theme header,
body.light-theme nav,
body.light-theme .navbar {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #0f172a !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .hero-section,
html[data-theme="light"] .hero,
html[data-theme="light"] .hero-featured-card,
html[data-theme="light"] .featured-card,
html[data-theme="light"] .game-card,
html[data-theme="light"] .footer,
html[data-theme="light"] [class*="card"],
body[data-theme="light"] .hero-section,
body[data-theme="light"] .hero,
body[data-theme="light"] .hero-featured-card,
body[data-theme="light"] .featured-card,
body[data-theme="light"] .game-card,
body[data-theme="light"] .footer,
body[data-theme="light"] [class*="card"],
body.light-theme .hero-section,
body.light-theme .hero,
body.light-theme .hero-featured-card,
body.light-theme .featured-card,
body.light-theme .game-card,
body.light-theme .footer,
body.light-theme [class*="card"] {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] p,
html[data-theme="light"] span,
html[data-theme="light"] a,
body[data-theme="light"] h1,
body[data-theme="light"] h2,
body[data-theme="light"] h3,
body[data-theme="light"] h4,
body[data-theme="light"] p,
body[data-theme="light"] span,
body[data-theme="light"] a,
body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme p,
body.light-theme span,
body.light-theme a {
  color: #0f172a !important;
}

