@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,400;0,600;0,700;1,700&family=Rajdhani:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --font-racing: 'Chakra Petch', sans-serif;
  --font-speed: 'Rajdhani', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* League Signature Colors: Orange (#f48300) & Red (#ff0015) */
  --color-eor-orange: #f48300;
  --color-eor-red: #ff0015;
  --gradient-eor: linear-gradient(135deg, #f48300 0%, #ff0015 100%);
  --gradient-eor-swapped: linear-gradient(135deg, #ff0015 0%, #f48300 100%);
  --glow-eor: rgba(244, 131, 0, 0.4);

  /* Official IMSA Multiclass Categories */
  /* GTP: Black with White Outline */
  --color-gtp: #000000;
  --color-gtp-border: #ffffff;
  --color-gtp-glow: rgba(255, 255, 255, 0.45);
  
  /* LMP2: IMSA Blue */
  --color-lmp2: #0072ce;
  --color-lmp2-glow: rgba(0, 114, 206, 0.45);
  
  /* GTD PRO: IMSA Red */
  --color-gtdpro: #dc2626;
  --color-gtdpro-glow: rgba(220, 38, 38, 0.45);

  /* GTD: IMSA Green */
  --color-gtd: #059669;
  --color-gtd-glow: rgba(5, 150, 105, 0.45);

  /* Discord Blurple */
  --color-discord: #5865F2;
  --color-discord-hover: #4752c4;
}

body {
  font-family: var(--font-body);
  background-color: #05070a;
  color: #f1f5f9;
  overflow-x: hidden;
}

/* Racing Headers */
.font-racing {
  font-family: var(--font-racing);
}

.font-speed {
  font-family: var(--font-speed);
}

/* League Gradients */
.bg-gradient-eor {
  background: var(--gradient-eor);
}

.bg-gradient-eor-swapped {
  background: var(--gradient-eor-swapped);
}

.text-gradient-eor {
  background: var(--gradient-eor);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  text-shadow: none !important;
  filter: none !important;
}

.border-gradient-eor {
  border-image: var(--gradient-eor) 1;
}

/* Animated gradient bar / shimmer */
.eor-gradient-animated {
  background: linear-gradient(90deg, #f48300, #ff0015, #f48300);
  background-size: 200% 200%;
  animation: eorGradientShift 4s ease infinite;
}

@keyframes eorGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Top Announcement Bar Page Indicator Oval Badge */
.top-banner-page-badge,
.eor-gradient-animated span.inline-flex.rounded-full {
  background-color: rgba(0, 0, 0, 0.72) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35) !important;
}

.top-banner-page-badge *,
.eor-gradient-animated span.inline-flex.rounded-full * {
  color: #ffffff !important;
}

.top-banner-page-badge .animate-ping,
.eor-gradient-animated .animate-ping {
  background-color: #fb923c !important;
}

/* Carbon Fiber Pattern Overlay */
.carbon-pattern {
  background-color: #06090f;
  background-image: radial-gradient(rgba(244, 131, 0, 0.04) 1px, transparent 0);
  background-size: 24px 24px;
}

.racing-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* Glassmorphic Panels */
.glass-panel {
  background: rgba(10, 14, 23, 0.68);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-panel-hover {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel-hover:hover {
  transform: translateY(-3px);
  border-color: rgba(244, 131, 0, 0.35);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.8), 0 0 15px rgba(244, 131, 0, 0.15);
}

/* Primary EOR Action Button */
.btn-eor-primary {
  background: var(--gradient-eor);
  color: #ffffff;
  font-weight: 700;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(244, 131, 0, 0.35);
}

.btn-eor-primary:hover {
  background: var(--gradient-eor-swapped);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 0, 21, 0.5);
}

/* Official IMSA Class Badges */

.badge-gtp,
.badge-lmp2,
.badge-gtdpro,
.badge-gtd {
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  letter-spacing: 0.5px;
  line-height: 1;
}

/* GTP: Black with crisp White Outline */
.badge-gtp {
  background: #000000;
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px var(--color-gtp-glow);
}

/* LMP2: IMSA Blue */
.badge-lmp2 {
  background: linear-gradient(135deg, #0284c7, #005596);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 10px var(--color-lmp2-glow);
}

/* GTD PRO: IMSA Red */
.badge-gtdpro {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #ffffff;
  border: 1px solid rgba(248, 113, 113, 0.5);
  box-shadow: 0 0 10px var(--color-gtdpro-glow);
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
}

/* GTD: IMSA Green */
.badge-gtd {
  background: linear-gradient(135deg, #059669, #065f46);
  color: #ffffff;
  border: 1px solid rgba(52, 211, 153, 0.4);
  box-shadow: 0 0 10px var(--color-gtd-glow);
}

.border-gtp { border-color: #ffffff !important; }
.border-lmp2 { border-color: #0284c7 !important; }
.border-gtdpro { border-color: #dc2626 !important; }
.border-gtd { border-color: #059669 !important; }

.text-gtp { color: #ffffff !important; }
.text-lmp2 { color: #38bdf8 !important; }
.text-gtdpro { color: #f87171 !important; }
.text-gtd { color: #34d399 !important; }

/* Hero Background and Gradient Vignette */
.hero-wrapper {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Hero Background Slideshow with Gentle Crossfade */
.hero-slideshow-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.hero-slide-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0;
  transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1), transform 10s ease-out;
  transform: scale(1.03);
  z-index: 0;
  will-change: opacity, transform;
}

.hero-slide-img.active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.hero-wrapper.drag-over::after {
  content: "Drop racing pictures here to add to slideshow";
  position: absolute;
  inset: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-racing);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  color: #ffffff;
  background: rgba(10, 14, 23, 0.9);
  border: 2px dashed #f48300;
  border-radius: 1rem;
  box-shadow: 0 0 30px rgba(244, 131, 0, 0.35);
  z-index: 40;
  pointer-events: none;
}

.hero-background-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  z-index: 0;
}

/* Roster Driver Autocomplete & Combobox Dropdown */
.roster-autocomplete-dropdown {
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 131, 0, 0.4) rgba(15, 23, 42, 0.95);
}

.roster-autocomplete-dropdown::-webkit-scrollbar {
  width: 6px;
}

.roster-autocomplete-dropdown::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 4px;
}

.roster-autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: rgba(244, 131, 0, 0.4);
  border-radius: 4px;
}

.roster-autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(244, 131, 0, 0.7);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(5, 7, 10, 0.52) 0%,
    rgba(5, 7, 10, 0.68) 60%,
    rgba(5, 7, 10, 0.80) 100%
  ),
  radial-gradient(
    circle at center,
    rgba(5, 7, 10, 0.20) 0%,
    rgba(5, 7, 10, 0.75) 90%
  );
  z-index: 1;
}

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

/* Discord CTA Button */
.btn-discord {
  background-color: var(--color-discord);
  color: #ffffff;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.4);
}

.btn-discord:hover {
  background-color: var(--color-discord-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(88, 101, 242, 0.6);
}

/* Pulsing Live Beacon */
.pulsing-dot {
  position: relative;
}

.pulsing-dot::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: inherit;
  border-radius: inherit;
  animation: pulse-ring 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  70% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* XtremeScoring Container Styling */
.xtreme-scoring-frame {
  width: 100%;
  min-height: 850px;
  border: none;
  border-radius: 12px;
  background: #090d16;
}

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

::-webkit-scrollbar-track {
  background: #05070a;
}

::-webkit-scrollbar-thumb {
  background: #273142;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #f48300;
}

/* User Access Control: Hide administrative/upload/sync controls from general visitors */
body:not(.admin-logged-in) .admin-only-control,
html:not(.admin-logged-in) .admin-only-control {
  display: none !important;
}

body.admin-logged-in .admin-only-control {
  animation: adminFadeIn 0.25s ease-out forwards;
}

@keyframes adminFadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-login-toggle {
  cursor: pointer;
  user-select: none;
}

body.admin-logged-in .admin-login-toggle {
  background-color: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

/* Prevent Admin login gate from flashing when already authenticated */
html.admin-logged-in #adminAuthGate,
body.admin-logged-in #adminAuthGate {
  display: none !important;
}

html.admin-logged-in #adminMainDashboard {
  display: block !important;
}

/* ============================================================
   HALL OF CHAMPIONS - PRESTIGE & TROPHY VAULT STYLES
   ============================================================ */
.text-gold-gradient {
  background: linear-gradient(135deg, #fff7cc 0%, #facc15 35%, #eab308 65%, #ca8a04 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-silver-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-bronze-gradient {
  background: linear-gradient(135deg, #ffedd5 0%, #f97316 50%, #c2410c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gold-glow {
  box-shadow: 0 0 35px rgba(234, 179, 8, 0.18), inset 0 0 15px rgba(234, 179, 8, 0.05);
}

.gold-glow-hover {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gold-glow-hover:hover {
  transform: translateY(-4px);
  border-color: rgba(234, 179, 8, 0.55);
  box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.9), 0 0 30px rgba(234, 179, 8, 0.28);
}

.trophy-plaque {
  background: radial-gradient(circle at top right, rgba(234, 179, 8, 0.08), transparent 60%),
              linear-gradient(180deg, #121824 0%, #080c14 100%);
  border: 1px solid rgba(234, 179, 8, 0.25);
  position: relative;
  overflow: hidden;
}

.trophy-plaque::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #eab308, #facc15, #eab308, transparent);
  opacity: 0.85;
}

.trophy-ribbon {
  background: linear-gradient(135deg, #ca8a04 0%, #eab308 50%, #a16207 100%);
  color: #000000;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.car-number-plaque {
  font-family: var(--font-racing);
  font-weight: 800;
  letter-spacing: -0.05em;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff7cc 0%, #facc15 25%, #eab308 60%, #ca8a04 100%);
  color: #05070a !important;
  border: 2px solid #fef08a;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.7), inset 0 -2px 4px rgba(161, 98, 7, 0.5);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.pedestal-border {
  position: relative;
}

.pedestal-border::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.5), transparent);
}

/* ========================================================
   FULL CALENDAR & EVENT WEATHER SYSTEM
   ======================================================== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-cell {
  min-height: 110px;
  background: rgba(10, 14, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
  position: relative;
}

@media (min-width: 768px) {
  .calendar-cell {
    min-height: 135px;
  }
}

.calendar-cell:hover {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(244, 131, 0, 0.25);
}

.calendar-cell.other-month {
  opacity: 0.35;
  background: rgba(5, 7, 10, 0.5);
}

.calendar-cell.today {
  background: rgba(244, 131, 0, 0.08);
  border-color: rgba(244, 131, 0, 0.5);
  box-shadow: inset 0 0 15px rgba(244, 131, 0, 0.15);
}

.calendar-cell.today::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-eor);
}

.calendar-event-card {
  position: relative;
  border-left-width: 3px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.calendar-event-card:hover {
  transform: translateY(-1.5px) scale(1.01);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.75);
  filter: brightness(1.15);
  z-index: 10;
}

.color-swatch-btn {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 2px solid transparent;
}

.color-swatch-btn.selected {
  transform: scale(1.25);
  border-color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.weather-metric-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s ease;
}

.weather-metric-box:hover {
  border-color: rgba(244, 131, 0, 0.35);
}

/* ==========================================================================
   THEME ENGINE: LIGHT MODE & DARK MODE STYLES
   ========================================================================== */

/* Floating Corner Theme Toggle Button */
.theme-corner-btn {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(244, 131, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.6), 0 0 15px rgba(244, 131, 0, 0.25);
  color: #f1f5f9;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.theme-corner-btn:hover {
  transform: scale(1.1);
  border-color: #f48300;
  box-shadow: 0 14px 30px -4px rgba(244, 131, 0, 0.45), 0 0 20px rgba(244, 131, 0, 0.35);
}

/* Smooth Transitions for Theme Switching */
body,
.glass-panel,
nav,
footer,
.calendar-cell,
.calendar-event-card,
input,
select,
textarea {
  transition: background-color 0.25s ease, color 0.2s ease, border-color 0.2s ease;
}

/* ==========================================================================
   DEFAULT DARK MODE FORMS, INPUTS & DROPDOWNS
   ========================================================================== */
:root,
html,
html.dark {
  color-scheme: dark;
}

input,
select,
textarea {
  color-scheme: dark !important;
}

/* Ensure ALL select elements and their native option lists display with dark backgrounds */
select {
  background-color: #0b0f17;
  color: #f1f5f9;
  color-scheme: dark !important;
}

select option,
select optgroup {
  background-color: #0b0f17 !important;
  color: #f1f5f9 !important;
  color-scheme: dark !important;
}

select option:checked,
select option:hover,
select option:focus {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

/* Custom Autocomplete & Combobox Dropdown Dark Mode Fallbacks */
.roster-autocomplete-dropdown {
  background-color: #0b0f17 !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
}

.roster-autocomplete-dropdown .roster-autocomplete-item {
  color: #e2e8f0 !important;
  background-color: transparent !important;
}

.roster-autocomplete-dropdown .roster-autocomplete-item:hover,
.roster-autocomplete-dropdown .roster-autocomplete-item.active {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

/* Calendar & Datalist native icons */
input::-webkit-calendar-picker-indicator {
  filter: invert(0.85);
}

/* --------------------------------------------------------------------------
   LIGHT MODE OVERRIDES (html.light)
   -------------------------------------------------------------------------- */
html.light body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

/* Grids & Overlays */
html.light .carbon-pattern {
  background-color: #f1f5f9 !important;
  background-image: radial-gradient(rgba(244, 131, 0, 0.08) 1px, transparent 0) !important;
}

html.light .racing-grid {
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 1px, transparent 1px) !important;
}

html.light .hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(248, 250, 252, 0.45) 0%,
    rgba(248, 250, 252, 0.75) 60%,
    rgba(248, 250, 252, 0.95) 100%
  ) !important;
}

/* Navigation Bar */
html.light nav {
  background-color: rgba(255, 255, 255, 0.94) !important;
  border-bottom-color: #e2e8f0 !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04) !important;
}

html.light #mobileMenu {
  background-color: #ffffff !important;
  border-top-color: #e2e8f0 !important;
}

html.light nav a.text-slate-300,
html.light #mobileMenu a.text-slate-300 {
  color: #475569 !important;
}

html.light nav a.text-slate-300:hover,
html.light #mobileMenu a.text-slate-300:hover {
  color: #0f172a !important;
  background-color: #f1f5f9 !important;
}

