/* =============================================================================
   OPÉRATION CASCADE — interface
   Identité reprise de CASCADE : fond presque noir, vert phosphore, monospace.
   ========================================================================== */

:root {
  --fond:        #070b0d;
  --fond-panneau:rgba(10, 18, 15, 0.92);
  --bord:        #17352a;
  --bord-clair:  #2a5c45;
  --vert:        #7cf2a8;
  --vert-sombre: #3f8f63;
  --ambre:       #ffb02e;
  --rouge:       #ff4d4d;
  --texte:       #cfe9da;
  --texte-faible:#7c9c8c;
  --ombre:       0 18px 50px rgba(0, 0, 0, 0.65);
  --mono: ui-monospace, "SFMono-Regular", "DejaVu Sans Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  touch-action: manipulation;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--mono);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#ecran { position: fixed; inset: 0; overflow: hidden; touch-action: none; }

#rendu {
  position: absolute; inset: 0;
  touch-action: none;
  width: 100%; height: 100%;
  display: block;
  background: #05080a;
  cursor: crosshair;
}

.cache { display: none !important; }

/* ------------------------------------------------------------------ voiles */
.voile {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(12, 34, 24, 0.55) 0%, rgba(4, 8, 8, 0.92) 70%),
    linear-gradient(180deg, rgba(3, 6, 6, 0.55), rgba(3, 6, 6, 0.9));
  backdrop-filter: blur(6px) saturate(0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
  z-index: 20;
}
.voile.actif { opacity: 1; visibility: visible; pointer-events: auto; }
.voile { pointer-events: none; }

.panneau-accueil {
  position: relative;
  width: min(760px, 100%);
  padding: 44px 48px 36px;
  border: 1px solid var(--bord);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(9, 20, 15, 0.96), rgba(5, 11, 9, 0.98));
  box-shadow: var(--ombre), inset 0 1px 0 rgba(124, 242, 168, 0.06);
  overflow: hidden;
  animation: apparait .4s ease both;
}
.panneau-accueil.etroit { width: min(460px, 100%); }
.panneau-accueil::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg, rgba(124,242,168,.032) 0 1px, transparent 1px 4px);
  pointer-events: none;
}
.panneau-accueil::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--vert), transparent);
  opacity: .55;
}
@keyframes apparait {
  from { opacity: 0; transform: translateY(10px) scale(.995); }
  to   { opacity: 1; transform: none; }
}

.surtitre {
  font-size: 10px; letter-spacing: .34em; color: var(--vert-sombre);
  text-transform: uppercase; margin-bottom: 18px;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: .94;
  letter-spacing: .02em;
  font-weight: 800;
  color: #eafff1;
  text-shadow: 0 0 26px rgba(124, 242, 168, .22);
}
h1 span { display: block; color: var(--vert); font-weight: 800; }
.sous-titre-accueil {
  margin: -10px 0 24px; font-size: 12px; letter-spacing: .18em;
  color: var(--vert-sombre); text-transform: uppercase;
}
h2 {
  margin: 0 0 22px; font-size: 22px; letter-spacing: .18em;
  color: #eafff1; font-weight: 700;
}

