/* =============================================================
   Musée des réussites de l'Humanité — feuille de style
   Direction visuelle (README) : palais doré au-dessus des nuages,
   style rétro des jeux de tir des années 90.
   Aucune police externe : polices système uniquement.
   ============================================================= */

:root {
  --fond: #15121e;          /* couleur de fond de l'intérieur (README) */
  --fond-panneau: #1f1a2c;
  --texte: #f3efe6;
  --texte-discret: #c9c2d6;
  --or: #e8c25a;
  --or-clair: #ffd978;
  --ciel: #2aa0e8;          /* couleur du ciel extérieur (README) */
  --lien: #9fdcff;
  --focus: #7fd4ff;
  --alerte: #ffb4a8;

  --police-titre: "Courier New", Courier, monospace;
  --police-texte: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}

/* L'attribut hidden doit toujours l'emporter sur les display: flex ci-dessous */
[hidden] {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police-texte);
  font-size: 1rem;
  line-height: 1.5;
}

h1,
h2 {
  font-family: var(--police-titre);
  font-weight: bold;
  color: var(--or);
  line-height: 1.2;
  margin: 0 0 1rem;
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

h2 {
  font-size: 1.3rem;
}

a {
  color: var(--lien);
}

a:hover {
  color: var(--texte);
}

/* Focus clavier bien visible sur tous les éléments interactifs */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0 0.35em;
  border: 2px solid currentColor;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  font-family: var(--police-titre);
  font-weight: bold;
  text-align: center;
  line-height: 1.4;
}

.discret {
  color: var(--texte-discret);
  font-size: 0.9em;
  font-weight: normal;
}

/* ---------- Canvas 3D (plein écran, derrière les écrans) ---------- */

#canvas-3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Écrans superposés (accueil, chargement, pause, fiche) ---------- */

.ecran {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  overflow-y: auto;
  background: rgba(21, 18, 30, 0.88);
}

/* Centrage vertical par marges automatiques (et non justify-content: center),
   pour que le haut du contenu reste accessible au défilement sur un petit écran */
.ecran > :first-child {
  margin-top: auto;
}

.ecran > :last-child {
  margin-bottom: auto;
}

.panneau {
  width: 100%;
  max-width: 42rem;
  padding: 2rem;
  background: var(--fond-panneau);
  border: 3px solid var(--or);
  box-shadow: 6px 6px 0 #000;   /* ombre « pixel » sans flou */
}

.panneau > :last-child {
  margin-bottom: 0;
}

/* Accueil : dégradé ciel → nuit, comme le palais au-dessus des nuages */
.ecran-accueil {
  background: linear-gradient(180deg, var(--ciel) 0%, #5a4fa6 45%, var(--fond) 100%);
}

.pied {
  padding: 0.5rem 1rem;
  background: var(--fond-panneau);
}

.pied nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: center;
}

.alerte {
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--alerte);
  background: rgba(255, 180, 168, 0.1);
  color: var(--alerte);
  font-weight: bold;
}

.alerte p {
  margin: 0 0 0.5rem;
}

.alerte p:last-child {
  margin-bottom: 0;
}

code {
  font-family: var(--police-titre);
  background: rgba(255, 255, 255, 0.1);
  padding: 0 0.3em;
}

.lien-texte {
  margin-top: -0.75rem;
  color: var(--texte-discret);
}

/* Bouton « Entrer » caché (file://, téléphone) : le lien ne doit pas se coller au message */
#btn-entrer[hidden] + .lien-texte {
  margin-top: 1rem;
}

/* ---------- Boutons ---------- */

.bouton {
  display: inline-block;
  margin: 0 0 1.5rem;
  padding: 0.75rem 1.5rem;
  border: 3px solid var(--or);
  background: var(--or);
  color: var(--fond);
  font-family: var(--police-titre);
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
}

.bouton:hover {
  background: var(--or-clair);
  border-color: var(--or-clair);
}

/* Lien présenté comme un bouton (ex. « Version texte » dans le menu pause) */
a.bouton {
  text-align: center;
  text-decoration: none;
}

.bouton-secondaire {
  background: transparent;
  color: var(--texte);
}

.bouton-secondaire:hover {
  background: rgba(232, 194, 90, 0.15);
  border-color: var(--or);
}

.boutons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.boutons .bouton {
  margin: 0;
  width: 100%;
}

