:root {
  --bg: #16161a;
  --panel: #202026;
  --line: #34343c;
  --text: #f4f4f6;
  --muted: #a9a9b4;
  --red: #e11212;
  --red-bright: #ff3b3b;
  --skew: -12deg;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: "Saira", "Arial Narrow", Arial, sans-serif;
  background:
    linear-gradient(115deg, transparent 0 86%, rgba(225, 18, 18, .16) 86% 86.3%, transparent 86.3% 88%, rgba(225, 18, 18, .16) 88% 88.3%, transparent 88.3%),
    linear-gradient(115deg, transparent 0 8%, rgba(255, 255, 255, .05) 8% 8.3%, transparent 8.3% 10%, rgba(255, 255, 255, .05) 10% 10.3%, transparent 10.3%),
    var(--bg);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
main { flex: 1; outline: none; }
:focus-visible { outline: 3px solid var(--red-bright); outline-offset: 2px; }

/* En-tete */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: rgba(14, 14, 17, .94);
  border-bottom: 3px solid var(--red);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.brand img { border-radius: 6px; }

.icon { flex: none; width: 1.15em; height: 1.15em; }

.account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account:empty { display: none; }
.account-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .95rem; }
.account-name b { overflow: hidden; max-width: 200px; text-overflow: ellipsis; white-space: nowrap; }
.account-name img { flex: none; border-radius: 50%; }
.account-error { color: var(--red-bright); font-size: .85rem; font-weight: 600; }
.account form { margin: 0; }

.account button {
  padding: 4px 0;
  color: var(--muted);
  background: none;
  border: 0;
  font: inherit;
  font-size: .85rem;
  text-decoration: underline;
  cursor: pointer;
}

.account button:hover { color: var(--text); }

.login {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  color: #fff;
  background: #5865f2;
  border-radius: 4px;
  font-size: .95rem;
  font-weight: 600;
}

.login:hover { background: #4752c4; }

.topbar nav { display: flex; gap: 4px; }

.topbar nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 3px solid transparent;
}

.topbar nav a:hover { color: var(--text); }
.topbar nav a[aria-current] { color: var(--text); border-color: var(--red-bright); }

/* Accueil */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr);
  align-items: end;
  gap: clamp(24px, 4vw, 56px);
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(24px, 3.4vw, 44px) clamp(16px, 4vw, 40px) 0;
}

.hero-text { align-self: center; }
.hero-logo { width: clamp(150px, 19vw, 250px); height: auto; margin-bottom: 16px; }

.eyebrow {
  margin: 0 0 18px;
  color: var(--red-bright);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(2rem, 4.2vw, 3.6rem);
  font-weight: 900;
  font-style: italic;
  line-height: .98;
  text-transform: uppercase;
}

.hero-race { margin: 0; color: var(--muted); font-size: .95rem; }
.hero-race b { display: block; color: var(--text); font-size: 1.25rem; font-weight: 800; }

/* Podium du championnat pilotes */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 8px; }

.step { display: block; color: var(--ink); transition: transform .2s; }
.step:hover { transform: translateY(-5px); }

.step-pic {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: clamp(130px, 15vw, 210px);
  padding-top: 12px;
  overflow: hidden;
  background:
    repeating-linear-gradient(115deg, transparent 0 28px, rgba(255, 255, 255, .12) 28px 31px, transparent 31px 58px),
    linear-gradient(170deg, color-mix(in srgb, var(--team) 72%, #000), #111116 92%);
}

.step-1 .step-pic { height: clamp(165px, 19vw, 265px); }
.step-3 .step-pic { height: clamp(110px, 12.5vw, 175px); }
.step-pic .head-unknown { align-self: center; width: 62%; height: auto; aspect-ratio: 1; font-size: clamp(1.8rem, 3.6vw, 3.2rem); }
.podiums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: clamp(14px, 2vw, 26px); }
.podium-block { min-width: 0; }

.podium-title {
  display: block;
  margin-bottom: 8px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}

.podium-title:hover { color: var(--red-bright); }
.step-pic img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; transition: transform .2s; }
.step:hover .step-pic img { transform: scale(1.04); }