.accroche {
  margin: 0 0 30px; max-width: 52ch;
  color: var(--texte-faible); font-size: 13.5px; line-height: 1.65;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.bouton {
  appearance: none;
  border: 1px solid var(--bord-clair);
  background: rgba(18, 38, 30, .55);
  color: var(--texte);
  font: inherit; font-size: 12px; letter-spacing: .18em;
  padding: 13px 22px;
  cursor: pointer;
  border-radius: 2px;
  text-decoration: none;
  transition: background .16s, border-color .16s, color .16s, transform .06s;
}
.bouton:hover { background: rgba(28, 62, 47, .7); border-color: var(--vert-sombre); color: #eafff1; }
.bouton:active { transform: translateY(1px); }
.bouton:focus-visible { outline: 2px solid var(--vert); outline-offset: 2px; }

.bouton.principal {
  background: linear-gradient(180deg, #6fe79c, #37a86a);
  border-color: #7cf2a8;
  color: #04140c;
  font-weight: 800;
  box-shadow: 0 0 0 rgba(124, 242, 168, 0), 0 10px 30px rgba(60, 190, 120, .18);
}
.bouton.principal:hover { background: linear-gradient(180deg, #8bffb6, #43c47d); color: #02110a; }

.bouton.discret {
  background: transparent; border-color: transparent;
  color: var(--texte-faible); padding-left: 8px; padding-right: 8px;
}
.bouton.discret:hover { color: var(--vert); background: transparent; }

.aide-cles {
  margin-top: 30px; padding-top: 18px;
  border-top: 1px solid rgba(23, 53, 42, .8);
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  font-size: 11px; color: var(--texte-faible);
}
.aide-cles b {
  color: var(--vert); font-weight: 600;
  display: inline-block; min-width: 8px;
}

/* ------------------------------------------------------------- réglages */
.ligne-reglage {
  display: grid;
  grid-template-columns: 1fr 1.2fr 62px;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(23, 53, 42, .55);
  font-size: 12px;
  color: var(--texte);
}
.ligne-reglage output { text-align: right; color: var(--vert); font-size: 12px; }
.ligne-reglage select {
  font: inherit; font-size: 12px; color: var(--texte);
  background: #0c1a14; border: 1px solid var(--bord-clair);
  padding: 7px 9px; border-radius: 2px;
}
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 3px; background: #1d3f30; border-radius: 2px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--vert); border: 2px solid #06281a; cursor: pointer;
  box-shadow: 0 0 10px rgba(124,242,168,.5);
}
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--vert); border: 2px solid #06281a; cursor: pointer;
}
input[type="checkbox"] { accent-color: #4bd488; width: 16px; height: 16px; }

/* ------------------------------------------------------------------ bilan */
.bilan {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: rgba(23, 53, 42, .6);
  border: 1px solid rgba(23, 53, 42, .8);
  margin-bottom: 26px;
}
.bilan div {
  background: #08120e; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.bilan span { font-size: 10px; letter-spacing: .16em; color: var(--texte-faible); }
.bilan b { font-size: 22px; color: var(--vert); font-weight: 700; }

/* ================================================================== HUD == */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }

/* viseur */
#viseur {
  position: absolute; left: 50%; top: var(--mire-y, 50%);
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  --ecart: 9px;
  transition: opacity .12s;
}
#viseur .branche {
  position: absolute; background: rgba(232, 255, 240, .92);
  box-shadow: 0 0 4px rgba(0, 0, 0, .95);
}
#viseur .haut   { width: 2px; height: 7px; left: 50%; margin-left: -1px; top: calc(50% - var(--ecart) - 7px); }
#viseur .bas    { width: 2px; height: 7px; left: 50%; margin-left: -1px; top: calc(50% + var(--ecart)); }
#viseur .gauche { height: 2px; width: 7px; top: 50%; margin-top: -1px; left: calc(50% - var(--ecart) - 7px); }
#viseur .droite { height: 2px; width: 7px; top: 50%; margin-top: -1px; left: calc(50% + var(--ecart)); }
#viseur .point {
  position: absolute; left: 50%; top: 50%; width: 2px; height: 2px;
  margin: -1px 0 0 -1px; background: var(--vert); border-radius: 50%;
  box-shadow: 0 0 6px var(--vert);
}
#viseur .basse { display: none; }

/* marqueur de touche */
#marqueur-touche {
  position: absolute; left: 50%; top: var(--mire-y, 50%);
  width: 26px; height: 26px; margin: -13px 0 0 -13px;
  opacity: 0;
  background:
    linear-gradient(45deg, transparent 45%, #fff 46% 54%, transparent 55%) 0 0 / 100% 100%,
    linear-gradient(-45deg, transparent 45%, #fff 46% 54%, transparent 55%) 0 0 / 100% 100%;
  mix-blend-mode: screen;
}
#marqueur-touche.joue { animation: touche .18s ease-out; }
@keyframes touche {
  0% { opacity: 1; transform: scale(.6); }
  100% { opacity: 0; transform: scale(1.15); }
}

/* bords de dégâts */
#degats-bord {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(120% 100% at 50% 50%, transparent 45%, rgba(190, 20, 20, .55) 100%);
  transition: opacity .35s ease;
}
#degats-bord.joue { opacity: 1; transition: opacity .05s; }

#degats-direction {
  position: absolute; inset: 0; opacity: 0;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  background: conic-gradient(from 0deg at 50% 50%,
    transparent 0deg, rgba(255, 70, 70, .45) 6deg,
    rgba(255, 70, 70, .45) 16deg, transparent 30deg);
  transition: opacity .45s ease;
}
#degats-direction.joue { opacity: 1; transition: opacity .06s; }