/* ---------- Liste des commandes ---------- */

.commandes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.commandes li {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.3rem 0;
}

/* Les touches gardent leur largeur ; c'est le texte de l'action qui passe à la ligne */
.commandes .touches {
  flex-shrink: 0;
  min-width: 9rem;
}

/* ---------- Chargement ---------- */

progress {
  width: 100%;
  height: 1.5rem;
  appearance: none;
  border: 3px solid var(--or);
  background: #3a3150;
}

progress::-webkit-progress-bar {
  background: #3a3150;
}

progress::-webkit-progress-value {
  background: var(--or);
}

progress::-moz-progress-bar {
  background: var(--or);
}

.pourcentage {
  font-family: var(--police-titre);
  font-weight: bold;
  text-align: right;
  margin: 0.25rem 0 0.5rem;
}

.message-verrouillage:empty,
#statut-chargement:empty {
  display: none;
}

/* ---------- HUD (pendant la visite) ---------- */

#hud {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;   /* le HUD ne doit pas gêner la souris */
}

/* Petit viseur en croix : blanc avec un contour noir, lisible sur tous les fonds */
#viseur {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
}

#viseur::before,
#viseur::after {
  content: "";
  position: absolute;
  background: #fff;
  box-shadow: 0 0 0 1px #000;
}

#viseur::before {
  left: 8px;
  top: 0;
  width: 2px;
  height: 18px;
}

#viseur::after {
  top: 8px;
  left: 0;
  width: 18px;
  height: 2px;
}

#invite {
  position: absolute;
  top: calc(50% + 2rem);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.4rem 0.9rem;
  border: 2px solid var(--or);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-family: var(--police-titre);
  font-weight: bold;
  white-space: nowrap;
}

#aide {
  position: absolute;
  top: 1rem;
  left: 1rem;
  max-width: 24rem;
  padding: 1rem;
  border: 2px solid var(--or);
  background: rgba(21, 18, 30, 0.88);
  font-size: 0.9rem;
}

#aide h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

#aide .commandes .touches {
  min-width: 7.5rem;
}

/* ---------- Fiche d'une œuvre ---------- */

.ecran-fiche {
  background: rgba(0, 0, 0, 0.6);
}

/* La fiche reçoit le focus par le code (pour les lecteurs d'écran),
   mais ce n'est pas un élément interactif : pas de contour de focus */
.ecran-fiche [role="dialog"]:focus {
  outline: none;
}

.fiche-annee {
  font-family: var(--police-titre);
  font-weight: bold;
  color: var(--texte-discret);
  margin-top: -0.5rem;
}

/* =============================================================
   Thèmes des salles (époques) — body[data-theme] est posé par js/ui.js
   selon la salle où se trouve le visiteur. Les couleurs des voiles
   viennent de js/salles.js (variables --voile-…).
   ============================================================= */

/* ---------- Voiles d'ambiance (par-dessus la 3D, sous l'interface) ---------- */

#ambiance {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.voile {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}

body[data-theme="origines"] .voile-origines,
body[data-theme="present"] .voile-present,
body[data-theme="futur"] .voile-futur {
  opacity: 1;
}

/* Aux origines : vignette chaude et saturée sur les bords */
.voile-origines {
  background: radial-gradient(ellipse at center,
    transparent 45%,
    var(--voile-origines-milieu, rgba(255, 140, 30, 0.16)) 72%,
    var(--voile-origines-bord, rgba(220, 70, 0, 0.55)) 100%);
}

/* Le présent : bords à peine teintés de cyan */
.voile-present {
  background: radial-gradient(ellipse at center,
    transparent 60%,
    var(--voile-present-milieu, transparent) 80%,
    var(--voile-present-bord, rgba(0, 200, 224, 0.16)) 100%);
}

/* Le futur : lignes de balayage discrètes + bords magenta / cyan */
.voile-futur {
  background:
    repeating-linear-gradient(to bottom,
      transparent 0, transparent 2px,
      var(--voile-futur-scanlines, rgba(0, 0, 0, 0.22)) 2px, var(--voile-futur-scanlines, rgba(0, 0, 0, 0.22)) 3px),
    radial-gradient(ellipse at 15% 50%, transparent 55%, var(--voile-futur-bord, rgba(255, 43, 214, 0.22)) 100%),
    radial-gradient(ellipse at 85% 50%, transparent 55%, var(--voile-futur-bord2, rgba(0, 229, 255, 0.2)) 100%);
}

