* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: #f4f8ff;
  background:
    radial-gradient(circle at 50% 0%, #173a68 0%, #0b1a2d 35%, #040a12 75%, #010409 100%);
}

/* =========================
   TOPBAR
========================= */

.topbar {
  height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 26px;
  background: rgba(5, 13, 24, 0.96);
  border-bottom: 1px solid rgba(98, 157, 229, 0.22);
}

.logo {
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.8px;
}

.logo span {
  color: #ff4168;
}

.round-info {
  color: #8aafdc;
  font-size: 14px;
  letter-spacing: 0.8px;
}

.quit-btn {
  justify-self: end;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid #315070;
  background: linear-gradient(180deg, #1a2d46, #0d1b2c);
  color: white;
  cursor: pointer;
}

/* =========================
   LAYOUT
========================= */

.game-shell {
  width: min(1580px, calc(100% - 40px));
  margin: 20px auto 35px;
}

/* =========================
   COURSE
========================= */

.race-panel {
  padding: 26px 28px 30px;
  border-radius: 26px;
  border: 1px solid rgba(91, 149, 218, 0.26);
  background:
    radial-gradient(circle at 50% 0%, rgba(48, 112, 184, 0.12), transparent 50%),
    linear-gradient(180deg, rgba(11, 27, 48, 0.98), rgba(5, 13, 24, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 42px rgba(0, 0, 0, 0.34);
}

.race-title {
  text-align: center;
  margin-bottom: 24px;
  color: #9ab9df;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
}

.runner + .runner {
  margin-top: 34px;
}

.runner-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.runner-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 900;
}

.runner-icon {
  font-size: 30px;
}

.runner-score {
  color: #95b0d0;
  font-size: 14px;
  font-weight: 800;
}

.runner-score strong {
  color: white;
  font-size: 18px;
}

/* =========================
   BARRE DE PROGRESSION
========================= */

.track-wrap {
  position: relative;
}

.track {
  position: relative;
  width: 100%;
  height: 28px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #07121d, #0c1d30);
  border: 1px solid #33567f;
  overflow: visible;
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.45),
    0 6px 16px rgba(0, 0, 0, 0.22);
}

/* ligne de fond */
.track::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(120, 170, 230, 0.18);
}

/* arrivée au bout */
.track::after {
  content: "🏁";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translate(100%, -50%);
  font-size: 28px;
}

/* remplissage */
.track-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 999px;
  transition: width 0.8s ease;
}

.player-fill {
  background: linear-gradient(90deg, rgba(35, 145, 225, 0.20), rgba(45, 220, 255, 0.45));
}

.computer-fill {
  background: linear-gradient(90deg, rgba(122, 62, 210, 0.20), rgba(198, 110, 255, 0.45));
}

