/* ============================================================
   TOURNOI SC VITROLLES — Design System Mobile-First Premium
   Charte : Rouge #D71920 / Noir / Blanc
   Inspiration : Linear, Stripe, Vercel
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700&family=Russo+One&display=swap');

.font-kickoff {
  font-family: 'Russo One', 'Impact', sans-serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}

:root {
  /* Palette */
  --primary: #D71920;
  --primary-dark: #A01018;
  --primary-light: #FEE2E4;
  --primary-glow: rgba(215, 25, 32, 0.4);

  --black: #0a0a0a;
  --gray-900: #18181b;
  --gray-800: #27272a;
  --gray-700: #3f3f46;
  --gray-500: #71717a;
  --gray-400: #a1a1aa;
  --gray-300: #d4d4d8;
  --gray-200: #e4e4e7;
  --gray-100: #f4f4f5;
  --gray-50: #fafafa;
  --white: #ffffff;

  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --text: #0a0a0a;
  --text-light: #71717a;
  --text-lighter: #a1a1aa;
  --border: #e4e4e7;
  --border-light: #f4f4f5;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --champions: #1e3a8a;
  --europa: #ea580c;
  --conference: #16a34a;

  /* Shadows premium */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.16);
  --shadow-primary: 0 8px 24px var(--primary-glow);

  /* Radius */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* Easing */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
*::selection { background: var(--primary); color: white; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}
/* Pages admin sans header : padding-top suffisant pour passer sous la barre statut iPhone */
main > .container {
  padding-top: max(env(safe-area-inset-top, 0px) + 16px, 60px);
}
/* Sauf si un .site-header juste avant gère déjà l'espace */
header.site-header + main > .container {
  padding-top: var(--space-4);
}
/* Le btn-back ne doit jamais être collé au bord */
.btn-back {
  position: relative;
  z-index: 5;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; transition: opacity 0.2s; }
a:active { opacity: 0.6; }

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

/* ============================================================
   LAYOUT — Mobile First
   ============================================================ */
.container {
  width: 100%;
  padding: 0 var(--space-4);
  margin: 0 auto;
}
@media (min-width: 640px) {
  .container { padding: 0 var(--space-6); max-width: 640px; }
}
@media (min-width: 1024px) {
  .container { max-width: 1100px; }
}

main {
  padding: var(--space-5) 0 calc(var(--space-12) + 80px);
  min-height: 60vh;
}
@media (min-width: 768px) {
  main { padding: var(--space-8) 0 var(--space-12); }
}

/* ============================================================
   HEADER — Sticky avec blur
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-3) 0;
  padding-top: calc(var(--space-3) + env(safe-area-inset-top));
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }

.site-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}
.site-logo {
  width: 56px; height: 56px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  object-fit: contain;
  flex-shrink: 0;
}
@media (min-width: 600px) {
  .site-logo { width: 64px; height: 64px; }
}
.site-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-tagline {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 500;
}

/* Nav desktop, cachée sur mobile */
.site-nav { display: none; }
@media (min-width: 768px) {
  .site-nav { display: flex; gap: var(--space-1); }
  .site-nav a {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--r-full);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.2s var(--ease-smooth);
  }
  .site-nav a:hover { background: var(--gray-100); color: var(--text); }
  .site-nav a.active {
    background: var(--text);
    color: white;
  }
}

/* Bottom Tab Bar — Mobile */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--border-light);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: var(--space-2) var(--space-2);
  padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom));
}
@media (min-width: 768px) {
  .tab-bar { display: none; }
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--space-2) var(--space-1);
  border-radius: var(--r-sm);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.2s var(--ease-smooth);
  position: relative;
  min-height: 56px; /* thumb target Apple HIG */
}
.tab-item svg { width: 22px; height: 22px; transition: transform 0.3s var(--ease-spring); }
.tab-item.active { color: var(--primary); }
.tab-item.active svg { transform: scale(1.15); }
.tab-item:active svg { transform: scale(0.9); }

/* ============================================================
   FAB RETOUR — Bouton flottant à portée du pouce
   ============================================================ */