/* bandeau haut */
#bandeau-haut {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 1px;
  border: 1px solid rgba(23, 53, 42, .9);
  background: rgba(4, 10, 8, .55);
  backdrop-filter: blur(3px);
}
#bandeau-haut .bloc {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 22px 9px;
  background: rgba(6, 14, 11, .55);
  min-width: 104px;
}
#bandeau-haut .etiquette {
  font-size: 8.5px; letter-spacing: .3em; color: var(--texte-faible);
}
#bandeau-haut .valeur {
  font-size: 21px; font-weight: 700; color: #eafff1; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
#bandeau-haut .sous { font-size: 9px; color: var(--texte-faible); letter-spacing: .08em; }
#bandeau-haut .vague .valeur { color: var(--vert); }

/* bandeau bas */
#bandeau-bas {
  position: absolute; left: 22px; right: 22px; bottom: 18px;
  display: flex; justify-content: space-between; align-items: flex-end;
}
.sante { display: flex; align-items: center; gap: 12px; }
.sante .jauge {
  width: 190px; height: 8px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(124,242,168,.25);
  overflow: hidden;
}
.sante .remplissage {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #37a86a, #7cf2a8);
  transition: width .18s ease, background .25s;
}
.sante .chiffres { display: flex; align-items: baseline; gap: 4px; }
.sante .chiffres span:first-child {
  font-size: 24px; font-weight: 700; color: #eafff1; font-variant-numeric: tabular-nums;
  min-width: 3ch;
}
.sante .unite { font-size: 9px; letter-spacing: .2em; color: var(--texte-faible); }

.munitions { display: flex; align-items: baseline; gap: 8px; text-align: right; }
.munitions .chargeur {
  font-size: 30px; font-weight: 700; color: #eafff1;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.munitions .chargeur.vide { color: var(--rouge); }
.munitions .reserve { font-size: 13px; color: var(--texte-faible); font-variant-numeric: tabular-nums; }
.munitions .arme {
  font-size: 9px; letter-spacing: .22em; color: var(--vert-sombre);
  margin-left: 10px; align-self: center;
}
.munitions .rechargement {
  font-size: 9px; letter-spacing: .16em; color: var(--accent);
  align-self: center; margin-left: 8px; white-space: nowrap;
  animation: rechargement .65s ease-in-out infinite alternate;
}
@keyframes rechargement { from { opacity: .35; } to { opacity: 1; } }

/* message central */
#message-centre {
  position: absolute; left: 50%; top: var(--message-y, 62%);
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: clamp(18px, 3vw, 30px);
  font-weight: 800; letter-spacing: .22em;
  color: #eafff1;
  text-shadow: 0 0 24px rgba(124,242,168,.5), 0 2px 12px #000;
  animation: message .5s ease both;
  white-space: normal; max-width: 82vw;
}
#message-centre.petit { font-size: clamp(13px, 1.6vw, 18px); letter-spacing: .3em; color: var(--vert); }
#message-centre.rouge { color: #ffd6d6; text-shadow: 0 0 24px rgba(255,60,60,.6), 0 2px 12px #000; }
@keyframes message {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* compteur de performance (F3) */
#perf {
  position: absolute; left: 14px; top: 14px;
  padding: 6px 10px;
  background: rgba(4, 10, 8, .72);
  border-left: 2px solid var(--vert-sombre);
  font-size: 10.5px; line-height: 1.5; color: var(--vert);
  white-space: pre; letter-spacing: .06em;
}

/* journal (éliminations) */
#journal {
  position: absolute; right: calc(22px + env(safe-area-inset-right, 0px)); top: 96px;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
  font-size: 10.5px; letter-spacing: .12em;
}
#journal .entree {
  padding: 4px 9px;
  background: rgba(4, 10, 8, .6);
  border-right: 2px solid var(--vert-sombre);
  color: var(--texte-faible);
  animation: entre .25s ease both;
}
#journal .entree b { color: var(--vert); }
@keyframes entre { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------- chargeur */
.chargement-boite { width: min(420px, 90vw); text-align: center; }
.jauge-chargement {
  height: 3px; background: rgba(124,242,168,.12); margin: 18px 0 12px; overflow: hidden;
}
#chargement-barre {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #37a86a, #7cf2a8);
  transition: width .2s ease;
}
#chargement-texte { font-size: 10px; letter-spacing: .3em; color: var(--texte-faible); }