/* pion */
.track-pawn {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  z-index: 5;
  transition: left 0.8s ease;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.player-pawn {
  background: radial-gradient(circle at 35% 25%, #205e88, #0b2741 75%);
  border: 2px solid #35d8ff;
  box-shadow:
    0 0 0 5px rgba(53, 216, 255, 0.08),
    0 0 22px rgba(53, 216, 255, 0.20);
}

.computer-pawn {
  background: radial-gradient(circle at 35% 25%, #5e2f81, #28153a 75%);
  border: 2px solid #c071ff;
  box-shadow:
    0 0 0 5px rgba(192, 113, 255, 0.08),
    0 0 22px rgba(192, 113, 255, 0.20);
}

/* marqueurs spéciaux */
.special-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: white;
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 3px 8px rgba(0,0,0,0.30);
}

.marker-up { background: #1d7746; }
.marker-down { background: #912842; }
.marker-x2, .marker-bonus { background: #9a730e; }
.marker-swap { background: #6c2f97; }
.marker-kboom {
  background: #b3320c;
  box-shadow: 0 0 14px rgba(255, 85, 22, 0.35);
}

.track-numbers {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: #6e89a8;
  font-size: 11px;
  font-weight: 800;
}

/* =========================
   QUESTION
========================= */

.question-panel {
  margin-top: 24px;
  padding: 30px 30px 25px;
  border-radius: 26px;
  border: 1px solid #294a70;
  background:
    radial-gradient(circle at 50% 0%, rgba(45, 99, 160, 0.15), transparent 50%),
    linear-gradient(180deg, rgba(12, 29, 51, 0.98), rgba(5, 14, 26, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 18px 40px rgba(0,0,0,0.28);
}

.question-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
}

.question-category {
  color: #31d5ff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.8px;
}

.timer {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #071522;
  border: 3px solid #31d8ff;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 0 20px rgba(49, 216, 255, 0.15);
}

.question-panel h1 {
  margin: 5px 70px 28px;
  text-align: center;
  font-size: clamp(27px, 2.3vw, 39px);
  font-weight: 500;
}

.answers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.answer {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 16px;
  border-radius: 13px;
  border: 1px solid #31537c;
  background: linear-gradient(180deg, #18345a, #102541);
  color: white;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.answer:hover {
  transform: translateY(-2px);
  border-color: #55c6fa;
  background: linear-gradient(180deg, #1c416c, #143052);
}

.answer span {
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #225b93;
  color: #39d7ff;
  font-weight: 900;
}

.question-message {
  margin-top: 18px;
  text-align: center;
  color: #ffc84c;
  font-size: 18px;
  font-weight: 900;
}

/* =========================
   OVERLAY
========================= */

.event-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 4, 10, 0.72);
  backdrop-filter: blur(5px);
}

.event-overlay.show {
  display: flex;
}

.event-card {
  min-width: 360px;
  padding: 35px 48px;
  text-align: center;
  border-radius: 28px;
  border: 1px solid #ff6b36;
  background:
    radial-gradient(circle at center, rgba(255, 109, 36, 0.22), transparent 65%),
    linear-gradient(180deg, #25110b, #09080a);
  box-shadow: 0 0 80px rgba(255, 75, 24, 0.28);
}

.event-icon {
  font-size: 72px;
}

.event-title {
  margin-top: 10px;
  font-size: 40px;
  font-weight: 1000;
}

.event-text {
  margin-top: 9px;
  color: #d8deea;
  font-size: 17px;
}

@media (max-width: 900px) {
  .answers {
    grid-template-columns: repeat(2, 1fr);
  }

  .question-panel h1 {
    margin-left: 20px;
    margin-right: 20px;
  }
}

/* =========================
   VERSION PLUS VISIBLE
========================= */

.race-panel {
  padding: 30px 34px 34px;
}

.runner + .runner {
  margin-top: 42px;
}

.runner-head {
  margin-bottom: 18px;
}

.runner-name {
  font-size: 22px;
  gap: 16px;
  letter-spacing: 0.4px;
}

.runner-icon {
  font-size: 36px;
}

.runner-score {
  font-size: 15px;
}

.runner-score strong {
  font-size: 22px;
}

/* barre plus visible */
.track {
  height: 34px;
  border-radius: 999px;
  border: 1px solid #3f6a99;
  background:
    linear-gradient(180deg, #0a1624, #102338);
  box-shadow:
    inset 0 2px 10px rgba(0, 0, 0, 0.45),
    0 0 18px rgba(63, 123, 196, 0.08),
    0 8px 20px rgba(0, 0, 0, 0.24);
}

.track::before {
  left: 16px;
  right: 16px;
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(120,170,230,0.18), rgba(160,210,255,0.25), rgba(120,170,230,0.18));
}

/* remplissage plus lisible */
.track-fill {
  border-radius: 999px;
}

.player-fill {
  background:
    linear-gradient(90deg, rgba(30, 140, 220, 0.30), rgba(44, 226, 255, 0.58));
}

.computer-fill {
  background:
    linear-gradient(90deg, rgba(115, 58, 205, 0.30), rgba(204, 108, 255, 0.58));
}

/* pion plus gros */
.track-pawn {
  width: 58px;
  height: 58px;
  font-size: 32px;
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.40);
}

.player-pawn {
  box-shadow:
    0 0 0 6px rgba(53, 216, 255, 0.10),
    0 0 28px rgba(53, 216, 255, 0.25);
}

.computer-pawn {
  box-shadow:
    0 0 0 6px rgba(192, 113, 255, 0.10),
    0 0 28px rgba(192, 113, 255, 0.25);
}

/* pièges placés au-dessus de la ligne */
.special-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.marker {
  top: -14px;
  width: 28px;
  height: 28px;
  font-size: 14px;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow:
    0 4px 10px rgba(0,0,0,0.38);
}

.marker-up {
  background: linear-gradient(180deg, #23a35d, #15653b);
}

.marker-down {
  background: linear-gradient(180deg, #bb3958, #7e223b);
}

.marker-x2,
.marker-bonus {
  background: linear-gradient(180deg, #c09318, #82600f);
}

.marker-swap {
  background: linear-gradient(180deg, #8e47c5, #5b2e84);
}

.marker-kboom {
  background: linear-gradient(180deg, #db4b1b, #95270c);
  box-shadow:
    0 0 18px rgba(255, 92, 28, 0.34),
    0 4px 10px rgba(0,0,0,0.38);
}

/* graduation plus lisible */
.track-numbers {
  margin-top: 16px;
  padding: 0 2px;
  color: #86a8cf;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.3px;
}


/* =========================
   ETIQUETTES PIEGES VISIBLES
========================= */

.special-markers {
  overflow: visible;
}

.marker {
  top: -16px;
  width: 30px;
  height: 30px;
  font-size: 14px;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,0.30);
  box-shadow:
    0 4px 10px rgba(0,0,0,0.38);
  z-index: 6;
}

/* petite etiquette sous le piège */
.marker::after {
  content: attr(data-label);
  position: absolute;
  top: 34px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;

  padding: 3px 7px;
  border-radius: 999px;

  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.4px;
  line-height: 1;

  color: #eef6ff;
  background: rgba(6, 16, 28, 0.95);
  border: 1px solid rgba(110, 165, 230, 0.24);
  box-shadow: 0 3px 8px rgba(0,0,0,0.28);
}

.marker-up {
  background: linear-gradient(180deg, #23a35d, #15653b);
}

.marker-down {
  background: linear-gradient(180deg, #bb3958, #7e223b);
}

.marker-x2,
.marker-bonus {
  background: linear-gradient(180deg, #c09318, #82600f);
}

.marker-swap {
  background: linear-gradient(180deg, #8e47c5, #5b2e84);
}

.marker-kboom {
  background: linear-gradient(180deg, #db4b1b, #95270c);
  box-shadow:
    0 0 18px rgba(255, 92, 28, 0.34),
    0 4px 10px rgba(0,0,0,0.38);
}


/* =========================
   BOUTON START
========================= */

.start-zone {
  display: flex;
  justify-content: center;
  margin: 24px 0 8px;
}

.start-btn {
  min-width: 240px;
  padding: 18px 34px;

  border-radius: 18px;
  border: 1px solid #35d7ff;

  background:
    radial-gradient(circle at 50% 0%, rgba(53, 215, 255, 0.20), transparent 60%),
    linear-gradient(180deg, #123a57, #0a2336);

  color: white;

  font-size: 24px;
  font-weight: 900;
  letter-spacing: 1px;

  cursor: pointer;

  box-shadow:
    0 0 0 5px rgba(53, 215, 255, 0.05),
    0 0 28px rgba(53, 215, 255, 0.22);

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.start-btn:hover {
  transform: translateY(-2px) scale(1.02);

  box-shadow:
    0 0 0 6px rgba(53, 215, 255, 0.07),
    0 0 38px rgba(53, 215, 255, 0.30);
}

.start-btn:active {
  transform: scale(0.98);
}

.start-zone.hidden {
  display: none;
}

/* =========================
   ECRAN D'ACCUEIL
========================= */

.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 30px;

  background:
    radial-gradient(circle at 50% 20%, rgba(34, 108, 179, 0.32), transparent 42%),
    linear-gradient(180deg, #071426, #02070d 75%);

  transition: opacity 0.35s ease;
}

.welcome-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.welcome-card {
  width: min(650px, 94vw);

  padding: 44px 46px 40px;

  border-radius: 30px;

  text-align: center;

  border: 1px solid rgba(73, 159, 238, 0.38);

  background:
    radial-gradient(circle at 50% 0%, rgba(55, 136, 212, 0.18), transparent 52%),
    linear-gradient(180deg, rgba(10, 28, 50, 0.98), rgba(4, 13, 24, 0.98));

  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.welcome-logo {
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 1000;
  letter-spacing: -1.5px;
}

.welcome-logo span {
  color: #ff4168;
}

.welcome-subtitle {
  margin-top: 10px;
  color: #8fb1d8;
  font-size: 16px;
}

.welcome-rules {
  margin: 30px 0;

  display: grid;
  gap: 12px;

  text-align: left;
}

.rule {
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 14px 16px;

  border-radius: 14px;

  color: #eaf4ff;

  background: rgba(13, 34, 58, 0.82);

  border: 1px solid rgba(77, 135, 198, 0.24);
}

.rule span {
  width: 34px;
  font-size: 23px;
  text-align: center;
}

.pseudo-label {
  display: block;

  margin-bottom: 8px;

  text-align: left;

  color: #9ab8d8;

  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.pseudo-input {
  width: 100%;

  padding: 15px 16px;

  border-radius: 13px;

  outline: none;

  border: 1px solid #315982;

  background: #081827;

  color: white;

  font-size: 18px;
  font-weight: 700;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.pseudo-input:focus {
  border-color: #36d6ff;

  box-shadow:
    0 0 0 4px rgba(54, 214, 255, 0.08),
    0 0 22px rgba(54, 214, 255, 0.13);
}

.enter-game-btn {
  width: 100%;

  margin-top: 18px;

  padding: 17px 20px;

  border: 1px solid #36d6ff;

  border-radius: 15px;

  background:
    radial-gradient(circle at 50% 0%, rgba(54, 214, 255, 0.22), transparent 60%),
    linear-gradient(180deg, #164767, #0b2b42);

  color: white;

  font-size: 18px;
  font-weight: 1000;
  letter-spacing: 0.8px;

  cursor: pointer;

  box-shadow:
    0 0 0 5px rgba(54, 214, 255, 0.05),
    0 0 30px rgba(54, 214, 255, 0.18);

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.enter-game-btn:hover {
  transform: translateY(-2px);

  box-shadow:
    0 0 0 6px rgba(54, 214, 255, 0.07),
    0 0 42px rgba(54, 214, 255, 0.26);
}

.enter-game-btn:active {
  transform: scale(0.99);
}


/* =========================
   DIFFICULTE
========================= */

.difficulty-block {
  margin-top: 24px;
}

.difficulty-title {
  margin-bottom: 10px;
  text-align: left;

  color: #9ab8d8;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.difficulty-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.difficulty-btn {
  padding: 14px 8px;

  border-radius: 13px;
  border: 1px solid #31547b;

  background:
    linear-gradient(180deg, #102942, #091a2c);

  color: #a9bfd9;

  font-size: 14px;
  font-weight: 900;

  cursor: pointer;

  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    color 0.15s ease;
}

.difficulty-btn small {
  display: block;
  margin-top: 5px;

  color: #6986a6;
  font-size: 10px;
  font-weight: 800;
}

.difficulty-btn:hover {
  transform: translateY(-2px);
  border-color: #4c85bb;
}

.difficulty-btn.active {
  color: white;

  border-color: #35d6ff;

  background:
    radial-gradient(circle at 50% 0%, rgba(53, 214, 255, 0.18), transparent 65%),
    linear-gradient(180deg, #174761, #0b2c40);

  box-shadow:
    0 0 0 4px rgba(53, 214, 255, 0.05),
    0 0 22px rgba(53, 214, 255, 0.16);
}

.difficulty-btn.active small {
  color: #57dfff;
}


/* GOLF GTI */

.runner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-car-icon {
  display: block;
  object-fit: contain;
}

.runner-name .player-car-icon {
  width: 52px;
  height: 52px;
}

.player-car-pawn {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,0.45));
}

/* =========================
   CHOIX AVATAR
========================= */

.avatar-block {
  margin-top: 24px;
}

.avatar-title {
  margin-bottom: 10px;
  text-align: left;

  color: #9ab8d8;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.avatar-btn {
  padding: 12px 8px 10px;

  border-radius: 14px;
  border: 1px solid #31547b;

  background:
    linear-gradient(180deg, #102942, #091a2c);

  color: #a9bfd9;

  cursor: pointer;

  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    color 0.15s ease;
}

.avatar-btn:hover {
  transform: translateY(-2px);
  border-color: #4c85bb;
}

.avatar-btn.active {
  color: white;

  border-color: #35d6ff;

  background:
    radial-gradient(circle at 50% 0%, rgba(53, 214, 255, 0.18), transparent 65%),
    linear-gradient(180deg, #174761, #0b2c40);

  box-shadow:
    0 0 0 4px rgba(53, 214, 255, 0.05),
    0 0 22px rgba(53, 214, 255, 0.16);
}

.avatar-icon {
  height: 54px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-option-img {
  width: 64px;
  height: 44px;
  object-fit: contain;
}

.avatar-emoji {
  font-size: 34px;
  line-height: 1;
}

.avatar-label {
  display: block;
  margin-top: 6px;

  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.player-car-runner {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.player-car-pawn {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,0.45));
}

.player-avatar-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.player-avatar-runner {
  font-size: 34px;
}

.player-avatar-pawn {
  font-size: 34px;
}



/* ======================================================
   SOLO CHRONO
====================================================== */

#gameModeSelector {
  margin: 22px auto;
  text-align: center;
}

.mode-title {
  margin-bottom: 10px;
  font-size: 13px;
  letter-spacing: 3px;
  opacity: .75;
}

.mode-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.game-mode-btn {
  min-width: 150px;
  padding: 12px 18px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  color: white;
  font-weight: 800;
  cursor: pointer;
  transition: .2s;
}

.game-mode-btn:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,.12);
}

.game-mode-btn.active {
  border-color: #00e5ff;
  box-shadow:
    0 0 10px rgba(0,229,255,.7),
    inset 0 0 12px rgba(0,229,255,.12);
}

#soloChrono {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9000;

  display: none;

  min-width: 180px;
  padding: 10px 18px;

  text-align: center;

  background: rgba(4,10,24,.94);
  border: 1px solid #00e5ff;
  border-radius: 12px;

  box-shadow:
    0 0 18px rgba(0,229,255,.35);
}

body.solo-mode #soloChrono {
  display: block;
}

.solo-chrono-title {
  font-size: 11px;
  letter-spacing: 2px;
  opacity: .75;
}

.solo-chrono-time {
  margin-top: 3px;
  font-size: 27px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}


/* ======================================================
   ACCUEIL COMPACT
====================================================== */

#welcomeScreen {
  overflow-y: auto;
}

#welcomeScreen .welcome-content,
#welcomeScreen > div {
  transform-origin: top center;
}

/* Règles */
#welcomeScreen .rules,
#welcomeScreen .welcome-rules {
  gap: 10px;
}

#welcomeScreen .rule,
#welcomeScreen .welcome-rule {
  padding-top: 14px !important;
  padding-bottom: 14px !important;
  min-height: 0 !important;
}

/* Espaces généraux de l'accueil */
#welcomeScreen h1 {
  margin-bottom: 8px !important;
}

#welcomeScreen .subtitle,
#welcomeScreen .welcome-subtitle {
  margin-bottom: 18px !important;
}

/* Pseudo */
#pseudoInput {
  padding-top: 14px !important;
  padding-bottom: 14px !important;
}

/* Avatars plus petits */
.avatar-options,
.avatar-grid {
  gap: 10px !important;
}

.avatar-btn,
.avatar-option {
  min-height: 100px !important;
  padding: 10px !important;
}

.avatar-btn img,
.avatar-option img {
  max-height: 42px !important;
}

/* Difficulté plus compacte */
.difficulty-options,
.difficulty-grid {
  gap: 10px !important;
}

.difficulty-btn {
  min-height: 78px !important;
  padding: 10px !important;
}

/* Mode de jeu */
#gameModeSelector {
  margin: 14px auto 12px !important;
}

.mode-title {
  margin-bottom: 7px !important;
}

.game-mode-btn {
  padding: 10px 16px !important;
}

/* Bouton entrer */
#enterGameBtn {
  margin-top: 8px !important;
  min-height: 58px !important;
}


/* ======================================================
   SOLO : MASQUER COMPLETEMENT L'ORDINATEUR
====================================================== */

body.solo-mode .computer-runner,
body.solo-mode .computer-track,
body.solo-mode #computerRunner,
body.solo-mode #computerTrack,
body.solo-mode [data-runner="computer"],
body.solo-mode [data-track="computer"] {
  display: none !important;
}

/* Le plateau solo respire davantage */
body.solo-mode .race-board,
body.solo-mode .track-area,
body.solo-mode .race-container {
  min-height: auto !important;
}


/* SOLO : masquer la deuxième piste */
body.solo-mode .computer-runner,
body.solo-mode .computer-track,
body.solo-mode #computerRunner,
body.solo-mode #computerTrack,
body.solo-mode [data-runner="computer"],
body.solo-mode [data-track="computer"] {
  display: none !important;
}


/* ======================================================
   SOLO : cacher complètement le 2e joueur / ancienne piste ordi
====================================================== */

body.solo-mode .runner:nth-of-type(2) {
  display: none !important;
}



/* ======================================================
   HALL MULTI RÉSEAU
====================================================== */

.multi-lobby {
  position: fixed;
  inset: 0;
  z-index: 20000;

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 25px;

  background:
    radial-gradient(
      circle at center,
      rgba(11, 45, 72, .95),
      rgba(1, 8, 18, .98)
    );

  overflow-y: auto;
}

.multi-lobby.hidden {
  display: none !important;
}

.multi-card {
  position: relative;

  width: min(680px, 95vw);

  padding: 30px;

  border: 1px solid rgba(0, 229, 255, .45);
  border-radius: 22px;

  background: rgba(7, 24, 44, .98);

  box-shadow:
    0 0 40px rgba(0, 229, 255, .16);
}

.multi-card h2 {
  margin: 5px 0 10px;

  text-align: center;

  font-size: 38px;
  letter-spacing: 4px;
}

.multi-logo {
  text-align: center;
  font-size: 46px;
}

.multi-close {
  position: absolute;
  right: 18px;
  top: 18px;

  border: 0;
  background: transparent;

  color: white;
  font-size: 24px;

  cursor: pointer;
}

.multi-status {
  margin: 12px 0 24px;

  text-align: center;

  color: #b8d0eb;
  font-weight: 700;
}

.multi-actions {
  display: grid;
  gap: 18px;
}

.multi-actions.hidden,
.multi-room-panel.hidden,
.multi-start-btn.hidden {
  display: none !important;
}

.multi-main-btn,
.multi-start-btn {
  width: 100%;

  padding: 17px 20px;

  border: 1px solid #00d9ff;
  border-radius: 12px;

  background:
    linear-gradient(
      180deg,
      rgba(21, 91, 132, .9),
      rgba(8, 43, 71, .95)
    );

  color: white;

  font-size: 17px;
  font-weight: 900;
  letter-spacing: 1px;

  cursor: pointer;

  box-shadow:
    0 0 15px rgba(0, 217, 255, .18);
}

.multi-main-btn:hover,
.multi-start-btn:hover {
  filter: brightness(1.18);
}

.multi-separator {
  display: flex;
  align-items: center;
  gap: 12px;

  opacity: .6;
}

.multi-separator span {
  flex: 1;
  height: 1px;
  background: #6384a5;
}

.join-zone {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#roomCodeInput {
  min-width: 0;

  padding: 14px;

  border: 1px solid #35688f;
  border-radius: 12px;

  outline: none;

  background: #051421;
  color: white;

  text-align: center;

  font-size: 24px;
  font-weight: 900;
  letter-spacing: 6px;
  text-transform: uppercase;
}

#roomCodeInput:focus {
  border-color: #00d9ff;

  box-shadow:
    0 0 15px rgba(0, 217, 255, .2);
}

.room-code-label {
  margin-top: 5px;

  text-align: center;

  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;

  color: #8fb1d5;
}

.room-code-display {
  margin: 8px 0;

  text-align: center;

  font-size: 48px;
  font-weight: 1000;
  letter-spacing: 10px;

  color: #35e7ff;

  text-shadow:
    0 0 15px rgba(53, 231, 255, .5);
}

.room-help {
  margin-bottom: 25px;

  text-align: center;

  color: #7896b4;
}

.players-title {
  display: flex;
  justify-content: space-between;

  margin: 15px 0 10px;

  font-weight: 900;
  letter-spacing: 1px;
}

.multi-players-list {
  display: grid;
  gap: 8px;

  margin-bottom: 20px;
}

.multi-player {
  display: grid;

  grid-template-columns:
    42px
    55px
    1fr;

  align-items: center;

  min-height: 58px;

  padding: 7px 12px;

  border: 1px solid rgba(91, 149, 194, .35);
  border-radius: 10px;

  background: rgba(17, 48, 76, .7);
}

.multi-player-number {
  color: #70a0c9;
  font-weight: 900;
}

.multi-player-avatar {
  font-size: 29px;
}

.multi-player-name {
  font-size: 18px;
  font-weight: 900;
}

.host-crown {
  margin-left: 8px;
}

.multi-start-btn {
  margin-top: 15px;

  border-color: #58ffb0;

  box-shadow:
    0 0 18px rgba(88, 255, 176, .22);
}

.multi-waiting {
  margin-top: 14px;

  text-align: center;

  color: #9eb5ca;
}

@media (max-width: 600px) {

  .multi-card {
    padding: 22px 16px;
  }

  .join-zone {
    grid-template-columns: 1fr;
  }

  .room-code-display {
    font-size: 37px;
  }
}


/* ACCUEIL : gagner un peu de hauteur */
#welcomeScreen {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

#welcomeScreen .rule,
#welcomeScreen .welcome-rule {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

#welcomeScreen .avatar-btn,
#welcomeScreen .avatar-option {
  min-height: 88px !important;
}

#welcomeScreen .difficulty-btn {
  min-height: 68px !important;
}

#gameModeSelector {
  margin: 10px auto !important;
}

#enterGameBtn {
  margin-top: 6px !important;
  min-height: 54px !important;
}

/* Encore un peu plus compact pour laisser apparaître ENTRER DANS LE JEU */

#welcomeScreen .avatar-btn,
#welcomeScreen .avatar-option {
  min-height: 76px !important;
}

#welcomeScreen .difficulty-btn {
  min-height: 58px !important;
  padding: 7px !important;
}

#gameModeSelector {
  margin-top: 6px !important;
  margin-bottom: 6px !important;
}

.game-mode-btn {
  padding: 8px 14px !important;
  min-height: 44px !important;
}

#enterGameBtn {
  margin-top: 4px !important;
  min-height: 48px !important;
}

/* Remonte le bas de l'accueil sans réduire davantage */
#gameModeSelector,
#enterGameBtn {
  transform: translateY(-35px);
}


/* CHOIX PC / MOBILE */
.display-choice {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: #06111f;
}

.display-choice-title {
  font-size: 28px;
  font-weight: 900;
  color: white;
  letter-spacing: 0.08em;
}

.display-choice-buttons {
  display: flex;
  gap: 20px;
}

.display-choice-buttons button {
  min-width: 220px;
  min-height: 90px;
  border-radius: 18px;
  border: 1px solid #26cfff;
  background: #102946;
  color: white;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
}

body.display-pc #displayChoice,
body.display-mobile #displayChoice {
  display: none;
}

@media (max-width: 700px) {
  .display-choice-buttons {
    flex-direction: column;
  }

  .display-choice-buttons button {
    min-width: 260px;
  }
}

/* ==================================================
   MODE MOBILE - ACCUEIL
   ================================================== */

body.display-mobile {
  overflow-x: hidden !important;
}

body.display-mobile #welcomeScreen {
  width: 100% !important;
  max-width: 480px !important;
  margin: 0 auto !important;
  padding: 12px !important;
  box-sizing: border-box !important;
}

/* Annule les anciens bricolages de déplacement */
body.display-mobile #gameModeSelector,
body.display-mobile #enterGameBtn {
  transform: none !important;
}

