/* ==========================================================================
   VOYAGE EN IMAGINAIRE — Laurent GANNE
   Feuille de style unique. Les couleurs se règlent dans :root ci-dessous.
   ========================================================================== */

:root {
  --ink:        #0a0c14;   /* fond le plus sombre        */
  --ink-2:      #12162a;   /* fond des panneaux          */
  --line:       rgba(255, 255, 255, 0.10);
  --text:       #f0ece4;   /* texte principal            */
  --muted:      #9d9fb4;   /* texte secondaire           */
  --gold:       #d8b26a;   /* accent principal (doré)    */
  --gold-soft:  rgba(216, 178, 106, 0.16);
  --rail-w:     184px;     /* largeur du menu de gauche  */
  --radius:     14px;
  --serif:      "Cormorant Garamond", Georgia, serif;
  --sans:       "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

/* IMPORTANT : l'attribut hidden doit toujours l'emporter sur les règles
   display (grid, flex…) définies plus bas, sinon les fenêtres censées être
   masquées restent affichées par-dessus le reste du site. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }

kbd {
  font-family: var(--sans);
  font-size: 0.7rem;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   1. PORTAIL D'ENTRÉE
   ========================================================================== */

.gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 100;
  animation: fade 0.8s ease both;
}

.gate__wall,
.home__wall {
  position: absolute;
  inset: 0;
  /* Papier peint : image choisie dans le site, sinon le fond par défaut. */
  background-image: var(--wall, url("assets/fond.svg"));
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  transition: opacity 0.9s ease;
}

/* Voile léger : il assure la lisibilité du texte sans éteindre le paysage.
   Augmentez les valeurs pour assombrir, diminuez-les pour éclaircir. */
.gate__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 44%,
      rgba(8, 14, 30, 0.44) 0%,
      rgba(8, 14, 30, 0.22) 55%,
      rgba(8, 14, 30, 0.40) 100%);
}

.gate__content {
  position: relative;
  text-align: center;
  padding: 2rem;
  max-width: 460px;
  width: 100%;
}

.gate__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #ffe6ae;
  margin: 0 0 1.1rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.gate__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  line-height: 1.02;
  margin: 0 0 2.4rem;
  color: #fffdf7;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.55),
    0 8px 34px rgba(0, 0, 0, 0.6);
}

.gate__title em {
  font-style: italic;
  color: #ffd98a;
}

/* ---- Cadre de saisie du mot de passe ---- */

.keyframe {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem 1.3rem;
  background: rgba(10, 14, 26, 0.62);
  backdrop-filter: blur(8px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.keyframe::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--gold-soft);
  border-radius: calc(var(--radius) - 5px);
  pointer-events: none;
}

.keyframe__label {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.keyframe__input {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--sans);
  font-size: 1.15rem;
  letter-spacing: 0.3em;
  text-align: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.keyframe__input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.keyframe__btn {
  width: 100%;
  margin-top: 0.8rem;
  padding: 0.78rem;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--gold);
  border: 0;
  border-radius: 9px;
  transition: transform 0.18s, filter 0.18s;
}

.keyframe__btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

.keyframe__error,
.modal__error {
  margin: 0.8rem 0 0;
  font-size: 0.78rem;
  color: #ff8b8b;
}

.shake { animation: shake 0.42s ease; }

/* ==========================================================================
   2. STRUCTURE DU SITE
   ========================================================================== */

.app {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  height: 100vh;
  animation: fade 0.7s ease both;
}

/* ---- Menu colonne gauche ---- */

.rail {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  padding: 1.5rem 0.75rem 0.9rem;
  overflow-y: auto;
}

.rail__head { margin-bottom: 1.6rem; }

.rail__brand {
  display: block;
  text-decoration: none;
  color: inherit;
  font-family: var(--serif);
  line-height: 1.04;
}

.rail__brand-main { display: block; font-size: 1.04rem; }
.rail__brand-sub  { display: block; font-size: 1.3rem; font-style: italic; color: var(--gold); }

.rail__author {
  margin: 0.55rem 0 0;
  font-size: 0.57rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.rail__nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }

.tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.62rem 0.55rem;
  text-align: left;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tab:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); }

.tab.is-active {
  background: var(--gold-soft);
  border-left-color: var(--gold);
  color: var(--text);
}