.btn-back-fab {
  position: fixed;
  left: 14px;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px)); /* au-dessus de la tab-bar admin */
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  transition: transform 0.15s var(--ease-smooth), box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.btn-back-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,0.22), 0 4px 8px rgba(0,0,0,0.1); }
.btn-back-fab:active { transform: scale(0.93); }
.btn-back-fab svg { width: 26px; height: 26px; stroke-width: 2.4; }
/* Sur les pages SANS tab-bar (publiques visiteurs) on remonte un peu */
body:not(:has(.tab-bar)) .btn-back-fab { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
/* Variante "home" : icône maison à côté du retour */
.btn-home-fab {
  position: fixed;
  left: 80px; /* à droite du back */
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: transform 0.15s var(--ease-smooth);
  text-decoration: none;
}
.btn-home-fab:active { transform: scale(0.93); }
.btn-home-fab svg { width: 24px; height: 24px; stroke-width: 2.2; }
body:not(:has(.tab-bar)) .btn-home-fab { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
/* Sur desktop, masquer les FAB (la nav suffit) */
@media (min-width: 768px) {
  .btn-back-fab, .btn-home-fab { display: none; }
}

/* ============================================================
   HERO — Premium gradient
   ============================================================ */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 60%, var(--black) 200%);
  color: white;
  padding: var(--space-12) 0 var(--space-10);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  top: -50%; left: -25%;
  width: 150%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.15) 0%, transparent 50%);
  z-index: -1;
  animation: heroGlow 8s ease-in-out infinite alternate;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.05) 0%, transparent 25%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 25%);
  z-index: -1;
}
@keyframes heroGlow {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(5%, 5%) rotate(15deg); }
}
.hero h1 {
  font-size: clamp(28px, 7vw, 44px);
  font-weight: 800;
  margin-bottom: var(--space-3);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero p {
  font-size: clamp(15px, 4vw, 18px);
  opacity: 0.9;
  max-width: 600px;
  font-weight: 400;
}
.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(10px);
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all 0.3s var(--ease-smooth);
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(215,25,32,0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.card-link:hover::after { opacity: 1; }
.card-link:hover { transform: translateY(-2px); border-color: var(--primary-light); }
.card-link:active { transform: translateY(0); }

.card-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  color: white;
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-primary);
}
.card-icon svg { width: 22px; height: 22px; }

.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   BOUTONS — Premium avec ripple & micro-anims
   ============================================================ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  min-height: 48px;
  border-radius: var(--r-sm);
  background: var(--text);
  color: white;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring),
              box-shadow 0.3s var(--ease-smooth),
              background 0.2s;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), rgba(255,255,255,0.3) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s;
}
.btn:hover::before { opacity: 1; }
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.05s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:hover {
  box-shadow: var(--shadow-primary), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-ghost {
  background: transparent;
  color: var(--primary);
}
.btn-ghost:hover { background: var(--primary-light); }

.btn-block { width: 100%; }
.btn-lg { padding: var(--space-5) var(--space-8); min-height: 56px; font-size: 16px; }
.btn-sm { padding: var(--space-2) var(--space-4); min-height: 36px; font-size: 13px; }

/* Ripple effect helper */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ============================================================
   BACK BUTTON
   ============================================================ */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  padding: var(--space-2) var(--space-3);
  margin: 0 calc(-1 * var(--space-3)) var(--space-2);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn-back:hover { color: var(--primary); background: var(--primary-light); }
.btn-back:active { transform: scale(0.96); }
.btn-back svg { width: 18px; height: 18px; }

/* ============================================================
   PILLS / CHIPS — Tactile
   ============================================================ */
.pills {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-1) 0;
  margin-bottom: var(--space-4);
  scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  min-height: 36px;
  border-radius: var(--r-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.pill:active { transform: scale(0.95); }
.pill.active {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

/* ============================================================
   SECTIONS HOMEPAGE
   ============================================================ */
.section { margin-bottom: var(--space-8); }
.section-header { margin-bottom: var(--space-4); display: flex; justify-content: space-between; align-items: end; }
.section-title { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 700; }
.section-subtitle { font-size: 14px; color: var(--text-light); margin-top: 2px; }

/* Stat cards premium */
.stat-card {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--gray-50) 100%);
  border-radius: var(--r-md);
  padding: var(--space-5);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(30%, -30%);
}
.stat-label { font-size: 11px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  margin-top: var(--space-2);
  letter-spacing: -0.02em;
}
.stat-trend { font-size: 12px; color: var(--success); margin-top: 4px; font-weight: 600; }

/* ============================================================
   BUVETTE — Menu mobile-first
   ============================================================ */
.menu-cat-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: var(--space-8) 0 var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  letter-spacing: -0.02em;
}
.menu-cat-title::before {
  content: "";
  display: block;
  width: 4px;
  height: 24px;
  background: var(--primary);
  border-radius: 2px;
}
.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
@media (min-width: 480px) {
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
}

