/* style.css -- habillage de l interface de GTA WASQUEHAL 2D */

:root {
  --encre: #2a241c;
  --papier: #efeae0;
  --voile: rgba(26, 22, 17, 0.72);
  --accent: #c9542f;
  --ombre: 0 6px 22px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #1a1611; color: var(--encre);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  user-select: none; -webkit-user-select: none;
}

#scene, #scene3d, #calque { position: fixed; inset: 0; display: block; cursor: crosshair; }
#calque { pointer-events: none; }
#scene3d, #calque { display: none; }

/* ---------- tete haute ---------- */
#hud {
  position: fixed; left: 18px; bottom: 18px; z-index: 10;
  display: flex; align-items: flex-end; gap: 16px; pointer-events: none;
}

#compteur {
  background: rgba(22, 18, 14, 0.9); color: #f4efe4;
  border-radius: 12px; padding: 10px 16px 8px; min-width: 128px;
}
#vitesse {
  font-size: 40px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -1px;
  transition: color .18s;
}
#vitesse.derape { color: #ffb34d; }
#unite { font-size: 12px; opacity: .72; margin-left: 5px; font-style: normal; }
#vehicule { display: block; font-size: 11px; opacity: .6; margin-top: 3px; min-height: 13px; }

#lieu {
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(22, 18, 14, 0.9); border-radius: 10px;
  padding: 8px 14px; box-shadow: var(--ombre);
}
#quartier { font-size: 15px; font-weight: 700; color: #f0d9a8; min-height: 20px; }
#rue { font-size: 13px; color: #e6dfd2; min-height: 18px; }

/* ---------- coin droit ---------- */
#coinDroit {
  position: fixed; right: 18px; top: 18px; z-index: 10;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
#minimap {
  width: 168px; height: 168px; border-radius: 50%;
  box-shadow: var(--ombre); background: #cfc9bb;
}
#boutons { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
#boutons button {
  font: inherit; font-size: 11.5px; text-align: left;
  background: rgba(22, 18, 14, 0.9); color: #efe9dd;
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 7px;
}
#boutons button:hover { background: rgba(50, 42, 32, 0.9); }
#boutons b { color: #ffc46b; }