/* Glassmorphic Panels */
html.light .glass-panel {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02) !important;
}

html.light .glass-panel-hover:hover {
  border-color: rgba(244, 131, 0, 0.5) !important;
  box-shadow: 0 16px 32px -10px rgba(0, 0, 0, 0.1), 0 0 15px rgba(244, 131, 0, 0.15) !important;
}

/* Surface Backgrounds */
html.light .bg-slate-950,
html.light .bg-slate-900,
html.light .bg-\[\#05070a\],
html.light .bg-\[\#070a0f\],
html.light .bg-\[\#070b12\],
html.light .bg-\[\#0a0e17\],
html.light .bg-\[\#06090f\],
html.light .bg-\[\#04060a\],
html.light .bg-black,
html.light #miataOpenSection {
  background-color: #ffffff !important;
}

html.light .bg-slate-950\/60,
html.light .bg-slate-950\/70,
html.light .bg-slate-950\/80,
html.light .bg-slate-950\/90,
html.light .bg-slate-900\/50,
html.light .bg-slate-900\/60,
html.light .bg-slate-900\/70,
html.light .bg-slate-900\/80,
html.light .bg-slate-900\/90,
html.light .bg-slate-900\/95,
html.light .bg-black\/80,
html.light .bg-black\/60,
html.light .bg-black\/50,
html.light .bg-black\/40 {
  background-color: #f8fafc !important;
}

/* Ensure Top Announcement Banner Page Indicator Oval remains dark and readable in Light Mode */
html.light .top-banner-page-badge,
html.light .eor-gradient-animated .top-banner-page-badge,
html.light .eor-gradient-animated span.inline-flex.rounded-full,
html.light .eor-gradient-animated .bg-black\/50 {
  background-color: rgba(0, 0, 0, 0.72) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35) !important;
}

html.light .top-banner-page-badge *,
html.light .eor-gradient-animated .top-banner-page-badge *,
html.light .eor-gradient-animated span.inline-flex.rounded-full *,
html.light .eor-gradient-animated .bg-black\/50 * {
  color: #ffffff !important;
}

html.light .top-banner-page-badge .animate-ping,
html.light .eor-gradient-animated .animate-ping {
  background-color: #fb923c !important;
}

html.light .bg-slate-800,
html.light .bg-slate-800\/40,
html.light .bg-slate-800\/60,
html.light .bg-slate-800\/80,
html.light .bg-slate-800\/90 {
  background-color: #f1f5f9 !important;
}

/* Text Colors */
html.light .text-white,
html.light .text-slate-100,
html.light .text-slate-200 {
  color: #0f172a !important;
}

html.light .text-slate-300 {
  color: #334155 !important;
}

html.light .text-slate-400 {
  color: #64748b !important;
}

html.light .text-slate-500 {
  color: #94a3b8 !important;
}

/* Borders & Dividers */
html.light .border-slate-800,
html.light .border-slate-800\/80,
html.light .border-slate-700,
html.light .border-slate-700\/60,
html.light .border-white\/10,
html.light .border-white\/5,
html.light .divide-slate-800,
html.light .divide-slate-800\/80 {
  border-color: #e2e8f0 !important;
}

/* Forms, Inputs & Selects */
html.light input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html.light select,
html.light textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  color-scheme: light !important;
}

html.light input:focus,
html.light select:focus,
html.light textarea:focus {
  border-color: #f48300 !important;
  box-shadow: 0 0 0 2px rgba(244, 131, 0, 0.2) !important;
}

html.light select option,
html.light select optgroup {
  background-color: #ffffff !important;
  color: #0f172a !important;
  color-scheme: light !important;
}

html.light select option:checked,
html.light select option:hover,
html.light select option:focus {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

html.light .roster-autocomplete-dropdown {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

html.light .roster-autocomplete-item:hover,
html.light .roster-autocomplete-item.active {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

/* Calendar Grid & Event Cards */
html.light .calendar-cell {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

html.light .calendar-cell.other-month {
  background-color: #f8fafc !important;
  color: #94a3b8 !important;
}

html.light .calendar-cell.today-cell {
  background-color: #fff7ed !important;
  border-color: #f48300 !important;
}

html.light .calendar-event-card {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

html.light .calendar-event-card:hover {
  background-color: #f8fafc !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
}

html.light .weather-metric-box {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

/* Modals */
html.light [id$="Modal"] .bg-slate-900,
html.light [id$="Modal"] .bg-slate-950,
html.light [id$="Modal"] .glass-panel {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

/* Tables */
html.light tr.hover\:bg-slate-800\/40:hover,
html.light tr:hover {
  background-color: #f1f5f9 !important;
}

html.light th {
  color: #475569 !important;
}

/* Footer */
html.light footer {
  background-color: #f1f5f9 !important;
  border-top-color: #e2e8f0 !important;
  color: #334155 !important;
}

html.light footer a {
  color: #475569 !important;
}

html.light footer a:hover {
  color: #0f172a !important;
}

/* Floating Corner Theme Button in Light Mode */
html.light .theme-corner-btn {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(244, 131, 0, 0.5) !important;
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.12), 0 0 15px rgba(244, 131, 0, 0.2) !important;
  color: #0f172a !important;
}

/* Ensure vibrant buttons and badges retain high contrast white text in Light Mode */
html.light .btn-eor-primary,
html.light .btn-eor-primary *,
html.light .btn-discord,
html.light .btn-discord *,
html.light .badge-gtp,
html.light .badge-lmp2,
html.light .badge-gtdpro,
html.light .badge-gtd,
html.light .eor-gradient-animated,
html.light .eor-gradient-animated *,
html.light .bg-sky-600,
html.light .bg-sky-600 *,
html.light .bg-sky-500,
html.light .bg-sky-500 *,
html.light .bg-orange-500,
html.light .bg-orange-500 *,
html.light .bg-orange-600,
html.light .bg-orange-600 *,
html.light .bg-red-600,
html.light .bg-red-600 *,
html.light .bg-red-600\/90,
html.light .bg-red-600\/90 *,
html.light .bg-\[\#ff0015\],
html.light .bg-\[\#ff0015\] *,
html.light .bg-emerald-600,
html.light .bg-emerald-600 * {
  color: #ffffff !important;
}

/* Text & Border GTP in light mode for readability */
html.light .text-gtp {
  color: #0f172a !important;
}
html.light .border-gtp {
  border-color: #0f172a !important;
}

/* League Gradient text preservation in Light Mode */
html.light .text-gradient-eor {
  background: var(--gradient-eor) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  color: transparent !important;
}

/* --------------------------------------------------------------------------
   PAGE HEADERS IN LIGHT MODE
   -------------------------------------------------------------------------- */
/* Subpage Headers across Calendar, Schedule, Standings, Roster, Rules, Champions */
html.light header:not(.hero-wrapper),
html.light header.py-10,
html.light header.py-12,
html.light .bg-gradient-to-b.from-\[\#131a29\],
html.light .bg-gradient-to-b.from-\[\#181d2a\] {
  background-image: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%) !important;
  background-color: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 14px -3px rgba(0, 0, 0, 0.04) !important;
}

html.light header:not(.hero-wrapper) h1,
html.light header:not(.hero-wrapper) h2,
html.light header:not(.hero-wrapper) h3,
html.light header:not(.hero-wrapper) .text-white {
  color: #0f172a !important;
}

html.light header:not(.hero-wrapper) p,
html.light header:not(.hero-wrapper) .text-slate-400,
html.light header:not(.hero-wrapper) .text-slate-300 {
  color: #475569 !important;
}

/* Subpage Header Pills */
html.light header:not(.hero-wrapper) .bg-orange-500\/10,
html.light header:not(.hero-wrapper) .bg-orange-500\/20 {
  background-color: #fff7ed !important;
  border-color: rgba(244, 131, 0, 0.4) !important;
  color: #ea580c !important;
}
html.light header:not(.hero-wrapper) .bg-amber-500\/15 {
  background-color: #fffbeb !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  color: #d97706 !important;
}

/* Header control buttons and links across subpages */
html.light header:not(.hero-wrapper) button.bg-slate-800,
html.light header:not(.hero-wrapper) a.bg-slate-800,
html.light header:not(.hero-wrapper) button.bg-slate-900,
html.light header:not(.hero-wrapper) a.bg-slate-900 {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

html.light header:not(.hero-wrapper) button.bg-slate-800:hover,
html.light header:not(.hero-wrapper) a.bg-slate-800:hover,
html.light header:not(.hero-wrapper) button.bg-slate-900:hover,
html.light header:not(.hero-wrapper) a.bg-slate-900:hover {
  background-color: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

/* Home Page Hero Header */
html.light header.hero-wrapper {
  background-color: #f1f5f9 !important;
}

html.light .hero-overlay {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(248, 250, 252, 0.72) 48%,
    rgba(248, 250, 252, 0.34) 100%
  ),
  linear-gradient(
    180deg,
    rgba(248, 250, 252, 0.18) 0%,
    rgba(248, 250, 252, 0.10) 65%,
    #f8fafc 100%
  ) !important;
}

html.light .hero-slide-img {
  opacity: 0 !important;
  filter: saturate(1.04) contrast(1.02);
}

html.light .hero-slide-img.active {
  opacity: 0.50 !important;
}

html.light header.hero-wrapper h1 {
  color: #0f172a !important;
  text-shadow: none !important;
}

html.light header.hero-wrapper h1 span.text-gradient-eor,
html.light header.hero-wrapper h1 span.text-gradient-miata {
  color: transparent !important;
  text-shadow: none !important;
}

html.light header.hero-wrapper p.text-slate-300 {
  color: #1e293b !important;
  font-weight: 500;
  text-shadow: none !important;
}

html.light header.hero-wrapper .text-xs.text-slate-400 {
  color: #334155 !important;
  font-weight: 600;
  text-shadow: none !important;
}

/* Miata Open Section Light Mode Polish */
html.light #miataOpenSection {
  background-color: #ffffff !important;
  border-top-color: #e2e8f0 !important;
}

html.light #miataOpenSection .bg-slate-800,
html.light #miataOpenSection .bg-slate-900 {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html.light #miataOpenSection .bg-slate-800:hover,
html.light #miataOpenSection .bg-slate-900:hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

html.light #miataOpenSection .bg-\[\#ff0015\] {
  background-color: #ff0015 !important;
  color: #ffffff !important;
}

html.light #miataOpenSection .bg-\[\#ff0015\] * {
  color: #ffffff !important;
}

/* Wednesday Night top pill in Hero */
html.light header.hero-wrapper .inline-flex.rounded-full.bg-slate-900\/90 {
  background-color: #ffffff !important;
  border-color: rgba(244, 131, 0, 0.45) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}
html.light header.hero-wrapper .inline-flex.rounded-full.bg-slate-900\/90 span.text-slate-200 {
  color: #0f172a !important;
}

/* Admin Dashboard Hero */
html.light #adminMainDashboard > div.relative.rounded-2xl {
  background-image: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%) !important;
  background-color: #ffffff !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05) !important;
}
html.light #adminMainDashboard .bg-black\/40 {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}
html.light #adminMainDashboard .text-white {
  color: #0f172a !important;
}

/* --------------------------------------------------------------------------
   FRONT PAGE CLASS BOXES & BADGES (LIGHT MODE)
   -------------------------------------------------------------------------- */
/* Class pill container boxes on front page hero: make boxes white */
html.light .hero-class-box,
html.light header.hero-wrapper .flex.flex-wrap.items-center.gap-2.pt-1 > div {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

/* Description text in the class boxes (e.g. Hypercar / LMDh, Dallara P217, Pro GT3, Pro-Am GT3) */
html.light .hero-class-box span:not(.badge-gtp):not(.badge-lmp2):not(.badge-gtdpro):not(.badge-gtd),
html.light header.hero-wrapper .flex.flex-wrap.items-center.gap-2.pt-1 > div > span:not([class*="badge-"]) {
  color: #0f172a !important;
  font-weight: 600 !important;
}

/* Class Badges themselves (GTP, LMP2, GTD PRO, GTD): ALWAYS KEEP WHITE FONT */
html.light .badge-gtp,
html.light .badge-lmp2,
html.light .badge-gtdpro,
html.light .badge-gtd,
html.light .badge-gtp *,
html.light .badge-lmp2 *,
html.light .badge-gtdpro *,
html.light .badge-gtd * {
  color: #ffffff !important;
  font-weight: 900 !important;
}

/* GTP Badge specific crisp outline in Light Mode */
html.light .badge-gtp {
  background: #000000 !important;
  border: 2px solid #000000 !important;
  color: #ffffff !important;
}

/* Multiclass Car Specs Section (The 4 Contending Divisions) */
html.light .class-spec-badge-gtp,
html.light [class*="class-spec-badge-gtp"],
html.light .w-10.h-10.bg-black {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-color: #000000 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}

html.light .class-spec-badge-gtp *,
html.light .w-10.h-10.bg-black * {
  color: #ffffff !important;
}

html.light .class-spec-badge-lmp2 {
  background-color: #0072ce !important;
  border-color: #0072ce !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 114, 206, 0.25) !important;
}
html.light .class-spec-badge-lmp2 * {
  color: #ffffff !important;
}

html.light .class-spec-badge-gtdpro {
  background-color: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25) !important;
}
html.light .class-spec-badge-gtdpro * {
  color: #ffffff !important;
}

html.light .class-spec-badge-gtd {
  background-color: #059669 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25) !important;
}
html.light .class-spec-badge-gtd * {
  color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   HOME PAGE BUTTONS (LIGHT MODE)
   -------------------------------------------------------------------------- */
/* View Standings button in Hero */
html.light .hero-btn-standings,
html.light a[href="standings.html"].bg-slate-800\/80 {
  background-color: #ffffff !important;
  border-color: #f48300 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 14px rgba(244, 131, 0, 0.15) !important;
}
html.light .hero-btn-standings:hover,
html.light a[href="standings.html"].bg-slate-800\/80:hover {
  background-color: #fff7ed !important;
  border-color: #ea580c !important;
  color: #0f172a !important;
  transform: translateY(-2px);
}

/* Driver Roster button in Hero */
html.light .hero-btn-roster,
html.light a[href="roster.html"].bg-slate-900\/80 {
  background-color: #ffffff !important;
  border-color: #0284c7 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.15) !important;
}
html.light .hero-btn-roster:hover,
html.light a[href="roster.html"].bg-slate-900\/80:hover {
  background-color: #f0f9ff !important;
  border-color: #0369a1 !important;
  color: #0f172a !important;
  transform: translateY(-2px);
}

/* Standings Section "Full 4-Class Standings" button */
html.light a[href="standings.html"].bg-slate-800 {
  background-color: #ffffff !important;
  border-color: #f48300 !important;
  color: #0f172a !important;
  box-shadow: 0 2px 8px rgba(244, 131, 0, 0.12) !important;
}
html.light a[href="standings.html"].bg-slate-800:hover {
  background-color: #fff7ed !important;
  border-color: #ea580c !important;
}

/* Countdown Timer Boxes on Next Event Card */
html.light .grid.grid-cols-4 .bg-slate-900\/90 {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}
html.light #timerDays,
html.light #timerHours,
html.light #timerMinutes {
  color: #0f172a !important;
}

/* Timetable Box on Next Event Card */
html.light #homeTimetableContainer {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
html.light #homeTimetableContainer div.text-slate-300 {
  color: #334155 !important;
}

/* Next Event Broadcast Banner */
html.light a[title="Watch on Racer Nexus"].bg-red-950\/20 {
  background-color: #ffffff !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08) !important;
}
html.light a[title="Watch on Racer Nexus"] .text-white {
  color: #0f172a !important;
}

/* Official Series Sponsors & Broadcast Partner Cards */
html.light a[title*="Official Series Sponsor"],
html.light a[title*="Official Broadcast Partner"],
html.light section .group.bg-slate-900\/80 {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
}
html.light a[title*="Official Broadcast Partner"] .text-white,
html.light section .group.bg-slate-900\/80 .text-white {
  color: #0f172a !important;
}
html.light a[title*="Official Series Sponsor"]:hover,
html.light a[title*="Official Broadcast Partner"]:hover,
html.light section .group.bg-slate-900\/80:hover {
  background-color: #f8fafc !important;
}

/* Standings preview section on front page */
html.light section.bg-\[\#06090f\] {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
html.light section.bg-\[\#06090f\] .text-white {
  color: #0f172a !important;
}

/* Standings podium row boxes inside 4 class cards on home page */
html.light [id^="homeLeadersRows_"] > div,
html.light .p-2.rounded.bg-slate-900\/90,
html.light .p-2.rounded.bg-slate-900\/70,
html.light .p-2.rounded.bg-slate-900\/50 {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
html.light [id^="homeLeadersRows_"] .text-white,
html.light [id^="homeLeadersRows_"] .text-slate-200,
html.light [id^="homeLeadersRows_"] .text-slate-300 {
  color: #0f172a !important;
}

/* Standings bottom links */
html.light .glass-panel a[href="standings.html"].text-white {
  color: #0f172a !important;
}

/* Discord Callout Banner on Home Page */
html.light section.bg-gradient-to-r.from-\[\#170e06\] {
  background-image: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 50%, #eff6ff 100%) !important;
  background-color: #f5f3ff !important;
  border-color: #c7d2fe !important;
}
html.light section.bg-gradient-to-r.from-\[\#170e06\] h2.text-white {
  color: #1e1b4b !important;
}
html.light section.bg-gradient-to-r.from-\[\#170e06\] p.text-slate-300 {
  color: #3730a3 !important;
}

/* Navigation active links and icon buttons */
html.light nav a.bg-slate-800\/60,
html.light nav a.bg-slate-800 {
  background-color: #ffffff !important;
  border-color: #f48300 !important;
  color: #f48300 !important;
  box-shadow: 0 2px 6px rgba(244, 131, 0, 0.12) !important;
}

html.light #openConfigBtn,
html.light #themeToggleNavBtn,
html.light #mobileMenuBtn {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}
html.light #openConfigBtn:hover,
html.light #themeToggleNavBtn:hover,
html.light #mobileMenuBtn:hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

/* Footer Admin Login Button */
html.light #adminLoginToggleBtn {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}
html.light #adminLoginToggleBtn:hover {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

/* ==========================================================================
   CALENDAR PAGE LIGHT MODE OVERRIDES
   ========================================================================== */
/* Calendar Toolbar */
html.light .calendar-toolbar,
html.light main > .bg-slate-900\/90 {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05) !important;
}
html.light #calendarMonthTitle {
  color: #0f172a !important;
}
html.light #calendarEventCountBadge {
  color: #64748b !important;
}
html.light .flex.items-center.bg-slate-950,
html.light .inline-flex.bg-slate-950 {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}
html.light #prevMonthBtn,
html.light #nextMonthBtn {
  color: #475569 !important;
}
html.light #prevMonthBtn:hover,
html.light #nextMonthBtn:hover,
html.light #todayBtn:hover {
  background-color: #ffffff !important;
  color: #0f172a !important;
}
html.light #todayBtn {
  color: #334155 !important;
}
html.light #seriesFilterSelect {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
html.light #viewGridBtn,
html.light #viewAgendaBtn {
  color: #475569 !important;
}
html.light #viewGridBtn.bg-orange-500\/20,
html.light #viewAgendaBtn.bg-orange-500\/20 {
  background-color: #fff7ed !important;
  border-color: rgba(244, 131, 0, 0.5) !important;
  color: #ea580c !important;
}
html.light #calendarQuickAddBtn {
  background-color: #fff7ed !important;
  border-color: rgba(244, 131, 0, 0.4) !important;
  color: #ea580c !important;
}

