/* La tente dans le monde (tente-ui.mjs ; étape 6, tâche 9 h ; brief 06-fabrication-tente-brief.md § 6.1, § 6.4 forme A « la toile », Q30 du
   02/11). Le marqueur de scène (le triangle de la carte dans le rond des marqueurs du Distributeur), la fiche d'accès (le gabarit
   `.caravan-access` de style.css : 240 px à droite, 210 px au téléphone), le voile (un dégradé radial, ni flou ni backdrop-filter : il
   coûte zéro sur un rendu à 60 i/s) et la feuille « Sous la tente » (en bas, au-dessus de la barre ; centrée en bas au grand écran).
   Verre ≥ 72 % (la nuit aussi). Une seule audace : la toile. */
.halo-preview {
  --tente-cyan: #8fe3f5; --tente-gold: #e0c98f; --tente-coral: #e8836f; --tente-crew: #9bcbbd;
  --tente-text: #f0e1c5; --tente-muted: #b7b6a7; --tente-line: rgb(150 214 228 / 30%);
}
/* Le conteneur et le calque ne font pas de pile : le voile passe sous l'interface (z 2), la feuille et les marqueurs au-dessus. */
.halo-preview .tente-ui, .halo-preview .tente-markers { position: static; z-index: auto; }
.halo-preview .tente-voile[hidden], .halo-preview .tente-feuille[hidden], .halo-preview .tente-marker[hidden],
.halo-preview .tente-access [hidden], .halo-preview .tente-feuille [hidden] { display: none !important; }
.halo-preview:is(.clean-view, .combat-open, .entry-open, .auth-open, .intro-open) :is(.tente-voile, .tente-feuille, .tente-access, .tente-marker) { visibility: hidden; pointer-events: none; }