/* ---------- annonces ---------- */
#annonces {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%);
  z-index: 12; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none; width: min(560px, 90vw);
}
.annonce {
  background: rgba(22, 18, 14, 0.93); color: #f4efe4;
  border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 8px 15px; box-shadow: var(--ombre);
  opacity: 0; transform: translateY(-10px); transition: opacity .35s, transform .35s;
}
.annonce.visible { opacity: 1; transform: none; }
.annonce b { display: block; font-size: 15px; }
.annonce span { display: block; font-size: 11.5px; opacity: .68; margin-top: 1px; }
.annonce.quartier { border-left-color: #e8b64d; }
.annonce.quartier b { font-size: 21px; letter-spacing: .4px; }
.annonce.enseigne { border-left-color: #6fb36a; }
.annonce.mode { border-left-color: #5ba3d0; }
.annonce.avert { border-left-color: #d8553f; }
.annonce.debug { border-left-color: #9a8fd0; }

/* ---------- debug ---------- */
#debug {
  position: fixed; left: 18px; top: 18px; z-index: 10;
  font: 11px/1.5 "Cascadia Mono", Consolas, monospace;
  color: #e9e2d4; background: rgba(22, 18, 14, 0.66);
  padding: 5px 9px; border-radius: 6px; max-width: 54vw;
  pointer-events: none;
}

#attribution {
  position: fixed; right: 14px; bottom: 10px; z-index: 10;
  font-size: 10.5px; color: rgba(245, 240, 232, 0.86);
  background: rgba(22, 18, 14, 0.82); padding: 5px 10px; border-radius: 7px;
  text-align: right; max-width: 46vw; pointer-events: none; line-height: 1.5;
}

/* ---------- voiles ---------- */
.voile {
  position: fixed; inset: 0; z-index: 20; display: none;
}
.voile.ouvert { display: block; }

#carte canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
#carte .barre {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2;
  background: rgba(22, 18, 14, 0.86); color: #f2ece0;
  padding: 9px 18px; display: flex; gap: 16px; align-items: baseline;
}
#carte .barre span { font-size: 11.5px; opacity: .66; }

.panneau {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(800px, 92vw); max-height: 88vh; overflow: auto;
  background: var(--papier); border-radius: 14px; padding: 26px 30px 22px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
}
.panneau h2 { margin: 0 0 14px; font-size: 24px; letter-spacing: .5px; }
.panneau h2 small { font-size: 13px; font-weight: 400; opacity: .6; margin-left: 8px; }
.panneau h3 {
  margin: 20px 0 7px; font-size: 13px; text-transform: uppercase;
  letter-spacing: 1.2px; color: #7a6b56;
}
.panneau p { margin: 7px 0; font-size: 13.5px; line-height: 1.6; }
.panneau ul { margin: 6px 0; padding-left: 20px; font-size: 13px; line-height: 1.7; }
.panneau .src { color: #86785f; font-size: 11.5px; }
.panneau .note, .panneau .avert {
  background: rgba(201, 84, 47, 0.1); border-left: 3px solid var(--accent);
  padding: 9px 13px; border-radius: 0 6px 6px 0; font-size: 12.5px;
}
.panneau .avert { background: rgba(216, 85, 63, 0.14); }
.panneau .attr { font-weight: 600; font-size: 14px; }
.panneau table { width: 100%; border-collapse: collapse; font-size: 13px; }
.panneau td { padding: 5px 8px; border-bottom: 1px solid rgba(0, 0, 0, .07); vertical-align: top; }
.panneau td:first-child { white-space: nowrap; font-weight: 600; width: 36%; }
.panneau td em { font-weight: 400; opacity: .6; font-style: normal; }
.panneau button {
  margin-top: 18px; font: inherit; font-size: 13px; padding: 8px 18px;
  background: var(--encre); color: var(--papier); border: 0;
  border-radius: 7px; cursor: pointer;
}
.panneau .quartiers li { margin-bottom: 2px; }

/* ---------- chargement ---------- */
#chargement {
  position: fixed; inset: 0; z-index: 40; background: #17130f;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .6s; color: #efe9dd; text-align: center;
}
#chargement.parti { opacity: 0; pointer-events: none; }
#chargement h1 {
  font-size: 44px; margin: 0 0 10px; letter-spacing: 3px; font-weight: 800;
  color: #f0d9a8;
}
#chargement p { margin: 5px 0; font-size: 13px; opacity: .72; }
#chargement .etat { color: #ffc46b; font-size: 12.5px; min-height: 18px; }
#chargement .petit { font-size: 10.5px; opacity: .45; margin-top: 22px; max-width: 420px; }

@media (max-width: 760px) {
  #hud { bottom: 48px; }
  #minimap { width: 112px; height: 112px; }
  #boutons button { font-size: 10.5px; }
  #debug { max-width: 92vw; font-size: 10px; }
  #attribution { max-width: 92vw; left: 10px; right: 10px; text-align: left; }
}

#chargement .etat.erreur {
  color: #ff9a7a; max-width: 520px; line-height: 1.65; text-align: left;
  background: rgba(255, 120, 80, 0.1); border-left: 3px solid #ff7a52;
  padding: 14px 18px; border-radius: 0 8px 8px 0;
}
#chargement code {
  display: inline-block; background: rgba(255, 255, 255, 0.1);
  padding: 2px 7px; border-radius: 4px; font-size: 11.5px; color: #ffd9a8;
  margin: 3px 0; word-break: break-all;
}

/* =====================================================================
   Ecran titre facon borne d arcade
   Le fond est la vue isometrique reelle, rendue au tiers de la definition
   puis agrandie sans lissage : de gros pixels, comme une borne.
   ===================================================================== */
