/**
 * @file main.css
 * @description Core design system tokens, typography, background stadium theme and responsive base resets.
 * @dependencies ./theme.css
 */

@import './theme.css';

:root {
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);

  --bg-dark: #070b14;
  --bg-card: rgba(15, 23, 42, 0.78);
  --bg-card-hover: rgba(30, 41, 59, 0.88);
  --bg-surface: rgba(10, 16, 29, 0.92);
  
  --border-glow: rgba(255, 255, 255, 0.09);
  --border-focus: #00f2fe;

  --neon-cyan: #00f2fe;
  --neon-blue: #38bdf8;
  --neon-green: #10b981;
  --neon-red: #f43f5e;
  --neon-gold: #fbbf24;

  --p1-color: #ff3366;
  --p1-glow: rgba(255, 51, 102, 0.4);
  --p2-color: #00d2ff;
  --p2-glow: rgba(0, 210, 255, 0.4);

  --accent-gold: #ffd200;
  --accent-green: #10b981;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Rajdhani', 'Outfit', -apple-system, sans-serif;
  
  /* Concept A Master Esports Tokens */
  --gold-metallic-text: linear-gradient(180deg, #FFFFFF 0%, #FFF3B0 25%, #FBBF24 55%, #D97706 100%);
  --gold-btn-gradient: linear-gradient(180deg, #FFF59D 0%, #FBBF24 25%, #F59E0B 60%, #D97706 100%);
  --gold-btn-shadow: 0 7px 0 #78350f, 0 14px 28px rgba(0, 0, 0, 0.6), 0 0 45px rgba(245, 158, 11, 0.55), inset 0 2px 1px rgba(255, 255, 255, 0.85);
  --gold-btn-shadow-hover: 0 9px 0 #78350f, 0 18px 36px rgba(0, 0, 0, 0.65), 0 0 55px rgba(245, 158, 11, 0.75), inset 0 2px 1px rgba(255, 255, 255, 0.95);
  --gold-btn-shadow-active: 0 2px 0 #78350f, 0 6px 15px rgba(0, 0, 0, 0.6), 0 0 25px rgba(245, 158, 11, 0.4), inset 0 1px 1px rgba(0, 0, 0, 0.3);
  --card-hero-glass: linear-gradient(180deg, rgba(20, 32, 60, 0.82) 0%, rgba(10, 16, 32, 0.96) 100%);
  --neon-emerald-glow: 0 0 32px rgba(16, 185, 129, 0.6);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 242, 254, 0.05);
  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.25);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-family);
  background-color: #050b14;
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

/* 🏟️ IMMERSIVE CONCEPT A NIGHT STADIUM BACKGROUND */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: 
    radial-gradient(ellipse at 50% 12%, rgba(0, 242, 254, 0.2) 0%, transparent 60%),
    linear-gradient(180deg, rgba(5, 11, 20, 0.2) 0%, rgba(5, 11, 20, 0.0) 25%, rgba(5, 11, 20, 0.1) 65%, rgba(4, 9, 18, 0.85) 100%),
    url('../assets/images/lobby-stadium-bg.jpg');
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
}

@media (min-width: 769px) {
  body::before {
    background-size: auto 100vh;
    background-position: center top;
  }
}

#app {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(10px, var(--sat)) max(10px, var(--sar)) max(10px, var(--sab)) max(10px, var(--sal));
}

@media (min-width: 768px) {
  #app {
    padding: 24px;
  }
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  transition: var(--transition);
}

button:active {
  transform: scale(0.97);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* GLOBAL MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: max(10px, var(--sat)) max(10px, var(--sar)) max(10px, var(--sab)) max(10px, var(--sal));
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 3px solid var(--neon-cyan);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 460px;
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 242, 254, 0.15);
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(30, 41, 59, 0.4);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
  border-color: rgba(239, 68, 68, 0.4);
  transform: rotate(90deg);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--neon-cyan) rgba(15, 23, 42, 0.5);
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--neon-cyan);
  border-radius: 4px;
}

/* DATA DISCLAIMER & FEEDBACK */
.data-disclaimer-note {
  margin-top: 8px;
  font-size: 0.68rem;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 8px;
  text-align: center;
  line-height: 1.4;
}

.btn-data-feedback-link {
  background: transparent;
  border: none;
  color: var(--neon-cyan);
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  transition: var(--transition);
}

.btn-data-feedback-link:hover {
  color: #fff;
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.6);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 480px) {
  .modal-card {
    border-radius: var(--radius-lg);
    max-height: calc(100dvh - 16px);
  }

  .modal-header {
    padding: 12px 14px;
  }

  .modal-title {
    font-size: 0.95rem;
  }

  .modal-body {
    padding: 12px 14px;
    gap: 10px;
  }

  .modal-close-btn {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }
}