.tab__num {
  width: 13px;
  flex: none;
  font-size: 0.66rem;
  text-align: center;
  color: var(--gold);
  opacity: 0.85;
}

.tab__label { flex: 1; font-size: 0.84rem; letter-spacing: 0.01em; }
.tab__lock  { font-size: 0.6rem; opacity: 0.55; }
.tab.is-open .tab__lock { opacity: 0.25; }

.tab__count {
  font-size: 0.68rem;
  color: var(--muted);
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

/* ---- Pied du menu ---- */

.rail__foot { padding-top: 0.9rem; border-top: 1px solid var(--line); }

.rail__link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.48rem 0.45rem;
  font-size: 0.7rem;
  line-height: 1.25;
  text-align: left;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: color 0.2s, border-color 0.2s;
}

.rail__link:hover { color: var(--text); border-color: var(--gold); }

/* Bouton « Légendes (admin) » : discret, avec une clé dorée. */
.rail__link--admin { margin-top: 0.4rem; }
.rail__link--admin:hover { border-color: var(--gold); }
.rail__admin-key { font-size: 0.82rem; filter: grayscale(0.2); }

/* Ligne de version, tout en bas du menu. */
.rail__version {
  margin: 0.7rem 0 0;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--muted);
  opacity: 0.5;
}

#connectLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #6b7080;
  transition: background 0.3s, box-shadow 0.3s;
}

.dot.is-on {
  background: #6ddf9c;
  box-shadow: 0 0 9px rgba(109, 223, 156, 0.75);
}

.rail__version {
  margin: 0.5rem 0 0;
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--muted);
  opacity: 0.4;
}

.rail__tip {
  margin: 0.7rem 0 0;
  font-size: 0.62rem;
  color: var(--muted);
  opacity: 0.55;
  text-align: center;
}

/* ---- Scène / vues ---- */

.stage { position: relative; overflow: hidden; }

.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: 1.7rem 2rem 1.7rem;
}

.view.is-active { display: flex; animation: rise 0.45s ease both; }

/* ==========================================================================
   3. PAGE D'ACCUEIL
   ========================================================================== */

#view-accueil { padding: 0; }

.home { position: relative; flex: 1; display: grid; place-items: center; overflow: hidden; }

/* Accueil : voile discret, le paysage reste bien visible. */
.home__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,
      rgba(8, 14, 30, 0.52) 0%,
      rgba(8, 14, 30, 0.14) 45%,
      rgba(8, 14, 30, 0.34) 100%);
}

/* Couche de nuit : superposée au voile, son opacité (--nuit) est réglée
   par app.js selon l'heure. 0 en plein jour, ~0.66 la nuit. */
.home::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 120%,
    rgba(6, 10, 24, 0.75) 0%, rgba(4, 6, 18, 0.95) 100%);
  opacity: var(--nuit, 0);
  transition: opacity 2s ease;
}

.home__text { position: relative; z-index: 3; text-align: center; padding: 2rem; }

.home__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.2rem, 5.5vw, 3.9rem);
  margin: 0;
  color: #fffdf7;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.5),
    0 10px 38px rgba(0, 0, 0, 0.55);
}