/* ------------------------------------------------------------------ erreur */
#erreur {
  position: absolute; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 30px;
  background: #0b0505; color: #ffb3b3; font-size: 13px; line-height: 1.6;
  white-space: pre-wrap;
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 900px), (max-height: 560px) {
  .voile { padding: 10px; }
  .panneau-accueil {
    padding: 22px 20px 20px;
    max-height: calc(100% - 8px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 720px) {
  .panneau-accueil { padding: 28px 22px 24px; }
  .aide-cles { gap: 6px 12px; font-size: 10px; }
  #bandeau-haut .bloc { padding: 6px 12px; min-width: 78px; }
  #bandeau-haut .valeur { font-size: 17px; }
  .sante .jauge { width: 110px; }
  #bandeau-bas { left: 12px; right: 12px; bottom: 12px; }
  .munitions .chargeur { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; transition-duration: .001s !important; }
}


/* ====================================================== commandes tactiles */
#tactile { position: absolute; inset: 0; z-index: 12; pointer-events: none; }

/* Pavé directionnel : quatre grosses flèches sous le pouce gauche.
   Le bloc entier capture les touches : un pouce qui déborde entre les flèches
   ne doit pas atteindre le canvas (où un tap déclenche un tir). */
#dpad {
  position: absolute;
  left: calc(6px + env(safe-area-inset-left, 0px));
  bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(3, 58px);
  grid-template-rows: repeat(3, 58px);
  gap: 4px;
  padding: 8px;
  pointer-events: auto;
  touch-action: none;
}
#dpad .fleche {
  width: 58px; height: 58px;
  border-radius: 14px;
  font-size: 19px; letter-spacing: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
#dpad .haut   { grid-column: 2; grid-row: 1; }
#dpad .gauche { grid-column: 1; grid-row: 2; }
#dpad .droite { grid-column: 3; grid-row: 2; }
#dpad .bas    { grid-column: 2; grid-row: 3; }

.t-bouton {
  pointer-events: auto; touch-action: none;
  width: 76px; height: 76px; border-radius: 50%;
  border: 2px solid rgba(124, 242, 168, .45);
  background: rgba(10, 24, 18, .55);
  color: var(--vert); font: inherit; font-size: 11px; letter-spacing: .1em;
  backdrop-filter: blur(4px);
  -webkit-user-select: none; user-select: none;
}
.t-bouton.tir {
  position: absolute;
  right: calc(18px + env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 96px; height: 96px; font-size: 13px;
  background: rgba(120, 26, 26, .55); border-color: rgba(255, 120, 120, .6); color: #ffd9d9;
}
.t-bouton.recharger {
  position: absolute;
  right: calc(132px + env(safe-area-inset-right, 0px));
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  width: 56px; height: 56px; font-size: 9.5px;
}
.t-bouton:active, .t-bouton.actif {
  background: rgba(124, 242, 168, .28);
  transform: scale(.96);
}
.t-bouton.tir:active, .t-bouton.tir.actif {
  background: rgba(220, 60, 60, .4);
}

#t-btn-pause {
  position: absolute;
  right: calc(14px + env(safe-area-inset-right, 0px));
  top: calc(14px + env(safe-area-inset-top, 0px));
  width: 46px; height: 46px; font-size: 13px; letter-spacing: 0;
  border-radius: 12px;
}

/* La barre de vie / munitions remonte au-dessus des commandes. */
#hud.tactile #bandeau-bas {
  left: calc(14px + env(safe-area-inset-left, 0px));
  right: calc(14px + env(safe-area-inset-right, 0px));
  bottom: calc(204px + env(safe-area-inset-bottom, 0px));
}
#hud.tactile .munitions .chargeur { font-size: 22px; }
#hud.tactile #journal { top: calc(74px + env(safe-area-inset-top, 0px)); }
#hud.tactile .sante .jauge { width: 104px; }

