/* dark theme */
:root {
  /* BRAND */
  --kyron-red: #FF2A1F;

  /* BACKGROUNDS */
  --bg: #05070D;
  --surface: #0B1020;
  --card: #0D1117;

  /* TEXT */
  --text-primary: #F5F7FA;
  --text-secondary: #A8B0C0;
  --text-muted: #7C879B;

  /* BORDERS & GLOW */
  --border: rgba(255, 255, 255, 0.07);
  --glow-cyan: rgba(0, 245, 255, 0.1);

  /* GAMES */
  --game-bgmi-text: #A78BFA;

  /* SOCIAL */
  --instagram: #E1306C;
  --whatsapp: #25D366;
  --youtube-text: #FF4444;

  /* GRID & NAV */
  --grid-line: rgba(0, 168, 255, 0.025);
  --nav-bg: rgba(5, 7, 13, 0.85);

  /* LEGACY ALIASES (used as game accents) */
  --neon: #00A8FF;
  --neon2: #7B2FFF;
  --chess: #F59E0B;
  --valorant: #FF4655;
}

/* light theme */
[data-theme="light"],
body.light-theme {
  --kyron-red: #E5232B;

  --bg: #F7F9FC;
  --nav-bg: rgba(247, 249, 252, 0.92);
  --surface: #EEF2F7;
  --card: #FFFFFF;

  --text-game-title:#F5F7FA;
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;

  --border: #DCE2EC;
  --glow-cyan: rgba(0, 159, 194, 0.12);

  --neon: #009FC2;
  --neon2: #6848D8;

  --grid-line: rgba(20, 95, 209, 0.03);
  --card-shadow: 0 4px 20px -2px rgba(17, 24, 39, 0.06), 0 2px 6px -1px rgba(17, 24, 39, 0.04);
  --card-hover-shadow: 0 12px 30px -4px rgba(17, 24, 39, 0.12), 0 4px 12px -2px rgba(17, 24, 39, 0.08);
}

/* ==========================================================================
   GAME VARIANTS
   Each variant sets: --accent, --accent-text, --accent-rgb
   Used by the hero badge (.badge-*) and the season cards (.ff, .bgmi, ...)
   ========================================================================== */

.badge-ff, .ff {
  --accent: var(--neon);
  --accent-text: var(--neon);
  --accent-rgb: 0, 245, 255;
}
.badge-bgmi, .bgmi {
  --accent: var(--neon2);
  --accent-text: var(--game-bgmi-text);
  --accent-rgb: 123, 47, 255;
}
.badge-chess, .chess {
  --accent: var(--chess);
  --accent-text: var(--chess);
  --accent-rgb: 245, 158, 11;
}
.badge-valorant, .valorant {
  --accent: var(--valorant);
  --accent-text: var(--valorant);
  --accent-rgb: 255, 70, 85;
}

/* light theme: darker accents for readability on white */
[data-theme="light"] :is(.badge-ff, .ff),
body.light-theme :is(.badge-ff, .ff) {
  --accent-rgb: 0, 159, 194;
}
[data-theme="light"] :is(.badge-bgmi, .bgmi),
body.light-theme :is(.badge-bgmi, .bgmi) {
  --accent-text: var(--neon2);
  --accent-rgb: 104, 72, 216;
}

/* ==========================================================================
   BASE
   ========================================================================== */

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

body {
  min-height: 100vh;
  background: var(--bg);
  font-family: 'Rajdhani', sans-serif;
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }

a:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   NAV
   ========================================================================== */

nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
}

.nav-inner {
  position: relative;
  max-width: 1440px;
  height: 60px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  flex-shrink: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}
.nav-logo span { color: var(--neon); }

/* Right group: game links, socials, admin, menu button */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* Desktop: the links' children sit directly in .nav-right and are ordered */
.nav-links { display: contents; }

