/* ASTRAVEX : Prélude · la page de jeu. */
html, body { overflow: hidden; overscroll-behavior: none; touch-action: none; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---- HUD : trois colonnes, discrètes, au-dessus du jeu */
.hud { position: fixed; left: 0; right: 0; top: 0; z-index: 5; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, rgba(4, 3, 14, .7), transparent); pointer-events: none; opacity: 0; transition: opacity .4s; }
body.en-jeu .hud { opacity: 1; }
.hud a { pointer-events: auto; }
.hud-g, .hud-d { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; min-width: 0; }
.hud-d { justify-content: flex-end; }
.hud-marque { text-decoration: none; color: var(--texte); font-size: .9rem; }
.hud-secteur { font-family: var(--mono); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--violet); }
.hud-c { display: grid; justify-items: center; gap: 2px; }
.hud-score { font-family: var(--titre); font-weight: 700; font-size: clamp(1.3rem, 3.4vw, 2rem); letter-spacing: .08em; font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 0 14px rgba(63, 224, 245, .5); }
.hud-combo { font-family: var(--titre); font-size: .9rem; color: var(--or); min-height: 1.2em; letter-spacing: .1em; }
.hud .etiquette b { color: #fff; font-family: var(--titre); font-weight: 700; font-size: 1rem; letter-spacing: .04em; }
.hud-icones { display: inline-flex; gap: 3px; }
.hud-icones i { width: 12px; height: 12px; display: inline-block; background: var(--cyan); clip-path: polygon(50% 0, 100% 100%, 50% 78%, 0 100%); filter: drop-shadow(0 0 4px var(--cyan)); }
.hud-icones.bouclier i { background: transparent; border: 2px solid var(--cyan); border-radius: 50%; clip-path: none; width: 11px; height: 11px; }
.hud-icones.drones i { background: #BFA6FF; filter: drop-shadow(0 0 4px #8F6BFF); width: 9px; height: 9px; }
.hud-icones.bombes i { background: var(--rose); border-radius: 50%; clip-path: none; width: 10px; height: 10px; filter: drop-shadow(0 0 4px var(--rose)); }
.hud-icones.puissance i { background: var(--or); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); filter: drop-shadow(0 0 4px var(--or)); }
.boss { display: grid; justify-items: center; gap: 3px; margin-top: 4px; }
.boss-jauge { width: min(320px, 50vw); height: 6px; background: rgba(255, 91, 216, .15); border: 1px solid rgba(255, 91, 216, .5); border-radius: 3px; overflow: hidden; }
.boss-jauge i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--rose), #ff9be8); box-shadow: 0 0 10px var(--rose); transition: width .15s; }
@media (max-width: 640px) { .hud { grid-template-columns: 1fr auto; } .hud-g { display: none; } .hud-d { gap: 8px; } }

/* ---- annonces */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); z-index: 8; opacity: 0;
  background: var(--panneau); border: 1px solid var(--trait); padding: 8px 16px; border-radius: 4px; font-family: var(--mono); letter-spacing: .06em;
  transition: opacity .3s, transform .3s; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.toast.vu { opacity: 1; transform: translate(-50%, 0); }
.annonce { position: fixed; left: 0; right: 0; top: 38%; z-index: 6; text-align: center; pointer-events: none; opacity: 0;
  font-family: var(--titre); font-weight: 900; font-size: clamp(1.6rem, 6vw, 3.4rem); letter-spacing: .22em; text-transform: uppercase; color: #fff;
  text-shadow: 0 0 24px rgba(143, 107, 255, .9), 0 0 2px #fff; transition: opacity .5s; padding-inline: 16px; }
.annonce small { display: block; font-family: var(--mono); font-weight: 400; font-size: .32em; letter-spacing: .3em; color: var(--cyan); margin-top: .4em; text-shadow: none; }
.annonce.vu { opacity: 1; }
.annonce.mere { text-shadow: 0 0 24px rgba(255, 91, 216, .95), 0 0 2px #fff; }

/* ---- le poste de pilotage */
.poste { position: fixed; z-index: 10; left: max(16px, env(safe-area-inset-left, 0px)); top: calc(16px + env(safe-area-inset-top, 0px));
  width: min(380px, calc(100vw - 32px)); max-height: calc(100% - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); overflow: auto;
  background: var(--panneau); backdrop-filter: blur(8px); border: 1px solid var(--trait); border-top: 2px solid var(--cyan); border-radius: 6px;
  padding: 18px 18px 14px; display: grid; gap: 14px; transition: opacity .35s, transform .35s; }
body.en-jeu .poste { opacity: 0; transform: translateX(-24px); pointer-events: none; }
.poste-tete .etiquette { margin: 0 0 4px; color: var(--cyan); }
.poste-titre { font-family: var(--titre); font-weight: 700; font-size: 1.25rem; letter-spacing: .08em; margin: 0; text-wrap: balance; }
.poste-intro { margin: 0; color: var(--doux); font-size: .92rem; }
.poste-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.poste-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
label.champ kbd { font-size: .95em; letter-spacing: 0; text-transform: none; }
.commandes summary { cursor: pointer; font-family: var(--mono); letter-spacing: .1em; text-transform: uppercase; font-size: .78rem; color: var(--doux); }
.commandes p { margin: .5em 0; font-size: .86rem; color: var(--texte); }
.c-violet { color: #BFA6FF; } .c-rose { color: var(--rose); }
label.champ.case { grid-template-columns: 1fr auto; align-items: center; }
label.champ.case input { width: 18px; height: 18px; accent-color: var(--or); }
label.champ.case input:disabled { opacity: .35; }
.c-or { color: var(--or); } .c-cyan { color: var(--cyan); } .c-vert { color: var(--vert); }
.records, .moteur { margin: 0; font-family: var(--mono); font-size: .76rem; color: var(--doux); letter-spacing: .04em; }
.moteur { border-top: 1px solid var(--trait); padding-top: 10px; }
@media (max-width: 640px) { .poste { top: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); max-height: 62%; } }

/* ---- pause / fin */
.voile { position: fixed; inset: 0; z-index: 12; display: grid; place-items: center; background: rgba(4, 3, 14, .55); backdrop-filter: blur(3px);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.voile-carte { background: var(--panneau); border: 1px solid var(--trait); border-top: 2px solid var(--rose); border-radius: 6px; padding: 22px 24px; display: grid; gap: 10px; text-align: center; justify-items: center; max-width: 420px; }
.voile-titre { margin: 0; font-family: var(--titre); font-weight: 900; font-size: clamp(1.4rem, 5vw, 2.2rem); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.voile-texte { margin: 0; color: var(--doux); }
.voile .etiquette { margin: 0; }