:root {
  --rose: #ff3d9a; --jaune: #ffd23f; --violet: #2a0f55; --nuit: #14082b; --cyan: #35e0d0;
  --pixel: "Cascadia Mono", "Lucida Console", Consolas, "DejaVu Sans Mono", ui-monospace, Menlo, monospace;
}
html, body { touch-action: none; overscroll-behavior: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
body.titre #scene3d, body.titre #scene { image-rendering: pixelated; cursor: default; }
body.titre #hud, body.titre #coinDroit, body.titre #annonces, body.titre #debug,
body.titre #attribution, body.titre #mission, body.titre #tactile, body.titre #calque { display: none !important; }

#titre {
  position: fixed; inset: 0; z-index: 30; display: none;
  font-family: var(--pixel); color: #fff3d6; text-transform: uppercase;
}
#titre.ouvert { display: block; }
#titre .teinte {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(20, 8, 43, 0.9) 0%, rgba(20, 8, 43, 0.72) min(34%, 420px), rgba(20, 8, 43, 0.12) min(66%, 760px), rgba(20, 8, 43, 0) 100%),
    linear-gradient(180deg, rgba(74, 20, 140, 0.6) 0%, rgba(214, 40, 140, 0.36) 46%, rgba(255, 150, 60, 0.3) 100%);
}
#titre .trame {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 2px, rgba(10, 0, 30, 0.22) 2px 3px);
}
#titre .colonne {
  position: absolute; left: clamp(14px, 5vw, 70px); top: 0; bottom: 0;
  width: min(560px, 92vw); display: flex; flex-direction: column; justify-content: center;
  padding: 10px 0 44px;
}
#titre .presente {
  margin: 0 0 10px; font-size: clamp(10px, 1.5vh + 4px, 15px); letter-spacing: 4px; color: var(--jaune);
  text-shadow: 2px 2px 0 #000;
}
#titre .marque { display: flex; align-items: center; gap: 16px; margin-bottom: clamp(6px, 2.4vh, 22px); }
#titre .ecu { width: clamp(40px, min(9vh, 13vw), 84px); flex: none; filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.7)); }
#titre h1 { margin: 0; line-height: 0.95; font-weight: 900; }
#titre h1 span {
  display: block; font-size: clamp(13px, min(3.4vh, 4.6vw), 30px); letter-spacing: 3px; text-transform: none; color: #fff;
  text-shadow: 2px 2px 0 var(--rose), 4px 4px 0 #000;
}
#titre h1 b {
  display: block; font-size: clamp(26px, min(8.6vh, 10.4vw), 78px); letter-spacing: 2px; color: var(--jaune);
  text-shadow: 3px 3px 0 var(--rose), 6px 6px 0 #4a148c, 9px 9px 0 rgba(0, 0, 0, 0.75);
}
#menuEntete {
  margin: 0 0 6px; font-size: clamp(11px, 2vh, 16px); letter-spacing: 3px; color: var(--cyan);
  text-shadow: 2px 2px 0 #000; min-height: 0;
}
#menuEntete:empty { display: none; }
#menuListe { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(1px, 0.5vh, 5px); }
#menuListe button {
  position: relative; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 14px; width: 100%;
  font: inherit; font-weight: 800; font-size: clamp(12px, min(2.9vh, 4.3vw), 24px); letter-spacing: 2px;
  text-transform: uppercase; text-align: left; color: #fff3d6;
  background: none; border: 0; padding: clamp(3px, 0.8vh, 8px) 12px clamp(3px, 0.8vh, 8px) 34px; cursor: pointer;
  text-shadow: 2px 2px 0 #000;
}
#menuListe button i { font-style: normal; color: var(--jaune); min-width: 2.2em; }
#menuListe button span { white-space: nowrap; }
#menuListe button em { margin-left: auto; font-style: normal; font-size: 0.72em; color: var(--cyan); white-space: nowrap; }
#menuListe button em u { text-decoration: none; padding: 0 9px; color: var(--jaune); }
#menuListe button small {
  flex-basis: 100%; padding-left: 3.4em; font-size: 0.52em; letter-spacing: 1px; text-transform: none;
  color: rgba(255, 243, 214, 0.78); font-weight: 600;
}
#menuListe button.inactif { color: rgba(255, 243, 214, 0.38); }
#menuListe button.inactif i { color: rgba(255, 210, 63, 0.4); }
#menuListe li.choisi button {
  background: linear-gradient(90deg, var(--rose) 0%, #c2187a 70%, rgba(194, 24, 122, 0) 100%);
  color: #fff; box-shadow: -6px 0 0 var(--jaune);
}
#menuListe li.choisi button::before {
  content: "\25B6"; position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--jaune); font-size: 0.8em; animation: clignote 0.7s steps(2) infinite;
}
#menuListe li.choisi button em, #menuListe li.choisi button small { color: #fff; }
@keyframes clignote { 50% { opacity: 0.25; } }
#menuTexte {
  margin-top: 10px; font-size: clamp(10px, 1.7vh, 13px); letter-spacing: 0.4px; text-transform: none;
  line-height: 1.55; color: #f6e9ff; text-shadow: 1px 1px 0 #000; max-height: 46vh; overflow: auto;
}
#menuTexte p { margin: 6px 0; }
#menuTexte table { border-collapse: collapse; width: 100%; }
#menuTexte th { text-align: left; color: var(--jaune); letter-spacing: 3px; padding: 8px 0 3px; }
#menuTexte td { padding: 2px 10px 2px 0; vertical-align: top; }
#menuTexte td:first-child { color: var(--cyan); white-space: nowrap; }
#titre[data-page="commandes"] #menuListe { order: 3; margin-top: 8px; }
#menuInvite {
  margin: clamp(6px, 2vh, 18px) 0 0; font-size: clamp(9px, 1.5vh, 12px); letter-spacing: 2px; color: var(--cyan);
  text-shadow: 1px 1px 0 #000; animation: clignote 1.2s steps(2) infinite; text-transform: none;
}
#menuInvite.muet { visibility: hidden; }
#titre .mentions {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  font-family: "Segoe UI", system-ui, sans-serif; font-size: clamp(8px, 1.25vh + 2px, 11px); line-height: 1.45; letter-spacing: 0.2px;
  text-transform: none; text-align: center; color: rgba(255, 243, 214, 0.92); background: rgba(12, 4, 28, 0.82);
}
#chargement h1 { font-family: var(--pixel); text-shadow: 3px 3px 0 var(--rose); }
#chargement h1 b { color: var(--jaune); }
#chargement { background: var(--nuit); }

