/* Thème « nuit de l'Escalade » : ciel de décembre, remparts de Genève, or des torches et rouge de Genève.
   Commun au téléphone (joueur.html) et au projecteur (animateur.html). */

@property --reste {
  syntax: '<number>';
  inherits: false;
  initial-value: 1;
}
@property --tour {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}

:root {
  --nuit: #0b0d2a;
  --encre: #090a1f;
  --or: #f2c14e;
  --or-clair: #ffe29a;
  --rouge: #e0303f;
  --texte: #f8eedb;
  --texte-2: #c9bea7;
  --erreur: #ffb4a9;
  --carte: rgba(255, 244, 220, 0.07);
  --carte-2: rgba(255, 244, 220, 0.12);
  --bord: rgba(242, 193, 78, 0.3);
  --argent: #dfe3ee;
  --bronze: #e0a06a;
  --titre: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, Cambria, 'Noto Serif', serif;
  --corps: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--texte);
  font-family: var(--corps);
  line-height: 1.35;
  background:
    radial-gradient(ellipse 75% 40% at 50% 104%, rgba(255, 150, 60, 0.3), transparent 70%),
    radial-gradient(ellipse 60% 55% at 0% 0%, rgba(90, 100, 220, 0.22), transparent 60%),
    linear-gradient(180deg, #070920 0%, #111540 52%, #261a40 100%) fixed;
}

/* Étoiles, puis remparts : décor fixe derrière le contenu. */
body::before,
body::after {
  content: '';
  position: fixed;
  z-index: 0;
  pointer-events: none;
}
body::before {
  inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 22px 34px, #fff, transparent),
    radial-gradient(1px 1px at 128px 86px, #ffe9b0, transparent),
    radial-gradient(1.8px 1.8px at 214px 152px, #fff, transparent),
    radial-gradient(1px 1px at 306px 42px, #fff, transparent),
    radial-gradient(1.4px 1.4px at 344px 218px, #cfd8ff, transparent),
    radial-gradient(1px 1px at 62px 226px, #fff, transparent),
    radial-gradient(1px 1px at 180px 12px, #fff, transparent);
  background-size: 360px 260px;
  opacity: 0.75;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 50%, transparent 82%);
  mask-image: linear-gradient(180deg, #000 0%, #000 50%, transparent 82%);
  animation: scintiller 6s ease-in-out infinite alternate;
}
body::after {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--muraille, 18vh);
  background: url(/muraille.svg) center bottom / cover no-repeat;
}
@keyframes scintiller { to { opacity: 0.45; } }

main, footer { position: relative; z-index: 1; }
p { margin: 0; }
h1, h2 { margin: 0; font-family: var(--titre); font-weight: 700; line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance; }
.surtitre { margin: 0; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--or); }
.muted { color: var(--texte-2); }
.or { color: var(--or); }
.erreur { color: var(--erreur); min-height: 1.4em; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--or-clair); outline-offset: 3px; }

.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 1.1rem;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 50px -25px rgba(0, 0, 0, 0.8);
}

.btn {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd978, #e9a93a);
  color: #24140a;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 #fff3c4, 0 12px 30px -12px rgba(242, 170, 60, 0.7);
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn--discret { background: transparent; color: var(--texte-2); border: 1px solid rgba(201, 190, 167, 0.5); box-shadow: none; }

/* Médaillon de lettre (A, B, C…) */
.lettre {
  flex: none;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--or);
  border-radius: 50%;
  color: var(--or);
  font-family: var(--titre);
  font-weight: 700;
}

/* Places du classement */
.place { font-family: var(--titre); font-weight: 700; color: var(--texte-2); font-variant-numeric: tabular-nums; }
.place-1 { color: var(--or); }
.place-2 { color: var(--argent); }
.place-3 { color: var(--bronze); }

.entrer > * { animation: entrer 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.entrer > :nth-child(2) { animation-delay: 0.06s; }
.entrer > :nth-child(3) { animation-delay: 0.12s; }
.entrer > :nth-child(4) { animation-delay: 0.18s; }
.entrer > :nth-child(n + 5) { animation-delay: 0.24s; }
@keyframes entrer { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