/* Règles d'intro plus compactes */
body.display-mobile #welcomeScreen .rule,
body.display-mobile #welcomeScreen .welcome-rule {
  padding: 8px 10px !important;
  margin: 6px 0 !important;
}

/* Avatars : 2 colonnes */
body.display-mobile .avatar-grid,
body.display-mobile .avatars-grid,
body.display-mobile .avatar-options {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px !important;
}

body.display-mobile .avatar-btn,
body.display-mobile .avatar-option {
  min-height: 90px !important;
  padding: 8px !important;
}

/* Difficulté : les 3 restent sur une ligne */
body.display-mobile .difficulty-options,
body.display-mobile .difficulty-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 6px !important;
}

body.display-mobile .difficulty-btn {
  min-width: 0 !important;
  min-height: 62px !important;
  padding: 6px 3px !important;
  font-size: 14px !important;
}

/* Solo / Multi */
body.display-mobile #gameModeSelector {
  margin: 10px 0 !important;
}

body.display-mobile .game-mode-options,
body.display-mobile .mode-options {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px !important;
}

body.display-mobile .game-mode-btn {
  min-width: 0 !important;
  min-height: 48px !important;
  padding: 7px !important;
  font-size: 14px !important;
}

/* Bouton entrée */
body.display-mobile #enterGameBtn {
  width: 100% !important;
  min-height: 54px !important;
  margin: 10px 0 15px !important;
  font-size: 18px !important;
}