/* Next Green Flag Event Spotlight Banner */
html.light #calendarNextEventBanner > div,
html.light .bg-gradient-to-r.from-orange-950\/40 {
  background-image: linear-gradient(135deg, #ffffff 0%, #fff7ed 60%, #fffbeb 100%) !important;
  background-color: #ffffff !important;
  border-color: rgba(244, 131, 0, 0.45) !important;
  box-shadow: 0 10px 25px -5px rgba(244, 131, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.02) !important;
}
html.light #calendarNextEventBanner h2,
html.light #calendarNextEventBanner h2 span,
html.light #calendarNextEventBanner .text-white {
  color: #0f172a !important;
}
html.light #calendarNextEventBanner p,
html.light #calendarNextEventBanner .text-slate-300 {
  color: #334155 !important;
}
html.light #calendarNextEventBanner .bg-slate-800\/80 {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #334155 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

/* Month Grid Container & Day Header Bar */
html.light #calendarGridContainer {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05) !important;
}
html.light #calendarGridContainer .bg-\[\#080d16\],
html.light .bg-\[\#080d16\],
html.light .calendar-day-headers {
  background-color: #f1f5f9 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}
html.light .calendar-day-headers > div:not(.text-rose-400\/80):not(.text-orange-400):not(.text-amber-400\/80),
html.light #calendarGridContainer .bg-\[\#080d16\] > div:not(.text-rose-400\/80):not(.text-orange-400):not(.text-amber-400\/80) {
  color: #475569 !important;
}

/* Calendar Day Cells & Event Cards */
html.light .calendar-cell {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}
html.light .calendar-cell:hover {
  background-color: #f8fafc !important;
  border-color: rgba(244, 131, 0, 0.35) !important;
}
html.light .calendar-cell.other-month {
  background-color: #f8fafc !important;
  color: #94a3b8 !important;
  opacity: 0.7 !important;
}
html.light .calendar-cell.today,
html.light .calendar-cell.today-cell {
  background-color: #fff7ed !important;
  border-color: #f48300 !important;
  box-shadow: inset 0 0 15px rgba(244, 131, 0, 0.08) !important;
}
html.light .calendar-cell .text-slate-400 {
  color: #64748b !important;
}
html.light .calendar-cell.group:hover span.group-hover\:text-white {
  color: #0f172a !important;
}
html.light .calendar-event-card {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}
html.light .calendar-event-card:hover {
  background-color: #f8fafc !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1) !important;
}
html.light .calendar-event-card.ring-2.ring-orange-500\/50,
html.light .calendar-event-card.border-orange-500,
html.light .calendar-event-card.bg-slate-900 {
  background-color: #fff7ed !important;
  border-color: #f48300 !important;
  box-shadow: 0 4px 16px rgba(244, 131, 0, 0.18) !important;
}
html.light .calendar-event-card .text-white {
  color: #0f172a !important;
}
html.light .calendar-event-card:hover .text-white,
html.light .calendar-event-card .group-hover\/card\:text-orange-300:hover {
  color: #ea580c !important;
}
html.light .calendar-event-card .text-slate-300 {
  color: #334155 !important;
}
html.light .calendar-event-card .text-slate-400 {
  color: #64748b !important;
}
html.light .calendar-event-card .bg-slate-800\/90 {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

/* Calendar Agenda View */
html.light #calendarAgendaList > div {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.05) !important;
}
html.light #calendarAgendaList > div:hover {
  background-color: #f8fafc !important;
}
html.light #calendarAgendaList > div.border-orange-500 {
  background-color: #fffdf5 !important;
  border-color: #f48300 !important;
  box-shadow: 0 8px 24px rgba(244, 131, 0, 0.12) !important;
}
html.light #calendarAgendaList h3.text-white {
  color: #0f172a !important;
}
html.light #calendarAgendaList .bg-slate-950 {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
html.light #calendarAgendaList .bg-slate-950 span.text-white {
  color: #0f172a !important;
}
html.light #calendarAgendaList .bg-slate-950 span.text-slate-400 {
  color: #64748b !important;
}
html.light #calendarAgendaList .bg-slate-800 {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}
html.light #calendarAgendaList span.bg-slate-800\/80 {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

