/* ===== Interface en jeu ===== */
.hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; transition: opacity .4s; }
.hud.cache { opacity: 0; }
.hud-zone {
  position: absolute; top: 34px; left: 50%; transform: translate(-50%, -10px); text-align: center;
  opacity: 0; transition: opacity .8s, transform .8s; text-shadow: 0 2px 16px rgba(0,0,0,.8);
}
.hud-zone.visible { opacity: 1; transform: translate(-50%, 0); }
.hud-zone-nom { display: block; font-family: var(--police-titre); font-size: 34px; letter-spacing: .12em; text-transform: uppercase; }
.hud-zone-desc { display: block; color: var(--braise-clair); font-size: 14px; letter-spacing: .08em; margin-top: 4px; }
.viseur { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 0 0 2px rgba(0,0,0,.35); opacity: 0; transition: opacity .3s; }
body.vue-premiere .viseur { opacity: 1; }
.minicarte {
  position: absolute; right: 22px; top: 22px; width: 180px; height: 180px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25); box-shadow: 0 10px 30px rgba(0,0,0,.5); background: #000;
}
.minicarte.cache { display: none; }
.hud-aide {
  position: absolute; left: 22px; bottom: 22px; display: flex; flex-wrap: wrap; gap: 14px; max-width: 70vw;
  font-size: 13px; color: rgba(255,255,255,.8); text-shadow: 0 1px 6px rgba(0,0,0,.9); transition: opacity 1.5s;
}
.hud-aide.estompe { opacity: 0; }
.hud-aide kbd { margin-right: 6px; font-size: 11px; }
.hud-fps { position: absolute; left: 22px; top: 22px; font: 600 12px var(--police-titre); color: var(--ok); text-shadow: 0 1px 4px #000; }
.hud-chargement { position: absolute; right: 22px; bottom: 22px; font-size: 12px; color: rgba(255,255,255,.7); text-shadow: 0 1px 4px #000; }

/* Pause */
.ecran-pause { background: rgba(8, 6, 5, .55); backdrop-filter: blur(4px); }
.menu-vertical { display: grid; gap: 10px; }
.menu-vertical .btn { width: 100%; }

/* Paramètres */
.parametres { display: grid; gap: 18px; }
.param label { display: flex; justify-content: space-between; font-size: 14px; color: var(--texte-doux); margin-bottom: 8px; }
.param output { color: var(--texte); font-family: var(--police-titre); }
.param-ligne { display: flex; align-items: center; justify-content: space-between; }
.param-ligne label { margin: 0; }
.choix-segment { display: flex; background: rgba(255,255,255,.06); border-radius: 999px; padding: 4px; border: 1px solid rgba(255,255,255,.1); }
.choix-segment button { flex: 1; padding: 9px 12px; border-radius: 999px; font-size: 14px; color: var(--texte-doux); transition: background .2s, color .2s; }
.choix-segment button.actif { background: var(--braise); color: #fff; }
input[type=range] { width: 100%; accent-color: var(--braise); }
.interrupteur { appearance: none; width: 44px; height: 24px; border-radius: 99px; background: rgba(255,255,255,.15); position: relative; cursor: pointer; transition: background .2s; }
.interrupteur::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.interrupteur:checked { background: var(--braise); }
.interrupteur:checked::after { transform: translateX(20px); }
.reprendre-info { margin-top: 14px; font-size: 13px; color: var(--texte-doux); text-align: center; }

/* ===== Véhicules, météo, frontière toxique ===== */
.hud-meteo { position: absolute; right: 22px; top: 214px; width: 180px; text-align: center; font: 600 13px var(--police-titre); color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.hud-action {
  position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px;
  background: rgba(10,8,6,.62); border: 1px solid var(--bord); backdrop-filter: blur(6px); font-size: 15px;
  opacity: 0; transition: opacity .25s; white-space: nowrap;
}
.hud-action.visible { opacity: 1; }
.hud-action kbd { margin-right: 8px; }
.hud-message {
  position: absolute; left: 50%; top: 120px; transform: translateX(-50%); max-width: 90vw; text-align: center;
  font-size: 14px; color: #fff; text-shadow: 0 1px 6px #000; opacity: 0; transition: opacity .4s;
}
.hud-message.visible { opacity: 1; }
.hud-vehicule {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: none; gap: 10px; align-items: stretch;
  padding: 10px 14px; border-radius: 14px; background: rgba(10,8,6,.6); border: 1px solid var(--bord); backdrop-filter: blur(6px);
}
.hud-vehicule.visible { display: flex; flex-wrap: wrap; justify-content: center; max-width: 92vw; }
.hv-nom { width: 100%; text-align: center; font: 600 12px var(--police-titre); letter-spacing: .12em; text-transform: uppercase; color: var(--braise-clair); }
.hv-case { min-width: 74px; text-align: center; }
.hv-case b { display: block; font: 700 26px var(--police-titre); }
.hv-case span { font-size: 11px; color: var(--texte-doux); }
.hv-gaz { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.hv-jauge { width: 12px; height: 34px; border-radius: 6px; background: rgba(255,255,255,.15); position: relative; overflow: hidden; }
.hv-jauge i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, var(--braise), var(--braise-clair)); }
.hv-aide { width: 100%; text-align: center; font-size: 12px; color: var(--texte-doux); }
.hv-alerte { width: 100%; text-align: center; font: 700 14px var(--police-titre); color: #ff4a3a; animation: clignote .5s steps(2) infinite; }
@keyframes clignote { 50% { opacity: 0; } }
.hud-toxique {
  position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .3s;
  background: radial-gradient(ellipse at center, rgba(60,35,10,0) 30%, rgba(50,28,8,.85) 100%);
}
.hud-toxique-info { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); font: 700 18px var(--police-titre); color: #ffb35c; text-shadow: 0 2px 10px #000; text-align: center; opacity: 0; }
.hud-toxique.danger .hud-toxique-info { opacity: 1; animation: clignote 1s steps(2) infinite; }
.hud-toxique-barre { width: 240px; height: 8px; margin: 10px auto 0; border-radius: 4px; background: rgba(0,0,0,.5); overflow: hidden; }
.hud-toxique-barre i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8bc34a, #ff9800, #e53935); }
.ecran-mort { background: radial-gradient(ellipse at center, rgba(40,10,5,.6), rgba(0,0,0,.92)); }
.mort { text-align: center; }
.mort-titre { font: 700 clamp(30px, 6vw, 56px) var(--police-titre); color: #ff6a4a; letter-spacing: .06em; }
.mort-sous { margin-top: 12px; color: var(--texte-doux); }
.sous-titre-touches { margin: 18px 0 10px; font: 600 14px var(--police-titre); letter-spacing: .12em; text-transform: uppercase; color: var(--braise-clair); }
.sous-titre-touches:first-of-type { margin-top: 0; }

/* ===== Commandes tactiles ===== */
.tactile { position: fixed; inset: 0; z-index: 6; pointer-events: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.tactile.cache { display: none; }
.t-zone-joy { position: absolute; left: 0; bottom: 0; width: 42vw; height: 62vh; pointer-events: auto; }
.t-zone-regard { position: absolute; right: 0; top: 0; width: 58vw; height: 100vh; pointer-events: auto; }
.t-joy {
  position: absolute; left: 110px; top: calc(100% - 120px); width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%;
  background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.25); transition: opacity .2s; opacity: .55;
}
.t-joy.actif { opacity: 1; transition: none; }
.t-joy-bouton { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(255,140,80,.75); box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.t-indice { position: absolute; left: 60px; bottom: 14px; font-size: 11px; color: rgba(255,255,255,.6); letter-spacing: .1em; text-transform: uppercase; }
.t-pause { position: absolute; left: calc(14px + env(safe-area-inset-left)); top: calc(14px + env(safe-area-inset-top)); width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-size: 14px; pointer-events: auto; border: 1px solid rgba(255,255,255,.25); }
.t-boutons {
  position: absolute; right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(3, auto); gap: 10px; justify-items: center; align-items: end; direction: rtl; pointer-events: none;
}
.t-btn {
  direction: ltr; pointer-events: auto; min-width: 64px; height: 64px; padding: 0 12px; border-radius: 32px;
  background: rgba(20,16,12,.55); border: 2px solid rgba(255,255,255,.28); color: #fff; font: 600 13px var(--police-titre);
  backdrop-filter: blur(4px); touch-action: none;
}
.t-btn.grand { min-width: 84px; height: 84px; border-radius: 42px; font-size: 15px; background: rgba(255,106,43,.55); }
.t-btn.petit { min-width: 52px; height: 52px; font-size: 12px; }
.t-btn.appui, .t-btn.actif { background: rgba(255,106,43,.9); border-color: #fff; }
.t-orientation { display: none; }
@media (orientation: portrait) {
  .t-orientation { display: flex; position: absolute; inset: 0; align-items: center; justify-content: center; text-align: center; padding: 30px;
    background: rgba(0,0,0,.85); font: 600 20px var(--police-titre); pointer-events: auto; }
}
@media (pointer: coarse) {
  .hud-aide { display: none; }
  .minicarte { width: 120px; height: 120px; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); }
  .hud-meteo { top: 140px; right: 12px; width: 120px; font-size: 11px; }
  .hud-vehicule { bottom: auto; top: 12px; padding: 6px 10px; }
  .hv-case b { font-size: 18px; }
  .hud-action { bottom: 46vh; }
  .hud-zone-nom { font-size: 22px; }
  .panneau { padding: 22px 18px; }
}
@media (pointer: coarse) { .hud-chargement { display: none; } }
/* écrans bas (smartphone en paysage) */
@media (max-height: 520px) {
  .panneau { padding: 16px 18px; max-height: calc(100vh - 16px); }
  .panneau h2 { font-size: 20px; margin-bottom: 10px; }
  .ecran { padding: 8px; }
  .carte-perso canvas { height: 150px; }
  .cartes-perso { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
  .carte-perso .chargement-perso { top: 60px; }
  .carte-perso .infos { padding: 6px 10px 8px; }
  .carte-perso .infos strong { font-size: 16px; }
  .btn { padding: 10px 20px; font-size: 13px; }
  .titre { font-size: clamp(48px, 16vh, 120px); }
  .sous-titre { margin: 10px 0 16px; font-size: 14px; }
  .accueil-pied { display: none; }
  .liste-touches { gap: 6px; font-size: 13px; }
  .hud-zone-nom { font-size: 20px; }
}

/* ===== Vie, blessures ===== */
.hud-vie { position: absolute; left: 22px; top: 50px; display: flex; align-items: center; gap: 8px; opacity: 0; transition: opacity .4s; color: #ff6b6b; text-shadow: 0 1px 4px #000; }
.hud-vie.visible { opacity: 1; }
.hud-vie-barre { width: 160px; height: 10px; border-radius: 5px; background: rgba(0,0,0,.5); overflow: hidden; border: 1px solid rgba(255,255,255,.2); }
.hud-vie-barre i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #c62828, #ff5252); transition: width .2s; }
.hud-vie.critique .hud-vie-barre i { animation: clignote .6s steps(2) infinite; }
.hud-blessure { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(160,0,0,0) 40%, rgba(160,0,0,.6) 100%); }
.hud-blessure.flash { animation: blessure .6s ease-out; }
@keyframes blessure { from { opacity: 1; } to { opacity: 0; } }
@media (pointer: coarse) { .hud-vie { top: calc(66px + env(safe-area-inset-top)); left: 14px; } .hud-vie-barre { width: 110px; } }
