/* SNCF en commun */

:root {
  color-scheme: light dark;
  /* mêmes tons que le site des communes : gris bleutés, rouge de signalisation, bleu de plaque */
  --fond: #eef1f4;
  --papier: #f8f9fb;
  --champ: #ffffff;
  --encre: #17212c;
  --doux: #5b6673;
  --pale: #8f99a5;
  --trait: #d4dae1;
  --trait-leger: #e3e7ec;
  --survol: #eef1f4;
  --eclair: #fde3e7;
  --barre: #dde3ea;
  --accent: #1f3f99;
  --signal: #c8102e;
  --plaque-bleue: #1f3f99;
  --ok: #1d7a46;
  --erreur: #b0122b;
  --erreur-fond: #fbe8eb;
  --bouton: #17212c;
  --bouton-texte: #ffffff;
  --ombre: rgba(23, 33, 44, 0.12);
  --flottant: rgba(248, 249, 251, 0.95);
  --colonne: 400px;
  --police-titre: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", "Avenir Next Condensed", sans-serif-condensed, sans-serif;
  font-family: "Barlow", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: var(--encre);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0f151c;
    --papier: #151c25;
    --champ: #1b2430;
    --encre: #e6ebf1;
    --doux: #95a1af;
    --pale: #66717f;
    --trait: #283342;
    --trait-leger: #1f2834;
    --survol: #1b2430;
    --eclair: #3b1f29;
    --barre: #1f2834;
    --accent: #6f94ff;
    --signal: #d8243f;
    --plaque-bleue: #2f57c9;
    --ok: #4cc382;
    --erreur: #ff6b7f;
    --erreur-fond: #3a1d25;
    --bouton: #e6ebf1;
    --bouton-texte: #151c25;
    --ombre: rgba(0, 0, 0, 0.45);
    --flottant: rgba(21, 28, 37, 0.95);
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--encre); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
input, select { background: var(--champ); color: var(--encre); }
[hidden] { display: none !important; }
a { color: var(--accent); }
.petit { font-size: 0.82rem; color: var(--doux); }

