/* =========================================================
   BoomArena — Main Stylesheet
   Premium neon-tech gaming platform
   ========================================================= */

/* ── CSS Custom Properties ── */

/* Skip link for keyboard/screen reader accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--neon-blue);
  color: #000;
  padding: 8px 16px;
  z-index: 100000;
  font-weight: bold;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  top: 0;
}

:root {
  /* Colors */
  --neon-blue: #00e5ff;
  --neon-purple: #b945ff;
  --neon-pink: #ff2d95;
  --neon-cyan: #00ffd5;
  --neon-orange: #ff6b35;
  --neon-yellow: #ffe066;

  --bg-primary: #0a0a1a;
  --bg-secondary: #0d0d2b;
  --bg-card: rgba(13, 13, 43, 0.85);
  --bg-glass: rgba(13, 13, 43, 0.55);

  --text-primary: #ffffff;
  --text-secondary: #a0a0c8;
  --text-muted: #5a5a8a;

  --border-glow: rgba(0, 229, 255, 0.3);
  --border-purple: rgba(185, 69, 255, 0.3);

  /* Gradients */
  --gradient-main: linear-gradient(135deg, #00e5ff 0%, #b945ff 50%, #ff2d95 100%);
  --gradient-dark: linear-gradient(180deg, #0a0a1a 0%, #0d0d2b 50%, #12123a 100%);
  --gradient-card: linear-gradient(135deg, rgba(0,229,255,0.08) 0%, rgba(185,69,255,0.08) 100%);
  --gradient-button: linear-gradient(135deg, #00e5ff, #b945ff);
  --gradient-button-hover: linear-gradient(135deg, #33ecff, #c96dff);

  /* Shadows */
  --shadow-neon: 0 0 20px rgba(0, 229, 255, 0.3), 0 0 60px rgba(0, 229, 255, 0.1);
  --shadow-purple: 0 0 20px rgba(185, 69, 255, 0.3), 0 0 60px rgba(185, 69, 255, 0.1);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Typography */
  --font-display: 'Orbitron', sans-serif;
  --font-heading: 'Exo 2', sans-serif;
  --font-body: 'Rajdhani', sans-serif;

  /* Spacing */
  --nav-height: 70px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--neon-blue), var(--neon-purple));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--neon-cyan), var(--neon-pink));
}

/* ── Particles Canvas ── */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Preloader ── */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ── Intro Video Overlay ── */
.intro-video-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: introFadeIn 0.4s ease;
}

.intro-video-overlay.intro-fade-out {
  animation: introFadeOut 0.5s ease forwards;
}

.intro-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-skip-btn {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  padding: 0.6rem 1.4rem;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  animation: introSkipIn 0.4s ease;
}

.intro-skip-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

.intro-skip-btn.intro-skip-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 10;
}

.intro-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
  transition: width 0.2s linear;
}

@keyframes introFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes introFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

@media (max-width: 480px) {
  .intro-skip-btn {
    bottom: 1.2rem;
    right: 1.2rem;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }
}

.preloader-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.preloader-logo {
  text-align: center;
  margin-bottom: 1rem;
}

.preloader-logo-img {
  height: 140px;
  width: auto;
  filter: drop-shadow(0 0 25px rgba(0, 229, 255, 0.5)) drop-shadow(0 0 50px rgba(185, 69, 255, 0.3));
  animation: preloader-logo-pulse 2.5s ease-in-out infinite;
}

@keyframes preloader-logo-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 25px rgba(0, 229, 255, 0.5)) drop-shadow(0 0 50px rgba(185, 69, 255, 0.3));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(0, 229, 255, 0.8)) drop-shadow(0 0 80px rgba(185, 69, 255, 0.5));
    transform: scale(1.03);
  }
}

.preloader-logo span {
  color: var(--neon-purple);
  -webkit-text-fill-color: var(--neon-purple);
}

.preloader-bar {
  width: min(260px, 80vw);
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  margin: 0.5rem auto;
  overflow: hidden;
}

.preloader-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--gradient-main);
  border-radius: 3px;
  animation: preloader-fill 2s ease-in-out forwards;
}

.preloader-text {
  font-family: var(--font-body);
  color: var(--text-secondary);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════
   NAVIGATION — Arcade HUD Bar v3.0
   ═══════════════════════════════════════ */
#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(4, 4, 14, 0.92);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(0, 229, 255, 0.12);
  transition: transform var(--transition-smooth), opacity var(--transition-smooth);
  /* Thin neon bottom line */
  box-shadow: 0 1px 0 rgba(0, 229, 255, 0.06), 0 4px 32px rgba(0, 0, 0, 0.6);
}

#main-nav.hidden {
  transform: translateY(-100%);
  opacity: 0;
}

/* Animated scan line at the very bottom of nav */
#main-nav::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 229, 255, 0.5) 30%,
    rgba(185, 69, 255, 0.5) 70%,
    transparent 100%);
  background-size: 200% 100%;
  animation: nav-line-scan 4s linear infinite;
}
@keyframes nav-line-scan {
  0%   { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* Logo — BOOM ARENA wordmark */
.nav-logo {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 42px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.35));
  transition: filter 0.3s ease;
}