/* ==================================================
   MODE MOBILE - ECRAN DE JEU
   ================================================== */

body.display-mobile .game-container,
body.display-mobile .game-screen,
body.display-mobile main {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

/* Plateau beaucoup plus compact */
body.display-mobile .runner {
  width: 100% !important;
  min-width: 0 !important;
  padding: 8px !important;
  margin: 6px 0 !important;
}

body.display-mobile .track,
body.display-mobile .race-track {
  transform: scaleX(0.92);
  transform-origin: left center;
}

/* Réduit les textes du plateau */
body.display-mobile .runner-name {
  font-size: 15px !important;
}

body.display-mobile .runner-position,
body.display-mobile .position-label {
  font-size: 12px !important;
}

/* Chrono SOLO */
body.display-mobile #soloChrono {
  position: fixed !important;
  top: 8px !important;
  right: 8px !important;
  left: auto !important;
  width: auto !important;
  min-width: 125px !important;
  padding: 8px 10px !important;
  font-size: 18px !important;
  z-index: 9999 !important;
  transform: none !important;
}

body.display-mobile #soloChrono * {
  font-size: inherit !important;
}

/* Carte question */
body.display-mobile .question-card,
body.display-mobile #questionArea,
body.display-mobile .question-area {
  width: calc(100% - 16px) !important;
  max-width: 100% !important;
  margin: 8px auto !important;
  padding: 14px 12px !important;
  box-sizing: border-box !important;
}