@media (max-height: 420px) {
  #dpad { grid-template-columns: repeat(3, 50px); grid-template-rows: repeat(3, 50px); bottom: calc(2px + env(safe-area-inset-bottom, 0px)); }
  #dpad .fleche { width: 50px; height: 50px; font-size: 17px; border-radius: 12px; }
  .t-bouton.tir { width: 84px; height: 84px; }
  .t-bouton.recharger { width: 48px; height: 48px; right: calc(118px + env(safe-area-inset-right, 0px)); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
  #hud.tactile #bandeau-bas { bottom: calc(178px + env(safe-area-inset-bottom, 0px)); }
  #hud.tactile .sante .jauge { width: 84px; }
}

/* ------------------------------------------------ portrait / rotation */
#orientation {
  position: absolute; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(12, 34, 24, .65), rgba(4, 8, 8, .98) 70%),
    var(--fond);
}
.orientation-boite { max-width: 360px; }
.orientation-boite h2 { margin: 18px 0 10px; font-size: 20px; letter-spacing: .18em; }
.orientation-boite p { margin: 0; color: var(--texte-faible); font-size: 13px; }
.orientation-icone {
  font-size: 68px; line-height: 1; color: var(--vert);
  animation: rotation-telephone 2.4s ease-in-out infinite;
}
@keyframes rotation-telephone {
  0%, 20% { transform: rotate(0deg); }
  55%, 80% { transform: rotate(90deg); }
  100% { transform: rotate(90deg); }
}

/* ---------------------------------------------- dernier hostile restant */
#indicateur-hostile {
  position: absolute; z-index: 11;
  width: 20px; height: 20px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 2px solid rgba(255, 90, 90, .95);
  background: rgba(120, 20, 20, .55);
  box-shadow: 0 0 14px rgba(255, 60, 60, .6);
  pointer-events: none;
}
#indicateur-hostile span {
  position: absolute; left: 50%; top: 135%;
  transform: translateX(-50%) rotate(-45deg);
  font-size: 9px; letter-spacing: .08em; color: #ffd6d6;
  white-space: nowrap; text-shadow: 0 1px 3px #000;
}

/* ---------------------------------------------------------------- avis */
.panneau-accueil.avis-panneau { width: min(600px, 100%); }
.avis-accroche { margin-bottom: 14px; }
#avis .ligne-reglage { grid-template-columns: 1fr 1.2fr; }
#avis input[type="text"],
#avis select,
#avis textarea {
  width: 100%;
  font: inherit; font-size: 12px;
  color: var(--texte);
  background: #0c1a14;
  border: 1px solid var(--bord-clair);
  border-radius: 2px;
  padding: 8px 9px;
}
.avis-message {
  display: flex; flex-direction: column; gap: 7px;
  margin: 4px 0 16px;
  font-size: 12px; color: var(--texte);
}
.avis-message textarea {
  min-height: 120px; resize: vertical; line-height: 1.5;
}
.avis-piege {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.avis-statut {
  min-height: 18px; margin-top: 10px;
  font-size: 11.5px; color: var(--texte-faible);
}
.avis-statut.ok { color: var(--vert); }
.avis-statut.erreur { color: #ff9a9a; }
#avis { touch-action: auto; }
#avis .panneau-accueil { touch-action: pan-y; }
#avis input, #avis textarea, #avis select {
  user-select: text; -webkit-user-select: text; touch-action: auto;
}
#avis .bouton[disabled] { opacity: .55; cursor: wait; }

@media (max-width: 720px) {
  #avis input, #avis select, #avis textarea { font-size: 16px; }
}

/* ------------------------------------------------------------ diagnostic */
#debug {
  position: absolute; left: 8px; top: 8px; z-index: 80;
  padding: 8px 10px; max-width: 62vw;
  background: rgba(0, 0, 0, .82); border: 1px solid #2a5c45;
  font: 10px/1.45 ui-monospace, monospace; color: #7cf2a8;
  white-space: pre; pointer-events: none;
}

.version {
  margin-top: 18px; font-size: 9.5px; letter-spacing: .22em;
  color: var(--vert-sombre); text-transform: uppercase;
}
.record-accueil {
  margin-top: 6px; font-size: 10px; letter-spacing: .22em;
  color: var(--ambre); text-transform: uppercase;
}
.nav-jeux {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid rgba(23, 53, 42, .8);
}
.nav-jeux .lien-nav {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--vert-sombre); text-decoration: none;
}
.nav-jeux .lien-nav:hover { color: var(--vert); }
.nav-jeux-tuto { margin-top: 8px; padding-top: 8px; }