.nav-logo:hover .nav-logo-img {
  filter: drop-shadow(0 0 14px rgba(0, 229, 255, 0.65));
}

.logo-boom {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.5);
}

.logo-arena {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #b945ff, #ff2d95);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(185, 69, 255, 0.4));
}

/* Nav links — HUD segment style */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(160, 160, 200, 0.6);
  position: relative;
  padding: 8px 14px;
  transition: color 0.2s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 3px; left: 14px; right: 14px;
  height: 1px;
  background: var(--neon-blue);
  box-shadow: 0 0 6px var(--neon-blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s;
}

.nav-link:hover,
.nav-link.active {
  color: rgba(255, 255, 255, 0.9);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-link.active {
  color: var(--neon-blue);
}

/* Login / User button — polygon cut corner */
.nav-login {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #060610 !important;
  background: linear-gradient(135deg, #00e5ff, #00ffd5);
  padding: 8px 20px;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
  transition: filter 0.2s, transform 0.15s;
  text-transform: uppercase;
  flex-shrink: 0;
}

.nav-login::before, .nav-login::after { display: none; }

.nav-login:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
}

.nav-hamburger span {
  width: 25px;
  height: 2px;
  background: var(--neon-blue);
  transition: var(--transition-fast);
  border-radius: 2px;
}

.nav-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translateY(10px);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translateY(-10px);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 26, 0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  z-index: 999;
}

.mobile-menu.open {
  display: flex;
}

.mobile-link {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.15em;
  transition: color var(--transition-fast);
}

.mobile-link:hover {
  color: var(--neon-blue);
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
}

/* ── Main Content ── */
#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ── Footer ── */
#main-footer {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, transparent 0%, rgba(10,10,26,0.95) 20%, var(--bg-primary) 100%);
  border-top: 1px solid rgba(0, 229, 255, 0.08);
  padding: 4rem 0 0;
  transition: opacity var(--transition-smooth);
}

#main-footer.hidden {
  opacity: 0;
  pointer-events: none;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.footer-logo {
  display: flex;
  align-items: center;
}

.footer-logo-img {
  height: 32px;
  width: auto;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.3));
}

.footer-logo span {
  color: var(--neon-purple);
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 3rem;
  justify-content: center;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--neon-blue);
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-socials {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.social-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: 8px;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.social-icon svg {
  width: 18px;
  height: 18px;
}

.social-icon:hover {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 15px rgba(0,229,255,0.2);
  transform: translateY(-2px);
}

.footer-bottom {
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

/* ── Utility Classes ── */
.hidden {
  display: none !important;
}

.page {
  min-height: 100vh;
  padding-top: var(--nav-height);
}

.page-enter {
  animation: pageEnter 0.6s ease forwards;
}

.page-exit {
  animation: pageExit 0.3s ease forwards;
}

.neon-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  background: var(--gradient-button);
  color: var(--bg-primary);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.4), 0 0 60px rgba(185, 69, 255, 0.2);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: transparent;
  color: var(--neon-blue);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 8px;
  border: 1px solid rgba(0,229,255,0.4);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(0, 229, 255, 0.1);
  border-color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0,229,255,0.2);
  transform: translateY(-1px);
}

.glass-card {
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0,229,255,0.1);
  border-radius: 16px;
  padding: 2rem;
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(0,229,255,0.25);
  box-shadow: 0 0 30px rgba(0,229,255,0.1);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }

  .footer-socials {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
  }

  .nav-links {
    display: none;
  }

  .footer-links {
    gap: 2rem;
  }

  .nav-hamburger {
    display: flex;
  }

  .footer-links {
    flex-direction: column;
    gap: 2rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  .nav-container { padding: 0 1rem; gap: 0.75rem; }
  .nav-logo-img { height: 34px; }
  .logo-boom, .logo-arena { font-size: 1rem; }
  .nav-actions { gap: 0.5rem; }
}
@media (max-width: 360px) {
  html { font-size: 13px; }
  .nav-container { padding: 0 0.75rem; }
  .nav-logo-img { height: 28px; }
  .logo-boom, .logo-arena { font-size: 0.85rem; }
}

/* ═══════════════════════════════════════
   Offline Banner
   ═══════════════════════════════════════ */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background: linear-gradient(135deg, #ff2d55 0%, #ff6b35 100%);
  color: #fff;
  text-align: center;
  padding: 0.6rem 1rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.offline-banner.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
.offline-icon {
  font-size: 1.2rem;
}

/* ═══════════════════════════════════════
   Focus Visible (Accessibility)
   ═══════════════════════════════════════ */
*:focus-visible {
  outline: 2px solid var(--neon-blue);
  outline-offset: 2px;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--neon-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════
   Screen Reader Only (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;
}

/* ═══════════════════════════════════════
   Reduced Motion (Accessibility)
   ═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .particle,
  #particles-canvas {
    display: none !important;
  }
}