/* ---------- Nom de la salle, affiché brièvement à l'entrée ---------- */

#nom-salle {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.6rem 1.4rem;
  border: 2px solid var(--or);
  background: rgba(21, 18, 30, 0.9);
  color: var(--or);
  font-family: var(--police-titre);
  font-size: 1.4rem;
  font-weight: bold;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 1;   /* au-dessus du panneau d'aide sur un petit écran */
}

#nom-salle.visible {
  opacity: 1;
}

#nom-salle:empty {
  display: none;
}

body[data-theme="origines"] #nom-salle {
  border: 1px solid #8a3a00;
  border-radius: 999px;
  background: linear-gradient(#d96a0a 0%, #c45a04 50%, #a84300 51%, #b84f02 100%);
  color: #fff;
  font-family: "Trebuchet MS", Verdana, Tahoma, sans-serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
}

body[data-theme="present"] #nom-salle {
  border: none;
  border-left: 4px solid #00b8cc;
  border-radius: 2px;
  background: rgba(247, 249, 250, 0.95);
  color: #111;
  font-family: var(--police-texte);
  font-weight: 600;
}

body[data-theme="futur"] #nom-salle {
  border: 1px solid #00e5ff;
  background: rgba(10, 6, 20, 0.92);
  color: #ff2bd6;
  font-family: Consolas, "Courier New", monospace;
  text-shadow: 0 0 6px #ff2bd6, 0 0 14px rgba(255, 43, 214, 0.6);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.45);
}

/* ---------- Fiche : apparition en fondu ---------- */

.ecran-fiche .panneau {
  animation: apparition 0.3s ease;
  transition: background 0.6s ease, color 0.6s ease, border-color 0.6s ease;
}

@keyframes apparition {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Fiche « Aux origines » : web 2.0 des années 2000 ---------- */

#fiche[data-theme="origines"] .panneau {
  overflow: hidden;
  padding-top: 0;
  border: 1px solid #b85a00;
  border-radius: 14px;
  background: linear-gradient(#fff8ec, #ffe9c9);
  color: #2b1606;
  font-family: "Trebuchet MS", Verdana, Tahoma, sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 #fff;
}

/* Barre de titre brillante (moitié haute plus claire) */
#fiche[data-theme="origines"] h2 {
  margin: 0 -2rem 1.25rem;
  padding: 0.9rem 2rem;
  border-bottom: 1px solid #8a3a00;
  background: linear-gradient(#d96a0a 0%, #c45a04 50%, #a84300 51%, #b84f02 100%);
  color: #fff;
  font-family: inherit;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* Année dans une pastille brillante */
#fiche[data-theme="origines"] .fiche-annee {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.15rem 0.9rem;
  border: 1px solid #d08030;
  border-radius: 999px;
  background: linear-gradient(#ffffff 0%, #ffe6bf 50%, #ffc880 51%, #ffdca8 100%);
  color: #6b2a00;
  font-family: inherit;
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0, 0, 0, 0.25);
}

#fiche[data-theme="origines"] .discret {
  color: #6b3a14;
}

/* Touches façon boutons brillants */
#fiche[data-theme="origines"] kbd {
  border: 1px solid #8f8f8f;
  border-radius: 7px;
  background: linear-gradient(#ffffff 0%, #eeeeee 50%, #d9d9d9 51%, #f2f2f2 100%);
  color: #222;
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ---------- Fiche « Le présent » : minimaliste ---------- */

#fiche[data-theme="present"] .panneau {
  border: none;
  border-left: 4px solid #00b8cc;
  border-radius: 2px;
  background: #f7f9fa;
  color: #111;
  font-family: var(--police-texte);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

#fiche[data-theme="present"] h2 {
  color: #111;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
}

#fiche[data-theme="present"] .fiche-annee {
  color: #00707d;
  font-family: inherit;
  font-weight: 500;
}

#fiche[data-theme="present"] .discret {
  color: #4a5358;
}

#fiche[data-theme="present"] kbd {
  border: 1px solid #b9c3c7;
  border-radius: 4px;
  background: #fff;
  color: #111;
}

/* ---------- Fiche « Le futur » : néons, lignes de balayage ---------- */