/* ---------- mission, objectif, bandeau ---------- */
#objectif { font-size: 12px; color: #9fe8df; min-height: 0; }
#objectif:empty { display: none; }
#mission {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 11; display: none;
  font-family: var(--pixel); text-align: center; pointer-events: none;
  background: rgba(20, 8, 43, 0.9); border: 2px solid var(--rose); border-radius: 6px; padding: 6px 16px; color: #fff3d6;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}
#mission.ouvert { display: block; }
#mission b { display: block; font-size: 13px; letter-spacing: 2px; color: var(--jaune); text-transform: uppercase; }
#mission span { display: block; font-size: 15px; font-variant-numeric: tabular-nums; margin-top: 2px; }
body.mission #annonces { top: 78px; }
#bandeau {
  position: fixed; left: 0; right: 0; top: 34%; z-index: 13; text-align: center; pointer-events: none;
  font-family: var(--pixel); text-transform: uppercase; opacity: 0; transform: scale(0.86); transition: opacity .18s, transform .18s;
}
#bandeau.visible { opacity: 1; transform: none; }
#bandeau b {
  display: block; font-size: clamp(26px, min(11vh, 8.4vw), 96px); font-weight: 900; letter-spacing: 3px; color: var(--jaune);
  text-shadow: 4px 4px 0 var(--rose), 8px 8px 0 #4a148c, 12px 12px 0 rgba(0, 0, 0, 0.6);
}
#bandeau span {
  display: inline-block; margin-top: 12px; max-width: 92vw; font-size: clamp(11px, min(2.6vh, 2.6vw), 20px); letter-spacing: 1.5px; color: #fff;
  background: rgba(20, 8, 43, 0.86); padding: 5px 14px; border-radius: 4px;
}
#bandeau span:empty { display: none; }
#debug { display: none; }
body.infos #debug { display: block; }

/* =====================================================================
   Commandes tactiles
   ===================================================================== */
#tactile { display: none; position: fixed; inset: 0; z-index: 14; pointer-events: none; }
body.tactile #tactile { display: block; }
#manette {
  position: absolute; left: 0; bottom: 0; width: 46%; height: 68%; pointer-events: auto; touch-action: none;
}
#manetteSocle {
  position: fixed; left: 96px; top: calc(100% - 104px); width: 124px; height: 124px; margin: -62px 0 0 -62px;
  border-radius: 50%; border: 3px solid rgba(255, 243, 214, 0.42); background: rgba(20, 8, 43, 0.28);
  pointer-events: none; transition: border-color .15s, background .15s;
}
#manetteSocle.actif { border-color: var(--jaune); background: rgba(20, 8, 43, 0.42); }
#manettePommeau {
  position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; border-radius: 50%;
  transform: translate(-50%, -50%); background: rgba(255, 61, 154, 0.82); border: 3px solid #fff3d6;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}