/* Catégorie */
body.display-mobile .question-category,
body.display-mobile #questionCategory {
  font-size: 14px !important;
  margin-bottom: 8px !important;
}

/* Texte de question */
body.display-mobile .question-text,
body.display-mobile #questionText {
  font-size: clamp(22px, 7vw, 34px) !important;
  line-height: 1.15 !important;
  margin: 10px 0 16px !important;
  text-align: center !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
}

/* Réponses : 1 colonne propre */
body.display-mobile .answers,
body.display-mobile .answers-grid,
body.display-mobile #answersContainer {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Boutons réponses */
body.display-mobile .answer-btn,
body.display-mobile .answer-button {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 58px !important;
  padding: 10px 12px !important;
  font-size: 18px !important;
  line-height: 1.15 !important;
  box-sizing: border-box !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

/* Lettres A B C... */
body.display-mobile .answer-letter {
  min-width: 38px !important;
  height: 38px !important;
  font-size: 18px !important;
}

/* Message sous les réponses */
body.display-mobile #questionMessage,
body.display-mobile .question-message {
  font-size: 16px !important;
  margin-top: 10px !important;
}

/* Evite tout débordement horizontal */
body.display-mobile * {
  max-width: 100%;
  box-sizing: border-box;
}


/* ==================================================
   MOBILE V2 - HAUT DU JEU
   ================================================== */

/* Le titre du jeu devient discret pendant la partie */
body.display-mobile header,
body.display-mobile .game-header,
body.display-mobile .topbar {
  min-height: 54px !important;
  padding: 6px 10px !important;
}

body.display-mobile header h1,
body.display-mobile .logo,
body.display-mobile .brand {
  font-size: 20px !important;
  line-height: 1 !important;
}

/* Chrono compact en haut à droite */
body.display-mobile #soloChrono {
  position: fixed !important;
  top: 215px !important;
  right: 8px !important;
  width: 170px !important;
  min-width: 0 !important;
  padding: 7px 10px !important;
  border-radius: 12px !important;
  z-index: 5000 !important;
}

