/* 0.9.16 — lot « ville » (docs/lots-0.9.16/CONTRAT.md) : la ville de Forbach, le jeu de la pause où
   toute la classe se retrouve (student/ville.js, games/ville.js). Un écran de jeu sombre, l'image en
   gros pixels agrandie sans lissage, et par-dessus des indications nettes et lisibles (texte au
   contour sombre, comme sur les bornes d'arcade), de grands boutons « à touches » et des fenêtres
   crème bordées de noir, façon fin des années 80. Couleurs : celles de la palette du jeu
   (games/ville-dessin.js), notées ici en variables. */

.vl-page, .vl-jeu {
  --vl-nuit: #1a1530;
  --vl-ombre: #3a3358;
  --vl-creme: #f6f1e4;
  --vl-jaune: #f7d84a;
  --vl-vert: #3f8f3a;
  --vl-vert-o: #2a6a28;
  --vl-rouge: #ff8a7a;
  --vl-brun: #7a4a2a;
  --vl-contour: -2px 0 var(--vl-nuit), 2px 0 var(--vl-nuit), 0 -2px var(--vl-nuit), 0 2px var(--vl-nuit), 2px 2px var(--vl-nuit), -2px 2px var(--vl-nuit), 2px -2px var(--vl-nuit), -2px -2px var(--vl-nuit);
}

/* La page de l'élève : tout l'écran sous la barre du haut. */
.vl-page {
  position: relative;
  display: flex;
  height: calc(100vh - var(--topbar-h, 58px));
  height: calc(100dvh - var(--topbar-h, 58px));
  margin-bottom: -40px;            /* (.page.focus garde 40 px en bas : la ville va jusqu'au bord) */
  overflow: hidden;
  background: var(--vl-nuit);
}