/* Calendar Color Legend Bar */
html.light .mt-8.bg-slate-900\/60,
html.light div.bg-slate-900\/60.border-slate-800\/80 {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.04) !important;
}
html.light .mt-8.bg-slate-900\/60 .text-slate-300 {
  color: #0f172a !important;
}
html.light .mt-8.bg-slate-900\/60 .text-slate-400 {
  color: #475569 !important;
}
html.light .mt-8.bg-slate-900\/60 .text-slate-500 {
  color: #64748b !important;
}

/* Event Details & Weather Briefing Modal */
html.light #trackStateBox {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
html.light #metricTrackState {
  color: #0f172a !important;
}
html.light #inlineWeatherEditForm {
  background-color: #f8fafc !important;
  border-color: rgba(244, 131, 0, 0.4) !important;
}
html.light #inlineWeatherEditForm input,
html.light #inlineWeatherEditForm select {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
html.light #closeDetailModalBtn,
html.light #closeDetailModalBottomBtn,
html.light #cancelWeatherEditBtn,
html.light #editFullEventFromDetailBtn {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
html.light #closeDetailModalBtn:hover,
html.light #closeDetailModalBottomBtn:hover,
html.light #cancelWeatherEditBtn:hover,
html.light #editFullEventFromDetailBtn:hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