body.display-mobile #soloChrono .solo-chrono-title {
  font-size: 12px !important;
  letter-spacing: .08em !important;
}

body.display-mobile #soloChrono .solo-chrono-time {
  font-size: 26px !important;
  line-height: 1 !important;
}

/* Carte de course */
body.display-mobile .runner {
  min-height: 175px !important;
  padding: 10px 6px !important;
  overflow: hidden !important;
}

/* Nom joueur */
body.display-mobile .runner-name {
  font-size: 17px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

/* CASE 1 / 60 */
body.display-mobile .runner-position,
body.display-mobile .position-label {
  font-size: 13px !important;
  white-space: nowrap !important;
}

/* Piste : réduction uniforme */
body.display-mobile .track,
body.display-mobile .race-track {
  width: 165% !important;
  transform: scale(.60) !important;
  transform-origin: left center !important;
}

/* Titre course */
body.display-mobile .race-title,
body.display-mobile .track-title {
  font-size: 17px !important;
  margin: 4px 0 8px !important;
}

/* Bouton START beaucoup plus raisonnable */
body.display-mobile #startBtn,
body.display-mobile .start-btn {
  width: 72% !important;
  max-width: 320px !important;
  min-height: 64px !important;
  padding: 10px !important;
  margin: 14px auto !important;
  font-size: 26px !important;
}

/* Question */
body.display-mobile #questionText,
body.display-mobile .question-text {
  font-size: 30px !important;
  line-height: 1.12 !important;
  margin: 12px 0 18px !important;
}

/* Compteur question */
body.display-mobile .question-timer,
body.display-mobile #questionTimer {
  width: 58px !important;
  height: 58px !important;
  font-size: 26px !important;
}


