:root {
  /* Color Palette - 2026 Cyber Ice Edition */
  --bg-primary: #07090e;
  --bg-secondary: #0d121c;
  --bg-tertiary: #131b2a;
  --bg-card: rgba(16, 24, 39, 0.7);
  --bg-card-hover: rgba(22, 33, 54, 0.85);
  --bg-glass: rgba(13, 20, 34, 0.65);
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(56, 189, 248, 0.5);
  --border-glow: rgba(14, 165, 233, 0.35);

  --accent-cyan: #00f0ff;
  --accent-blue: #3b82f6;
  --accent-ice: #38bdf8;
  --accent-orange: #ff5e00;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Elevation & Blur */
  --backdrop-blur: blur(16px);
  --glow-cyan: 0 0 25px rgba(0, 240, 255, 0.25);
  --glow-orange: 0 0 25px rgba(255, 94, 0, 0.25);
  --glow-blue: 0 0 25px rgba(59, 130, 246, 0.25);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.8);

  /* Layout */
  --container-max: 1320px;
  --header-height: 80px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  font-size: 16px;
}

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

/* Ambient Cyber & Ice Background Glows */
body::before {
  content: '';
  position: fixed;
  top: -200px;
  left: 20%;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}

body::after {
  content: '';
  position: fixed;
  top: 40%;
  right: -100px;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(255, 94, 0, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}

/* Ice Arena Grid Texture Pattern */
.bg-grid-overlay {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

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

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

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

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.gradient-text-ice {
  background: linear-gradient(135deg, #ffffff 15%, var(--accent-cyan) 60%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-fire {
  background: linear-gradient(135deg, #ffffff 15%, var(--accent-orange) 70%, #ff2a00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Containers */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* Header & Navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  transition: all var(--transition-smooth);
  background: rgba(7, 9, 14, 0.92);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header.scrolled {
  background: rgba(7, 9, 14, 0.98);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(59, 130, 246, 0.1));
  border: 1px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-cyan);
  color: var(--accent-cyan);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-icon::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: rotate(45deg);
  animation: logoShine 4s infinite linear;
}

@keyframes logoShine {
  0% { transform: translateY(-100%) rotate(45deg); }
  20%, 100% { transform: translateY(100%) rotate(45deg); }
}

.logo-title {
  display: flex;
  flex-direction: column;
}

.logo-title .main-txt {
  font-size: 1.05rem;
  line-height: 1;
  color: #fff;
  white-space: nowrap;
}

.logo-title .sub-txt {
  font-size: 0.65rem;
  color: var(--accent-cyan);
  letter-spacing: 0.16em;
  margin-top: 3px;
  white-space: nowrap;
}

/* Nav Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex-shrink: 1;
}

.nav-link {
  padding: 7px 12px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  transition: all var(--transition-fast);
  white-space: nowrap;
  display: inline-block;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.nav-more {
  position: relative;
}

.nav-more-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.nav-more.open .nav-more-toggle,
.nav-more.active .nav-more-toggle {
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
}

.nav-more-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 8px;
  background: rgba(10, 14, 24, 0.98);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
}

.nav-more.open .nav-more-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-more-item {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
}

.nav-more-item:hover,
.nav-more-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.live-indicator-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-rose);
  text-transform: uppercase;
  white-space: nowrap;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-rose);
  box-shadow: 0 0 10px var(--accent-rose);
  animation: pulseDot 1.4s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.4; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #030712;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 240, 255, 0.55);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-orange {
  background: linear-gradient(135deg, var(--accent-orange), #ff2a00);
  color: #fff;
  box-shadow: var(--glow-orange);
}

.btn-orange:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 94, 0, 0.6);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

/* Glass Card */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(56, 189, 248, 0.08);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-cyan {
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.badge-orange {
  background: rgba(255, 94, 0, 0.15);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 94, 0, 0.35);
}

.badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  z-index: 1001;
}

.mobile-nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #fff;
  transition: all var(--transition-fast);
}

/* Footer */
.site-footer {
  margin-top: 100px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 70px 0 30px;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-col h4 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 20px;
  position: relative;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--accent-cyan);
}

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

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

.footer-links a:hover {
  color: var(--accent-cyan);
  transform: translateX(4px);
}

.footer-bottom {
  padding-top: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive Overrides */
@media (max-width: 1120px) {
  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: min(86vw, 300px);
    max-width: 300px;
    height: 100dvh;
    height: 100vh;
    margin: 0;
    background: #07090e;
    flex-direction: column;
    flex-wrap: nowrap;
    padding: calc(var(--header-height) + 20px) 20px 28px;
    gap: 0;
    align-items: stretch;
    border-left: 1px solid var(--border-subtle);
    transform: translateX(105%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1100;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

  .nav-menu.open {
    transform: translateX(0);
  }

  .nav-menu .nav-link {
    display: block;
    width: 100%;
    box-sizing: border-box;
    white-space: normal;
    border-radius: 10px;
    padding: 14px 14px;
    margin: 0;
    border: none;
    background: transparent;
    font-size: 1.02rem;
    line-height: 1.3;
  }

  .nav-menu .nav-link:hover,
  .nav-menu .nav-link.active {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-cyan);
    border: none;
  }

  .nav-more {
    width: 100%;
  }

  .nav-more-toggle {
    width: 100%;
    text-align: left;
  }

  .nav-more-menu {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 0 0 0 10px;
    margin: 4px 0 8px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .nav-more-item {
    padding: 12px 14px;
    font-size: 0.98rem;
  }

  .mobile-nav-toggle {
    display: flex;
    position: relative;
    z-index: 1200;
  }
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .site-header {
    height: 70px;
  }

  .header-inner {
    height: 70px;
  }

  .logo-title .sub-txt {
    display: none;
  }

  .nav-actions .live-indicator-badge {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .tab-filter-bar {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .tab-filter-bar::-webkit-scrollbar {
    display: none;
  }

  /* Table horizontal scroll touch smoothness */
  .standings-table-wrap {
    margin: 0;
    border-radius: var(--radius-md);
    -webkit-overflow-scrolling: touch;
  }

  .modern-table th, .modern-table td {
    padding: 12px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .date-navigator {
    flex-direction: column;
    align-items: stretch;
  }

  .date-presets {
    justify-content: center;
    width: 100%;
  }

  .date-input-wrap {
    flex-direction: column;
    width: 100%;
  }

  .date-picker-custom {
    width: 100%;
  }

  .protocol-meta-grid {
    grid-template-columns: 1fr;
  }
}
