/* === Reset & Base === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: 'Roboto', 'Helvetica Neue', sans-serif; font-size: 1rem; line-height: 1.7; color: #FFFFFF; background-color: #0D1B2A; -webkit-font-smoothing: antialiased; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid #FFD700; outline-offset: 2px; border-radius: 2px; }

/* === CSS Variables === */
:root {
  --primary-red: #E63946;
  --gold: #FFD700;
  --dark-bg: #0D1B2A;
  --neon-green: #39FF14;
  --electric-blue: #00BFFF;
  --white: #FFFFFF;
  --dark-red: #8B0000;
  --card-bg: #1B2838;
  --text-primary: #FFFFFF;
  --text-secondary: #B0B0B0;
  --font-heading: 'Futura Bold', 'Impact', sans-serif;
  --font-body: 'Roboto', 'Helvetica Neue', sans-serif;
  --header-z: 1000;
  --transition-speed: 0.35s;
  --max-width: 1200px;
  --progress-bar-height: 3px;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); line-height: 1.15; letter-spacing: 0.02em; }
h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
body, p, li, a, span, div { font-family: var(--font-body); }
small, .text-small { font-size: 0.875rem; color: var(--text-secondary); }

/* === Skip Link === */
.skip-link { position: absolute; top: -100%; left: 0; z-index: 9999; padding: 0.75rem 1.5rem; background: var(--gold); color: #0D1B2A; font-weight: 700; font-size: 0.9rem; transition: top 0.25s; }
.skip-link:focus { top: 0; }

/* === Image Container (reusable) === */
.image-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background-color: var(--card-bg); border-radius: 4px; }
.image-frame img { width: 100%; height: 100%; object-fit: cover; }
.image-frame .image-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 0.875rem; background: var(--card-bg); }

/* === Header === */
.site-header { position: fixed; top: 0; left: 0; width: 100%; z-index: var(--header-z); background: transparent; transition: background var(--transition-speed) ease, box-shadow var(--transition-speed) ease; will-change: background; }
.site-header.scrolled { background: rgba(13, 27, 42, 0.97); box-shadow: 0 2px 20px rgba(0, 0, 0, 0.6); }
.header-inner { display: flex; align-items: center; gap: 1.25rem; max-width: var(--max-width); margin: 0 auto; padding: 0.75rem 1.5rem; position: relative; }
.brand-logo { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.brand-mark { display: block; width: 6px; height: 28px; background: var(--primary-red); transform: skewX(-12deg); border-radius: 1px; }
.brand-text { font-family: var(--font-heading); font-size: 1.6rem; color: var(--gold); letter-spacing: 0.06em; white-space: nowrap; }

/* === League Tabs === */
.league-tabs { display: flex; align-items: center; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; flex-shrink: 1; min-width: 0; }
.league-tabs::-webkit-scrollbar { display: none; }
.league-tab { flex-shrink: 0; padding: 0.4rem 0.9rem; font-family: var(--font-heading); font-size: 0.8rem; color: var(--text-secondary); background: transparent; border: 1px solid transparent; border-radius: 2px; transition: all 0.25s; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.league-tab:hover { color: var(--white); border-color: rgba(255, 215, 0, 0.3); }
.league-tab.active { color: var(--neon-green); border-color: var(--neon-green); background: rgba(57, 255, 20, 0.08); clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%, 0 6px); }

/* === Primary Nav === */
.primary-nav ul { display: flex; align-items: center; gap: 0.25rem; }
.primary-nav a { display: block; padding: 0.5rem 0.9rem; font-size: 0.9rem; color: var(--text-secondary); transition: color 0.25s; border-radius: 2px; white-space: nowrap; }
.primary-nav a:hover { color: var(--gold); }
.primary-nav a[aria-current="page"] { color: var(--gold); border-bottom: 2px solid var(--gold); border-radius: 0; }

/* === Nav Status (Console dot) === */
.nav-status { display: flex; align-items: center; gap: 0.45rem; flex-shrink: 0; margin-left: auto; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neon-green); box-shadow: 0 0 8px rgba(57, 255, 20, 0.5); animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.85); } }
.status-label { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }

/* === Nav Toggle (Mobile) === */
.nav-toggle { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 4px; width: 36px; height: 36px; flex-shrink: 0; background: transparent; border-radius: 2px; transition: background 0.25s; }
.nav-toggle:hover { background: rgba(255, 255, 255, 0.05); }
.nav-toggle-line { display: block; width: 22px; height: 2px; background: var(--white); border-radius: 1px; transition: transform 0.3s, opacity 0.3s; }
[data-open] .nav-toggle-line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
[data-open] .nav-toggle-line:nth-child(2) { opacity: 0; }
[data-open] .nav-toggle-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* === Progress Bar === */
.progress-bar { position: absolute; bottom: 0; left: 0; width: 0%; height: var(--progress-bar-height); background: linear-gradient(90deg, var(--primary-red), var(--gold)); transition: width 0.1s linear; transform-origin: left; }

/* === Footer === */
.site-footer { position: relative; background: rgba(13, 27, 42, 0.98); border-top: 1px solid rgba(230, 57, 70, 0.2); padding: 3rem 1.5rem 2rem; margin-top: 4rem; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 3rem; }
.footer-brand { grid-column: 1 / 2; }
.footer-brand .brand-logo { margin-bottom: 0.5rem; }
.footer-tagline { font-size: 0.9rem; color: var(--text-secondary); margin-top: 0.25rem; }
.footer-links { grid-column: 2 / 3; display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem; justify-self: end; }
.footer-links a { font-size: 0.9rem; color: var(--text-secondary); transition: color 0.25s; padding: 0.2rem 0; }
.footer-links a:hover { color: var(--gold); }
.footer-info { grid-column: 1 / -1; border-top: 1px solid rgba(255, 215, 0, 0.1); padding-top: 1.5rem; margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; font-size: 0.8rem; color: var(--text-secondary); }
.footer-info a { color: var(--gold); transition: color 0.25s; }
.footer-info a:hover { color: var(--primary-red); }
.footer-copy { flex-basis: 100%; }
.trust-statement { grid-column: 1 / -1; margin-top: 0.5rem; padding: 1rem 1.25rem; background: rgba(230, 57, 70, 0.06); border-left: 3px solid var(--primary-red); border-radius: 2px; }
.trust-statement p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; }

/* === Back to Top === */
.back-to-top { position: fixed; bottom: 2rem; right: 2rem; z-index: 900; width: 44px; height: 44px; background: var(--primary-red); border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0.35s, transform 0.35s; box-shadow: 0 4px 16px rgba(230, 57, 70, 0.35); cursor: pointer; }
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-3px); background: var(--dark-red); }
.top-arrow { display: block; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 10px solid var(--white); }

/* === Responsive === */
@media (max-width: 1023px) {
  .header-inner { padding: 0.6rem 1rem; gap: 0.75rem; }
  .brand-text { font-size: 1.4rem; }
  .league-tab { font-size: 0.7rem; padding: 0.3rem 0.7rem; }
  .primary-nav a { font-size: 0.8rem; padding: 0.4rem 0.7rem; }
  .nav-status { margin-left: 0; }
}
@media (max-width: 767px) {
  .nav-toggle { display: flex; }
  .league-tabs { display: none; }
  .nav-status { display: none; }
  .primary-nav { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100dvh; background: rgba(13, 27, 42, 0.98); z-index: -1; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0.35s; }
  .primary-nav[data-open] { opacity: 1; visibility: visible; }
  .primary-nav ul { flex-direction: column; gap: 0.75rem; text-align: center; }
  .primary-nav a { font-size: 1.3rem; padding: 0.75rem 1.5rem; color: var(--white); }
  .primary-nav a[aria-current="page"] { color: var(--gold); border-bottom: 2px solid var(--gold); }
  .site-header.scrolled .primary-nav { background: rgba(13, 27, 42, 0.99); }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-links { grid-column: 1 / 2; align-items: flex-start; justify-self: start; }
  .back-to-top { bottom: 1rem; right: 1rem; width: 40px; height: 40px; }
}
@media (max-width: 480px) {
  .header-inner { padding: 0.5rem 0.75rem; }
  .brand-text { font-size: 1.2rem; }
  .brand-mark { height: 22px; width: 5px; }
  .site-footer { padding: 2rem 1rem 1.5rem; }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .status-dot { animation: none; }
  .progress-bar { transition: none; }
}