/* ==================================================
   MOBILE V3 - SOLO + QUESTION + REPONSES
   ================================================== */

/* SOLO : une seule piste */
body.display-mobile.solo-mode .runner:nth-of-type(2) {
  display: none !important;
}

/* Carte course moins haute quand on joue solo */
body.display-mobile.solo-mode .race-container,
body.display-mobile.solo-mode .race-board {
  min-height: 0 !important;
}

/* Question nettement plus compacte */
body.display-mobile #questionText,
body.display-mobile .question-text {
  font-size: 24px !important;
  line-height: 1.18 !important;
  margin: 8px 8px 14px !important;
  padding: 0 !important;
}

/* Carte question moins gourmande */
body.display-mobile .question-card,
body.display-mobile #questionArea,
body.display-mobile .question-area {
  padding: 12px 10px !important;
  margin: 8px auto !important;
}

/* Réponses compactes */
body.display-mobile .answers,
body.display-mobile .answers-grid,
body.display-mobile #answersContainer {
  gap: 6px !important;
}

/* Les 6 réponses doivent rester confortables mais pas énormes */
body.display-mobile .answer-btn,
body.display-mobile .answer-button {
  min-height: 50px !important;
  padding: 7px 10px !important;
  font-size: 17px !important;
  line-height: 1.1 !important;
}