#fiche[data-theme="futur"] .panneau {
  border: 1px solid #00e5ff;
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent 2px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.03) 3px),
    #0a0614;
  color: #e9f7ff;
  font-family: Consolas, "Courier New", monospace;
  box-shadow: 0 0 0 1px #ff2bd6, 0 0 26px rgba(255, 43, 214, 0.45), inset 0 0 30px rgba(0, 229, 255, 0.08);
}

#fiche[data-theme="futur"] h2 {
  color: #ff2bd6;
  font-family: inherit;
  text-shadow: 0 0 6px #ff2bd6, 0 0 14px rgba(255, 43, 214, 0.6);
}

#fiche[data-theme="futur"] .fiche-annee {
  color: #00e5ff;
  font-family: inherit;
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.7);
}

#fiche[data-theme="futur"] .discret {
  color: #b9c6d6;
}

#fiche[data-theme="futur"] kbd {
  border: 1px solid #00e5ff;
  background: rgba(0, 229, 255, 0.08);
  color: #00e5ff;
}

/* ---------- Léger « glitch » des titres du futur ----------
   Deux copies du texte (attribut data-texte) décalées en cyan et magenta,
   visibles une fraction de seconde toutes les 4 secondes.
   « / "" » : texte décoratif, ignoré par les lecteurs d'écran. */

/* (#nom-salle est déjà positionné en absolu : ses copies s'y accrochent) */
#fiche[data-theme="futur"] #fiche-titre {
  position: relative;
}

#fiche[data-theme="futur"] #fiche-titre::before,
#fiche[data-theme="futur"] #fiche-titre::after,
body[data-theme="futur"] #nom-salle::before,
body[data-theme="futur"] #nom-salle::after {
  content: attr(data-texte);
  content: attr(data-texte) / "";
  position: absolute;
  inset: 0;
  padding: inherit;
  opacity: 0;
  pointer-events: none;
}

#fiche[data-theme="futur"] #fiche-titre::before,
body[data-theme="futur"] #nom-salle::before {
  color: #00e5ff;
  animation: glitch-a 4s steps(1) infinite;
}

#fiche[data-theme="futur"] #fiche-titre::after,
body[data-theme="futur"] #nom-salle::after {
  color: #ff2bd6;
  animation: glitch-b 4s steps(1) infinite;
}

@keyframes glitch-a {
  0%, 90%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); }
  91% { opacity: 0.85; transform: translate(-3px, 0); clip-path: inset(15% 0 55% 0); }
  93% { opacity: 0.85; transform: translate(2px, 0); clip-path: inset(60% 0 10% 0); }
  95% { opacity: 0; }
}

@keyframes glitch-b {
  0%, 91%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); }
  92% { opacity: 0.85; transform: translate(3px, 0); clip-path: inset(50% 0 20% 0); }
  94% { opacity: 0.85; transform: translate(-2px, 0); clip-path: inset(5% 0 70% 0); }
  96% { opacity: 0; }
}

/* Réglage « réduire les animations » du système : pas de glitch ni de fondu animé */
@media (prefers-reduced-motion: reduce) {
  #fiche-titre::before,
  #fiche-titre::after,
  #nom-salle::before,
  #nom-salle::after {
    display: none;
  }

  .voile,
  #nom-salle,
  .ecran-fiche .panneau {
    transition: none;
    animation: none;
  }
}

/* ---------- Pages de texte (mentions légales, confidentialité, visite texte) ---------- */

.page-texte main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-texte .sommaire li {
  margin: 0.4rem 0;
}

.salle-texte {
  margin: 2.5rem 0;
  padding-top: 1rem;
  border-top: 3px solid var(--or);
}

.salle-texte .emplacement {
  color: var(--texte-discret);
  font-style: italic;
}

.liste-oeuvres {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.liste-oeuvres li {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--fond-panneau);
  border-left: 4px solid var(--or);
}

.liste-oeuvres h3 {
  margin: 0 0 0.25rem;
  color: var(--texte);
  font-size: 1.15rem;
}

.liste-oeuvres .fiche-annee {
  margin: 0 0 0.5rem;
}

.liste-oeuvres p:last-child {
  margin-bottom: 0;
}

/* =============================================================
   Cyber Escape Challenge (js/cyber.js) — même look néon que la fiche du futur
   ============================================================= */

/* ---------- Alerte dans la fiche de l'œuvre du défi ---------- */