.langue {
  border: 1px solid var(--trait); background: none; border-radius: 999px; padding: 1px 9px;
  font-size: 0.78rem; color: var(--doux);
}
.langue:hover { color: var(--encre); border-color: var(--doux); }
.entete-haut { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------------------------------------------------------------- accueil */

body.accueil { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.accueil-carte {
  max-width: 34rem; background: var(--papier); border: 8px solid var(--signal); border-radius: 18px;
  padding: 26px 30px; box-shadow: 0 0 0 3px var(--papier), 0 0 0 4px var(--trait), 0 10px 30px var(--ombre);
}
.accueil-carte h1 {
  margin: 0 0 12px; font-family: var(--police-titre); font-size: 2rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.02em;
}
.erreur { color: var(--erreur); font-weight: 600; }
.bouton-principal {
  background: var(--signal); color: #ffffff; border: 0; border-radius: 10px; padding: 12px 22px;
  font-family: var(--police-titre); font-size: 1.15rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.bouton-principal:hover { opacity: 0.9; }
.creation { margin-top: 18px; }
.creation .petit { margin: 6px 0 16px; }
.reglage { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
.reglage input {
  width: 6.5em; padding: 7px 10px; border: 1px solid var(--trait); border-radius: 8px;
  background: var(--fond, transparent); color: var(--encre); font: inherit; text-align: right;
}
.reglage input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------------------------------------------------------------- partie */

body.partie { height: 100vh; height: 100dvh; overflow: hidden; }
/* ordinateur : commandes et volets à gauche, carte à droite ; téléphone : commandes, carte, volets */
.cadre {
  display: grid; grid-template-columns: var(--colonne) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "commandes carte" "volets carte"; height: 100%;
}

.zone-carte { grid-area: carte; position: relative; min-height: 0; overflow: hidden; background: var(--fond); }
#carte { display: block; touch-action: none; cursor: grab; }
#carte.glisse { cursor: grabbing; }
#carte.sur-gare { cursor: pointer; }

.carte-boutons {
  position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px;
}
.carte-boutons button {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--trait);
  background: var(--flottant); font-size: 17px; line-height: 1; color: var(--encre);
  box-shadow: 0 1px 3px var(--ombre);
}
.carte-boutons button:hover { background: var(--papier); }

.pastilles {
  position: absolute; top: 10px; left: 10px; right: 56px; display: flex; flex-direction: column; align-items: flex-start;
  gap: 6px; pointer-events: none;
}
.pastilles > * { pointer-events: auto; }
.pastille-filtre {
  display: flex; align-items: center; gap: 7px;
  background: var(--flottant); border: 1px solid var(--trait); border-radius: 999px;
  padding: 4px 6px 4px 10px; font-size: 0.88rem; box-shadow: 0 1px 3px var(--ombre);
}
.pastille-filtre button { border: 0; background: none; font-size: 1.1rem; line-height: 1; padding: 0 4px; }
.pastille-quete-tete { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.pastille-rejeu {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  background: var(--bouton); color: var(--bouton-texte); border-radius: 999px; padding: 4px 12px;
  font-size: 0.85rem; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0.9;
}
.barre-rejeu { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--barre); }
#barre-rejeu-avance { height: 100%; width: 0; background: var(--encre); }
.infobulle {
  position: absolute; z-index: 5; pointer-events: none; display: flex; flex-direction: column; gap: 3px;
  background: var(--flottant); border: 1px solid var(--trait); border-radius: 8px;
  padding: 6px 9px; box-shadow: 0 4px 14px var(--ombre); max-width: 260px; font-size: 0.88rem;
}
.chargement {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--doux); font-size: 0.95rem;
}

/* ---------------------------------------------------------------- colonne */

.commandes, .volets { background: var(--papier); border-right: 1px solid var(--trait); }
.commandes { grid-area: commandes; padding: 14px 16px 6px; display: flex; flex-direction: column; gap: 10px; }
.volets {
  grid-area: volets; min-height: 0; overflow-y: auto; padding: 0 16px 24px; display: flex; flex-direction: column; gap: 10px;
}
.entete { display: flex; flex-direction: column; gap: 4px; }
.entete .site {
  font-family: var(--police-titre); font-weight: 700; font-size: 0.86rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--signal); text-decoration: none;
}
.entete h1 {
  margin: 0; font-family: var(--police-titre); font-weight: 700; font-size: 1.7rem; line-height: 1.2; cursor: text; border-radius: 6px; overflow-wrap: anywhere;
}
.entete h1:hover { background: var(--survol); }
.entete h1.sans-titre { color: var(--pale); font-weight: 600; }
#titre-champ { width: 100%; font-size: 1.2rem; font-weight: 700; padding: 3px 6px; border: 1px solid var(--trait); border-radius: 6px; }

/* pseudo, couleur et « Autre appareil », à côté du nom de la partie */
.moi-barre { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.ma-couleur {
  flex: none; width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0;
  box-shadow: 0 0 0 2px var(--papier), 0 0 0 3px var(--trait);
}
.ma-couleur.vide { background: repeating-conic-gradient(var(--trait) 0 25%, var(--papier) 0 50%) 50% / 8px 8px !important; }
.ma-couleur[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--papier), 0 0 0 4px var(--encre); }
#pseudo {
  flex: 1; min-width: 0; padding: 5px 8px; border: 1px solid var(--trait); border-radius: 8px; font-size: 0.95rem;
}
.bouton-appareil {
  flex: none; border: 1px solid var(--trait); background: var(--champ); border-radius: 8px; padding: 5px 9px;
  font-size: 0.85rem; color: var(--doux);
}
.bouton-appareil[aria-expanded="true"] { color: var(--encre); border-color: var(--doux); }
.nuancier { display: grid; grid-template-columns: repeat(16, 1fr); gap: 4px; padding: 6px 0 2px; }
.nuance { aspect-ratio: 1; border: 0; border-radius: 50%; padding: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12) inset; }
.nuance[aria-checked="true"] { box-shadow: 0 0 0 2px var(--papier), 0 0 0 4px var(--encre); }
.nuance:disabled { opacity: 0.18; cursor: not-allowed; }
.appareil { border: 1px solid var(--trait); border-radius: 10px; padding: 4px 10px 10px; margin-top: 4px; }
.appareil p { margin: 6px 0; font-size: 0.88rem; }
.appareil .code { font-size: 1.35rem; font-weight: 750; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }
#mon-lien { overflow-wrap: anywhere; }
.code-form { display: flex; gap: 6px; }
.code-form input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--trait); border-radius: 8px; text-transform: uppercase; }
.code-form input::placeholder { text-transform: none; }
.code-form button { border: 1px solid var(--trait); background: var(--champ); border-radius: 8px; padding: 6px 10px; }