/* Lettres A B C... */
body.display-mobile .answer-letter {
  min-width: 34px !important;
  width: 34px !important;
  height: 34px !important;
  font-size: 17px !important;
}

/* Catégorie + petit chrono */
body.display-mobile #questionCategory,
body.display-mobile .question-category {
  font-size: 13px !important;
}

body.display-mobile #questionTimer,
body.display-mobile .question-timer {
  width: 48px !important;
  height: 48px !important;
  font-size: 22px !important;
}


/* SOLO : cache définitivement la piste Joueur 2 */
body.solo-mode .runner:has(#computerFill) {
  display: none !important;
}


/* MOBILE : le chrono ne reste plus collé à l'écran */
body.display-mobile #soloChrono {
  position: static !important;
  width: calc(100% - 24px) !important;
  max-width: 360px !important;
  margin: 10px auto 14px !important;
  padding: 8px 12px !important;
  transform: none !important;
}

body.display-mobile #soloChrono .solo-chrono-title {
  font-size: 13px !important;
}

body.display-mobile #soloChrono .solo-chrono-time {
  font-size: 26px !important;
}


/* ==================================================
   MOBILE V4 - EPURATION
   ================================================== */

/* Sur mobile, on cache le chrono global SOLO pendant la partie */
body.display-mobile #soloChrono {
  display: none !important;
}

/* Carte question plus compacte */
body.display-mobile .question-card,
body.display-mobile #questionArea,
body.display-mobile .question-area {
  margin-top: 10px !important;
  padding: 10px !important;
}

/* Question lisible sans prendre tout l'écran */
body.display-mobile #questionText,
body.display-mobile .question-text {
  font-size: 23px !important;
  line-height: 1.16 !important;
  margin: 8px 4px 12px !important;
}

/* Réponses confortables pour les doigts */
body.display-mobile .answer-btn,
body.display-mobile .answer-button {
  min-height: 56px !important;
  padding: 10px 12px !important;
  font-size: 17px !important;
  margin: 0 !important;
}

/* Un peu plus d'air entre les réponses */
body.display-mobile .answers,
body.display-mobile .answers-grid,
body.display-mobile #answersContainer {
  gap: 8px !important;
}

/* Bouton START plus compact */
body.display-mobile #startBtn,
body.display-mobile .start-btn {
  min-height: 58px !important;
  font-size: 23px !important;
  margin: 12px auto !important;
}


/* ==================================================
   MOBILE V5 - REPONSES ADAPTATIVES
   MEMES REGLES QUE PC
   ================================================== */

/* Par défaut sur mobile : 2 colonnes */
body.display-mobile .answers,
body.display-mobile .answers-grid,
body.display-mobile #answersContainer {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

/* Boutons tactiles */
body.display-mobile .answer-btn,
body.display-mobile .answer-button {
  min-width: 0 !important;
  min-height: 58px !important;
  padding: 9px 10px !important;
  font-size: 16px !important;
  line-height: 1.12 !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
}

/* Si JS détecte des réponses longues, retour en 1 colonne */
body.display-mobile .answers.mobile-long-answers,
body.display-mobile .answers-grid.mobile-long-answers,
body.display-mobile #answersContainer.mobile-long-answers {
  grid-template-columns: 1fr !important;
}

body.display-mobile .mobile-long-answers .answer-btn,
body.display-mobile .mobile-long-answers .answer-button {
  min-height: 52px !important;
  font-size: 15px !important;
  padding: 8px 10px !important;
}


/* MOBILE V6 : réponses toujours sur 1 colonne */
body.display-mobile .answers,
body.display-mobile .answers-grid,
body.display-mobile #answersContainer {
  grid-template-columns: 1fr !important;
}

body.display-mobile .answer-btn,
body.display-mobile .answer-button {
  width: 100% !important;
  min-height: 54px !important;
  font-size: 16px !important;
  padding: 9px 12px !important;
  text-align: left !important;
}


#gameModeSelector {
  transform: none !important;
}

#enterGameBtn {
  transform: none !important;
}

/* =========================
   CLASSEMENT HEBDOMADAIRE
========================= */

.weekly-leaderboard {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(53, 214, 255, 0.25);
  border-radius: 14px;
  background: rgba(8, 24, 40, 0.72);
  box-shadow: 0 0 18px rgba(53, 214, 255, 0.08);
}

.weekly-leaderboard-title {
  margin-bottom: 10px;
  text-align: center;
  color: #57dfff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
}

.weekly-leaderboard-list {
  color: #d8e7f5;
  font-size: 13px;
  line-height: 1.6;
}

.weekly-score-row {
  display: grid;
  grid-template-columns: 30px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
}

.weekly-score-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weekly-score-points {
  color: #ffffff;
  font-weight: 900;
}

.weekly-score-time {
  color: #8fb3d4;
  font-size: 12px;
}
