/* ---------- le mode SPEEDRUN du mode Histoire (13 nov. 2026, src/story/speedrun.js, src/ui/story.js storySpeedrun) ----------
   Le chrono pendant la course : à droite, au milieu de la hauteur (le guide et la carte en haut à droite, l'objectif en haut
   à gauche restent libres), chiffres de chronomètre au centième ; les passages faits et le prochain, l'écart avec mon record
   en vert (en avance) ou en rouge (en retard), l'écart avec le record du monde en plus petit. */
.sr-hud { position: fixed; right: max(10px, env(safe-area-inset-right, 0px)); top: 38%; z-index: 60; pointer-events: none;
  display: grid; gap: 4px; justify-items: end; font-family: 'Barlow Condensed', system-ui, sans-serif; color: #f3ecd9; }
.sr-clock { font-family: 'Anton', 'Barlow Condensed', sans-serif; font-size: 34px; line-height: 1; letter-spacing: .02em; font-variant-numeric: tabular-nums;
  color: #ffd23a; -webkit-text-stroke: 1.5px #0b0f24; paint-order: stroke fill; text-shadow: 3px 3px 0 #e8202e; }
.sr-clock.wait { color: #a6acd0; text-shadow: none; }
.sr-clock.done { color: #3ee08a; animation: sr-pop .5s ease-out; }
@keyframes sr-pop { from { transform: scale(1.35); } to { transform: scale(1); } }
.sr-rows { display: grid; gap: 2px; min-width: 210px; }
.sr-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: baseline; padding: 2px 8px; background: rgba(11, 15, 36, .72);
  border-left: 3px solid #2c3570; font-size: 15px; font-variant-numeric: tabular-nums; }
.sr-row.cur { border-left-color: #ffd23a; }
.sr-row span { font-weight: 600; letter-spacing: .02em; }
.sr-row b { font-weight: 700; }
.sr-row i { font-style: normal; font-weight: 700; }
.sr-row i.ahead { color: #3ee08a; }
.sr-row i.behind { color: #ff5b62; }
.sr-row em { grid-column: 1 / -1; justify-self: end; font-style: normal; font-size: 12px; color: #a6acd0; }
.sr-row em i { font-size: 12px; }
.sr-note { font-size: 13px; color: #a6acd0; max-width: 260px; text-align: right; text-shadow: 0 1px 0 #000; }
@media (prefers-reduced-motion: reduce) { .sr-clock.done { animation: none; } }

/* l'écran SPEEDRUN (depuis HISTOIRE, X) : sur la grille 640 × 360 du jeu */
.px.sr-screen { display: grid; place-items: center; }
.sr-screen .sr-box { width: 560px; max-width: 96%; background: #141a3d; border: 3px solid #0b0f24; box-shadow: 5px 5px 0 #e8202e; padding: 12px 14px; display: grid; gap: 8px; color: #f3ecd9;
  font-family: 'Barlow Condensed', system-ui, sans-serif; font-size: 11px; }
.sr-screen .sr-title { font-family: 'Bangers', sans-serif; font-weight: 400; font-size: 30px; letter-spacing: .04em; color: #ffd23a; -webkit-text-stroke: 1px #0b0f24; paint-order: stroke fill; line-height: 1; }
.sr-screen .sr-rules { margin: 0; color: #c9cbe3; line-height: 1.3; }
.sr-screen .sr-cols { display: grid; grid-template-columns: 180px 1fr; gap: 12px; }
.sr-screen i { font-style: normal; font-size: 10px; letter-spacing: .1em; color: #ffd23a; display: block; }
.sr-screen .sr-me em { font-style: normal; font-family: 'Anton', sans-serif; font-size: 26px; font-variant-numeric: tabular-nums; display: block; }
.sr-screen .sr-vid { display: grid; gap: 3px; margin-top: 6px; }
.sr-screen .sr-vid small { color: #a6acd0; }
.sr-screen .sr-vid label { font-size: 10px; color: #c9cbe3; }
.sr-screen .sr-vid input { font: inherit; font-size: 10px; background: #0b0f24; color: #f3ecd9; border: 2px solid #2c3570; padding: 3px 5px; min-width: 0; }
.sr-screen .sr-vid input:focus-visible { outline: 2px solid #ffd23a; }
.sr-screen .sr-vid button { font-family: 'Bangers', sans-serif; font-size: 13px; letter-spacing: .05em; background: #ffd23a; color: #0b0f24; border: 2px solid #0b0f24; cursor: pointer; padding: 2px 6px; justify-self: start; }
.sr-screen .sr-msg { font-size: 10px; color: #3ee08a; min-height: 12px; }
.sr-screen .sr-list { display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.sr-screen .sr-wr { font-family: 'Bangers', sans-serif; font-size: 14px; letter-spacing: .03em; color: #ffd23a; margin-bottom: 2px; }
.sr-screen .sr-line { display: grid; grid-template-columns: 18px 1fr auto 72px; gap: 6px; align-items: baseline; padding: 1px 4px; background: #1b2250; }
.sr-screen .sr-line.me { outline: 1px solid #ffd23a; }
.sr-screen .sr-line b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-screen .sr-line em { font-style: normal; font-weight: 700; }
.sr-screen .sr-line small { color: #a6acd0; text-align: right; }
.sr-screen .sr-keys { display: flex; gap: 14px; justify-content: flex-end; font-size: 12px; }
.sr-screen .sr-keys span { cursor: pointer; }
.sr-screen .sr-go { color: #ffd23a; }
.st-shelf-sr { cursor: pointer; color: #ffd23a; }

/* le rappel d'enregistrer son écran (13 nov. 2026, le créateur) : sur l'écran du mode, et 10 s au départ de la course */
.sr-screen .sr-rec { margin: 0; padding: 5px 7px; background: #2a0f16; border-left: 3px solid #e8202e; color: #f3ecd9; line-height: 1.3; }
.sr-screen .sr-rec b { color: #ff5b62; margin-right: 4px; letter-spacing: .04em; }
.sr-screen .sr-rec.hot { animation: sr-blink .9s steps(2) infinite; }
.sr-hud.rec .sr-note { color: #ff5b62; font-weight: 700; font-size: 15px; }
@keyframes sr-blink { 50% { background: #4a1420; } }
@media (prefers-reduced-motion: reduce) { .sr-screen .sr-rec.hot { animation: none; } }

/* le choix du genre de partie, après le mode joli / grille-pain (Screens.storyKind) : la carte SPEEDRUN, un chronomètre doré
   dont l'aiguille file, la carte cerclée de rouge quand elle est choisie */
.st-kind .st-gfx-c.srk.on { border-color: #ff5b62; box-shadow: 0 0 26px rgba(232, 32, 46, .55); }
.st-kind .st-gfx-c.srk em { background: #e8202e; color: #fff; }
.st-kind .sr-watch { position: absolute; left: 50%; top: 14px; width: 58px; height: 58px; margin-left: -29px; border-radius: 50%; box-sizing: border-box;
  background: repeating-conic-gradient(from 0deg, rgba(255, 216, 74, .9) 0 2deg, transparent 2deg 30deg), radial-gradient(circle, #1d1a10 0 60%, #ffd23a 61% 70%, #8a5a08 71%);
  border: 2px solid #1a1020; box-shadow: 0 0 18px rgba(255, 200, 60, .5); }
.st-kind .sr-watch .hand { position: absolute; left: 50%; top: 9px; width: 2px; height: 20px; margin-left: -1px; background: linear-gradient(#ff3b3b, #ffd84a); transform-origin: 50% 20px; }
.st-kind .sr-watch .crown { position: absolute; left: 50%; top: -9px; width: 10px; height: 7px; margin-left: -5px; background: #ffd23a; border: 2px solid #1a1020; border-radius: 2px; }
.st-kind .on .sr-watch .hand { animation: pc-hand 1.2s steps(60) infinite; }
.st-kind .on .sr-watch { animation: sr-tick 1.2s ease-in-out infinite; }
@keyframes sr-tick { 50% { transform: scale(1.06); } }
@keyframes pc-hand { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .st-kind .on .sr-watch, .st-kind .on .sr-watch .hand { animation: none; } }
/* (les deux cartes à la même hauteur, celle du plus long texte : le record et l'avertissement « aucune sauvegarde » de SPEEDRUN) */
.st-kind .st-gfx-c { height: auto; min-height: 196px; padding-bottom: 12px; }