.home__sub {
  margin: 0.9rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #ffe6ae;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.home__by {
  margin: 2.2rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #f2eee4;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}

.home__guide {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: #eae6dc;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}

/* ==========================================================================
   3 bis. ASTRE ANIMÉ (soleil le jour, lune la nuit)
   La trajectoire, la couleur et l'heure sont pilotées par app.js.
   ========================================================================== */

/* Piste invisible : un arc que l'astre parcourt d'est en ouest.
   --t va de 0 (lever, à gauche) à 1 (coucher, à droite). */
.sky {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 26%;
  height: 0;
  z-index: 1;
  pointer-events: none;
}

/* Position horizontale : interpolée en JS via --x (0 → 1). */
.sky__body {
  position: absolute;
  left: calc(var(--x, 0.5) * 100%);
  /* Hauteur : un arc. Au centre (midi) l'astre est haut ; aux extrémités
     il rase l'horizon. --lift est calculé en JS (0 bas, 1 haut). */
  bottom: calc(var(--lift, 0.5) * 30vh);
  transform: translate(-50%, 50%);
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  /* Couleur de l'astre, changée en JS selon le moment de la journée. */
  background: var(--astre, radial-gradient(circle at 40% 38%, #fff3cf, #ffcf4d 55%, #ff9e2c));
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
  transition: bottom 1.2s ease, left 1.2s ease, background 2s ease;
}

/* Halo lumineux autour de l'astre. */
.sky__glow {
  position: absolute;
  inset: -60%;
  border-radius: 50%;
  background: var(--halo, radial-gradient(circle, rgba(255,214,90,0.55) 0%, rgba(255,214,90,0) 68%));
  transition: background 2s ease;
}

/* Heure affichée au centre de l'astre. */
.sky__clock {
  position: relative;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  color: var(--clock, rgba(60, 40, 10, 0.72));
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.35);
  transition: color 2s ease;
}

@media (max-width: 820px) {
  .sky__body { width: 66px; height: 66px; }
  .sky__clock { font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sky__body { transition: none; }
}

/* ==========================================================================
   4. EN-TÊTE D'ONGLET ET OUTILS
   ========================================================================== */

.view__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.3rem;
}

.view__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.05rem;
  margin: 0;
}

.view__meta {
  margin: 0.32rem 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.view__tools { display: flex; align-items: center; gap: 0.5rem; }

.chip {
  padding: 0.44rem 0.9rem;
  font-size: 0.74rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.chip:hover { color: var(--text); border-color: var(--gold); }
.chip[hidden] { display: none; }

.chip--export { color: var(--gold); border-color: var(--gold-soft); }

/* ---- Bouton du diaporama ---- */

.chip--play {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.chip__icon { font-size: 0.66rem; line-height: 1; }

.chip--play.is-on {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold);
}

.chip--play.is-on:hover { filter: brightness(1.08); }

/* ---- Menu déroulant « Exporter vers » ---- */

.export { position: relative; }

.export__menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  min-width: 158px;
  display: none;
  flex-direction: column;
  padding: 5px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
  z-index: 20;
}

.export.is-open .export__menu { display: flex; }

.export__menu button {
  padding: 0.56rem 0.7rem;
  font-size: 0.82rem;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  transition: background 0.16s, color 0.16s;
}

.export__menu button:hover { background: var(--gold-soft); color: var(--text); }

/* ==========================================================================
   5. VISIONNEUSE
   ========================================================================== */

.viewer {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.012) 0 12px, transparent 12px 24px),
    var(--ink-2);
  outline: none;
  overflow: hidden;
}

.viewer:focus-visible { border-color: var(--gold-soft); }

.viewer__empty { text-align: center; padding: 2.5rem; max-width: 460px; }

.viewer__empty-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin: 0 0 0.6rem;
  color: var(--muted);
}

.viewer__empty-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--muted);
  opacity: 0.75;
}

.viewer__empty-text code {
  font-size: 0.8rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--gold);
}

.viewer__media {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 1.6rem 3.6rem 3.4rem;
}

/* ---- Carte postale : photo encadrée + légende en dessous ---- */

.shot {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.05rem;
  max-width: min(560px, 92%);  /* taille modérée, façon carte postale */
  max-height: 100%;
  animation: fade 0.4s ease both;
}

.shot img {
  flex: 0 1 auto;             /* rétrécit sans s'étirer ni déborder */
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 58vh;           /* la photo reste entière et contenue */
  object-fit: contain;
  background: #f6f1e4;        /* le « carton » crème de la carte postale */
  padding: 11px 11px 34px;    /* bordure blanche, plus large en bas */
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 2px;
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.35),
    0 18px 40px rgba(0, 0, 0, 0.5);
}

.shot__caption {
  flex: none;
  width: 100%;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-style: italic;
  line-height: 1.45;
  text-align: center;
  color: #e8e3d6;
  text-wrap: balance;
}

/* ---- Bloc audio ---- */

.audio-card {
  width: min(520px, 100%);
  text-align: center;
  animation: fade 0.4s ease both;
}

.audio-card__disc {
  width: 132px;
  height: 132px;
  margin: 0 auto 1.6rem;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--ink) 0 17%, transparent 17.5%),
    conic-gradient(from 0deg, var(--gold), #7a5f2f, var(--gold), #7a5f2f, var(--gold));
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
  animation: spin 7s linear infinite;
}

.audio-card__title {
  font-family: var(--serif);
  font-size: 1.32rem;
  margin: 0 0 1.3rem;
  word-break: break-word;
}

.audio-card audio { width: 100%; }

