:root {
  /* Theme Colors - Dark Stitch */
  --bg-color: #131313;
  --text-color: #e5e2e1;

  /* Mandatory Palette */
  --primary-color: #E10600;
  --secondary-color: #E9C400;

  /* Accents & States */
  --primary-hover: #c00500;
  --text-muted: #e5e2e1;
  --border-color: rgba(255, 255, 255, 0.05);

  /* Glassmorphism */
  --glass-bg: rgba(19, 19, 19, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(225, 6, 0, 0.08);

  /* Typography */
  --font-heading: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Layout */
  --max-width: 1400px;
  --spacing-sm: 0.5rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 3rem;
  --spacing-xl: 5rem;
  --radius: 2px;
}

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

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

/* =========================================
   Typography
   ========================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: var(--spacing-md);
  color: var(--text-color);
}

h1 { font-size: clamp(3rem, 6vw, 5rem); }
h2 { font-size: clamp(2.5rem, 5vw, 4rem); color: var(--text-color); }
h3 { font-size: clamp(1.8rem, 3vw, 2.5rem); }

p {
  font-size: 1.125rem;
  margin-bottom: var(--spacing-md);
  color: var(--text-muted);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease, transform 0.3s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* =========================================
   Layout & Grid
   ========================================= */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

section {
  padding: var(--spacing-xl) 0;
  position: relative;
  z-index: 1;
}

.grid-asymmetric {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--spacing-md);
}

.grid-item-featured {
  grid-column: span 8;
  grid-row: span 2;
}

.grid-item-standard {
  grid-column: span 4;
}

.grid-item-wide {
  grid-column: span 12;
}

/* =========================================
   Components (Glassmorphism & Cards)
   ========================================= */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius);
  padding: var(--spacing-lg);
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.glass-panel:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(225, 6, 0, 0.15);
}

.glass-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.glass-panel:hover::before {
  width: 8px;
}

.badge {
  display: inline-block;
  background-color: var(--secondary-color);
  color: #131313;
  font-family: var(--font-heading);
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  border-radius: 2px;
  margin-bottom: var(--spacing-sm);
}

/* =========================================
   Buttons & Links
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: -0.02em;
  padding: 0.875rem 2rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: white;
}

.btn-secondary {
  background-color: transparent;
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

/* =========================================
   Header & Navigation - handled by includes
   ========================================= */

/* =========================================
   Hero Section
   ========================================= */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--bg-color);
}

.hero-content {
  max-width: 800px;
  position: relative;
  z-index: 2;
}

.hero-content h1 {
  margin-bottom: var(--spacing-sm);
}

.hero-content p {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-lg);
  color: var(--text-muted);
  font-weight: 500;
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 1024px) {
  .grid-item-featured {
    grid-column: span 12;
    grid-row: auto;
  }
  .grid-item-standard {
    grid-column: span 6;
  }
}

@media (max-width: 768px) {
  :root {
    --spacing-xl: 3rem;
    --spacing-lg: 2rem;
  }

  .nav-menu {
    display: none;
  }

  .grid-item-standard {
    grid-column: span 12;
  }

  .hero-content p {
    font-size: 1.25rem;
  }

  .btn {
    width: 100%;
  }
}

/* =========================================
   Tables (Results / Standings)
   ========================================= */
.table-container {
  width: 100%;
  overflow-x: auto;
  background: rgba(28, 27, 27, 1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
  font-family: var(--font-heading);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.03);
}

/* ============================================================
 * FIX : éléments de formulaire et états actifs lisibles
 * (corrige les <select>/<option> qui apparaissent en blanc sur
 * blanc sous macOS Safari/Chrome, et les boutons qui perdent
 * leur contraste à l'état :active)
 * ============================================================ */

/* Options de select : forcer fond sombre + texte clair */
select option {
  background-color: #131313 !important;
  color: #e5e2e1 !important;
}
select optgroup {
  background-color: #131313;
  color: #e9c400;
}

/* Select fermé : assure la lisibilité même quand focus */
select {
  color: #e5e2e1 !important;
  background-color: #131313;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23E10600' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* Input texte : couleur explicite au focus */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
textarea:focus {
  color: #e5e2e1 !important;
  outline: none;
}

/* Boutons à l'état :active — empêche qu'ils deviennent illisibles */
button:active,
a.btn:active,
input[type="submit"]:active {
  opacity: 0.85;
  /* On garde explicitement les couleurs : pas de filter qui inverse */
}

/* Style commun aux liens-boutons cliqués (preserve text) */
.btn:active,
[class*="bg-[#E10600]"]:active {
  background-color: #c00500 !important;
  color: #ffffff !important;
}
[class*="bg-[#E9C400]"]:active {
  background-color: #c9a900 !important;
  color: #131313 !important;
}
[class*="bg-white"]:active {
  background-color: #e5e2e1 !important;
  color: #131313 !important;
}

/* Focus visible pour accessibilité (sans casser le design) */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid #E10600;
  outline-offset: 2px;
}