.licence-accueil {
  margin-top: 7px; font-size: 9.5px; letter-spacing: .1em;
  color: var(--texte-faible);
}
.licence-accueil a {
  color: var(--vert-sombre); text-decoration: none;
}
.licence-accueil a:hover { color: var(--vert); }
.avis-note {
  margin: 0 0 12px; font-size: 10.5px; line-height: 1.45;
  color: var(--texte-faible);
}
.record-fin {
  margin: -12px 0 22px; text-align: center;
  font-size: 10px; letter-spacing: .22em; color: var(--texte-faible);
}
.record-fin b {
  display: inline-block; margin-left: 8px; font-size: 16px;
  color: var(--ambre); font-variant-numeric: tabular-nums;
}
.record-fin b.nouveau { animation: record-pulse .9s ease-in-out infinite alternate; }
@keyframes record-pulse {
  from { text-shadow: 0 0 0 rgba(255, 176, 46, 0); }
  to   { text-shadow: 0 0 18px rgba(255, 176, 46, .85); }
}

/* ------------------------------------------------------- mode d'emploi */
.tuto-panneau { width: min(760px, 100%); }
.tuto-accroche { margin-bottom: 18px; }
.tuto-etapes {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 20px;
}
.tuto-etape {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(23, 53, 42, .85);
  background: rgba(6, 14, 11, .55);
}
.tuto-etape b {
  display: block; color: var(--vert);
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
}
.tuto-etape p {
  margin: 6px 0 0; font-size: 11.5px; line-height: 1.5;
  color: var(--texte-faible);
}
.tuto-icone {
  flex: 0 0 48px; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--bord-clair); border-radius: 8px;
  background: rgba(10, 24, 18, .6);
  color: var(--vert); font-size: 10px; letter-spacing: .04em;
}
.tuto-icone.large { font-size: 8.5px; }
.tuto-icone.deplacement {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center; font-size: 10px; line-height: 1;
}
.tuto-icone.deplacement span:nth-child(1) { grid-column: 1; grid-row: 2; }
.tuto-icone.deplacement span:nth-child(2) { grid-column: 2; grid-row: 1; }
.tuto-icone.deplacement span:nth-child(3) { grid-column: 2; grid-row: 3; }
.tuto-icone.deplacement span:nth-child(4) { grid-column: 3; grid-row: 2; }
.tuto-icone.viseur { position: relative; }
.tuto-icone.viseur::before,
.tuto-icone.viseur::after {
  content: ""; position: absolute; background: var(--vert);
  box-shadow: 0 0 6px rgba(124, 242, 168, .7);
}
.tuto-icone.viseur::before {
  width: 2px; height: 30px; left: 50%; top: 9px; margin-left: -1px;
}
.tuto-icone.viseur::after {
  height: 2px; width: 30px; top: 50%; left: 9px; margin-top: -1px;
}
.tuto-icone.viseur span {
  position: absolute; left: 50%; top: 50%;
  width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border: 1px solid var(--vert); border-radius: 50%;
}
.tuto-option {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 20px; font-size: 12px; color: var(--texte-faible);
  cursor: pointer;
}
.tuto-option input { accent-color: #4bd488; width: 16px; height: 16px; }
.tuto-actions {
  position: sticky; bottom: 0; z-index: 1;
  display: block;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(5, 11, 9, 0) 0%, rgba(5, 11, 9, .97) 32%);
}
.tuto-actions .tuto-option { margin: 0 0 8px; }

@media (max-width: 560px) {
  .tuto-etapes { grid-template-columns: 1fr; }
}

@media (max-height: 560px) {
  .tuto-panneau { padding: 16px 20px 14px; }
  .tuto-panneau h2 { margin-bottom: 12px; font-size: 19px; }
  .tuto-panneau .surtitre { margin-bottom: 10px; }
  .tuto-accroche { margin-bottom: 10px; font-size: 11.5px; }
  .tuto-etapes { gap: 8px; margin-bottom: 10px; }
  .tuto-etape { padding: 8px 10px; gap: 9px; }
  .tuto-icone { flex-basis: 40px; width: 40px; height: 40px; }
  .tuto-etape b { font-size: 10px; }
  .tuto-etape p { font-size: 10.5px; line-height: 1.35; margin-top: 4px; }
  .tuto-option { margin-bottom: 8px; font-size: 11px; }
  .tuto-actions { padding-top: 8px; }
  .tuto-actions .bouton { padding: 10px 16px; font-size: 11px; }
}

/* ------------------------------------------------- mise en page portrait */
@media (orientation: portrait) and (max-width: 720px) {
  #hud.tactile #bandeau-haut .bloc { padding: 6px 10px; min-width: 66px; }
  #message-centre { top: 42%; font-size: 16px; letter-spacing: .16em; }
}