/* compteurs : grands chiffres centrés, comme sur le site des communes ; gares en premier, plus grand */
.compteurs { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 2px 10px; text-align: center; padding: 2px 0 4px; align-items: end; }
.stat-libelle {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--doux);
}
.stat-valeur {
  font-family: var(--police-titre); font-weight: 600; font-size: 2.3rem; line-height: 1.05;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stat-total { font-size: 0.5em; font-weight: 500; color: var(--doux); }
.stat:not(.stat-principale) .stat-valeur { font-size: 1.7rem; }

/* champ de saisie : plaque émaillée de station */
.saisie {
  --plaque: var(--plaque-bleue); --plaque-bord: #f4f6f8; --plaque-texte: #ffffff;
  display: flex;
}
.saisie input {
  border: 0; border-radius: 7px; background: var(--plaque); color: var(--plaque-texte);
  box-shadow: inset 0 0 0 3px var(--plaque), inset 0 0 0 5px var(--plaque-bord), 0 2px 0 rgba(0, 0, 0, 0.25), 0 3px 8px var(--ombre);
  transition: background-color 0.2s, box-shadow 0.2s;
}
.saisie input {
  flex: 1; min-width: 0; padding: 12px 16px; text-align: center;
  font-family: var(--police-titre); font-size: 1.35rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.saisie input::placeholder {
  color: rgba(255, 255, 255, 0.66); text-transform: none; letter-spacing: 0.01em; font-weight: 600; opacity: 1;
  font-size: 0.72em;
}
.saisie input:focus {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--plaque), inset 0 0 0 5px var(--plaque-bord), 0 2px 0 rgba(0, 0, 0, 0.25), 0 0 0 3px var(--accent);
}
/* limite atteinte : plaque grisée */
.saisie.ferme { --plaque: #8a929c; --plaque-bord: #dfe3e8; }
.saisie.ferme input { cursor: not-allowed; box-shadow: inset 0 0 0 3px var(--plaque), inset 0 0 0 5px var(--plaque-bord); }
.saisie.ferme input::placeholder { color: rgba(255, 255, 255, 0.92); }
@media (prefers-color-scheme: dark) {
  .saisie { --plaque-bord: #e6ebf1; }
  .saisie.ferme { --plaque: #3a4553; --plaque-bord: #7d8896; }
}
.saisie.secoue { animation: secoue 0.32s; }
@keyframes secoue {
  20% { transform: translateX(-6px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) { .saisie.secoue { animation: none; } }
.message { min-height: 1.3em; font-size: 0.92rem; }
.message.ok { color: var(--ok); }
.message.erreur { color: var(--erreur); }
.message.info { color: var(--encre); }
.quota { font-size: 0.82rem; color: var(--doux); margin-top: -6px; }

.onglets {
  display: flex; gap: 14px; border-bottom: 1px solid var(--trait); position: sticky; top: 0; z-index: 2;
  background: var(--papier); padding-top: 6px;
}
.onglets button {
  border: 0; background: none; padding: 10px 4px 8px; border-bottom: 2px solid transparent; color: var(--doux);
  font-weight: 600; font-size: 0.9rem;
}
.onglets button[aria-selected="true"] { color: var(--encre); border-bottom-color: var(--signal); }
.onglets button span { font-weight: 500; color: var(--doux); }

.outils-liste { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.outils-liste select {
  flex: 1 1 30%; min-width: 0; padding: 5px 6px; border: 1px solid var(--trait); border-radius: 7px; font-size: 0.85rem;
}

.liste { list-style: none; margin: 0; padding: 0; }
.liste li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nom droite" "badges droite";
  gap: 2px 8px; padding: 6px 6px; border-bottom: 1px solid var(--trait-leger); cursor: pointer; border-radius: 6px;
}
.liste li:hover, .liste li:focus { background: var(--survol); outline: none; }
.liste li.eclair { background: var(--eclair); }
.liste .nom { grid-area: nom; font-weight: 600; overflow-wrap: anywhere; }
.liste .badges { grid-area: badges; align-items: center; }
.liste .dep, .infobulle .dep { font-size: 0.8rem; color: var(--doux); margin-right: 3px; }
.liste .droite {
  grid-area: droite; display: flex; align-items: center; gap: 6px; color: var(--doux); font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.liste .qui { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.liste .qui-nom { max-width: 8.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--encre); }
.retirer { border: 0; background: none; color: var(--doux); font-size: 1.1rem; line-height: 1; padding: 0 3px; border-radius: 4px; }
.retirer:hover { color: var(--erreur); background: var(--erreur-fond); }
.vide { color: var(--doux); font-size: 0.9rem; }

.badges { display: flex; flex-wrap: wrap; gap: 3px; }
.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.55em; height: 1.55em;
  padding: 0 0.32em; border: 1.5px solid; border-radius: 999px; font-size: 10.5px; font-weight: 800;
  line-height: 1; letter-spacing: -0.01em; white-space: nowrap;
}
.badge-ligne { border-radius: 4px; font-variant-numeric: tabular-nums; }
.badge-dep { border-radius: 4px; border-color: var(--trait); color: var(--doux); background: var(--champ); font-variant-numeric: tabular-nums; }
.puce {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none;
  box-shadow: 0 0 0 1.5px var(--papier), 0 0 0 2.2px var(--pale);
}

/* classement */
.classement { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 0.92rem; }
.classement th {
  text-align: left; font-weight: 600; color: var(--doux); font-size: 0.72rem; padding: 10px 4px 6px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.classement th button { border: 0; background: none; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.classement th button.actif { color: var(--encre); }
.classement th button.actif::after { content: " ▾"; }
.classement td { padding: 6px 4px; border-bottom: 1px solid var(--trait-leger); vertical-align: middle; }
.classement tbody tr { cursor: pointer; }
.classement tbody tr:hover td, .classement tbody tr:focus td { background: var(--survol); }
.classement tbody tr:focus { outline: none; }
.classement tr.connecte td { font-weight: 650; background: var(--fond); }
.classement tr.filtre td { background: var(--eclair); }
.classement .rang { color: var(--doux); width: 1.8em; }
.classement .joueur-contenu { display: inline-flex; align-items: center; gap: 8px; }
.classement .nb, .classement th:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }

/* quêtes */
.quetes-region {
  width: 100%; margin: 8px 0 2px; padding: 5px 6px; border: 1px solid var(--trait); border-radius: 7px; font-size: 0.85rem;
}
#quetes h3 { font-size: 0.95rem; margin: 12px 0 4px; }
.section-quetes {
  display: flex; align-items: baseline; gap: 6px; width: 100%; border: 0; background: none; padding: 4px 0; text-align: left;
  font-weight: 700; font-size: 0.95rem;
}
.section-quetes .fleche { width: 1em; color: var(--doux); }
.section-quetes .petit { font-weight: 500; }
.quetes { list-style: none; margin: 0; padding: 0; }
.quetes li { border-bottom: 1px solid var(--trait-leger); }
.quete-tete {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "b t c" "r r r";
  align-items: center; gap: 4px 8px; padding: 6px 4px; border: 0; background: none; text-align: left;
}
.quete-tete > .badge { grid-area: b; }
.quete-tete:has(.quete-sous) { grid-template-areas: "b t c" "s s s" "r r r"; }
.quete-tete .quete-sous { grid-area: s; font-size: 0.78rem; color: var(--doux); margin-top: -3px; }
.quete-tete .quete-titre { grid-area: t; font-weight: 600; font-size: 0.9rem; }
.quete-tete .quete-compte { grid-area: c; font-size: 0.82rem; color: var(--doux); font-variant-numeric: tabular-nums; }
.quete-tete .barre { grid-area: r; height: 4px; background: var(--barre); border-radius: 2px; overflow: hidden; }
.quete-tete .avance { display: block; height: 100%; background: var(--encre); border-radius: 2px; }
.quetes li.faite .quete-compte { color: var(--ok); font-weight: 700; }
.quete-noms { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 4px 10px; }
.quete-noms p { width: 100%; margin: 0 0 4px; }
.quete-nom {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--trait); background: var(--champ);
  border-radius: 999px; padding: 2px 8px 2px 5px; font-size: 0.82rem;
}

.sources { margin-top: auto; font-size: 0.82rem; color: var(--doux); padding-top: 10px; }
.sources summary { cursor: pointer; }
.sources ul { padding-left: 1.2em; }

.notifications {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 20; display: flex;
  flex-direction: column; gap: 6px; pointer-events: none;
}
.notification {
  background: var(--bouton); color: var(--bouton-texte); padding: 8px 14px; border-radius: 10px; font-weight: 600;
  font-size: 0.92rem; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); transition: opacity 0.5s, transform 0.5s;
}
.notification.sort { opacity: 0; transform: translateY(-8px); }

/* plein écran : seulement la carte */
body.plein-ecran .commandes, body.plein-ecran .volets { display: none; }
body.plein-ecran .cadre { grid-template-columns: 1fr; grid-template-rows: 1fr; grid-template-areas: "carte"; }

/* ---------------------------------------------------------------- téléphone */

@media (max-width: 820px) {
  .stat:not(.stat-principale) .stat-valeur { font-size: 1.5rem; }
  body.partie { height: auto; overflow: auto; }
  .cadre { display: block; height: auto; }
  .zone-carte { height: min(62vh, 112vw); height: min(62svh, 112vw); border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); }
  .commandes, .volets { border-right: 0; }
  .commandes { padding: 12px 14px 8px; }
  .stat-valeur { font-size: 2rem; }
  .volets { overflow: visible; padding: 0 14px 24px; }
  body.plein-ecran .zone-carte { position: fixed; inset: 0; height: auto; z-index: 10; }
  .carte-boutons { top: 8px; right: 8px; }
  .nuancier { grid-template-columns: repeat(8, 1fr); }
}

/* ---------------------------------------------------------------- administration (/admin/CLE) */

body.admin { padding: 20px 16px 40px; }
body.admin main { max-width: 72rem; margin: 0 auto; }
body.admin h1 { font-family: var(--police-titre); text-transform: uppercase; color: var(--signal); margin: 0 0 6px; }
.admin-partie { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--trait); }
.admin-partie h2 { margin: 0 0 4px; font-size: 1.15rem; }
.admin-partie h2 a { color: var(--encre); }
.admin-defile { overflow-x: auto; }
.admin-table { border-collapse: collapse; width: 100%; margin-top: 8px; font-size: 0.9rem; }
.admin-table th, .admin-table td { padding: 6px 10px; border-bottom: 1px solid var(--trait); text-align: left; vertical-align: top; }
.admin-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--doux); }
.admin-table td.nb { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table code { font-size: 0.95rem; font-weight: 700; white-space: nowrap; }
.admin-table a { word-break: break-all; }
.admin-fusionne td { color: var(--doux); }
.admin-limite { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0 2px; font-size: 0.9rem; }
.admin-limite label { display: flex; align-items: center; gap: 6px; }
.admin-limite input[type=number] { width: 6.5em; padding: 4px 8px; border: 1px solid var(--trait); background: var(--champ); border-radius: 8px; }
.admin-limite button { padding: 4px 12px; border: 1px solid var(--trait); background: var(--champ); border-radius: 8px; }
.admin-fusion { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0 2px; font-size: 0.9rem; }
.admin-fusion label { display: flex; align-items: center; gap: 6px; }
.admin-fusion select { max-width: 14em; padding: 4px 8px; border: 1px solid var(--trait); background: var(--champ); border-radius: 8px; }
.admin-fusion button { padding: 4px 12px; border: 1px solid var(--trait); background: var(--champ); border-radius: 8px; }
.admin-fusion p { flex-basis: 100%; margin: 2px 0 0; }
.admin-ok { color: var(--signal); font-weight: 700; }
.admin-err { color: #c62828; font-weight: 700; }

/* ---------------------------------------------------------------- annonce épique (option des quêtes, défis remplis) */
/* À la manière de la mort d'un boss dans Dark Souls : bande sombre en travers de l'écran, grand titre doré qui
   grossit lentement avec un halo qui s'étend, puis tout s'efface. Durée : DUREE_EPIQUE dans app.js. */


.epique {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.45) 100%);
  opacity: 0;
}
.epique-bande {
  width: 100%; padding: 4.5vh 16px 4vh; text-align: center;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(4, 3, 2, 0.82) 22%, rgba(4, 3, 2, 0.82) 78%, rgba(0, 0, 0, 0) 100%);
}
.epique-titre { position: relative; display: inline-block; }
.epique-texte, .epique-halo {
  display: block; font-family: "Trajan Pro", "Cinzel", "Optima", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  font-weight: 400; text-transform: uppercase; letter-spacing: 0.12em; line-height: 1.1; white-space: nowrap;
  font-size: clamp(1.7rem, 7.2vw, 5.4rem);
}
.epique-texte {
  position: relative; color: #e9c46a;
  background: linear-gradient(to bottom, #fff2c4 0%, #e9c46a 45%, #b8872e 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(233, 196, 106, 0.35)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.8));
}
.epique-halo {
  position: absolute; left: 0; right: 0; top: 0; color: #f3d27a; filter: blur(10px); opacity: 0;
}
.epique-sous {
  margin-top: 1.4vh; color: #d8cfb8; font-family: Georgia, "Times New Roman", serif; font-style: italic;
  font-size: clamp(0.95rem, 2.4vw, 1.5rem); letter-spacing: 0.06em; opacity: 0;
}

.epique.joue { animation: epique-fond 5.6s ease-in-out forwards; }
.epique.joue .epique-bande { animation: epique-bande 5.6s ease-in-out forwards; }
.epique.joue .epique-texte { animation: epique-texte 5.6s cubic-bezier(0.2, 0.6, 0.3, 1) forwards; }
.epique.joue .epique-halo { animation: epique-halo 5.6s ease-out forwards; }
.epique.joue .epique-sous { animation: epique-sous 5.6s ease-in-out forwards; }

@keyframes epique-fond { 0% { opacity: 0; } 8% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes epique-bande { 0% { transform: scaleY(0.6); } 12% { transform: scaleY(1); } 100% { transform: scaleY(1); } }
@keyframes epique-texte {
  0% { opacity: 0; transform: scale(0.94); letter-spacing: 0.08em; }
  18% { opacity: 1; }
  100% { opacity: 1; transform: scale(1.06); letter-spacing: 0.16em; }
}
@keyframes epique-halo {
  0%, 10% { opacity: 0; transform: scale(1); }
  24% { opacity: 0.75; transform: scale(1.04); }
  70% { opacity: 0; transform: scale(1.3); }
  100% { opacity: 0; transform: scale(1.3); }
}
@keyframes epique-sous { 0%, 25% { opacity: 0; transform: translateY(6px); } 40% { opacity: 1; transform: none; } 100% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .epique.joue .epique-bande, .epique.joue .epique-texte, .epique.joue .epique-halo, .epique.joue .epique-sous { animation: none; }
  .epique.joue .epique-texte, .epique.joue .epique-sous { opacity: 1; }
}
