/* Sacha Kart World : ce que la page publique (/) et la course (/course/) ont en commun.
   Les couleurs et les polices de la fête, le vocabulaire (titre, or, plaque, bouton) et
   l'écran de départ : le médaillon sur la poussière d'or, les cinq feux.
   Règles reprises telles quelles de la maquette validée. Rien de privé ici. */
:root {
  color-scheme: dark;
  --nuit: #08070E;
  --nuit-2: #13111E;
  --nuit-3: #1D1A2C;
  --or: #F3C452;
  --or-clair: #FFE9A6;
  --or-fonce: #B4832A;
  --ivoire: #FBF5E6;
  --ivoire-doux: #BDB5A4;
  --rose: #FF5FA8;
  --vert: #2ED47A;
  --jaune: #FFD233;
  --violet: #A56BFF;
  --bleu: #3F8CFF;
  --filet: rgba(243, 196, 82, 0.5);

  --sc-canvas: var(--nuit);
  --sc-surface: var(--nuit-2);
  --sc-ink: var(--ivoire);
  --sc-ink-soft: var(--ivoire-doux);
  --sc-accent: var(--or);
  --sc-accent-ink: #1A1304;
  --sc-font-display: "Montserrat", "Avenir Next", "Helvetica Neue", system-ui, sans-serif;
  --sc-font-text: "Nunito", "Avenir Next", system-ui, sans-serif;

  --gout: max(16px, env(safe-area-inset-left, 0px));
  --gout-d: max(16px, env(safe-area-inset-right, 0px));
  --damier: conic-gradient(#F4F1E8 25%, #0d0c14 0 50%, #F4F1E8 0 75%, #0d0c14 0) 0 0 / 18px 18px;
  --fanions: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='336' height='54' viewBox='0 0 336 54'><path d='M0 4 Q168 22 336 4' fill='none' stroke='%23F3C452' stroke-opacity='.8' stroke-width='2'/><path d='M6 6l40 4-22 36z' fill='%23FFD233'/><path d='M62 11l40 3-20 37z' fill='%232ED47A'/><path d='M118 14l40 1-19 38z' fill='%23A56BFF'/><path d='M174 15l40-2-21 38z' fill='%23FF5FA8'/><path d='M230 12l40-4-23 37z' fill='%233F8CFF'/><path d='M286 8l40-4-24 36z' fill='%23F4F1E8'/></svg>");
}
body { background: var(--nuit); color: var(--ivoire); font-family: var(--sc-font-text); font-weight: 600; }
h1, h2, h3, h4, p, figure { margin: 0; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid var(--or-clair); outline-offset: 3px; border-radius: 12px; }

/* ---------- le vocabulaire commun ---------- */
.titre { font-family: var(--sc-font-display); font-weight: 900; font-style: italic; text-transform: uppercase; line-height: 0.98; letter-spacing: -0.01em; text-wrap: balance; }
.or { background: linear-gradient(180deg, #FFF6D2 0%, var(--or) 46%, var(--or-fonce) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 rgba(0,0,0,.55)); padding-right: 0.08em; }
.plaque { background: rgba(14, 12, 22, 0.84); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1.5px solid var(--filet); border-radius: 22px; color: var(--ivoire); box-shadow: 0 22px 50px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,233,166,.18); }
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; min-height: 48px; padding: 0.55em 1.5em; font-family: var(--sc-font-display); font-weight: 800; font-size: 0.98rem; color: #1A1304; background: linear-gradient(180deg, var(--or-clair), var(--or) 55%, #D9A53A); border-radius: 999px; box-shadow: 0 4px 0 var(--or-fonce), 0 12px 24px rgba(243,196,82,.22); text-decoration: none; transition: transform 140ms var(--sc-ease-out), box-shadow 140ms var(--sc-ease-out); }
.bouton:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--or-fonce); }
.bouton--filet { background: transparent; color: var(--or-clair); box-shadow: inset 0 0 0 2px var(--filet); }
.bouton--filet:active { box-shadow: inset 0 0 0 2px var(--or); }
[hidden] { display: none !important; }

