@import url('https://fonts.googleapis.com/css2?family=Bungee&family=Press+Start+2P&family=Rubik:wght@400;500;700;900&display=swap');
/* =====================================================================
   LA RÉCRÉATION — direction « écran de sélection »
   =====================================================================
   Validée par Jérôme le 25/09/2026 d'après maquettes/recre-da.html.
   Chargée EN DERNIER dans les sept ateliers (juste avant </head>) : elle
   rhabille, elle ne touche à aucune mécanique.

   🔑 UNE COULEUR PAR ATELIER, comme les colonnes du mur : on sait où l'on
      est d'un coup d'œil. Elle est lue sur l'onglet actif (`:has`), donc
      aucune ligne de JavaScript à ajouter dans les pages.
   🔑 Les sélecteurs commencent par `body` : ils passent devant les règles
      propres à chaque page, qui n'ont qu'une classe.
   ⛔ ON NE PENCHE QUE LES BOUTONS ET LES PASTILLES, jamais un conteneur :
      le piano, la grille du beat, la planche de pixels et la toile
      reposent sur des positions exactes.
   ⚠️ Les textes restent en Rubik, lisible. Bungee pour les titres et les
      étiquettes, jamais pour un paragraphe.
   ===================================================================== */

/* Le focus clavier se voit toujours (audit du 25/09), comme dans le jeu. */
body :focus-visible { outline: 4px solid #fff !important; outline-offset: 3px; box-shadow: 0 0 0 7px #000 !important; }

:root {
  --noir: #000;
  --panneau-da: #0D0D12;
  --jaune-da: #FFE14B;
  --rouge-da: #FF5E3A;
  --titre-da: 'Bungee', Impact, 'Arial Black', sans-serif;
  --texte-da: 'Rubik', system-ui, 'Segoe UI', sans-serif;
  --rayon: 0px;
  --rayon-gros: 0px;
  --nuit: #07070C;
  --nuit-2: #0D0D12;
  --nuit-3: #17171F;
}
html:has(.onglets-recre[data-on="pause"])      { --accent: #5CE6A5; }
html:has(.onglets-recre[data-on="synthe"])     { --accent: #4CC9F0; }
html:has(.onglets-recre[data-on="beat"])       { --accent: #F0B23C; }
html:has(.onglets-recre[data-on="pixel"])      { --accent: #F58BC0; }
html:has(.onglets-recre[data-on="toile"])      { --accent: #FFE14B; }
html:has(.onglets-recre[data-on="miroir"])     { --accent: #A78BFA; }
html:has(.onglets-recre[data-on="artifice"])   { --accent: #FF8A3D; }
html:has(.onglets-recre[data-on="logique"])    { --accent: #E040FB; }
html:has(.onglets-recre[data-on="motdepasse"]) { --accent: #FF5E3A; }
html:has(.onglets-recre) { --accent-doux: color-mix(in srgb, var(--accent) 16%, transparent); }

body:has(.onglets-recre) {
  font-family: var(--texte-da);
  background: radial-gradient(circle at 50% 130%, color-mix(in srgb, var(--accent) 26%, #120022), #07070C 64%) fixed, #07070C;
}
body:has(.onglets-recre) .wrap { max-width: 1480px; padding: 0 clamp(16px, 2.4vw, 44px); }

/* ---- la barre des ateliers, en haut, noire, pleine largeur ---- */
body .onglets-recre {
  position: sticky; top: 0; z-index: 50;
  margin: 0 calc(-1 * clamp(16px, 2.4vw, 44px)) 3vh; padding: 1.4vh clamp(16px, 2.4vw, 44px);
  background: #000; border-bottom: 5px solid var(--accent);
  display: flex; gap: .7vw; flex-wrap: wrap; align-items: center;
}
body .onglets-recre::after {
  content: 'RÉCRÉ · AUCUN POINT'; margin-left: auto;
  font: clamp(11px, .9vw, 15px) var(--titre-da); color: var(--jaune-da); white-space: nowrap;
}
body .onglets-recre a {
  font: clamp(12px, 1vw, 17px) var(--titre-da); text-transform: uppercase; letter-spacing: .02em;
  padding: .9vh 1.1vw; border: 3px solid #333; border-radius: 0; background: #111; color: #aaa;
  transform: skewX(-7deg); text-decoration: none; white-space: nowrap;
}
body .onglets-recre a:hover { border-color: var(--accent); color: var(--accent); }
body .onglets-recre a.on {
  background: var(--accent); color: #000; border-color: #000;
  box-shadow: 0 0 0 3px var(--accent), 0 0 24px var(--accent);
}

/* ---- titres et étiquettes ---- */
/* ⚠️ Seulement le grand titre de la page. `.titre` sert aussi à de petits
   intitulés dans les panneaux (« La couleur que tu viens de composer ») :
   leur donner ce style les faisait déborder sur dix lignes (vu le 25/09). */
body:has(.onglets-recre) h1, body:has(.onglets-recre) h1.titre, body:has(.onglets-recre) .wrap > .titre {
  font-family: var(--titre-da); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; line-height: .95;
  font-size: clamp(34px, 4.6vw, 82px);
  background: linear-gradient(#FFF36B, var(--rouge-da)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 .5vh 0 #000); margin-bottom: 1.2vh;
}
body:has(.onglets-recre) h2, body:has(.onglets-recre) h3 {
  font-family: var(--titre-da); font-weight: 400; text-transform: uppercase; letter-spacing: .02em;
}
body:has(.onglets-recre) .kicker {
  font: clamp(12px, 1vw, 17px) var(--titre-da); letter-spacing: .04em; color: var(--accent);
}
body:has(.onglets-recre) .chapo, body:has(.onglets-recre) .tete p { font-size: clamp(16px, 1.3vw, 23px); font-weight: 500; color: #ddd; }

/* ---- les panneaux : noirs, cernés, liserés de la couleur de l'atelier ---- */
body:has(.onglets-recre) .panneau,
body:has(.onglets-recre) .bloc,
body:has(.onglets-recre) .module,
body:has(.onglets-recre) .ecran,
body:has(.onglets-recre) .clavier-zone,
body:has(.onglets-recre) .grille-zone,
body:has(.onglets-recre) .table-fx,
body:has(.onglets-recre) .cadre,
body:has(.onglets-recre) .atelier > .toile,
body:has(.onglets-recre) .lecon,
body:has(.onglets-recre) .mot-du-moment,
body:has(.onglets-recre) .atelier > .potards,
body:has(.onglets-recre) .mail-dabord {
  background: var(--panneau-da); border: 5px solid #000; border-radius: 0;
  box-shadow: 0 0 0 4px var(--accent), .7vw .9vh 0 4px #000;
}
body:has(.onglets-recre) .mail-dabord { background: #000; }
body:has(.onglets-recre) .module h3, body:has(.onglets-recre) .bloc h3 { color: var(--accent); }

/* ---- boutons : autocollants penchés ---- */
body:has(.onglets-recre) .btn {
  font-family: var(--titre-da); font-weight: 400; text-transform: uppercase; letter-spacing: .02em;
  border-radius: 0; border: 4px solid #000; transform: skewX(-7deg);
  background: linear-gradient(#FFF36B, #FFB52E); color: #000; box-shadow: .35vw .45vh 0 #000;
}
body:has(.onglets-recre) .btn:hover { filter: brightness(1.06); box-shadow: calc(.35vw + 2px) calc(.45vh + 2px) 0 #000; }
body:has(.onglets-recre) .btn:active { transform: skewX(-7deg) translate(2px, 2px); box-shadow: 0 0 0 #000; }
body:has(.onglets-recre) .btn.creux {
  background: #000; color: #fff; border-color: #fff; box-shadow: .35vw .45vh 0 var(--accent);
}
body:has(.onglets-recre) .btn.creux:hover { background: #fff; color: #000; }
body:has(.onglets-recre) .btn.allume, body:has(.onglets-recre) .btn.creux.on {
  background: var(--accent); color: #000; border-color: #000; box-shadow: .35vw .45vh 0 #000, 0 0 18px var(--accent);
}
body:has(.onglets-recre) #btn-retour, body:has(.onglets-recre) .retour-jeu {
  background: linear-gradient(#FFF36B, #FFB52E); color: #000; border-color: #000; box-shadow: .35vw .45vh 0 #000;
}

/* ---- champs ---- */
body:has(.onglets-recre) input[type=text], body:has(.onglets-recre) input[type=password], body:has(.onglets-recre) select,
body:has(.onglets-recre) .champ-labo {
  background: #fff; color: #111; border: 4px solid #000; border-radius: 0; box-shadow: 0 0 0 3px var(--jaune-da);
}
body:has(.onglets-recre) input::placeholder { color: #8a8a96; }
body:has(.onglets-recre) label { font-family: var(--titre-da); color: var(--accent); letter-spacing: .03em; }

/* ---- les réglages à curseur : une barre de vie ----
   🔑 La partie remplie est peinte par recre.js (--rempli), qui écoute
      tous les curseurs de la page : aucune page à retoucher. */
body:has(.onglets-recre) input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 18px; border-radius: 0; outline: none;
  border: 3px solid #fff; transform: skewX(-7deg);
  background: linear-gradient(90deg, var(--accent), var(--jaune-da)) 0 0 / var(--rempli, 50%) 100% no-repeat, #000;
}
body:has(.onglets-recre) input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 26px; border-radius: 0; background: #fff; border: 3px solid #000; cursor: pointer;
}
body:has(.onglets-recre) input[type=range]::-moz-range-thumb {
  width: 10px; height: 22px; border-radius: 0; background: #fff; border: 3px solid #000; cursor: pointer;
}

/* ---- « le mot » : le carnet devient une collection de cartes ---- */
body:has(.onglets-recre) .mot-du-moment .quoi { font: clamp(24px, 2.4vw, 44px) var(--titre-da); color: #fff; text-transform: uppercase; }
body:has(.onglets-recre) .carnet span {
  font: clamp(10px, .8vw, 13px) var(--titre-da); text-transform: uppercase;
  border: 3px solid #000; border-radius: 0; background: #222; color: #555;
  box-shadow: 0 0 0 2px #333; transform: skewX(-7deg);
}
body:has(.onglets-recre) .carnet span.vu {
  background: var(--accent); color: #000; box-shadow: 0 0 0 2px var(--accent), 0 0 12px var(--accent);
  animation: carte-retourne .6s ease;
}
@keyframes carte-retourne { from { transform: skewX(-7deg) rotateY(180deg); } }
body:has(.onglets-recre) .compte-mots { font: clamp(10px, .75vw, 12px) 'Press Start 2P', monospace; color: #aaa; }

/* ---- les défis de chaque atelier ---- */
body:has(.onglets-recre) .defis li {
  font-weight: 500; background: #000; border: 3px solid #333; transform: skewX(-7deg); padding: .8vh 1vw; margin-bottom: .8vh;
}
body:has(.onglets-recre) .defis li.fait { background: var(--accent); color: #000; border-color: #000; }

/* =====================================================================
   PAR ATELIER — les éléments phares
   ===================================================================== */

/* Image : les familles en pastilles */
body .famille { font-family: var(--titre-da); text-transform: uppercase; border-radius: 0; border: 3px solid #333; background: #000; transform: skewX(-7deg); }
body .famille.on { background: var(--accent); color: #000; border-color: #000; }
body .scene canvas, body .atelier .toile canvas { border-radius: 0; }

/* Synthé : l'écran en néon, les formes d'onde, le piano cerné */
body .ecran .lecture b, body .ecran .lecture { font-family: var(--titre-da); }
body .ecran .lecture b { color: var(--jaune-da); }
body .choix button { font-family: var(--titre-da); text-transform: uppercase; border-radius: 0; border: 3px solid #333; background: #000; transform: skewX(-7deg); }
body .choix button.on { background: var(--accent); color: #000; border-color: #000; }
body .clavier { border: 5px solid #000; box-shadow: 0 0 0 4px var(--accent); background: #000; }
body .touche { border-radius: 0; border-width: 3px; border-color: #000; font-family: var(--titre-da); }
body .touche.joue.blanche, body .touche.joue.noire { box-shadow: 0 0 22px var(--accent); }

/* Beat : les scènes en grandes cartes, les cases cernées */
body .scenes .scene { border-radius: 0; border: 5px solid #000; transform: skewX(-7deg); }
body .scenes .scene b { font-family: var(--titre-da); font-weight: 400; text-transform: uppercase; }
body .bt-lecture { border: 5px solid #000; box-shadow: .35vw .45vh 0 #000; }
body .bpm .chiffre { font-family: var(--titre-da); }
body .styles button { font-family: var(--titre-da); text-transform: uppercase; border-radius: 0; border: 3px solid #fff; background: #000; transform: skewX(-7deg); }
body .grille .case { border-radius: 0; border: 3px solid #000; }
body .instr .nom { font-family: var(--titre-da); text-transform: uppercase; }

/* Pixel : la palette en autocollants */
body .outils button { font-family: var(--titre-da); text-transform: uppercase; border-radius: 0; transform: skewX(-7deg); }
body .outils button.on { background: var(--accent); color: #000; border-color: #000; }
body .palette button, body .palette16 button { border-radius: 0; border: 4px solid #000; transform: skewX(-7deg); }
body .palette button.on, body .palette16 button.on { box-shadow: 0 0 0 4px var(--jaune-da); }
body .echantillon { border-radius: 0; border: 5px solid #000; box-shadow: 0 0 0 3px #fff; }
body .hexa { font-size: clamp(26px, 2.6vw, 48px); }

/* La toile : la barre d'attente en barre de vie */
body .attente-barre { border-radius: 0; background: #000; border: 3px solid #fff; transform: skewX(-7deg); }
body .attente-plein { border-radius: 0; background: linear-gradient(90deg, var(--accent), var(--jaune-da)); }
body .attente-mot { font-family: var(--titre-da); text-transform: uppercase; color: var(--jaune-da); }

/* Logique : le néon, l'octet */
body .neon-mot button { border-radius: 0; border: 4px solid #000; transform: skewX(-7deg); font-family: var(--titre-da); }
body .neon-mot button.allume { box-shadow: 0 0 0 3px var(--accent), 0 0 30px var(--accent); text-shadow: 0 0 12px var(--accent), 0 0 30px var(--accent); color: #fff; }
body .octet button { border-radius: 0; border: 4px solid #333; background: #000; transform: skewX(-7deg); font-family: var(--titre-da); }
body .octet button.un { background: var(--accent); color: #000; border-color: #000; box-shadow: 0 0 20px var(--accent); }
body .octet button.un small { color: #000; }
body .octet-lecture b { font-family: var(--titre-da); color: var(--jaune-da); }
body .circuit { border-radius: 0; }

/* Mots de passe : les choix et les règles en pastilles */
body .choix4 button, body .scenarios button, body .onglets-gen button {
  font-family: var(--titre-da); text-transform: uppercase; border-radius: 0; border: 4px solid #fff; background: #000; color: #fff; transform: skewX(-7deg);
}
body .choix4 button.juste, body .scenarios button.on, body .onglets-gen button.on { background: var(--accent); color: #000; border-color: #000; }
body .choix4 button.faux { background: #333; color: #888; }
body .devine-mot { font-size: clamp(34px, 4vw, 72px); background: #000; border: 5px solid #000; box-shadow: 0 0 0 4px #fff; border-radius: 0; }
body .coches span { border-radius: 0; border: 3px solid #333; background: #000; transform: skewX(-7deg); font-family: var(--titre-da); text-transform: uppercase; }
body .coches span.ok { background: var(--accent); color: #000; border-color: #000; }
body .estim .temps { font-family: var(--titre-da); color: var(--jaune-da); }

/* Les petits intitulés de panneau restent petits, quoi qu'il arrive. */
body:has(.onglets-recre) .lecon .titre, body:has(.onglets-recre) .panneau .titre, body:has(.onglets-recre) .bloc .titre {
  font: clamp(12px, .9vw, 15px) var(--titre-da); background: none; -webkit-background-clip: border-box; background-clip: border-box;
  color: var(--accent); filter: none; margin-bottom: 9px; line-height: 1.3;
}