/* ==========================================================================
   HALL OF CHAMPIONS LIGHT MODE OVERRIDES
   ========================================================================== */
html.light .trophy-plaque {
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 60%),
              linear-gradient(180deg, #ffffff 0%, #fffdf5 100%) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.02) !important;
}
html.light .trophy-plaque::before {
  background: linear-gradient(90deg, transparent, #eab308, #facc15, #eab308, transparent) !important;
  opacity: 0.75 !important;
}
html.light .gold-glow {
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15) !important;
}
html.light .gold-glow-hover:hover {
  border-color: rgba(245, 158, 11, 0.6) !important;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.08), 0 0 25px rgba(245, 158, 11, 0.22) !important;
  transform: translateY(-4px);
}

/* Header Archival Stat Pill in Champions */
html.light .archival-stat-pill,
html.light header .flex.items-center.gap-4.bg-slate-900\/90.border-amber-500\/30 {
  background-color: #ffffff !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.12) !important;
}
html.light .archival-stat-pill span.text-white,
html.light header .flex.items-center.gap-4.bg-slate-900\/90.border-amber-500\/30 span.text-white {
  color: #0f172a !important;
}

/* Champions Toolbar Season & Class Filters */
html.light .champions-season-btn.border-transparent {
  color: #64748b !important;
  background-color: transparent !important;
}
html.light .champions-season-btn.border-transparent:hover {
  color: #0f172a !important;
  background-color: #f1f5f9 !important;
}
html.light .champions-season-btn.active-season-tab {
  background-color: #fffbeb !important;
  border-color: #d97706 !important;
  color: #b45309 !important;
}
html.light .champions-class-btn:not(.active-class-tab) {
  color: #64748b !important;
  background-color: transparent !important;
}
html.light .champions-class-btn:not(.active-class-tab):hover {
  color: #0f172a !important;
  background-color: #f1f5f9 !important;
}
html.light #championsSearchInput {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
html.light #addChampionBtn {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}
html.light #addChampionBtn:hover {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}
html.light .open-season-manager-btn {
  background-color: #fffbeb !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  color: #b45309 !important;
}