/* Le jeu */
.vl-jeu {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: var(--vl-nuit);
  color: var(--vl-creme);
  font-family: var(--title-font);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
/* L'enseignant regarde la ville dans la page de la pause (sans jouer) : un cadre. */
.vl-jeu.regarder { flex: none; width: 100%; height: min(68vh, 620px); border-radius: 18px; touch-action: none; }
.vl-ecran {
  position: absolute; left: 0; top: 0; display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}
.vl-jeu.regarder .vl-ecran { cursor: grab; }

/* Les prénoms au-dessus des têtes, les panneaux des lieux */
.vl-etiquettes { position: absolute; left: 0; top: 0; overflow: hidden; pointer-events: none; }
.vl-etiq { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; line-height: 1.2; }
.vl-nom { padding: 1px 7px 2px; border-radius: 7px; background: rgb(26 21 48 / 74%); color: var(--vl-creme); font-weight: 700; font-size: 13.5px; }
.vl-nom.vl-moi { background: var(--vl-jaune); color: var(--vl-nuit); }
.vl-lieu { padding: 2px 8px; border: 2px solid var(--vl-brun); border-radius: 4px; background: var(--vl-creme); color: var(--vl-nuit); font-weight: 700; font-size: 13px; box-shadow: 0 3px 0 rgb(26 21 48 / 45%); }

/* Les indications (score, temps, plan, bonus, messages) */
.vl-hud { position: absolute; inset: 0; pointer-events: none; }
.vl-hud-g { position: absolute; left: 14px; top: 10px; max-width: 40%; }
.vl-score { font-size: 32px; font-weight: 800; line-height: 1.1; text-shadow: var(--vl-contour); font-variant-numeric: tabular-nums; }
.vl-jeu[data-mode="accueil"] .vl-score, .vl-jeu[data-mode="chargement"] .vl-score, .vl-jeu[data-mode="ferme"] .vl-score { visibility: hidden; }
.vl-serie-l { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.vl-serie { font-size: 17px; font-weight: 800; color: var(--vl-jaune); text-shadow: var(--vl-contour); }
.vl-serie-barre { display: block; width: 90px; height: 9px; border: 2px solid var(--vl-nuit); border-radius: 3px; background: rgb(26 21 48 / 60%); overflow: hidden; }
.vl-serie-barre > i { display: block; height: 100%; width: 0; background: var(--vl-jaune); }
.vl-hud-c { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.vl-temps { font-size: 30px; font-weight: 800; line-height: 1.1; text-shadow: var(--vl-contour); font-variant-numeric: tabular-nums; }
.vl-temps:empty { display: none; }
.vl-jeu.vite .vl-temps { color: var(--vl-rouge); animation: vl-battre 1s steps(2, jump-none) infinite; }
@keyframes vl-battre { 50% { transform: scale(1.12); } }
.vl-fete { padding: 4px 14px; border: 3px solid var(--vl-nuit); border-radius: 999px; background: var(--vl-jaune); color: var(--vl-nuit); font-size: 16px; font-weight: 800; white-space: nowrap; box-shadow: 0 3px 0 var(--vl-nuit); }
.vl-fete:empty { display: none; }
.vl-hud-d { position: absolute; right: 12px; top: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.vl-boutons { display: flex; gap: 8px; pointer-events: auto; }
.vl-carte { width: 192px; height: auto; border: 3px solid var(--vl-nuit); border-radius: 8px; background: #163f24; image-rendering: pixelated; box-shadow: 0 3px 0 rgb(26 21 48 / 55%); }
.vl-qui { font-size: 14px; font-weight: 700; text-shadow: var(--vl-contour); }
.vl-qui:empty { display: none; }
.vl-bonus { position: absolute; right: 16px; bottom: 14px; font-size: 24px; font-weight: 800; white-space: pre; text-shadow: var(--vl-contour); }
.vl-fil { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(92%, 640px); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vl-msg { margin: 0; padding: 6px 16px; border: 2px solid var(--vl-nuit); border-radius: 12px; background: rgb(246 241 228 / 94%); color: var(--vl-nuit); font-size: 16.5px; font-weight: 700; text-align: center; animation: vl-msg .25s steps(3) both; }
@keyframes vl-msg { from { transform: translateY(10px); opacity: 0; } }
.vl-reseau { position: absolute; left: 14px; bottom: 14px; padding: 4px 12px; border-radius: 10px; background: rgb(26 21 48 / 85%); font-size: 14px; font-weight: 700; }
.vl-jeu.tactile .vl-reseau { left: auto; right: 14px; bottom: 54px; }
.vl-fleche { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; margin: -18px 0 0 -40px; width: 80px; }
.vl-fleche-pointe { display: block; font-size: 30px; line-height: 1; color: var(--vl-jaune); text-shadow: var(--vl-contour); }
.vl-fleche-nom { margin-top: 2px; font-size: 12.5px; font-weight: 800; color: var(--vl-jaune); text-shadow: var(--vl-contour); white-space: nowrap; }
.vl-jeu:not([data-mode="jeu"]) .vl-fleche { display: none; }

/* « 3, 2, 1, partez ! » */
.vl-decompte { position: absolute; inset: 0 0 auto; top: 14%; display: grid; justify-items: center; font-size: 130px; font-weight: 800; color: var(--vl-jaune); text-shadow: -5px 0 var(--vl-nuit), 5px 0 var(--vl-nuit), 0 -5px var(--vl-nuit), 0 5px var(--vl-nuit), 5px 5px var(--vl-nuit), -5px 5px var(--vl-nuit), 5px -5px var(--vl-nuit), -5px -5px var(--vl-nuit); pointer-events: none; }
.vl-decompte:empty { display: none; }
.vl-decompte.partez { font-size: 92px; color: var(--vl-creme); }

/* Les fenêtres : accueil, fin de partie */
.vl-panneau-fond { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; overflow: auto; background: rgb(26 21 48 / 42%); }
.vl-panneau {
  width: min(600px, 100%);
  margin: auto;
  padding: 20px 24px 22px;
  border: 4px solid var(--vl-nuit);
  border-radius: 18px;
  background: var(--vl-creme);
  color: var(--vl-nuit);
  box-shadow: 0 8px 0 var(--vl-nuit), 0 18px 40px rgb(0 0 0 / 35%);
  font-family: var(--ui-font);
  text-align: center;
}
.vl-panneau h2 { margin: 0 0 6px; font-family: var(--title-font); font-size: 28px; line-height: 1.2; color: var(--vl-nuit); }
.vl-but { margin: 0 0 12px; font-family: var(--title-font); font-size: 21px; font-weight: 700; }
.vl-touches { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.vl-cles { display: inline-flex; gap: 4px; }
.vl-panneau kbd { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border: 2px solid var(--vl-nuit); border-radius: 7px; background: #fff; box-shadow: 0 3px 0 var(--vl-nuit); font: 800 17px/1 var(--title-font); color: var(--vl-nuit); }
.vl-tactile-seul { display: none; }
.vl-jeu.tactile .vl-tactile-seul { display: inline; }
.vl-legende { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; margin: 0 0 12px; padding: 0; list-style: none; }
.vl-legende li { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 2px solid var(--vl-nuit); border-radius: 10px; background: #fff; font-family: var(--title-font); font-size: 16px; }
.vl-legende li span { font-size: 13.5px; font-weight: 700; }
.vl-icone { height: 30px; width: auto; image-rendering: pixelated; }
.vl-astuce { margin: 0 0 10px; font-size: 15.5px; color: #3a3358; }
.vl-record { margin: 0 0 10px; font-family: var(--title-font); font-size: 18px; font-weight: 700; }
.vl-erreur { margin: 0 0 8px; min-height: 1em; font-weight: 700; color: #9a3a25; }
.vl-erreur:empty { display: none; }
.vl-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
.vl-score-fin { margin: 4px 0 6px; font-family: var(--title-font); font-size: 40px; font-weight: 800; }
.vl-nouveau { margin: 0 0 8px; font-family: var(--title-font); font-size: 22px; font-weight: 800; color: #b07a00; }
.vl-stats { margin: 0 0 12px; font-size: 15.5px; color: #3a3358; }
.vl-podium { display: flex; justify-content: center; gap: 10px; margin: 4px 0 14px; padding: 0; list-style: none; }
.vl-podium li { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 96px; padding: 8px 10px; border: 2px solid var(--vl-nuit); border-radius: 12px; background: #fff; font-size: 14.5px; }
.vl-podium li.moi { background: #fff4d9; border-width: 3px; }
.vl-podium b { font-family: var(--title-font); font-size: 16px; }
.vl-podium em { font-style: normal; font-weight: 700; color: #b07a00; font-size: 13.5px; }
.vl-medaille { font-size: 24px; line-height: 1; }

/* Les boutons « à touches » */
.vl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 8px 18px;
  border: 3px solid var(--vl-nuit); border-radius: 12px;
  background: var(--vl-jaune); color: var(--vl-nuit);
  box-shadow: 0 4px 0 var(--vl-nuit);
  font: 800 17px/1.15 var(--title-font);
  cursor: pointer;
  pointer-events: auto;
}
.vl-btn:hover { filter: brightness(1.05); }
.vl-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--vl-nuit); }
.vl-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.vl-btn:disabled { cursor: default; opacity: .6; transform: none; box-shadow: 0 4px 0 var(--vl-nuit); filter: none; }
.vl-btn[aria-pressed="true"] { background: #9fe0a0; }
.vl-btn.small { min-height: 34px; padding: 4px 10px; font-size: 14px; box-shadow: 0 3px 0 var(--vl-nuit); }
.vl-principal { min-height: 56px; padding: 10px 28px; background: var(--vl-vert); color: #fff; font-size: 22px; }
.vl-son { min-width: 46px; padding: 6px 10px; font-size: 20px; }
.vl-hud-d .vl-btn { min-height: 42px; }

/* La croix à l'écran (écran tactile) */
.vl-croix { display: none; position: absolute; left: 18px; bottom: 18px; width: 150px; height: 150px; border: 3px solid rgb(246 241 228 / 65%); border-radius: 50%; background: rgb(26 21 48 / 35%); touch-action: none; pointer-events: auto; }
.vl-jeu.tactile .vl-croix { display: block; }
.vl-cf { position: absolute; font-size: 19px; line-height: 1; color: rgb(246 241 228 / 75%); }
.vl-cf-h { top: 9px; left: 50%; transform: translateX(-50%); }
.vl-cf-b { bottom: 9px; left: 50%; transform: translateX(-50%); }
.vl-cf-g { left: 10px; top: 50%; transform: translateY(-50%); }
.vl-cf-d { right: 10px; top: 50%; transform: translateY(-50%); }
.vl-croix-centre { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border: 3px solid var(--vl-nuit); border-radius: 50%; background: var(--vl-creme); box-shadow: 0 4px 0 var(--vl-nuit); transform: translate(var(--dx, 0px), var(--dy, 0px)); }
.vl-jeu.tactile .vl-fil { bottom: 180px; }

/* L'enseignant : suivre un élève */
.vl-regard { margin: 0 0 6px; font-size: 15px; font-weight: 700; text-shadow: var(--vl-contour); }
.vl-suivre { display: flex; flex-wrap: wrap; gap: 6px; pointer-events: auto; }
.vl-vide { font-size: 14px; text-shadow: var(--vl-contour); }

/* La ville fermée (hors de la pause) */
.vl-ferme { margin: auto; width: min(560px, calc(100% - 32px)); padding: 30px 26px; border: 4px solid var(--vl-nuit); border-radius: 22px; background: var(--vl-creme); color: var(--vl-nuit); box-shadow: 0 8px 0 var(--vl-nuit); text-align: center; font-size: 18px; }
.vl-ferme h1 { margin: 6px 0 10px; font-size: 30px; color: var(--vl-nuit); }
.vl-ferme-emoji { font-size: 64px; line-height: 1; }
.vl-ferme-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 18px; }

/* 0.9.18 — lot « ville » : les Missions de Jean Moulin (lot 1, docs/lots-0.9.18/ville.md). Une seule
   chose à la fois : la carte de l'objectif (un dessin, une phrase, l'étape « 1 / 2 », « Écouter »), la
   flèche de mission (sa pointe, son dessin et son nom), UN bouton d'action (« Parler », « Prendre »,
   « Donner » ; la touche Espace sur un ordinateur, un gros bouton au doigt), le panneau de l'AED
   (0.9.18.1 : « la surveillante » avant ; au plus trois choix). Contrastes : texte nuit sur crème,
   jaune sur nuit (plus de 10:1). */
.vl-mission { display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(380px, 100%); margin-top: 10px; padding: 7px 8px 7px 7px; border: 3px solid var(--vl-nuit); border-radius: 14px; background: rgb(246 241 228 / 96%); color: var(--vl-nuit); box-shadow: 0 4px 0 rgb(26 21 48 / 55%); font-family: var(--ui-font); pointer-events: auto; }
.vl-mission[hidden] { display: none; }
.vl-mission[data-etat="bravo"] { background: #fff1bf; }
.vl-mission-dessin { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border: 2px solid var(--vl-nuit); border-radius: 10px; background: #fff; }
.vl-mission-dessin .vl-icone { height: 34px; }
.vl-mission-mots { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.vl-mission-texte { font-size: 17px; font-weight: 800; line-height: 1.2; }
.vl-mission-etape { padding: 1px 9px; border-radius: 999px; background: var(--vl-nuit); color: var(--vl-jaune); font: 800 15px/1.35 var(--title-font); font-variant-numeric: tabular-nums; }
.vl-mission-etape[hidden] { display: none; }
.vl-ecouter { flex: none; min-width: 44px; min-height: 44px; padding: 4px; font-size: 20px; }
.vl-panneau .vl-btn:focus-visible, .vl-mission .vl-btn:focus-visible, .vl-choix-carte:focus-visible, .vl-action:focus-visible { outline: 4px solid #2c3f8c; outline-offset: 3px; }

.vl-action { position: absolute; right: 18px; bottom: 60px; display: inline-flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 18px; border: 3px solid var(--vl-nuit); border-radius: 16px; background: var(--vl-jaune); color: var(--vl-nuit); box-shadow: 0 5px 0 var(--vl-nuit); font: 800 22px/1 var(--title-font); cursor: pointer; pointer-events: auto; animation: vl-action .2s steps(3) both; }
.vl-action[hidden] { display: none; }
.vl-action:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--vl-nuit); }
.vl-action[aria-busy="true"] { opacity: .75; }
.vl-action-icone { font-size: 26px; line-height: 1; }
.vl-action-touche { padding: 4px 7px; border: 2px solid var(--vl-nuit); border-radius: 7px; background: #fff; box-shadow: 0 2px 0 var(--vl-nuit); font: 800 13px/1 var(--title-font); color: var(--vl-nuit); }
@keyframes vl-action { from { transform: scale(.85); } }
.vl-jeu.tactile .vl-action { right: 24px; bottom: 30px; min-width: 170px; min-height: 92px; padding: 10px 24px; border-radius: 24px; font-size: 28px; justify-content: center; }
.vl-jeu.tactile .vl-action-touche { display: none; }
.vl-jeu.tactile.avec-action .vl-bonus { bottom: 136px; }

/* La flèche vers l'étape d'une mission : la même pointe, et une étiquette (dessin et nom) */
.vl-fleche.mission { width: 120px; margin-left: -60px; }
.vl-fleche.mission .vl-fleche-nom { padding: 2px 8px; border: 2px solid var(--vl-nuit); border-radius: 8px; background: var(--vl-creme); color: var(--vl-nuit); text-shadow: none; font-size: 14px; }

/* Les étiquettes : l'AED (son rôle), la caisse du CDI (combien de livres) */
.vl-nom.vl-pnj { background: #7e2430; color: #fff; }
.vl-lieu.vl-caisse { font-variant-numeric: tabular-nums; }

/* Le panneau de l'AED */
.vl-dialogue { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; text-align: left; }
.vl-dialogue .vl-icone { flex: none; height: 64px; }
.vl-dialogue h2 { margin: 0; }
.vl-dialogue .vl-but { margin: 2px 0 0; }
.vl-choix { display: grid; gap: 10px; margin: 0 0 6px; }
.vl-choix-carte { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; border: 3px solid var(--vl-nuit); border-radius: 14px; background: #fff; color: var(--vl-nuit); box-shadow: 0 4px 0 var(--vl-nuit); font: inherit; text-align: left; cursor: pointer; }
.vl-choix-carte:hover:not(:disabled) { background: #fff6dc; }
.vl-choix-carte:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--vl-nuit); }
.vl-choix-carte:disabled { cursor: default; background: #ece6d6; box-shadow: 0 2px 0 var(--vl-nuit); }
.vl-choix-carte .vl-icone { justify-self: center; height: 40px; }
.vl-choix-mots { display: flex; flex-direction: column; gap: 2px; }
.vl-choix-mots b { font: 800 19px/1.2 var(--title-font); }
.vl-choix-mots span { font-size: 16px; line-height: 1.3; }
.vl-choix-info { padding: 2px 10px; border-radius: 999px; background: var(--vl-nuit); color: var(--vl-jaune); font: 800 15px/1.4 var(--title-font); white-space: nowrap; font-variant-numeric: tabular-nums; }
.vl-astuce-mission { font-weight: 700; }
/* Après la relecture : une mission qui ne tient plus dans le temps qui reste (grisée, et ses mots
   « ⏳ Plus le temps ») ; ce que mes livres me vaudront (fin de la partie, accueil). */
.vl-choix-carte.trop-tard .vl-choix-info { background: var(--vl-ombre); color: #fff; }
.vl-livres-dus { font-weight: 700; color: var(--vl-nuit); }

/* 0.9.18.1 — lot « ville » (docs/lots-0.9.18.1/ville.md) : la fin de la pause annoncée, en haut à
   droite sous les boutons : « ☕ Fin de la pause dans 3:12 » (des mots, pas une couleur seule). Texte
   crème sur nuit (plus de 9:1, quel que soit le dessin dessous). Au-dessus du voile des fenêtres
   (l'accueil, la fin de la partie : on la lit pour décider de jouer). Dans la dernière minute : plus
   grande, nuit sur jaune (plus de 12:1), bordée plus épais, une ombre (la forme change aussi). Toute
   ronde, comme l'annonce d'une fête (.vl-fete) : une information, pas un bouton (coins de 12 px). */
.vl-fin-pause { position: relative; z-index: 1; padding: 3px 13px; border: 2px solid var(--vl-nuit); border-radius: 999px; background: rgb(26 21 48 / 84%); color: var(--vl-creme); font: 800 15px/1.3 var(--title-font); white-space: nowrap; font-variant-numeric: tabular-nums; }
.vl-fin-pause[hidden] { display: none; }
.vl-fin-pause.bientot { padding: 5px 16px; border-width: 3px; background: var(--vl-jaune); color: var(--vl-nuit); font-size: 21px; box-shadow: 0 3px 0 var(--vl-nuit); }
/* 0.9.18.1 : une mise à jour installée pendant qu'on est dans la ville : le message, puis la ville se
   recharge (games/ville.js, miseAJour) */
.vl-maj-icone { margin: 0 0 8px; font-size: 52px; line-height: 1; }
.vl-panneau .vl-maj { margin-bottom: 4px; }

/* Petits écrans (téléphone, iPad en portrait) */
@media (max-width: 760px) {
  .vl-score, .vl-temps { font-size: 24px; }
  .vl-carte { width: 132px; }
  .vl-hud-d .vl-btn { min-height: 38px; padding: 4px 10px; font-size: 14px; }
  .vl-fete { font-size: 13px; white-space: normal; max-width: 60vw; }
  .vl-decompte { font-size: 96px; }
  .vl-panneau h2 { font-size: 23px; }
  .vl-but { font-size: 18px; }
}
@media (max-width: 760px) {
  .vl-mission { max-width: 62vw; }
  .vl-mission-texte { font-size: 15px; }
  .vl-choix-carte { grid-template-columns: 40px 1fr; }
  .vl-choix-info { grid-column: 2; justify-self: start; }
  /* (0.9.18.1) la fin de la pause sur deux lignes s'il le faut */
  .vl-fin-pause { max-width: 46vw; white-space: normal; text-align: right; font-size: 13px; }
  .vl-fin-pause.bientot { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .vl-jeu.vite .vl-temps, .vl-msg, .vl-action { animation: none; }
}