.fiche-defi {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid #ff2040;
  background: rgba(255, 32, 64, 0.1);
  box-shadow: 0 0 14px rgba(255, 32, 64, 0.35);
}

.fiche-defi p {
  margin: 0 0 0.5rem;
}

.fiche-defi p:last-child {
  margin-bottom: 0;
}

.fiche-defi-alerte {
  color: #ff4060;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-shadow: 0 0 6px rgba(255, 32, 64, 0.8);
  animation: clignote-alerte 1.6s steps(2, jump-none) infinite;
}

#fiche .fiche-defi kbd {
  border-color: #ff4060;
  color: #ff4060;
  background: rgba(255, 32, 64, 0.12);
}

.fiche-defi-resolu {
  margin: 1.25rem 0;
  color: #39ff9c;
  font-weight: bold;
  text-shadow: 0 0 6px rgba(57, 255, 156, 0.6);
}

@keyframes clignote-alerte {
  0%, 70% { opacity: 1; }
  85% { opacity: 0.35; }
  100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .fiche-defi-alerte { animation: none; }
}

/* ---------- Écran du défi ---------- */

.ecran-cyber {
  z-index: 20;
  background: rgba(5, 3, 12, 0.82);
}

.panneau-cyber {
  max-width: 52rem;
  border: 1px solid #00e5ff;
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent 2px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.03) 3px),
    #0a0614;
  color: #e9f7ff;
  font-family: Consolas, "Courier New", monospace;
  box-shadow: 0 0 0 1px #ff2bd6, 0 0 26px rgba(255, 43, 214, 0.45), inset 0 0 30px rgba(0, 229, 255, 0.08);
}

.panneau-cyber:focus {
  outline: none;
}

.panneau-cyber h2,
.panneau-cyber h3 {
  font-family: inherit;
}

.panneau-cyber h2 {
  margin: 0 0 0.25rem;
  color: #ff2bd6;
  text-shadow: 0 0 6px #ff2bd6, 0 0 14px rgba(255, 43, 214, 0.6);
}

.panneau-cyber h3 {
  color: #00e5ff;
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.6);
}

.panneau-cyber .discret {
  color: #b9c6d6;
}

.panneau-cyber kbd {
  border: 1px solid #00e5ff;
  background: rgba(0, 229, 255, 0.08);
  color: #00e5ff;
}

.cyber-surtitre,
.cyber-categorie {
  margin: 0;
  color: #00e5ff;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.cyber-categorie {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid #ff2bd6;
  color: #ff2bd6;
}

.cyber-statut {
  margin: 0 0 0.75rem;
  color: #b9c6d6;
}