.menu-item {
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  padding: var(--space-4);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s var(--ease-smooth);
  overflow: hidden;
}
.menu-item:active { transform: scale(0.98); }
.menu-item.in-cart {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.menu-item h4 { font-size: 16px; font-weight: 700; margin-bottom: var(--space-1); letter-spacing: -0.01em; }
.menu-item-desc { font-size: 13px; color: var(--text-light); margin-bottom: var(--space-3); flex: 1; line-height: 1.4; }
.menu-item-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.menu-item-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.menu-item-price::after { content: ''; }

.qty-control {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--gray-100);
  border-radius: var(--r-full);
  padding: 4px;
  transition: all 0.3s var(--ease-spring);
}
.qty-control.has-qty {
  background: var(--primary);
}
.qty-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.qty-control.has-qty .qty-btn { color: white; }
.qty-btn:active { transform: scale(0.85); }
.qty-btn-add {
  background: var(--primary);
  color: white;
  width: 36px; height: 36px;
  font-size: 22px;
  box-shadow: var(--shadow-primary);
  transition: all 0.3s var(--ease-spring);
}
.qty-btn-add:hover { transform: scale(1.05) rotate(90deg); }
.qty-btn-add:active { transform: scale(0.9); }
.qty-display {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: transform 0.3s var(--ease-spring);
}
.qty-control.has-qty .qty-display { color: white; }

/* Animation +1 quand on ajoute */
.bump-anim {
  animation: bump 0.4s var(--ease-spring);
}
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ============================================================
   PANIER FAB
   ============================================================ */
