/* STAR RUNNERS — thème borne d'arcade : landing, classement, pages de texte */

@font-face { font-family: "Press Start 2P"; src: url("../fonts/press-start-2p-fr.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "VT323"; src: url("../fonts/vt323.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --black: #110f12;
  --white: #fefefe;
  --orange: #ff9528;
  --red: #dc3030;
  --score: #ff4839;
  --teal: #79e2db;
  --teal-deep: #0ccbbb;
  --blue: #045bb8;
  --yellow: #ffe81f;
  --grey: #87888a;
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --body: "VT323", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

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

html { background: var(--black); color: var(--white); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--body);
  font-size: 24px;
  line-height: 1.3;
  background: var(--black);
}

a { color: var(--white); text-underline-offset: .2em; }
a:hover { color: var(--yellow); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

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

/* Boutons : blocs pleins, sans arrondi ni lueur, comme sur une borne */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.4rem;
  font-family: var(--pixel);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--yellow);
  background: transparent;
  border: 3px solid var(--yellow);
  border-radius: 0;
  cursor: pointer;
  line-height: 1.6;
  text-align: center;
}
.btn:hover { color: var(--black); background: var(--yellow); }
.btn-primary { color: var(--black); background: var(--orange); border-color: var(--orange); }
.btn-primary:hover { background: var(--yellow); border-color: var(--yellow); }

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

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

.marquee {
  display: flex;
  justify-content: center;
  gap: 4rem;
  font-family: var(--pixel);
  font-size: clamp(.7rem, 1.6vw, 1rem);
  line-height: 1.8;
  text-align: center;
}
.marquee span { display: block; color: var(--score); }

.hero {
  align-self: center;
  justify-self: center;
  text-align: center;
  width: min(100%, 66rem);
  padding: 2.5rem 0 2rem;
}

.drone { display: block; width: 42px; height: auto; margin: 0 auto 1.6rem; image-rendering: pixelated; }

.logo { margin: 0; line-height: 0; }
.logo img { display: block; width: min(100%, 40rem); height: auto; margin: 0 auto; }
.logo-404 img { width: min(100%, 22rem); }

.logo-sub {
  margin: 2rem 0 0;
  font-family: var(--pixel);
  font-size: clamp(.85rem, 2vw, 1.25rem);
  letter-spacing: .5em;
  padding-left: .5em; /* compense l'espacement du dernier caractère */
  color: var(--teal);
}

.tagline {
  margin: 1.6rem auto 0;
  max-width: 40ch;
  font-family: var(--pixel);
  font-size: clamp(.7rem, 1.6vw, 1rem);
  line-height: 1.9;
  color: var(--white);
  text-transform: uppercase;
  text-wrap: balance;
}

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

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .6rem 1.6rem;
  font-family: var(--pixel);
  font-size: .62rem;
  line-height: 1.8;
  color: var(--grey);
}
.foot p { margin: 0; }
.foot a { color: var(--white); text-decoration: none; }
.foot a:hover { color: var(--yellow); }
.foot .credit { color: var(--teal); font-size: .8rem; }
.foot .links { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; }

/* Ouverture : le titre apparaît brique par brique (balayage), puis PLAY clignote une fois */
@media (prefers-reduced-motion: no-preference) {
  .logo img { animation: wipe 1.1s steps(9, end) both; }
  .logo-sub, .tagline, .play { animation: pop 0s linear 1.2s both; }
  .play { animation: pop 0s linear 1.2s both, blink 1s steps(1, end) 1.2s 3; }
}
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes pop { from { visibility: hidden; } to { visibility: visible; } }
@keyframes blink { 50% { background: var(--yellow); border-color: var(--yellow); } }

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

.page {
  position: relative;
  z-index: 1;
  max-width: 50rem;
  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: 3rem;
}
.home { display: block; line-height: 0; }
.home img { width: 13rem; height: auto; display: block; }

.page h1 {
  margin: 0;
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(1.2rem, 4vw, 1.9rem);
  line-height: 1.3;
  color: var(--yellow);
  text-transform: uppercase;
}
.page .lede { margin: .8rem 0 0; color: var(--teal); }
.page h2 {
  margin: 2.4rem 0 .8rem;
  font-family: var(--pixel);
  font-weight: 400;
  font-size: .85rem;
  line-height: 1.6;
  color: var(--orange);
  text-transform: uppercase;
}
.page p { margin: 0 0 1rem; }
.small { font-size: 1.05rem; color: var(--grey); }

/* Votre run */
.yours {
  margin: 2rem 0 0;
  padding: 1.4rem 1.5rem;
  border: 3px solid var(--teal);
}
.page .yours h2 { margin: 0 0 .9rem; color: var(--white); }
.yours-score {
  margin: 0;
  font-family: var(--pixel);
  font-size: clamp(1.6rem, 7vw, 2.6rem);
  line-height: 1;
  color: var(--score);
  font-variant-numeric: tabular-nums;
}
.yours-rank { margin: 1rem 0 0; font-size: 1.6rem; }
.yours-rank strong { color: var(--yellow); font-weight: 400; }
.yours-note { margin: .3rem 0 0; color: var(--grey); }
.yours .actions { margin-top: 1.2rem; }

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

/* Tableau des meilleurs scores, façon « HIGH SCORES » */
.board-wrap { margin-top: 2rem; overflow-x: auto; }
.board {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--pixel);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}
.board th {
  padding: .5rem .6rem 1rem;
  text-align: left;
  font-weight: 400;
  font-size: .65rem;
  color: var(--teal);
}
.board td { padding: .75rem .6rem; white-space: nowrap; color: var(--white); }
.board .num { text-align: right; }
.board .rank { width: 4rem; }
.board td.pilot { white-space: normal; word-break: break-word; }
.board tbody tr:nth-child(1) td { color: var(--yellow); }
.board tbody tr:nth-child(2) td { color: var(--orange); }
.board tbody tr:nth-child(3) td { color: var(--score); }
.board tr.me td { color: var(--black) !important; background: var(--teal); }
.board td.gap { text-align: center; color: var(--grey); }
.page .board-state { margin: 2rem 0 0; color: var(--grey); }

.page-foot { margin-top: 3.5rem; justify-content: flex-start; }

@media (max-width: 560px) {
  body { font-size: 22px; }
  .marquee { gap: 2rem; }
  .board { font-size: .62rem; }
  .board .rank { width: 2.6rem; }
  .home img { width: 9rem; }
  .foot { justify-content: center; text-align: center; }
}

/* PLAY et LEADERBOARD côte à côte */
.cta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem; margin-top: 2.4rem; }
.cta .play { margin-top: 0; }
.board-btn { min-height: 64px; font-size: .8rem; }
@media (prefers-reduced-motion: no-preference) { .board-btn { animation: pop 0s linear 1.2s both; } }

/* Classement d'abord, puis un petit encart pour ton run */
.yours { padding: 1rem 1.2rem; margin-top: 1.6rem; }
.yours-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem 2rem; margin: 0; font-family: var(--pixel); font-size: .75rem; color: var(--teal); }
.yours-line b { font-weight: 400; font-size: 1.15rem; color: var(--score); margin-left: .5rem; }
.yours-line .c b { color: var(--yellow); }
.yours-rank { margin: .7rem 0 0; font-size: 1.3rem; }
.yours .actions { margin-top: .9rem; }

.btn.share { color: var(--teal); border-color: var(--teal); }
.btn.share:hover { color: var(--black); background: var(--teal); }