/* Season / Era Banner */
html.light #seasonsContainer section > .trophy-plaque h3.text-white {
  color: #0f172a !important;
}
html.light #seasonsContainer section > .trophy-plaque span.font-mono {
  color: #64748b !important;
}

/* Champion Card Typography & Campaign Stats Box */
html.light .trophy-plaque h4.text-white {
  color: #0f172a !important;
}
html.light .trophy-plaque:hover h4.text-white {
  color: #d97706 !important;
}
html.light .trophy-plaque p.text-slate-400 {
  color: #64748b !important;
}
html.light .trophy-plaque .text-slate-300 {
  color: #334155 !important;
}
html.light .trophy-plaque .grid.grid-cols-4.bg-slate-950\/80,
html.light .trophy-plaque .bg-slate-950\/80 {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}
html.light .trophy-plaque .grid.grid-cols-4 span.text-slate-400 {
  color: #64748b !important;
}
html.light .trophy-plaque .grid.grid-cols-4 span.text-slate-200 {
  color: #334155 !important;
}
html.light .trophy-plaque .border-slate-800\/90,
html.light .trophy-plaque .border-slate-800\/80 {
  border-color: #e2e8f0 !important;
}
html.light .edit-champion-btn {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}
html.light .edit-champion-btn:hover {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

/* Callout Section (WILL YOUR NAME BE ETCHED NEXT?) */
html.light section.trophy-plaque h2.text-white {
  color: #0f172a !important;
}
html.light section.trophy-plaque p.text-slate-300 {
  color: #334155 !important;
}
html.light section.trophy-plaque a[href="schedule.html"].bg-slate-800 {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}
html.light section.trophy-plaque a[href="schedule.html"].bg-slate-800:hover {
  background-color: #f8fafc !important;
  border-color: #94a3b8 !important;
}

/* Edit Champion Modal in Champions */
html.light #editChampionModal .p-3.bg-slate-950\/60 {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
html.light #cancelEditChampionBtn {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

/* Season Manager Modal & Subcards */
html.light #seasonManagerModal .bg-slate-950\/80,
html.light #seasonManagerModal [id^="retireChampionsPreviewContainer"] > div {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
html.light #seasonManagerModal input {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
html.light .close-season-manager-btn {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

/* Schedule & Standings & Rules Additional Light Mode Overrides */
html.light .bg-gradient-to-r.from-\[\#170e06\] {
  background-image: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 50%, #eff6ff 100%) !important;
  background-color: #f5f3ff !important;
  border-color: #c7d2fe !important;
}
html.light .bg-gradient-to-r.from-\[\#170e06\] h2.text-white,
html.light .bg-gradient-to-r.from-\[\#170e06\] h3.text-white {
  color: #1e1b4b !important;
}
html.light .bg-gradient-to-r.from-\[\#170e06\] p.text-slate-300 {
  color: #3730a3 !important;
}
html.light .class-tab-btn:not(.active-tab),
html.light .roster-class-btn:not(.active-roster-tab) {
  color: #64748b !important;
  border-color: transparent !important;
  background-color: transparent !important;
}
html.light .class-tab-btn:not(.active-tab):hover,
html.light .roster-class-btn:not(.active-roster-tab):hover {
  color: #0f172a !important;
  background-color: #f1f5f9 !important;
}
html.light #driverSearch,
html.light #rosterSearch {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
html.light #toggleScheduleEmbedBtn,
html.light #openXtremeScoringExternal,
html.light #toggleEmbedModeBtn,
html.light #openRosterImportBtn,
html.light #openStandingsImportBtn,
html.light #openScheduleImportBtn,
html.light #openScheduleEditorBtn,
html.light #linkCalendarEventsBtn {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}
html.light #toggleScheduleEmbedBtn:hover,
html.light #openXtremeScoringExternal:hover,
html.light #toggleEmbedModeBtn:hover,
html.light #openRosterImportBtn:hover,
html.light #openStandingsImportBtn:hover,
html.light #openScheduleImportBtn:hover,
html.light #openScheduleEditorBtn:hover,
html.light #linkCalendarEventsBtn:hover {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}
html.light #scheduleSeasonSelect {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
html.light .glass-panel .bg-slate-950\/70,
html.light .glass-panel .bg-slate-950\/80 {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

/* ==========================================================================
   1ST PHORM SPONSOR LOGO THEME SWITCHING (LIGHT MODE / DARK MODE)
   ========================================================================== */
/* Default (Dark Mode): Show white logo, hide black logo */
.sponsor-1st-phorm-light {
  display: none !important;
}
.sponsor-1st-phorm-dark {
  display: block !important;
  margin: 0 auto;
}

/* Light Mode: Hide white logo, reveal official black logo */
html.light .sponsor-1st-phorm-dark {
  display: none !important;
}
html.light .sponsor-1st-phorm-light {
  display: block !important;
  margin: 0 auto;
}

/* Ensure all sponsor partner links are vertically centered */
footer a[title="1st Phorm"],
footer a[title="Sim Motion"],
footer a[title*="Racer Nexus"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Fallback for standalone / dynamically injected 1st Phorm images */
html.light img[src*="sponsor-1st-phorm.png"]:not(.sponsor-1st-phorm-dark) {
  content: url('../assets/images/sponsor-1st-phorm-light.png');
}

/* Schedule Card YouTube Race Button and Admin Quick Edit */
.youtube-race-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

body.admin-logged-in button.btn-edit-youtube-link.admin-only-control,
html.admin-logged-in button.btn-edit-youtube-link.admin-only-control,
body.admin-logged-in button.btn-delete-schedule-round.admin-only-control,
html.admin-logged-in button.btn-delete-schedule-round.admin-only-control {
  display: inline-flex !important;
}

html.light .youtube-race-btn {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

html.light .youtube-race-btn:hover {
  background-color: #fee2e2 !important;
  border-color: #f87171 !important;
}

html.light .btn-edit-youtube-link,
html.light .btn-delete-schedule-round {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

html.light .btn-edit-youtube-link:hover {
  background-color: #f97316 !important;
  border-color: #ea580c !important;
  color: #ffffff !important;
}

html.light .btn-delete-schedule-round:hover {
  background-color: #dc2626 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
}

/* Miata Open Series Primary Red Hero & Badge Accent */
.text-gradient-miata {
  background: linear-gradient(135deg, #ff0015 0%, #ef4444 55%, #b91c1c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  text-shadow: none !important;
  filter: none !important;
}

.badge-miata {
  background-color: #ff0015;
  color: #ffffff;
  border: 1px solid rgba(248, 113, 113, 0.55);
}

html.light .text-gradient-miata,
html.light header.hero-wrapper h1 span.text-gradient-miata {
  background: linear-gradient(135deg, #ff0015 0%, #dc2626 60%, #991b1b 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  color: transparent !important;
  text-shadow: none !important;
  filter: none !important;
}

html.light .badge-miata {
  background-color: #ff0015 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
}

html.light .hero-series-dot[aria-selected="false"] {
  background-color: rgba(255, 255, 255, 0.92) !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}

html.light .hero-series-dot[data-hero-dot="0"][aria-selected="true"] {
  background-color: #fff7ed !important;
  color: #c2410c !important;
  border-color: #f48300 !important;
}

html.light .hero-series-dot[data-hero-dot="1"][aria-selected="true"] {
  background-color: #fef2f2 !important;
  color: #b91c1c !important;
  border-color: #ff0015 !important;
}

/* Single-line responsive desktop navigation with 9 links (including Distribution & Admin) */
nav > .max-w-7xl {
  max-width: 90rem;
}

@media (min-width: 768px) {
  nav .h-20 {
    gap: 0.5rem;
  }

  nav .h-20 > a img {
    height: 2.75rem;
  }

  nav .hidden.md\:flex {
    gap: 0.25rem;
  }

  nav .hidden.md\:flex > * + * {
    margin-left: 0 !important;
  }

  nav .hidden.md\:flex > a {
    white-space: nowrap;
    padding: 0.45rem 0.55rem !important;
    font-size: 0.78rem !important;
    gap: 0.3rem;
  }

  nav .hidden.md\:flex > a svg {
    width: 0.9rem;
    height: 0.9rem;
    flex-shrink: 0;
  }

  nav .btn-discord {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.78rem !important;
  }
}

@media (min-width: 1280px) {
  nav .h-20 > a img {
    height: 3.15rem;
  }

  nav .hidden.md\:flex {
    gap: 0.3rem;
  }

  nav .hidden.md\:flex > a {
    padding: 0.5rem 0.72rem !important;
    font-size: 0.84rem !important;
    gap: 0.375rem;
  }

  nav .btn-discord {
    padding: 0.55rem 0.95rem !important;
    font-size: 0.84rem !important;
  }
}

/* Guarantee hidden broadcast & sponsor elements stay hidden over Tailwind flex/inline-flex utilities */
.eor-broadcast-only.hidden,
.eor-broadcast-only[hidden],
#homeSponsorsSection.hidden,
#homeSponsorsSection[hidden] {
  display: none !important;
}