.nav-links > a:not(.admin-btn) {
  order: 1;
  position: relative;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links > a:not(.admin-btn)::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.2rem;
  height: 2px;
  background: var(--neon);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.nav-links > a:not(.admin-btn):hover,
.nav-links > a:not(.admin-btn):focus-visible { color: var(--neon); }
.nav-links > a:not(.admin-btn):hover::after,
.nav-links > a:not(.admin-btn):focus-visible::after,
.nav-links > a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links > a[aria-current="page"] { color: var(--text-primary); }

/* Social icons */
.nav-social {
  order: 2;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 0.5rem 0 0.75rem;
}
.nav-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--c);
  transition: opacity 0.2s, background-color 0.2s;
}
.nav-social a:hover { opacity: 0.8; background: var(--surface); }
.nav-social svg { display: block; fill: currentColor; }

/* Admin button */
.nav-links a.admin-btn {
  order: 3;
  padding: 0.4rem 1rem;
  border: 1px solid var(--neon);
  border-radius: 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: var(--neon);
  transition: background 0.2s;
}
.nav-links a.admin-btn:hover { background: var(--glow-cyan); }

/* Mobile menu button */
.nav-toggle {
  order: 4;
  display: none;
  width: 38px;
  height: 38px;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-primary);
}
.nav-toggle:focus-visible { outline: 2px solid var(--neon); outline-offset: 3px; }
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-inner { padding: 0 1rem; }
  .nav-toggle { display: flex; }
  .nav-social { margin: 0 0.5rem 0 0; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }
  .nav-links.open { visibility: visible; opacity: 1; transform: none; }

  .nav-links > a:not(.admin-btn) {
    display: block;
    padding: 0.85rem 0.5rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links > a:not(.admin-btn)::after { display: none; }
  .nav-links a.admin-btn {
    display: block;
    margin-top: 0.85rem;
    text-align: center;
  }
}

/* Theme toggle */
.switch {
  --width-of-switch: 2.5em;
  --height-of-switch: 1.25em;
  --size-of-icon: 0.9em;
  --slider-offset: 0.3em;
  position: relative;
  display: block;
  width: var(--width-of-switch);
  height: var(--height-of-switch);
  font-size: 1rem;
}
.switch input { width: 0; height: 0; opacity: 0; }

.slider {
  position: absolute;
  inset: 0;
  border-radius: 30px;
  background-color: #f4f4f5;
  cursor: pointer;
  transition: 0.4s;
}
.slider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: var(--slider-offset);
  width: var(--size-of-icon);
  height: var(--size-of-icon);
  border-radius: 20px;
  background: linear-gradient(40deg, #ff0080, #ff8c00 70%);
  transform: translateY(-50%);
  transition: 0.4s;
}
input:checked + .slider { background-color: #303136; }
input:checked + .slider::before {
  left: calc(100% - (var(--size-of-icon) + var(--slider-offset)));
  background: #303136;
  box-shadow:
    inset -3px -2px 5px -2px #8983f7,
    inset -10px -4px 0 0 #a3dafb;
}
input:focus-visible + .slider { outline: 2px solid var(--neon); outline-offset: 2px; }

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   HERO BANNER
   ========================================================================== */

.game-hero {
  position: relative;
  min-height: 310px;
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  isolation: isolate;

  /* Main artwork is rendered by .game-header::before so portrait artwork
     can be rotated without affecting the text/layout. */
  background-image: none;
}

/* Extended background: fills the entire hero without cropping the
   main artwork. It is intentionally blurred/dimmed so the centered
   full image remains the visual focus. */
.game-hero::before {
  content: "";
  position: absolute;
  inset: -28px;
  z-index: -2;
  background-image: var(--game-image);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(22px) saturate(0.8) brightness(0.45);
  opacity: 0.9;
  transform: scale(1.08);
}

/* Low vignette + left-side readability gradient. */
.game-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(5, 7, 13, 0.94) 0%,
      rgba(5, 7, 13, 0.72) 24%,
      rgba(5, 7, 13, 0.25) 55%,
      rgba(5, 7, 13, 0.48) 100%),
    linear-gradient(180deg,
      rgba(5, 7, 13, 0.38) 0%,
      transparent 25%,
      transparent 70%,
      rgba(5, 7, 13, 0.78) 100%);
}