/* ---- Flèches de défilement ---- */

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 66px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--muted);
  background: rgba(10, 12, 20, 0.55);
  border: 1px solid var(--line);
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.25s, color 0.2s, border-color 0.2s;
  z-index: 5;
}

.viewer:hover .nav-arrow { opacity: 1; }
.nav-arrow:hover { color: var(--gold); border-color: var(--gold-soft); }
.nav-arrow--prev { left: 12px; }
.nav-arrow--next { right: 12px; }
.nav-arrow[hidden] { display: none; }

/* ---- Barre d'information basse ---- */

.viewer__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.15rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: linear-gradient(0deg, rgba(10, 12, 20, 0.92), transparent);
}

.viewer__name    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Minuterie du diaporama ---- */

.timebar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  z-index: 6;
}

.timebar i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #ffe6ae);
}

@keyframes timebar { from { width: 0; } to { width: 100%; } }
.viewer__counter { flex: none; color: var(--gold); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   6. BOUTON PORTE (retour accueil)
   ========================================================================== */

.door {
  position: absolute;
  right: 1.7rem;
  bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.34rem;
  padding: 0;
  background: transparent;
  border: 0;
  z-index: 15;
  transition: transform 0.25s;
}

.door:hover { transform: translateY(-3px); }

.door__svg { width: 46px; height: 71px; overflow: visible; }

.door__frame {
  fill: rgba(10, 12, 20, 0.7);
  stroke: var(--line);
  stroke-width: 1.4;
  transition: stroke 0.3s;
}

.door__panel {
  fill: rgba(255, 255, 255, 0.03);
  stroke: var(--muted);
  stroke-width: 1;
  opacity: 0.6;
  transform-origin: 7px 46px;
  transition: opacity 0.3s, transform 0.45s cubic-bezier(0.34, 1.3, 0.5, 1);
}

.door__line { stroke: var(--muted); stroke-width: 0.8; opacity: 0.35; }
.door__knob { fill: var(--gold); opacity: 0.7; transition: opacity 0.3s; }

.door:hover .door__frame { stroke: var(--gold); }
.door:hover .door__panel { opacity: 1; transform: perspective(160px) rotateY(-38deg); }
.door:hover .door__knob  { opacity: 1; }

.door__label {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s;
}

.door:hover .door__label { color: var(--gold); }

/* ==========================================================================
   7. MODALE MOT DE PASSE HORAIRE
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(6, 7, 12, 0.82);
  backdrop-filter: blur(7px);
  animation: fade 0.3s ease both;
}

.modal__box {
  position: relative;
  width: 100%;
  max-width: 382px;
  padding: 2.1rem 1.8rem 1.6rem;
  text-align: center;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  animation: rise 0.35s ease both;
}

.modal__seal { font-size: 1.7rem; }

.modal__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.55rem;
  margin: 0.55rem 0 0.2rem;
}

.modal__sub {
  margin: 0 0 1.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.modal__actions { display: flex; gap: 0.6rem; margin-top: 1.1rem; }

.btn {
  flex: 1;
  padding: 0.72rem;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, filter 0.2s;
}

.btn--ghost:hover { color: var(--text); border-color: var(--gold); }

.btn--primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.btn--primary:hover { filter: brightness(1.1); }

/* ==========================================================================
   8. MESSAGE FLOTTANT
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 2.2rem;
  transform: translateX(-50%);
  z-index: 300;
  padding: 0.8rem 1.4rem;
  font-size: 0.83rem;
  background: var(--ink-2);
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.6);
  animation: rise 0.3s ease both;
}

/* ==========================================================================
   9. ANIMATIONS
   ========================================================================== */

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   10. ÉCRANS ÉTROITS
   ========================================================================== */

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }

  .rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 1rem;
  }

  .rail__head { margin-bottom: 0.9rem; }
  .rail__nav { flex-direction: row; overflow-x: auto; gap: 4px; }

  .tab {
    flex: none;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: 8px 8px 0 0;
    padding: 0.55rem 0.75rem;
  }

  .tab.is-active { border-left-color: transparent; border-bottom-color: var(--gold); }
  .tab__count, .rail__tip { display: none; }
  .view { padding: 1.1rem; }
  .viewer__media { padding: 1rem 1rem 3rem; }
  .door { right: 1rem; bottom: 1rem; }
  .door__svg { width: 34px; height: 52px; }
}