/* ---------- le départ : le médaillon sur la poussière d'or ---------- */
.depart { position: relative; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; overflow: clip; background: #050409; }
.depart__fond { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; opacity: 0.9; }
.depart::after { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 60% at 50% 42%, transparent 40%, rgba(5,4,9,.75) 100%); pointer-events: none; }
.depart__centre { position: relative; z-index: 2; display: grid; justify-items: center; align-content: center; gap: clamp(0.6rem, 2svh, 1.4rem); padding: calc(1.5rem + env(safe-area-inset-top, 0px)) var(--gout) 1rem; text-align: center; }
.depart__medaillon { width: min(86vw, 62svh, 40rem); height: auto; filter: drop-shadow(0 18px 50px rgba(243,196,82,.35)); animation: pose 900ms var(--sc-ease-out) both, flotte 7s ease-in-out 900ms infinite; }
.depart h1 { font-size: clamp(1.5rem, 1rem + 3.2vw, 3rem); }
.depart__bas { position: relative; z-index: 2; display: grid; justify-items: center; gap: 0.7rem; padding: 0 var(--gout) calc(1.3rem + env(safe-area-inset-bottom, 0px)); text-align: center; }
.depart__invite { font-family: var(--sc-font-display); font-weight: 700; font-size: 0.86rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--or-clair); }
/* le lien vers la version télé (/tele/), sous le code des invités ; prêt aussi pour le départ de la course */
.depart__tele { font-size: 0.9rem; font-weight: 700; color: var(--or-clair); text-decoration: underline; text-underline-offset: 0.2em; text-shadow: 0 1px 8px rgba(0,0,0,.9); padding: 0.35rem 0.6rem; }
.depart__tele:hover { color: var(--ivoire); }
.feux { display: flex; gap: 0.5rem; padding: 0.42rem 0.75rem; border-radius: 999px; background: #0d0c14; border: 1.5px solid var(--filet); }
.feux i { width: 15px; height: 15px; border-radius: 50%; background: #2b2836; }
html.ouvert .feux i { animation: feu 500ms var(--sc-ease-out) both; }
.feux i:nth-child(1) { --c: var(--bleu); animation-delay: 0.1s; } .feux i:nth-child(2) { --c: var(--vert); animation-delay: 0.35s; }
.feux i:nth-child(3) { --c: var(--jaune); animation-delay: 0.6s; } .feux i:nth-child(4) { --c: var(--violet); animation-delay: 0.85s; }
.feux i:nth-child(5) { --c: var(--rose); animation-delay: 1.1s; }
@keyframes feu { to { background: var(--c); box-shadow: 0 0 14px var(--c); } }
@keyframes pose { from { opacity: 0; scale: 0.82; } to { opacity: 1; scale: 1; } }
@keyframes flotte { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

@media (prefers-reduced-motion: reduce) {
  .depart__medaillon { animation: none; }
  html.ouvert .feux i { animation-duration: 1ms; animation-delay: 0s; }
}

/* ---------- téléphone tenu à l'horizontale : le médaillon à gauche, le reste à droite ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  .depart { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); grid-template-rows: 1fr; align-items: center; }
  .depart__centre { gap: 0.5rem; padding: calc(0.6rem + env(safe-area-inset-top, 0px)) 0.5rem 0.6rem max(var(--gout), env(safe-area-inset-left, 0px)); }
  .depart .depart__medaillon { width: min(36vw, 62svh); }
  .depart h1 { font-size: clamp(1.05rem, 0.5rem + 3.2svh, 1.6rem); max-width: 16ch; }
  .depart__bas { gap: 0.55rem; padding: 0.6rem max(var(--gout), env(safe-area-inset-right, 0px)) calc(0.6rem + env(safe-area-inset-bottom, 0px)) 0.5rem; }
}