.cyber-voyants {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cyber-voyants li {
  padding: 0.2rem 0.6rem;
  border: 1px solid #3a3456;
  color: #8a86a6;
  font-size: 0.85rem;
}

.cyber-voyants li.actuel {
  border-color: #ff2bd6;
  color: #ff2bd6;
  box-shadow: 0 0 8px rgba(255, 43, 214, 0.5);
}

.cyber-voyants li.ouvert {
  border-color: #39ff9c;
  color: #39ff9c;
}

/* Journal, message chiffré, page de l'attaquant */
.artefact {
  margin: 1rem 0;
}

.artefact figure {
  margin: 0;
}

.artefact figcaption {
  padding: 0.25rem 0.6rem;
  background: #1a0830;
  border: 1px solid #3a3456;
  border-bottom: 0;
  color: #b9c6d6;
  font-size: 0.8rem;
}

.journal {
  display: block;
  margin: 0;
  padding: 0.75rem;
  max-height: 16rem;
  overflow: auto;
  border: 1px solid #3a3456;
  background: #020106;
  color: #39ff9c;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre;
}

.page-rancon {
  padding: 1.25rem;
  border: 1px solid #3a3456;
  background: #000;
  color: #ff4060;
  text-align: center;
}

.rancon-titre {
  margin: 0 0 0.75rem;
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 0.2em;
  text-shadow: 0 0 10px rgba(255, 32, 64, 0.9);
}

.rancon-signature {
  margin-bottom: 0;
  color: #6b2030;
  font-size: 0.8rem;
}

.dechiffreur {
  margin-top: 1rem;
}

.dechiffreur label,
.form-cyber label {
  display: block;
  margin-bottom: 0.4rem;
  color: #00e5ff;
}

.dechiffreur input {
  width: 100%;
  margin-bottom: 0.5rem;
}

.dechiffreur output {
  min-height: 2.5rem;
  white-space: pre-wrap;
}

.panneau-cyber input {
  padding: 0.6rem 0.75rem;
  border: 1px solid #00e5ff;
  background: #020106;
  color: #e9f7ff;
  font: inherit;
}

.ligne-reponse {
  display: flex;
  gap: 0.75rem;
}

.ligne-reponse input {
  flex: 1;
  min-width: 0;
}

.ligne-reponse .bouton {
  margin: 0;
}

.panneau-cyber .bouton {
  border-color: #00e5ff;
  background: #00e5ff;
  color: #05030c;
  font-family: inherit;
}

.panneau-cyber .bouton:hover {
  background: #7ff3ff;
  border-color: #7ff3ff;
}

.panneau-cyber .bouton-secondaire {
  background: transparent;
  color: #e9f7ff;
}

.panneau-cyber .bouton-secondaire:hover {
  background: rgba(0, 229, 255, 0.12);
}

.retour-ok {
  color: #39ff9c;
  font-weight: bold;
}

.retour-erreur {
  color: #ff4060;
  font-weight: bold;
}

.cyber-indices {
  padding-left: 1.2rem;
  color: #ffd978;
}

.cyber-indices li {
  margin-bottom: 0.5rem;
}

.cyber-flag-titre {
  margin-bottom: 0.25rem;
  color: #00e5ff;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.cyber-flag {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px dashed #39ff9c;
  color: #39ff9c;
  font-size: 1.3rem;
  font-weight: bold;
  user-select: all;
  text-shadow: 0 0 8px rgba(57, 255, 156, 0.6);
}

#cyber .boutons {
  margin-top: 1.5rem;
}

/* =============================================================
   Défi KPS — Le pingouin prend la page !
   ============================================================= */

body.pingu-actif {
  overflow-x: hidden;
}

#btn-pingu-defi {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
  margin: 0;
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  background: var(--fond-panneau);
  border: 3px solid var(--or);
  color: var(--or);
  box-shadow: 4px 4px 0 #000;
}

#btn-pingu-defi:hover {
  background: var(--or);
  color: var(--fond);
}

#pingu-hud {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--fond-panneau);
  color: var(--texte);
  border: 3px solid var(--or);
  box-shadow: 4px 4px 0 #000;
  padding: 0.6rem 1.2rem;
  font-family: var(--police-texte);
  font-size: 0.92rem;
  text-align: center;
  max-width: 92vw;
}

#pingu-hud strong {
  color: var(--or-clair);
  font-family: var(--police-titre);
}

#pingu-avatar {
  position: fixed;
  top: 0;
  left: 0;
  width: 34px;
  height: 42px;
  z-index: 999;
  pointer-events: none;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.65));
}

/* Mise en valeur des balises HTML détournées comme éléments de gameplay */
.pingu-dom-highlight {
  outline: 2px dashed rgba(127, 212, 255, 0.55);
  outline-offset: 3px;
  transition: transform 0.15s ease;
}

.pingu-echelle-active {
  outline: 2px dotted var(--or);
  outline-offset: 4px;
  background: rgba(232, 194, 90, 0.08);
}

/* Balises <kbd> transformées en artefacts à collecter */
.pingu-artefact {
  border-color: var(--focus);
  color: var(--or-clair);
  box-shadow: 0 0 8px rgba(127, 212, 255, 0.75);
  animation: pinguPulse 0.9s infinite alternate;
}

.pingu-artefact-pris {
  opacity: 0.35;
  border-color: currentColor;
  color: var(--texte-discret);
  box-shadow: none;
  animation: none;
  text-decoration: line-through;
}

/* Quand Pingu a fini sa quête : #btn-entrer devient le portail final */
.pingu-portail-pret {
  background: var(--or-clair) !important;
  border-color: #fff !important;
  color: var(--fond) !important;
  box-shadow: 0 0 18px var(--or-clair), 4px 4px 0 #000 !important;
  animation: pinguPulse 0.7s infinite alternate;
}

@keyframes pinguPulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .pingu-artefact,
  .pingu-portail-pret {
    animation: none;
  }

  .pingu-dom-highlight {
    transition: none;
  }
}