/* ==========================================================================
   LIGHT THEME HERO
   ========================================================================== */

/* Blurred backdrop: bright instead of dimmed */
[data-theme="light"] .game-hero::before,
body.light-theme .game-hero::before {
  filter: blur(22px) saturate(0.9) brightness(1.1);
  opacity: 0.55;
}

/* Overlay: light fade for readability instead of the dark vignette */
[data-theme="light"] .game-hero::after,
body.light-theme .game-hero::after {
  background:
    linear-gradient(90deg,
      rgba(247, 249, 252, 0.95) 0%,
      rgba(247, 249, 252, 0.75) 24%,
      rgba(247, 249, 252, 0.15) 55%,
      rgba(247, 249, 252, 0.35) 100%),
    linear-gradient(180deg,
      rgba(247, 249, 252, 0.3) 0%,
      transparent 25%,
      transparent 70%,
      rgba(247, 249, 252, 0.85) 100%);
}

/* Main artwork: full strength */
[data-theme="light"] .game-header::before,
body.light-theme .game-header::before {
  opacity: 0.95;
}

/* Text: dark, since the background is now light */
[data-theme="light"] .game-title,
body.light-theme .game-title { color: var(--text-primary); }

[data-theme="light"] .game-subtitle,
body.light-theme .game-subtitle,
[data-theme="light"] .back-link,
body.light-theme .back-link { color: var(--text-secondary); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.back-link:hover { color: var(--neon); }

.game-header {
  display: flex;
  align-items: center;
  min-height: 180px;
  padding: 1rem 0;
}

.game-header-content {
  position: relative;
  z-index: 2;
}

/* Main artwork: show the full source image and rotate it 90deg so portrait
   source artwork is presented horizontally in the hero. */
.game-header::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background-image: var(--game-image);
 background-position: center ;
  background-size: auto 110%;
  background-repeat: no-repeat;
  transform-origin: center;
  opacity: 0.62;
  pointer-events: none;
}

.game-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.3rem 0.9rem;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 100px;
  background: rgba(var(--accent-rgb), 0.07);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent-text);
}

.game-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 900;
  color: var(--text-game-title);
}

.game-subtitle {
  margin-top: 0.3rem;
  font-size: 1rem;
  color: var(--text-muted);
}

/* ==========================================================================
   SEASONS GRID
   ========================================================================== */

.seasons-section { padding: 3rem 0; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.section-head h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.count-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.seasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
}

.season-card {
  display: block;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--card-shadow, none);
  transition:
    transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
    border-color 0.35s cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.season-card:hover {
  transform: translateY(-5px);
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 16px 50px rgba(var(--accent-rgb), 0.12), var(--card-hover-shadow, none);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-top .game-badge { margin: 0; }

.card-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-title {
  margin-bottom: 0.5rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-hint { font-size: 0.85rem; color: var(--text-muted); }

.card-arrow {
  margin-top: 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-text);
}

/* ==========================================================================
   EMPTY / ERROR STATE
   ========================================================================== */

.empty-state {
  grid-column: 1 / -1;
  padding: 5rem 1rem;
  text-align: center;
}
.empty-state div { margin-bottom: 1rem; font-size: 3rem; }
.empty-state p {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.empty-state p.error { color: var(--kyron-red); }

/* ==========================================================================
   MOTION & RESPONSIVE
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 600px) {
  .game-subtitle {display: none;}

  .game-header {
    min-height: 125px;
  }

  .game-header::before {
    background-size: contain;
    opacity: 0.5;
  }
}