#pedales {
  position: absolute; right: calc(14px + env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom));
  width: 210px; height: 190px; pointer-events: none;
}
#pedales button, #raccourcis button {
  pointer-events: auto; touch-action: none; font-family: var(--pixel); font-weight: 800; color: #fff3d6;
  background: rgba(20, 8, 43, 0.62); border: 3px solid rgba(255, 243, 214, 0.55);
  -webkit-user-select: none; user-select: none; padding: 0;
}
#pedales button { position: absolute; border-radius: 50%; font-size: 26px; line-height: 1; }
#pedales button small { display: block; font-size: 10px; letter-spacing: 1px; margin-top: 2px; }
#pedales button.tenu { background: var(--rose); border-color: var(--jaune); transform: scale(0.94); }
#pedales .p-gaz { right: 0; bottom: 78px; width: 96px; height: 96px; border-color: rgba(53, 224, 208, 0.8); }
#pedales .p-frein { right: 104px; bottom: 0; width: 96px; height: 96px; border-color: rgba(255, 210, 63, 0.8); }
#pedales .p-main { right: 0; bottom: 0; width: 70px; height: 70px; font-size: 11px; letter-spacing: 1px; }
#pedales .p-klaxon { right: 120px; bottom: 108px; width: 56px; height: 56px; font-size: 22px; }
#pedales .p-main .p { display: none; }
/* pilotage au pouce : la manette accelere, il ne reste que le frein a droite */
#tactile[data-pilotage="pouce"] .p-gaz { display: none; }
#tactile[data-pilotage="pouce"] .p-frein { right: 0; bottom: 84px; width: 104px; height: 104px; }
#tactile[data-pilotage="pouce"] .p-main { right: 116px; bottom: 6px; width: 78px; height: 78px; }
#tactile[data-pilotage="pouce"] .p-klaxon { right: 122px; bottom: 112px; }
/* a pied */
#tactile.apied .p-gaz, #tactile.apied .p-frein, #tactile.apied .p-klaxon { display: none; }
#tactile.apied .p-main { right: 0; bottom: 84px; width: 104px; height: 104px; font-size: 13px; }
#tactile.apied .p-main .v { display: none; }
#tactile.apied .p-main .p { display: inline; }
#raccourcis {
  position: absolute; left: calc(10px + env(safe-area-inset-left)); top: calc(8px + env(safe-area-inset-top));
  display: flex; gap: 6px; pointer-events: none;
}
#raccourcis button { min-width: 46px; height: 40px; padding: 0 9px; border-radius: 8px; font-size: 11px; letter-spacing: 1px; border-width: 2px; }
#raccourcis button:active { background: var(--rose); }
#paysage {
  display: none; position: absolute; left: 50%; top: 56px; transform: translateX(-50%); margin: 0; width: max-content; max-width: 92vw;
  font-size: 11px; color: #fff3d6; background: rgba(20, 8, 43, 0.86); padding: 5px 10px; border-radius: 6px; text-align: center;
}
@media (orientation: portrait) { body.tactile #paysage { display: block; } }

/* ---------- habillage compact sur ecran tactile ---------- */
body.tactile #boutons { display: none; }
body.tactile #coinDroit { right: calc(8px + env(safe-area-inset-right)); top: calc(8px + env(safe-area-inset-top)); }
body.tactile #minimap { width: 96px; height: 96px; }
body.tactile #hud {
  left: 50%; bottom: auto; top: calc(8px + env(safe-area-inset-top)); transform: translateX(-50%);
  align-items: stretch; gap: 6px;
}
body.tactile #compteur { min-width: 0; padding: 5px 10px 4px; border-radius: 9px; }
body.tactile #vitesse { font-size: 24px; }
body.tactile #unite { font-size: 10px; }
body.tactile #vehicule { display: none; }
body.tactile #lieu { padding: 4px 10px; border-radius: 9px; max-width: 34vw; overflow: hidden; }
body.tactile #quartier { font-size: 12px; min-height: 0; white-space: nowrap; }
body.tactile #rue { font-size: 10.5px; min-height: 0; white-space: nowrap; }
body.tactile #objectif { font-size: 10px; white-space: nowrap; }
body.tactile #annonces { top: 60px; width: min(420px, 60vw); }
body.tactile .annonce { padding: 5px 10px; }
body.tactile .annonce b { font-size: 12.5px; }
body.tactile .annonce.quartier b { font-size: 15px; }
body.tactile .annonce span { font-size: 10px; }
body.tactile #mission { top: 56px; padding: 4px 10px; }
body.tactile #mission b { font-size: 10px; }
body.tactile #mission span { font-size: 12px; }
body.tactile.mission #annonces { top: 104px; }
body.tactile #attribution {
  left: 50%; right: auto; bottom: calc(2px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: 44vw; font-size: 7.5px; line-height: 1.3; text-align: center; padding: 2px 6px; background: rgba(22, 18, 14, 0.6);
}
@media (orientation: portrait) {
  /* telephone tenu debout : raccourcis en haut, puis compteur a gauche et
     minimap a droite, annonces dessous, attributions tout en bas */
  body.tactile #coinDroit { top: calc(56px + env(safe-area-inset-top)); }
  body.tactile #minimap { width: 84px; height: 84px; }
  body.tactile #hud { top: calc(56px + env(safe-area-inset-top)); left: 8px; transform: none; flex-direction: column; align-items: flex-start; }
  body.tactile #lieu { max-width: 62vw; }
  body.tactile #annonces { top: calc(170px + env(safe-area-inset-top)); width: 92vw; }
  body.tactile #mission { top: calc(150px + env(safe-area-inset-top)); }
  body.tactile.mission #annonces { top: calc(204px + env(safe-area-inset-top)); }
  body.tactile #attribution { max-width: 96vw; width: max-content; }
  #pedales { bottom: calc(44px + env(safe-area-inset-bottom)); }
  #manette { width: 50%; height: 44%; }
  #paysage { top: auto; bottom: calc(250px + env(safe-area-inset-bottom)); animation: sefface 9s forwards; }
}
@keyframes sefface { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
@media (max-height: 460px) {
  #titre .colonne { justify-content: flex-start; padding-top: 6px; }
  #titre .presente { margin-bottom: 3px; letter-spacing: 2px; }
  #titre .marque { margin-bottom: 4px; }
  #menuInvite { display: none; }
}

#carte .barre { align-items: center; }
#carte .barre button {
  margin-left: auto; font: inherit; font-size: 12px; padding: 6px 14px; border-radius: 7px; cursor: pointer;
  background: #ff3d9a; color: #fff; border: 0;
}
#carte canvas { touch-action: none; }