.cart-fab {
  position: fixed;
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom) + 70px);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--r-full);
  padding: var(--space-3) var(--space-5);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-lg), var(--shadow-primary);
  cursor: pointer;
  z-index: 30;
  border: none;
  min-height: 52px;
  font-size: 15px;
  transition: all 0.4s var(--ease-spring);
  white-space: nowrap;
  animation: cartIn 0.5s var(--ease-spring);
}
@media (min-width: 768px) {
  .cart-fab { bottom: var(--space-6); }
}
@keyframes cartIn {
  from { transform: translateX(-50%) translateY(100px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.cart-fab.empty { display: none; }
.cart-fab:active { transform: translateX(-50%) scale(0.96); }
.cart-badge {
  background: white;
  color: var(--primary);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.cart-total-fab { font-variant-numeric: tabular-nums; font-family: 'Space Grotesk', sans-serif; }

/* ============================================================
   MODAL SHEET (bottom-up sur mobile)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  padding: 0;
  transition: background 0.3s;
}
.modal-overlay.open { display: flex; background: rgba(0,0,0,0.5); }
.modal {
  background: white;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: var(--space-6);
  padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  position: relative;
  animation: slideUp 0.35s var(--ease-spring);
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; padding: var(--space-4); }
  .modal { border-radius: var(--r-xl); max-width: 520px; max-height: 85vh; }
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal::before {
  content: "";
  display: block;
  width: 40px; height: 4px;
  background: var(--gray-300);
  border-radius: 2px;
  margin: -8px auto var(--space-4);
}
@media (min-width: 640px) { .modal::before { display: none; } }

.modal h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}
.modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: var(--gray-100);
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
}
.modal-close:active { transform: scale(0.9); background: var(--gray-200); }

/* ============================================================
   FORMS
   ============================================================ */
input[type="text"], input[type="number"], input[type="email"], input[type="password"],
input[type="date"], input[type="time"], textarea, select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  min-height: 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 16px; /* 16px évite zoom auto iOS */
  font-family: inherit;
  background: var(--bg-elevated);
  color: var(--text);
  transition: all 0.2s var(--ease-smooth);
  -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}
textarea { min-height: 80px; resize: vertical; }
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text);
}

/* ============================================================
   STATUT COMMANDE
   ============================================================ */
.status-card {
  background: var(--bg-elevated);
  border-radius: var(--r-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  margin: var(--space-5) 0;
  position: relative;
  overflow: hidden;
}
.status-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}
.status-numero {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(64px, 18vw, 96px);
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin: var(--space-4) 0;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.status-label {
  font-size: 12px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 14px;
  margin-top: var(--space-3);
}
.status-pill::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.status-pill.en_attente { background: #fef3c7; color: #92400e; }
.status-pill.en_preparation { background: #dbeafe; color: #1e40af; }
.status-pill.prete { background: #d1fae5; color: #065f46; animation: pulseSoft 2s ease-in-out infinite; }
.status-pill.remise { background: var(--gray-100); color: var(--gray-700); }
.status-pill.annulee { background: #fee2e2; color: #991b1b; }
@keyframes pulseSoft { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--black);
  color: white;
  padding: var(--space-8) 0;
  text-align: center;
  font-size: 13px;
  margin-bottom: 70px;
}
@media (min-width: 768px) { .site-footer { margin-bottom: 0; } }
.site-footer a { color: white; opacity: 0.7; }
.site-footer p { opacity: 0.85; }
.site-footer p + p { margin-top: var(--space-2); opacity: 0.5; font-size: 12px; }

/* ============================================================
   EMPTY / LOADING STATES
   ============================================================ */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  color: var(--text-light);
}
.empty-state svg { width: 60px; height: 60px; margin: 0 auto var(--space-4); opacity: 0.3; }
.empty-state h3 { color: var(--text); margin-bottom: var(--space-2); }

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 0%, var(--gray-200) 50%, var(--gray-100) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ============================================================
   TABLEAU CLASSEMENT — MOBILE-FIRST
   ============================================================ */
.standings-card { padding: 0; overflow: hidden; }
.standings-header {
  padding: var(--space-4) var(--space-5);
  background: var(--gray-50);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.standings-header h3 { font-family: 'Space Grotesk'; font-size: 16px; }

/* Tableau classement : ULTRA-compact mobile, tout visible sans scroll horizontal */
.standings-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.standings-table th, .standings-table td { padding: 9px 2px; text-align: left; vertical-align: middle; }
.standings-table th { font-size: 10px; text-transform: uppercase; color: var(--text-light); font-weight: 700; letter-spacing: 0; background: var(--gray-50); }
.standings-table tbody tr { border-top: 1px solid var(--border-light); }
.standings-table td.center, .standings-table th.center { text-align: center; }
.standings-table td.numeric { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.standings-table .qualif-1 td { background: linear-gradient(90deg, rgba(16,185,129,0.07), transparent 70%); }
.standings-table .qualif-2 td { background: linear-gradient(90deg, rgba(245,158,11,0.07), transparent 70%); }

/* Largeurs colonnes : iPhone SE (375px) - 32 padding container = ~343px utiles */
.standings-table .col-rank  { width: 28px; padding-left: 6px; padding-right: 0; }
.standings-table .col-team  {
  width: auto;
  padding-left: 4px;
  font-size: 12px;
  line-height: 1.2;
  /* Troncature des noms longs avec ellipsis pour rester sur 1 ligne */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0; /* astuce CSS pour que ellipsis fonctionne avec table-layout fixed */
}
.standings-table .col-team strong { font-weight: 700; }
.standings-table .col-j     { width: 24px; }
.standings-table .col-g     { width: 24px; color: #15803d; }
.standings-table .col-n     { width: 24px; color: #6b7280; }
.standings-table .col-p     { width: 24px; color: #b91c1c; }
.standings-table .col-diff  { width: 34px; font-weight: 600; padding-right: 4px; }
.standings-table .col-diff.pos { color: #15803d; }
.standings-table .col-diff.neg { color: #b91c1c; }
.standings-table .col-pts   {
  width: 38px;
  background: var(--gray-50);
  border-left: 1px solid var(--border-light);
  padding-right: 4px;
}
.standings-table .col-pts strong { font-size: 14px; color: var(--primary); font-weight: 800; }
.standings-table thead .col-pts { background: linear-gradient(180deg, var(--primary), var(--primary-dark)); color: white; }

/* Mobile très étroit (iPhone SE 320-375px) : tout rentre, on respire un peu plus à partir de 400px */
@media (min-width: 400px) {
  .standings-table { font-size: 13px; }
  .standings-table th, .standings-table td { padding: 10px 4px; }
  .standings-table .col-team { font-size: 13px; }
  .standings-table .col-j, .standings-table .col-g, .standings-table .col-n, .standings-table .col-p { width: 28px; }
  .standings-table .col-diff { width: 40px; }
  .standings-table .col-pts { width: 44px; }
  .standings-table .col-pts strong { font-size: 15px; }
}
@media (min-width: 600px) {
  .standings-table { font-size: 14px; }
  .standings-table th, .standings-table td { padding: 12px 8px; }
  .standings-table .col-j, .standings-table .col-g, .standings-table .col-n, .standings-table .col-p { width: 36px; }
  .standings-table .col-diff { width: 48px; }
  .standings-table .col-pts { width: 56px; }
}
/* hide-mobile : on garde l'utilitaire mais on ne s'en sert plus pour le classement */
.hide-mobile { display: table-cell; }

.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  background: var(--gray-100);
  color: var(--text);
}
.rank-1 { background: var(--primary); color: white; }
.rank-2 { background: var(--gray-300); color: var(--text); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: toastIn 0.3s var(--ease-spring), toastOut 0.3s var(--ease-spring) 2s forwards;
}
@keyframes toastIn { from { transform: translateX(-50%) translateY(20px); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(-50%) translateY(20px); opacity: 0; } }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-light { color: var(--text-light); }
.fw-700 { font-weight: 700; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }

/* Animations d'entrée */
.fade-in { animation: fadeIn 0.4s var(--ease-smooth); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }
.fade-in-stagger > * { animation: fadeIn 0.4s var(--ease-smooth) backwards; }
.fade-in-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.fade-in-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.fade-in-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.fade-in-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.fade-in-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.fade-in-stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* Réduit les animations si user le demande */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