.step-plate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 98px;
  padding: 8px 10px;
  background: linear-gradient(100deg, var(--team) 55%, color-mix(in srgb, var(--team) 80%, #000));
}

.step-rank { font-size: clamp(1.1rem, 1.6vw, 1.5rem); font-weight: 900; font-style: italic; line-height: 1; }
.step-who { min-width: 0; }

.step-who b {
  display: block;
  overflow: hidden;
  font-size: clamp(.8rem, 1.05vw, 1.1rem);
  font-weight: 900;
  font-style: italic;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.step-who small { display: block; font-size: .8rem; opacity: .9; }

/* Tuiles du menu principal */
.tiles-wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px clamp(16px, 4vw, 40px) 48px;
}

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

.tile {
  display: flex;
  flex-direction: column;
  min-height: 216px;
  padding: 18px 18px 16px;
  background: var(--panel);
  border-top: 4px solid var(--red);
  transition: transform .2s, background-color .2s;
}

.tile:hover { transform: translateY(-5px); background: #2a2a32; }

.tile h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 1.3rem;
  font-weight: 900;
  font-style: italic;
  line-height: 1.1;
  text-transform: uppercase;
}

.tile p { margin: 0; color: var(--muted); line-height: 1.45; }
.tile-go { margin-top: auto; padding-top: 14px; color: var(--red-bright); font-size: .9rem; font-weight: 800; }

.tile-main { background: var(--red); border-top-color: #fff; }
.tile-main:hover { background: #f52121; }
.tile-main p { color: #fff; }
.tile-main .tile-go { color: #fff; }

.tile-logos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.tile-logos img { width: 100%; height: auto; }

.tile-top { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.tile-top li { display: flex; align-items: baseline; gap: 10px; }
.tile-top span { width: 1em; color: var(--red-bright); font-weight: 900; font-style: italic; }
.tile-top b { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.tile-top em { color: var(--muted); font-style: normal; font-weight: 800; }

/* News */
.home-news { padding-top: 0; }
.home-news .subtitle { margin-bottom: 18px; }
.news-page { max-width: 800px; }
.news-list { display: grid; gap: 12px; }

.news-card {
  min-width: 0;
  padding: 16px 20px 18px;
  background: var(--panel);
  border-left: 5px solid var(--red);
}

.news-card header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.news-card time { color: var(--muted); font-size: .85rem; }

.news-empty { margin: 0; padding: 18px 20px; color: var(--muted); background: var(--panel); }

.news-card p { margin: 8px 0 0; line-height: 1.5; overflow-wrap: anywhere; }
.news-card a { color: var(--red-bright); text-decoration: underline; }
.news-card code { padding: 1px 5px; background: #0003; border-radius: 3px; font-size: .9em; }
.news-h { display: block; font-size: 1.2rem; font-weight: 800; }
.news-quote { display: block; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.emoji { display: inline; width: 1.3em; height: 1.3em; vertical-align: -.25em; }

.badge {
  padding: 1px 7px;
  color: #fff;
  background: var(--red);
  border-radius: 3px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.news-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.news-images img { min-width: 0; max-width: 100%; max-height: 560px; }
.more { display: inline-block; margin-top: 14px; color: var(--red-bright); font-weight: 800; font-style: italic; text-transform: uppercase; }

/* Pages */
.page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px) clamp(16px, 4vw, 40px) 56px;
}

.title, .subtitle {
  margin: 0;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  line-height: 1.05;
}

.title { font-size: clamp(2rem, 5vw, 3.2rem); }
.subtitle { margin-top: 48px; font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
.lead { margin: 6px 0 22px; color: var(--muted); }

/* Boutons d'ecuries, inspires des visuels de classement */
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.team-btn {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 72px;
  min-height: 70px;
  background: #15151b;
  transition: transform .15s, box-shadow .15s;
}

.team-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 22px color-mix(in srgb, var(--team) 40%, transparent); }

.pos, .score {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-style: italic;
  font-size: 1.3rem;
}

.pos { color: var(--red-bright); }
.score { background: var(--red); color: #fff; }

.band {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-right: 10px;
  color: var(--ink);
  background: linear-gradient(100deg, var(--team) 55%, color-mix(in srgb, var(--team) 80%, #000));
}

.band img { flex: none; width: 96px; height: 48px; }

.name {
  font-weight: 900;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.05;
  text-transform: uppercase;
}

/* Boutons de pilotes */
.driver-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }

.driver-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 6px solid var(--team);
  transition: transform .15s, border-color .15s;
}

.driver-btn:hover { transform: translateY(-2px); border-color: var(--text); border-left-color: var(--team); }

.thumb {
  flex: none;
  width: 54px;
  height: 54px;
  overflow: hidden;
  background: #fff1;
  border-radius: 8px;
}

.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.driver-btn b { display: block; font-weight: 800; font-size: 1.05rem; }
.driver-btn small { color: var(--muted); font-size: .85rem; }

/* Page d'une ecurie */
.back { display: inline-block; margin-bottom: 16px; color: var(--muted); font-weight: 600; }
.back:hover { color: var(--text); }

.team-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
  padding: 14px 22px 14px 12px;
  color: var(--ink);
  background: linear-gradient(100deg, var(--team) 55%, color-mix(in srgb, var(--team) 78%, #000));
}

.team-head img { width: 140px; height: 70px; }

.team-head h1 {
  flex: 1 1 200px;
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  text-transform: uppercase;
}

.team-head p { margin: 0; font-size: 1.05rem; }

.seats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }

.seat { display: flex; flex-direction: column; background: var(--panel); }

.seat-pic {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: clamp(260px, 38vw, 430px);
  padding-top: 18px;
  overflow: hidden;
  background:
    repeating-linear-gradient(115deg, transparent 0 34px, rgba(255, 255, 255, .13) 34px 37px, transparent 37px 70px),
    linear-gradient(170deg, color-mix(in srgb, var(--team) 72%, #000), #111116 92%);
}

.seat-pic img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }

.plate { padding: 12px 18px 16px; border-top: 4px solid var(--team); }

.plate h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}

.plate p { margin: 2px 0 0; color: var(--muted); }

.seat-empty .seat-pic { align-items: center; background: #1a1a1f; }
.seat-empty .seat-pic span { font-size: 6rem; font-weight: 900; font-style: italic; color: var(--line); }
.seat-empty h2 { color: var(--muted); }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; font-weight: 800; font-style: italic; text-transform: uppercase; }
.pager a { padding: 8px 0; color: var(--muted); }
.pager a:hover { color: var(--text); }

/* Classements */
.standings { max-width: 1040px; }

.tabs { display: inline-flex; margin-bottom: 22px; border: 2px solid var(--line); }

.tabs a {
  padding: 10px 18px;
  color: var(--muted);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
}

.tabs a:hover { color: var(--text); }
.tabs a[aria-current] { color: #fff; background: var(--red); }

/* Panel FIA */
.topbar nav a[hidden] { display: none; }
.fia-page { max-width: 800px; }
#fia-panel { padding: 4px 20px 20px; background: var(--panel); }
#fia-panel > .news-empty { margin: 0 -20px -20px; }
.fia-message { margin: 14px 0 0; padding: 10px 14px; background: #1f3a2a; border-left: 4px solid #3ecf7a; }
.fia-message.is-error { background: #3a1f1f; border-left-color: var(--red-bright); }
.fia-add { display: flex; flex-wrap: wrap; gap: 8px; }
.fia-add input { flex: 1 1 180px; min-width: 0; }

.fia-add input, .fia-add select, .fia-row select {
  padding: 9px 10px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  font: inherit;
}

.fia-add button, .cta-save {
  padding: 10px 16px;
  color: #fff;
  background: var(--red);
  border: 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.fia-add button:hover, .cta-save:hover { background: #f52121; }
.cta-save { width: 100%; margin-top: 14px; font-size: 1.05rem; }
.fia-list, .fia-log { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
.fia-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.fia-row b { flex: 1 1 140px; font-weight: 600; }
.fia-remove { padding: 4px; color: var(--muted); background: none; border: 0; font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; }
.fia-log > li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.fia-log b { color: var(--text); }
.fia-log ul { margin: 4px 0 0; padding-left: 18px; }
.row-no-team { display: flex; align-items: center; justify-content: center; width: 84px; font-size: .68rem; text-align: center; }

/* Calendrier */
.cal-page { max-width: 1240px; }
.cal-layout { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: start; gap: 24px; }
.cal-seasons { position: sticky; top: 90px; display: grid; gap: 8px; }

.cal-seasons a {
  padding: 14px 16px;
  color: var(--muted);
  background: var(--panel);
  border-left: 5px solid var(--line);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  transition: color .2s, border-color .2s;
}

.cal-seasons a:hover { color: var(--text); border-left-color: var(--text); }
.cal-seasons a[aria-current] { color: #fff; background: var(--red); border-left-color: #fff; }

.round-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.round-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 10px 14px;
  background: var(--panel);
  border-left: 5px solid var(--red);
  transition: transform .2s, background-color .2s;
}

.round-card:hover { transform: translateY(-3px); background: #2a2a32; }
.round-num { flex: none; width: 2.2em; color: var(--red-bright); font-weight: 900; font-style: italic; font-size: 1.15rem; }
.flag { flex: none; width: 42px; height: auto; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); }
.round-name { flex: 1; min-width: 0; }
.round-name b { display: block; font-weight: 800; line-height: 1.15; }
.round-name small, .round-state small { display: block; color: var(--muted); font-size: .8rem; }
.round-state { flex: none; text-align: right; font-size: .9rem; }
.round-state b { font-weight: 800; }
.round-state:not(:has(small)) b { color: var(--muted); font-weight: 600; }
.round-state.is-next b { color: var(--red-bright); font-weight: 800; }

.round-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--panel); border-left: 6px solid var(--red); animation: slide-in .8s cubic-bezier(.2, .8, .2, 1) backwards; }
.round-head .flag { width: 64px; }
.round-head h1 { margin: 0; font-size: clamp(1.5rem, 3.4vw, 2.4rem); font-weight: 900; font-style: italic; line-height: 1.05; text-transform: uppercase; }
.round-head p { margin: 2px 0 0; color: var(--muted); }

.round-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; gap: 14px; margin-top: 14px; }
.circuit-map { position: sticky; top: 90px; padding: 20px; background: var(--panel); text-align: center; }
.circuit-map img { width: 100%; max-height: 460px; margin: 0 auto; }
.circuit-map p { margin: 10px 0 0; color: var(--muted); font-size: .85rem; }
.round-results { min-width: 0; padding: 4px 18px 18px; background: var(--panel); }
.res-title { margin: 14px 0 8px; font-size: 1.15rem; font-weight: 900; font-style: italic; text-transform: uppercase; }
.res-list { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.res-list li { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.res-list img, .no-logo { flex: none; width: 56px; height: 28px; }
.res-list b { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.res-pos { flex: none; width: 2.3em; color: var(--red-bright); font-weight: 900; font-style: italic; }
.is-out b { color: var(--muted); }
.res-note, .res-empty { margin: 12px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.res-empty { padding: 10px 0; font-size: 1rem; }

@media (max-width: 900px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .cal-seasons { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .round-grid, .round-body { grid-template-columns: minmax(0, 1fr); }
  .circuit-map { position: static; }
}

/* Classements : une seule colonne, meme style que les boutons d'ecuries */
.team-grid.ranking { grid-template-columns: minmax(0, 1fr); }
.ranking-note { margin: 14px 0 0; color: var(--muted); font-size: .9rem; }

.rank-row { min-height: 62px; }
.rank-row .band img.row-logo { width: 84px; height: 42px; }
.rank-row .thumb { width: 46px; height: 46px; background: rgba(0, 0, 0, .28); }
.rank-row .band .thumb img { width: 100%; height: 100%; }
/* Tete noire avec un ? pour les pilotes sans avatar */
.head-unknown {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff;
  background: #050507;
  border-radius: 24%;
  font-weight: 900;
  font-size: 1.6rem;
  font-style: normal;
  line-height: 1;
}

.seat-pic .head-unknown {
  align-self: center;
  width: min(46%, 190px);
  height: auto;
  aspect-ratio: 1;
  font-size: clamp(3.5rem, 9vw, 6rem);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
}

footer {
  padding: 18px clamp(16px, 4vw, 40px);
  color: var(--muted);
  font-size: .8rem;
  text-align: center;
  border-top: 1px solid var(--line);
}

.step-who { width: 100%; }
.step-who small { font-size: .72rem; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 780px) {
  .brand span { display: none; }
  .topbar nav { order: 3; width: 100%; justify-content: space-between; }
  .topbar nav a { padding: 6px 2px; font-size: .85rem; gap: 4px; }
  .account-name b { max-width: 120px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .team-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .podiums { grid-template-columns: minmax(0, 1fr); }
  .step-pic { height: 170px; }
  .step-1 .step-pic { height: 215px; }
  .step-3 .step-pic { height: 140px; }
}

@media (max-width: 520px) {
  .topbar nav a { font-size: .8rem; }
  .topbar nav .icon { display: none; }
  .round-card { flex-wrap: wrap; }
  .round-state { width: 100%; padding-left: calc(2.2em + 12px); text-align: left; }
  .rank-row .band { gap: 7px; }
  .rank-row .band img.row-logo { width: 60px; height: 30px; }
  .rank-row .thumb { width: 38px; height: 38px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .tile { min-height: 0; }
  .seats { grid-template-columns: minmax(0, 1fr); }
  .seat-pic { height: 340px; }
  .team-btn { grid-template-columns: 36px minmax(0, 1fr) 60px; }
  .band img { width: 80px; height: 40px; }
  .name { font-size: 1rem; }
}

/* Animation d'ouverture : les feux de depart s'allument, s'eteignent, puis le logo arrive */
.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  cursor: pointer;
  animation: intro-wipe .9s cubic-bezier(.7, 0, .3, 1) 4.6s forwards;
}

.lights {
  position: absolute;
  display: flex;
  gap: clamp(8px, 2.4vw, 18px);
  padding: clamp(10px, 2vw, 16px);
  background: #0a0a0c;
  border-radius: 10px;
  animation: fade-out .3s linear 3s forwards;
}

.lights i {
  display: block;
  width: clamp(34px, 9vw, 64px);
  aspect-ratio: 1;
  background: #26262c;
  border-radius: 50%;
  animation: light-on .05s linear var(--d) forwards;
}

.lights i:nth-child(1) { --d: .3s; }
.lights i:nth-child(2) { --d: .8s; }
.lights i:nth-child(3) { --d: 1.3s; }
.lights i:nth-child(4) { --d: 1.8s; }
.lights i:nth-child(5) { --d: 2.3s; }

.intro-logo {
  width: clamp(200px, 40vw, 380px);
  height: auto;
  animation: logo-in .8s cubic-bezier(.2, .8, .2, 1) 3.1s backwards;
}

@keyframes intro-wipe {
  from { clip-path: polygon(0 0, 120% 0, 100% 100%, 0 100%); }
  to { clip-path: polygon(120% 0, 120% 0, 100% 100%, 100% 100%); visibility: hidden; }
}

@keyframes light-on {
  to { background: var(--red-bright); box-shadow: 0 0 22px var(--red-bright); }
}

@keyframes fade-out {
  to { opacity: 0; }
}

@keyframes logo-in {
  from { opacity: 0; transform: translateX(-120px) skewX(-14deg); }
}

/* Bande rouge qui traverse l'ecran quand on change de page */
.sweep {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
}

.sweep i {
  position: absolute;
  top: -10%;
  left: 0;
  width: 34%;
  height: 120%;
  visibility: hidden;
  background: linear-gradient(90deg, transparent, var(--red) 18% 82%, transparent);
  transform: translateX(-160%) skewX(-18deg);
}

.sweep.run i { animation: sweep 1s cubic-bezier(.6, 0, .4, 1); }

@keyframes sweep {
  from { visibility: visible; transform: translateX(-160%) skewX(-18deg); }
  to { visibility: visible; transform: translateX(460%) skewX(-18deg); }
}

/* Arrivee des elements de chaque page */
.hero-logo { animation: logo-in 1s cubic-bezier(.2, .8, .2, 1) var(--start, 0s) backwards; }

.hero h1, .eyebrow, .hero-race, .title, .subtitle, .lead, .tabs, .back, .pager, .ranking-note {
  animation: rise .8s cubic-bezier(.2, .8, .2, 1) calc(var(--start, 0s) + .2s) backwards;
}

.team-head { animation: slide-in .8s cubic-bezier(.2, .8, .2, 1) backwards; }

.team-grid > *, .driver-grid > *, .seats > *, .tiles > *, .podium > *, .news-list > .news-card, .round-grid > *, .round-body > * {
  animation: rise .8s cubic-bezier(.2, .8, .2, 1) calc(var(--start, 0s) + .3s + var(--i, 0) * 100ms) backwards;
}

.seat-pic img { animation: rise 1s cubic-bezier(.2, .8, .2, 1) .5s backwards; }

:is(.team-grid, .driver-grid, .seats, .tiles, .podium, .news-list, .round-grid) > :nth-child(2) { --i: 1; }
:is(.team-grid, .driver-grid, .seats, .tiles, .podium, .news-list, .round-grid) > :nth-child(3) { --i: 2; }
:is(.team-grid, .driver-grid, .seats, .tiles, .podium, .news-list, .round-grid) > :nth-child(4) { --i: 3; }
:is(.team-grid, .driver-grid, .seats, .tiles, .podium, .news-list, .round-grid) > :nth-child(5) { --i: 4; }
:is(.team-grid, .driver-grid, .seats, .tiles, .podium, .news-list, .round-grid) > :nth-child(6) { --i: 5; }
:is(.team-grid, .driver-grid, .seats, .tiles, .podium, .news-list, .round-grid) > :nth-child(7) { --i: 6; }
:is(.team-grid, .driver-grid, .seats, .tiles, .podium, .news-list, .round-grid) > :nth-child(8) { --i: 7; }
:is(.team-grid, .driver-grid, .seats, .tiles, .podium, .news-list, .round-grid) > :nth-child(n+9) { --i: 8; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(-40px); }
}

/* Petits effets au survol */
.band img, .thumb img, .seat-pic img { transition: transform .2s; }
.team-btn:hover .band img { transform: scale(1.08); }
.driver-btn:hover .thumb img { transform: scale(1.1); }
.seat:hover .seat-pic img { transform: scale(1.03); }