/* Le marqueur : un rond de 44 px (celui du Distributeur), le triangle de l'équipage dedans. */
.halo-preview .tente-marker {
  position: fixed; left: 0; top: 0; z-index: 7; display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0;
  border: 1px solid rgb(170 215 209 / 65%); border-radius: 50%; background: rgb(18 35 34 / 70%); color: var(--tente-crew); cursor: pointer;
  pointer-events: auto; touch-action: manipulation; will-change: transform;
}
.halo-preview .tente-marker:hover { background: rgb(48 81 76 / 90%); }
.halo-preview .tente-marker:focus-visible { outline: 2px solid #add3be; outline-offset: 3px; }
.halo-preview .tente-marker[aria-expanded="true"] { border-color: var(--tente-cyan); box-shadow: 0 0 0 1px rgb(143 227 245 / 40%); }
.tente-marker-forme { width: 24px; height: 24px; overflow: visible; }
.tente-marker-toile { fill: rgb(12 18 17 / 72%); stroke: var(--tente-crew); stroke-width: 1.6; stroke-linejoin: round; }
/* Plein en bon état, tireté à l'Usure, barré hors d'usage ; la sienne, un second contour. */
.tente-marker[data-etat="bon"] .tente-marker-toile { fill: var(--tente-crew); stroke: rgb(12 18 17 / 90%); stroke-width: 1; }
.tente-marker[data-etat="usure"] .tente-marker-toile { stroke-dasharray: 3 2; }
.tente-marker-barre { fill: none; stroke: var(--tente-crew); stroke-width: 1.6; stroke-linecap: round; }
.tente-marker-double { fill: none; stroke: var(--tente-crew); stroke-width: 1.2; stroke-linejoin: round; }
/* Hors ligne : à demi. */
.halo-preview .tente-markers.is-hors-ligne .tente-marker { opacity: .5; }

/* La fiche d'accès : le gabarit de celle du Distributeur, son verre porté à 72 %. Le bouton plein (« Entrer ») est le plus bas de la carte,
   sous le pouce (§ 6.1) ; l'ordre de tabulation reste celui du DOM (§ 11.4). */
.halo-preview .caravan-access.tente-access { background: rgb(15 34 38 / 72%); color: var(--tente-text); pointer-events: auto; }
.halo-preview .tente-access .tente-fermer { width: 44px; height: 44px; min-height: 44px; }
.halo-preview .tente-access .tente-access-titre { color: var(--tente-gold); text-transform: uppercase; }
.tente-access-niveau, .tente-access-places { margin: 0; color: #d7ddd2; font-size: 12px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.tente-access-places { margin-bottom: 10px; color: var(--tente-muted); font-size: 11px; }
.tente-access-loin, .tente-access-scelle { margin: 0 0 10px; color: var(--tente-muted); font-size: 11px; }
.tente-access-gestes { display: flex; flex-direction: column; gap: 6px; }
.halo-preview .tente-access .tente-entrer, .halo-preview .tente-access .tente-ouvrir, .halo-preview .tente-access .tente-replier { min-height: 44px; }
.halo-preview .tente-access .tente-entrer { border-color: rgb(143 227 245 / 70%); background: rgb(56 124 138 / 62%); color: #eafcff; font-weight: 600; }
.halo-preview .tente-access .tente-entrer:hover { background: rgb(66 146 162 / 72%); }
.tente-hors-ligne { margin: 0 0 10px; padding: 6px 9px; border: 1px solid rgb(226 188 126 / 35%); border-radius: 5px; color: #f0d4a2; background: rgb(60 44 22 / 30%); font-size: 11px; }
.tente-statut { min-height: 0; color: #bfe6ef; }
.tente-statut[data-erreur="true"] { color: var(--tente-coral); }

/* Le voile : brun-ocre, clair au centre, sombre au bord ; sous les panneaux, au-dessus du canevas ; les pointeurs le traversent. */
.halo-preview .tente-voile {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 45%, rgb(92 62 30 / 15%) 0%, rgb(58 36 16 / 38%) 55%, rgb(32 19 8 / 60%) 100%);
  animation: tente-fondu 300ms ease both;
}
@keyframes tente-fondu { from { opacity: 0; } to { opacity: 1; } }

/* La feuille « Sous la tente » : verre ≥ 72 %, jamais modale ; en bas, centrée. */
.halo-preview .tente-feuille {
  position: fixed; z-index: 8; left: 50%; bottom: var(--computer-bottom, 96px); transform: translateX(-50%);
  width: min(400px, calc(100vw - 32px)); box-sizing: border-box; padding: 12px 16px 14px; color: var(--tente-text); pointer-events: auto;
  border: 1px solid var(--tente-line); border-radius: 7px; background: rgb(15 34 38 / 72%);
  box-shadow: 0 12px 35px rgb(12 25 20 / 22%), inset 0 1px rgb(231 237 205 / 10%); text-shadow: 0 1px 3px rgb(8 17 16 / 65%);
  font: 12px/1.5 var(--font-ui, system-ui, sans-serif); animation: tente-fondu 300ms ease both;
}
.tente-feuille button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.tente-feuille button:focus-visible { outline: 2px solid #add3be; outline-offset: 3px; }
.tente-feuille-eyebrow {
  margin: 0; padding: 4px 0 6px; border-bottom: 1px solid rgb(224 201 143 / 55%); color: var(--tente-gold);
  font-size: 10px; letter-spacing: 2.4px; text-transform: uppercase;
}
.tente-feuille-titre { margin: 8px 0 0; font: 400 17px/1.3 Georgia, serif; color: #f1e9d8; }
.tente-feuille-titre:focus { outline: none; }
.tente-feuille-lead { margin: 2px 0 0; color: var(--tente-muted); font-size: 11px; }
.tente-feuille-etat { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 10px; padding-bottom: 8px; border-bottom: 1px solid rgb(180 205 183 / 16%); }
.tente-feuille-niveau { color: #d7ddd2; }
.tente-feuille-places { display: grid; justify-items: end; gap: 3px; color: var(--tente-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
/* Les disques : un par place ; plein = prise, pointillé = libre (la forme, pas la couleur seule). */
.tente-disques { display: flex; gap: 5px; }
.tente-disque { width: 12px; height: 12px; box-sizing: border-box; border-radius: 50%; border: 1.5px dashed var(--tente-gold); }
.tente-disque[data-plein="true"] { border-style: solid; border-color: var(--tente-gold); background: var(--tente-gold); }
/* Le coffre : une ligne de 44 px, icône, nom, places, chevron. */
.tente-feuille .tente-coffre {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 12px; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin: 0;
  padding: 0 4px; border: 0; border-bottom: 1px solid rgb(180 205 183 / 16%); background: transparent; text-align: left; text-shadow: inherit;
}
.tente-feuille .tente-coffre:hover { background: rgb(36 72 78 / 40%); }
.tente-coffre-icone { display: inline-grid; width: 20px; height: 20px; color: #cfe0d8; }
.tente-coffre-icone svg { width: 20px; height: 20px; }
.tente-coffre-compte { color: #cfe8ee; font-variant-numeric: tabular-nums; }
.tente-chevron { color: #bcd0c6; font-size: 18px; line-height: 1; }
.tente-feuille-scelle { margin: 8px 0 0; color: var(--tente-muted); font-size: 11px; }
.tente-feuille .tente-hors-ligne { margin: 10px 0 0; }
.tente-feuille .tente-statut { margin: 8px 0 0; }
/* « Sortir » : le bouton plein, le plus bas de la feuille, 52 px. */
.tente-feuille .tente-sortir {
  display: block; width: 100%; min-height: 52px; margin-top: 12px; padding: 0 14px; border: 1px solid rgb(143 227 245 / 70%); border-radius: 6px;
  color: #eafcff; background: rgb(56 124 138 / 62%); font: 600 14px var(--font-ui, system-ui, sans-serif);
}
.tente-feuille .tente-sortir:hover { background: rgb(66 146 162 / 72%); }
.tente-feuille .tente-sortir:disabled { opacity: .55; cursor: wait; }

/* Au téléphone (et au pointeur grossier) : au-dessus de la barre, 358 px au plus. */
@media (max-width: 720px), (pointer: coarse) {
  .halo-preview .tente-feuille { bottom: var(--mobile-panel-bottom, 76px); width: min(358px, calc(100vw - 32px)); }
}
/* Au téléphone (portrait, ou paysage de moins de 500 px de haut), la feuille recouvre l'étiquette du lieu, qui transparaissait sous « Sortir »
   (recette 9 i, 03/11) : cachée tant qu'on est dessous, comme sac ouvert ; la feuille dit « Sous la tente ». Une tablette et le grand écran la
   laissent lisible, à côté de la feuille. */
@media (max-width: 720px), (pointer: coarse) and (max-height: 500px) {
  .halo-preview.is-sous-tente .hud-left-stack .place { visibility: hidden; }
}
/* En paysage (844 × 390) : deux colonnes, le texte à gauche, « Sortir » à droite. */
@media (max-height: 420px) {
  .halo-preview .tente-feuille { display: grid; grid-template-columns: minmax(0, 1fr) 168px; column-gap: 16px; width: min(640px, calc(100vw - 32px)); }
  .halo-preview .tente-feuille > * { grid-column: 1; }
  .halo-preview .tente-feuille > .tente-sortir { grid-column: 2; grid-row: 1 / span 8; align-self: end; margin-top: 0; }
}
/* Le grand écran (pointeur fin, ≥ 1800 px) : centrée en bas, 440 px, au ras de la barre (maquette 2026-11-02-etape6-maquette-tente-A-grand). */
@media (min-width: 1800px) and (pointer: fine) {
  .halo-preview .tente-feuille { width: 440px; bottom: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .halo-preview .tente-voile, .halo-preview .tente-feuille, .halo-preview .tente-marker, .halo-preview .tente-access, .tente-feuille *, .tente-access * { animation: none; transition: none; }
}