/* ---------- score de style ---------- */
#style {
  position: fixed; left: 18px; top: 18px; z-index: 10; pointer-events: none; min-width: 150px;
  font-family: var(--pixel); color: #fff3d6; background: rgba(20, 8, 43, 0.86);
  border-left: 4px solid var(--jaune); border-radius: 0 6px 6px 0; padding: 6px 12px 7px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
}
#style b { display: block; font-size: 12px; letter-spacing: 2px; color: var(--jaune); }
#style b i { font-style: normal; color: #fff; font-size: 17px; margin-left: 6px; font-variant-numeric: tabular-nums; }
#style span { display: block; font-size: 12.5px; letter-spacing: 1px; color: var(--cyan); min-height: 0; white-space: nowrap; }
#style span:empty { display: none; }
#style em { display: none; height: 4px; margin-top: 4px; background: rgba(255, 255, 255, 0.16); }
#style.actif em { display: block; }
#style em u { display: block; height: 100%; background: var(--rose); }
#style.actif { border-left-color: var(--rose); }
#style.gain b i { animation: gain 0.5s; }
@keyframes gain { 0% { color: var(--jaune); transform: scale(1.5); display: inline-block; } 100% { color: #fff; transform: none; } }
#style b i { display: inline-block; transform-origin: left center; }
body.titre #style { display: none !important; }
body.infos #debug { top: 78px; }
#mission.urgent { border-color: #ff5a3c; animation: clignote 0.5s steps(2) infinite; }
body.tactile #style { left: auto; right: calc(8px + env(safe-area-inset-right)); top: calc(112px + env(safe-area-inset-top)); min-width: 0; padding: 4px 8px 5px; border-left: 0; border-right: 3px solid var(--jaune); border-radius: 6px 0 0 6px; text-align: right; }
body.tactile #style b { font-size: 9px; }
body.tactile #style b i { font-size: 13px; transform-origin: right center; }
body.tactile #style span { font-size: 10px; }
@media (orientation: portrait) {
  body.tactile #style { top: calc(146px + env(safe-area-inset-top)); }
  body.tactile #annonces { top: calc(190px + env(safe-area-inset-top)); }
  body.tactile.mission #style { top: calc(206px + env(safe-area-inset-top)); }
  body.tactile.mission #annonces { top: calc(250px + env(safe-area-inset-top)); }
}
/* fenetre etroite : le panneau de mission occupe le haut, le style passe dessous */
@media (max-width: 1100px) { body.mission:not(.tactile) #style { top: 112px; } }
#style span { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
