/* STAR RUNNERS — landing, classement, pages de texte */

@font-face { font-family: "Sixtyfour"; src: url("../fonts/sixtyfour.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Condensed"; src: url("../fonts/plex-cond-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Condensed"; src: url("../fonts/plex-cond-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --black: #000;
  --star: #f4f1e8;
  --gold: #ffc94a;
  --gold-deep: #d99a1e;
  --ice: #8fe6ff;
  --muted: #9a98ad;
  --line: #24253a;
  --hazard: #ff6a4d;
  --display: "Sixtyfour", "IBM Plex Mono", ui-monospace, monospace;
  --body: "IBM Plex Sans Condensed", "Arial Narrow", system-ui, sans-serif;
  --data: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--black); color: var(--star); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.5;
  background: var(--black);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--star); text-underline-offset: .2em; text-decoration-color: rgba(244, 241, 232, .45); }
a:hover { text-decoration-color: var(--gold); }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }

#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; pointer-events: none; }

/* Bouton principal */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.6rem;
  font-family: var(--data);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .12em;
  text-decoration: none;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold-deep);
  border-radius: 3px;
  cursor: pointer;
}
.btn:hover { border-color: var(--gold); }
.btn-primary {
  color: var(--black);
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 28px rgba(255, 201, 74, .35);
}
.btn-primary:hover { background: #ffd975; border-color: #ffd975; }

/* ===== Landing ===== */

.landing {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 1.5rem max(1.25rem, 5vw);
}

.hero {
  align-self: center;
  justify-self: center;
  text-align: center;
  max-width: 62rem;
  padding: 3rem 0 2rem;
}

.presents {
  margin: 0 0 1.6rem;
  font-family: var(--data);
  font-size: .9rem;
  letter-spacing: .3em;
  color: var(--muted);
}

.logo {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 2px var(--gold), 0 0 32px rgba(255, 201, 74, .45);
}
.logo-main {
  display: block;
  font-size: clamp(2.3rem, 9.2vw, 7rem);
  letter-spacing: .02em;
}
.logo-sub {
  display: block;
  margin-top: 1.1rem;
  font-family: var(--body);
  font-weight: 600;
  font-size: clamp(1.05rem, 2.6vw, 1.6rem);
  letter-spacing: .42em;
  padding-left: .42em; /* compense l'espacement du dernier caractère */
  color: var(--star);
  text-shadow: none;
}

.tagline {
  margin: 2.6rem auto 0;
  max-width: 30ch;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  line-height: 1.4;
  color: var(--star);
  text-wrap: balance;
}

.tagline-big {
  max-width: 22ch;
  font-size: clamp(1.7rem, 4.6vw, 2.9rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: .01em;
}

.play {
  margin-top: 2.4rem;
  min-width: 12rem;
  min-height: 60px;
  font-size: 1.25rem;
  letter-spacing: .3em;
  padding-left: calc(1.6rem + .3em);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem 1.6rem;
  font-family: var(--data);
  font-size: .8rem;
  color: var(--muted);
}
.foot p { margin: 0; }
.foot a { color: var(--muted); }

/* Une seule séquence d'ouverture : le titre recule dans l'espace, puis le reste apparaît */
@media (prefers-reduced-motion: no-preference) {
  .logo { animation: recede 2.4s cubic-bezier(.16, .8, .3, 1) both; }
  .presents { animation: fade 1.2s ease-out .2s both; }
  .tagline, .play { animation: fade 1s ease-out 1.9s both; }
  .foot { animation: fade 1s ease-out 2.4s both; }
}
@keyframes recede {
  from { opacity: 0; transform: scale(2.4); filter: blur(6px); }
  35% { opacity: 1; filter: blur(0); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ===== Pages intérieures (classement, confidentialité) ===== */

.page {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.25rem max(1.25rem, 4vw) 3rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.home {
  font-family: var(--display);
  font-size: .95rem;
  color: var(--gold);
  text-decoration: none;
}

.page h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  line-height: 1.1;
  color: var(--gold);
}
.page .lede { margin: .6rem 0 0; color: var(--muted); }
.page h2 {
  margin: 2.2rem 0 .6rem;
  font-family: var(--body);
  font-weight: 600;
  font-size: 1.25rem;
}
.page p { margin: 0 0 1rem; }
.small { font-size: .9rem; color: var(--muted); }

/* Votre run */
.yours {
  margin: 2rem 0 0;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--gold-deep);
  border-radius: 4px;
  background: rgba(255, 201, 74, .05);
}
.page .yours h2 { margin: 0 0 .6rem; font-size: 1rem; font-weight: 400; color: var(--muted); }
.yours-score {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.yours-rank { margin: .9rem 0 0; font-size: 1.25rem; }
.yours-rank strong { color: var(--gold); font-weight: 600; }
.yours-note { margin: .3rem 0 0; color: var(--muted); font-size: 1rem; }
.yours .actions { margin-top: 1.1rem; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Tableau */
.board-wrap { margin-top: 2rem; overflow-x: auto; }
.board {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--data);
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
}
.board th {
  padding: .4rem .5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 500;
  font-size: .8rem;
  color: var(--muted);
}
.board td {
  padding: .6rem .5rem;
  border-bottom: 1px solid rgba(36, 37, 58, .7);
  white-space: nowrap;
}
.board .num { text-align: right; }
.board .rank { color: var(--gold-deep); width: 3.5rem; }
.board td.pilot { white-space: normal; word-break: break-word; }
.board tr.me td { color: var(--gold); background: rgba(255, 201, 74, .07); }
.board td.gap { text-align: center; color: var(--muted); }
.page .board-state { margin: 2rem 0 0; color: var(--muted); }

.page-foot { margin-top: 3rem; }

@media (max-width: 520px) {
  body { font-size: 17px; }
}
