/* ==========================================================================
   FunKey · Accueil — « Groove Machine »
   Dépend de funkey.css (variables, fond, ruban, volet).
   Tout est dimensionné en vh / vw pour s'adapter à n'importe quel écran
   (base de conception : 1920×1080).
   ========================================================================== */

html { background: var(--fk-expresso); }

body.accueil {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  isolation: isolate;
  overflow-x: hidden;
  color: var(--fk-creme);
  font-family: var(--fk-jeu-texte);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   1. État de départ (avant l'entrée en scène, uniquement si JS actif)
   ========================================================================== */
html.js body:not(.entree) .logo,
html.js body:not(.entree) .jeu,
html.js body:not(.entree) .boule,
html.js body:not(.entree) .marque-coin { opacity: 0; }

html.js body:not(.entree) .fk-ruban { transform: translateY(110%); }
html.js body:not(.entree) .outils   { opacity: 0; }

/* ==========================================================================
   2. Reflets de la boule à facettes (carrés de lumière qui balaient l'écran)
   ========================================================================== */
.reflets {
  position: fixed;
  left: 50%;
  top: 12vh;
  width: 0;
  height: 0;
  z-index: -2;
  pointer-events: none;
  animation: fk-tourne 90s linear infinite;
}

.spot {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  background: var(--c);
  border-radius: 22%;
  opacity: 0.16;
  transform: rotate(var(--a)) translateX(var(--r));
  animation: brille 4.2s ease-in-out infinite;
  animation-delay: var(--d);
}

@keyframes brille {
  0%, 100% { opacity: 0.03; }
  50%      { opacity: var(--pic, 0.26); }
}

/* ==========================================================================
   3. En-tête : boule à facettes + logo
   ========================================================================== */
.entete {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 13.5vh 5vw 0;
}

/* --- Boule à facettes (cliquable : lance la fête) --- */
.boule {
  position: absolute;
  top: 0;
  left: 50%;
  translate: -50% 0;
  z-index: 3;
  width: 9.5vh;
  height: 13vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.pendule {
  position: absolute;
  inset: 0;
  transform-origin: 50% 0;
  animation: balancier 7s ease-in-out infinite;
}

.fil {
  position: absolute;
  left: 50%;
  top: 0;
  width: 3px;
  height: 3.2vh;
  margin-left: -1.5px;
  background: var(--fk-sable);
}

.facettes {
  --f: 2.1vh;
  position: absolute;
  left: 0;
  top: 3vh;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: var(--fk-contour) solid var(--fk-creme);
  border-radius: 50%;
  background: repeating-conic-gradient(var(--fk-creme) 0 25%, var(--fk-sable) 0 50%) 0 0 / var(--f) var(--f);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.35);
  animation: facettes 5s linear infinite;
}

/* volume de la sphère : bords assombris */
.facettes::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(42, 21, 13, 0.62) 100%);
}

/* reflet franc, sans flou */
.facettes::after {
  content: "";
  position: absolute;
  left: 18%;
  top: 14%;
  width: 24%;
  height: 13%;
  border-radius: 50%;
  background: var(--fk-creme);
  transform: rotate(-32deg);
}

body.entree .boule { animation: descend 1s var(--fk-rebond) 0.1s both; }

@keyframes descend {
  from { opacity: 0; transform: translateY(-110%); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes balancier {
  0%, 100% { transform: rotate(3.2deg); }
  50%      { transform: rotate(-3.2deg); }
}

@keyframes facettes {
  to { background-position: var(--f) 0; }
}

/* --- Logo --- */
.logo {
  position: relative;
  z-index: 2;
  margin: 0;
  line-height: 0;
  text-align: center;
}

/* Logo FunKey seul à l'accueil : 20 % plus gros (15 vh × 1,2 = 18 vh). */
.logo-image {
  display: block;
  width: auto;
  height: 18vh;
  max-width: 80vw;
  object-fit: contain;
  filter: drop-shadow(6px 6px 0 var(--fk-expresso));
  cursor: pointer;
}

/* Logo de secours (si l'image est absente) : lettres rayées 70s */
/* Logo de l'établissement importé dans les réglages : il prend la place de celui de FunKey,
   à la taille d'origine (FunKey passe alors en petit dans le coin). */
.logo-image.logo-etab {
  height: 15vh;
  max-width: 60vw;
}

.logo-texte {
  display: inline-block;
  margin: 0;
  font-family: var(--fk-titre);
  font-size: 16.8vh;           /* 14 vh × 1,2 */
  line-height: 1.15;
  color: transparent;
  background-image: linear-gradient(
    180deg,
    var(--fk-orange) 0 33%,
    var(--fk-moutarde) 33% 66%,
    var(--fk-rose) 66% 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 4px var(--fk-creme);
  filter: drop-shadow(6px 6px 0 var(--fk-expresso));
  cursor: pointer;
}

body.entree .logo { animation: logo-arrive 0.95s var(--fk-rebond) 0.25s both; }

@keyframes logo-arrive {
  from { opacity: 0; transform: translateY(-34vh) scale(0.45) rotate(-9deg); }
  to   { opacity: 1; transform: none; }
}

.rigole { animation: logo-rigole 0.8s ease-in-out; }

@keyframes logo-rigole {
  0%, 100% { transform: rotate(0) scale(1); }
  15% { transform: rotate(-5deg) scale(1.06); }
  35% { transform: rotate(4deg) scale(1.08); }
  55% { transform: rotate(-3deg) scale(1.04); }
  75% { transform: rotate(2deg) scale(1.02); }
}

/* ==========================================================================
   4. Le bac : les 4 pochettes
   ========================================================================== */
.bac {
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 3vh 5vw 4vh;
}

.jeux {
  --tuile: min(20vw, 34vh);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(14px, 3.3vw, 64px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.jeu {
  position: relative;
  width: var(--tuile);
  transform: rotate(var(--rot, 0deg));
}

.jeu:nth-child(1) { --rot: -1.4deg; }
.jeu:nth-child(2) { --rot: 0.9deg; }
.jeu:nth-child(3) { --rot: -0.8deg; }
.jeu:nth-child(4) { --rot: 1.3deg; }

.jeu:hover,
.jeu:focus-within { z-index: 5; }

body.entree .jeu {
  animation: sort-du-bac 0.95s var(--fk-rebond) both;
  animation-delay: calc(0.6s + var(--i, 0) * 0.14s);
}

@keyframes sort-du-bac {
  from { opacity: 0; transform: translateY(58vh) rotate(calc(var(--rot) * -8)) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) rotate(var(--rot)) scale(1); }
}

/* --- La pochette (lien ou bouton) --- */
.pochette {
  position: relative;
  display: block;
  width: 100%;
  isolation: isolate;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.pochette:focus-visible { outline: none; }
.pochette:focus-visible .carre {
  outline: var(--fk-contour) solid var(--fk-creme);
  outline-offset: 6px;
}

.jeu[data-dispo="non"] .pochette { cursor: default; }

/* Halo : un mini sunburst dans la couleur du jeu, derrière la pochette */
.halo {
  position: absolute;
  z-index: -1;
  left: calc(var(--tuile) * -0.325);
  top: calc(var(--tuile) * -0.325);
  width: calc(var(--tuile) * 1.65);
  aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-conic-gradient(var(--jeu) 0 5deg, transparent 5deg 10deg);
  -webkit-mask-image: radial-gradient(circle, #000 26%, transparent 68%);
  mask-image: radial-gradient(circle, #000 26%, transparent 68%);
  opacity: 0;
  scale: 0.6;
  transition: opacity 0.3s ease-out, scale 0.55s var(--fk-rebond);
  animation: fk-tourne 40s linear infinite;
  pointer-events: none;
}

.pochette:is(:hover, :focus-visible) .halo {
  opacity: 0.6;
  scale: 1;
}

/* Disque vinyle qui sort de la pochette par le haut */
.vinyle {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 4%;
  width: 92%;
  aspect-ratio: 1;
  overflow: hidden;
  border: var(--fk-contour) solid var(--fk-creme);
  border-radius: 50%;
  background: var(--fk-chocolat);
  box-shadow: 6px 6px 0 var(--jeu-fonce);
  transition: transform 0.5s var(--fk-rebond);
  pointer-events: none;
}

.vinyle-tour {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    conic-gradient(
      from 20deg,
      transparent 0 18deg,
      rgba(245, 230, 200, 0.14) 18deg 48deg,
      transparent 48deg 198deg,
      rgba(245, 230, 200, 0.14) 198deg 228deg,
      transparent 228deg 360deg
    ),
    repeating-radial-gradient(circle at center, var(--fk-expresso) 0 3px, var(--fk-chocolat) 3px 7px);
  animation: fk-tourne 1.6s linear infinite paused;
}

.vinyle-etiquette {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border: var(--fk-contour) solid var(--fk-creme);
  border-radius: 50%;
  background: var(--jeu);
}

/* trou central */
.vinyle-etiquette::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--fk-chocolat);
}

/* repère de rotation : on voit que le disque tourne */
.vinyle-etiquette::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 12%;
  width: 12%;
  aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--fk-creme);
}

.pochette:is(:hover, :focus-visible) .vinyle { transform: translateY(-26%); }
.pochette:is(:hover, :focus-visible) .vinyle-tour { animation-play-state: running; }

/* Le carré : la pochette elle-même (cible de l'inclinaison 3D) */
.carre {
  position: relative;
  z-index: 1;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border: var(--fk-contour) solid var(--fk-creme);
  border-radius: var(--fk-rayon);
  background: var(--jeu-fonce);
  box-shadow: 8px 8px 0 var(--jeu-fonce);
  transform:
    translateY(var(--lev, 0px))
    perspective(900px)
    rotateX(calc(var(--ry, 0) * -12deg))
    rotateY(calc(var(--rx, 0) * 12deg));
  transition: transform 0.4s var(--fk-rebond), box-shadow 0.25s ease-out;
}

.pochette.suit .carre {
  transition: transform 0.08s linear, box-shadow 0.25s ease-out;
}

.pochette:is(:hover, :focus-visible) .carre {
  --lev: -1.4vh;
  box-shadow: 14px 14px 0 var(--jeu-fonce);
}

.visuel {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Image absente : sunburst plat dans la couleur du jeu */
.carre.sans-image {
  background: repeating-conic-gradient(var(--jeu) 0 7.5deg, var(--jeu-fonce) 7.5deg 15deg);
}
.carre.sans-image .visuel { display: none; }

/* Pastille de touche (1 à 4 : raccourci clavier) */
.touche {
  position: absolute;
  left: 4%;
  top: 4%;
  display: grid;
  place-items: center;
  width: calc(var(--tuile) * 0.13);
  aspect-ratio: 1;
  border: 3px solid var(--fk-chocolat);
  border-radius: 50%;
  background: var(--fk-creme);
  color: var(--fk-chocolat);
  font-family: var(--fk-jeu-texte);
  font-size: calc(var(--tuile) * 0.075);
  line-height: 1;
}

/* Pastille « Bientôt » pour les jeux pas encore prêts */
.bientot {
  position: absolute;
  right: 4%;
  top: 4%;
  padding: 0.5em 0.9em 0.4em;
  border: 3px solid var(--fk-chocolat);
  border-radius: 999px;
  background: var(--fk-creme);
  box-shadow: 3px 3px 0 var(--jeu-fonce);
  color: var(--fk-chocolat);
  font-family: var(--fk-titre);
  font-size: calc(var(--tuile) * 0.07);
  line-height: 1;
  transform: rotate(8deg);
}

/* Accroche : étiquette qui jaillit dans la bande calme du bas de la pochette */
.accroche {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 5%;
  padding: 0.35em 0.7em 0.3em;
  border: var(--fk-contour) solid var(--fk-creme);
  border-radius: 28px;
  background: var(--jeu);
  box-shadow: 4px 4px 0 var(--jeu-fonce);
  color: var(--fk-chocolat);
  font-family: var(--fk-jeu-texte);
  font-size: calc(min(3.3vh, calc(var(--tuile) * 0.09)) * var(--fk-texte, 1));
  line-height: 1.1;
  text-align: center;
  text-wrap: balance;
  opacity: 0;
  transform: translateY(170%) rotate(-3deg);
  transition: transform 0.45s var(--fk-rebond), opacity 0.2s ease-out;
}

.pochette:is(:hover, :focus-visible) .accroche {
  opacity: 1;
  transform: translateY(0) rotate(-2deg);
}

/* Nom du jeu : toujours visible sous la pochette, s'illumine au survol */
.nom {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 2.15em;
  margin-top: 1.8vh;
  color: var(--fk-creme);
  font-family: var(--fk-titre);
  font-size: calc(min(4vh, calc(var(--tuile) * 0.115)) * var(--fk-texte, 1));
  line-height: 1.05;
  text-align: center;
  text-wrap: balance;
  text-shadow: 3px 3px 0 var(--jeu-fonce);
  transition: color 0.2s ease-out, transform 0.4s var(--fk-rebond);
}

.pochette:is(:hover, :focus-visible) .nom {
  color: var(--jeu-clair);
  transform: scale(1.07) rotate(-1.5deg);
}

/* Clic sur un jeu disponible */
.pochette.choisi .carre { animation: pop 0.5s var(--fk-rebond) both; }

@keyframes pop {
  0%   { scale: 1; }
  45%  { scale: 1.13; }
  100% { scale: 1.06; }
}

/* Clic sur un jeu pas encore prêt : la pochette secoue la tête */
.carre.refuse { animation: secoue 0.6s ease-in-out; }

@keyframes secoue {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  20% { translate: -1.2vh 0; rotate: -3deg; }
  40% { translate: 1.2vh 0; rotate: 3deg; }
  60% { translate: -0.8vh 0; rotate: -2deg; }
  80% { translate: 0.8vh 0; rotate: 2deg; }
}

/* ==========================================================================
   5. Pied de page : ruban 70s + boutons discrets
   ========================================================================== */
.pied { position: relative; }

body.entree .fk-ruban {
  animation:
    ruban-monte 0.8s var(--fk-rebond) 0.3s both,
    fk-defile 16s linear infinite;
}

@keyframes ruban-monte {
  from { transform: translateY(110%); }
  to   { transform: translateY(0); }
}

.outils {
  position: absolute;
  right: 5vw;
  bottom: calc(6.5vh + 1.6vh);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1.4vh;
}

body.entree .outils { animation: apparait 0.6s ease-out 1.6s both; }

@keyframes apparait { from { opacity: 0; } to { opacity: 1; } }

.outil {
  position: relative;
  display: grid;
  place-items: center;
  width: 6.2vh;
  height: 6.2vh;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: var(--fk-contour) solid var(--fk-creme);
  border-radius: 50%;
  background: var(--fk-caramel);
  box-shadow: 4px 4px 0 var(--fk-expresso);
  color: var(--fk-creme);
  cursor: pointer;
  transition: transform 0.3s var(--fk-rebond), background 0.2s, color 0.2s;
}

.outil svg { width: 58%; height: 58%; }

.outil:hover {
  background: var(--fk-orange);
  color: var(--fk-chocolat);
  transform: scale(1.1);
}

#btn-reglages:hover { transform: scale(1.1) rotate(90deg); }

.outil .barre { display: none; }
.outil.coupe .barre { display: inline; }
.outil.coupe .ondes { display: none; }

/* Voyant de l'écran de projection : anneau vide = fermé, rond plein vert = ouvert
   (la forme change aussi, pas seulement la couleur) */
.voyant {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 1.9vh;
  min-width: 14px;
  aspect-ratio: 1;
  border: 3px solid var(--fk-creme);
  border-radius: 50%;
  background: var(--fk-expresso);
  transition: background-color 0.2s, box-shadow 0.2s;
}
#btn-projection[data-etat="ouvert"] .voyant {
  background: var(--fk-ok);
  box-shadow: 0 0 0 4px rgba(124, 196, 106, 0.3);
}

/* « Terminer la partie » : pastille texte, à deux clics */
.outil.outil-texte {
  display: inline-flex;
  align-items: center;
  gap: 0.7vh;
  width: auto;
  height: 6.2vh;
  min-height: 44px;
  padding: 0 2.2vh 0 1.8vh;
  border-radius: 999px;
  font-family: var(--fk-jeu-texte);
  font-size: calc(2.6vh * var(--fk-texte, 1));
  line-height: 1;
}
.outil.outil-texte svg { width: 3.4vh; height: 3.4vh; min-width: 20px; min-height: 20px; }
.outil.outil-texte[data-confirme="oui"] {
  background: var(--fk-erreur);
  color: var(--fk-expresso);
  animation: pulse-confirme 0.8s ease-in-out infinite alternate;
}
@keyframes pulse-confirme { from { scale: 1; } to { scale: 1.06; } }

/* ==========================================================================
   7 bis. Établissement : plaque du nom, FunKey en petit dans le coin
   ========================================================================== */
.plaque {
  position: absolute;
  left: 5vw;
  bottom: calc(6.5vh + 1.6vh);
  z-index: 5;
  max-width: 38vw;
  padding: 1vh 2.4vh;
  border: var(--fk-contour) solid var(--fk-creme);
  border-radius: 999px;
  background: var(--fk-caramel);
  box-shadow: 4px 4px 0 var(--fk-expresso);
  color: var(--fk-creme);
  font-family: var(--fk-jeu-texte);
  font-size: calc(2.8vh * var(--fk-texte, 1));
  line-height: 1.1;
}
.plaque-nom { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.marque-coin {
  position: fixed;
  left: 5vw;
  top: 3vh;
  z-index: 4;
  display: flex;
  align-items: center;
  line-height: 0;
}
.marque-coin-image {
  display: block;
  width: auto;
  height: 7vh;
  max-width: 24vw;
  object-fit: contain;
  filter: drop-shadow(3px 3px 0 var(--fk-expresso));
}
.marque-coin-texte {
  font-family: var(--fk-titre);
  font-size: 5vh;
  line-height: 1;
  color: var(--fk-creme);
  text-shadow: 3px 3px 0 var(--fk-orange);
}
body.entree .marque-coin { animation: coin-arrive 0.7s var(--fk-rebond) 0.5s both; }
@keyframes coin-arrive {
  from { opacity: 0; transform: translateY(-3vh) scale(0.7); }
  to   { opacity: 1; transform: none; }
}

/* Messages de l'animateur (ouverture de la projection, confirmations…) */
.info {
  position: absolute;
  left: 50%;
  bottom: calc(6.5vh + 1.6vh);
  z-index: 6;
  translate: -50% 0;
  max-width: min(60vw, 60rem);
  margin: 0;
  padding: 1vh 2.4vh;
  border: 3px solid var(--fk-creme);
  border-radius: 24px;
  background: var(--fk-chocolat);
  color: var(--fk-creme);
  font-family: var(--fk-jeu-texte);
  font-size: calc(2.5vh * var(--fk-texte, 1));
  line-height: 1.25;
  text-align: center;
}

/* Écran de fin (« Terminer la partie » quand le navigateur ne ferme pas la fenêtre) */
.fin {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 5vh 5vw;
  background: repeating-conic-gradient(from 0deg at 50% 50%, var(--fk-chocolat) 0deg 7.5deg, var(--fk-caramel) 7.5deg 15deg);
}
.fin-carte {
  max-width: 70vh;
  padding: 5vh 6vh 5.5vh;
  border: var(--fk-contour) solid var(--fk-creme);
  border-radius: var(--fk-rayon);
  background: var(--fk-expresso);
  box-shadow: 1vh 1vh 0 var(--fk-orange);
  text-align: center;
}
.fin-titre {
  margin: 0 0 1.4vh;
  font-family: var(--fk-titre);
  font-weight: 400;
  font-size: calc(9vh * var(--fk-texte, 1));
  line-height: 1.05;
  text-shadow: 0.6vh 0.6vh 0 var(--fk-orange);
}
.fin-texte {
  margin: 0 0 3.4vh;
  color: var(--fk-sable);
  font-family: var(--fk-jeu-texte);
  font-size: calc(3.4vh * var(--fk-texte, 1));
  line-height: 1.3;
}
.fin-bouton {
  padding: 1.4vh 3.4vh;
  border: var(--fk-contour) solid var(--fk-creme);
  border-radius: 999px;
  background: var(--fk-orange);
  color: var(--fk-expresso);
  font-family: var(--fk-jeu-texte);
  font-size: calc(3vh * var(--fk-texte, 1));
  cursor: pointer;
  transition: transform 0.2s var(--fk-rebond), background-color 0.15s;
}
.fin-bouton:hover { background: #F2915F; transform: scale(1.05); }

/* ==========================================================================
   6. Intro : une platine, un bras qui se pose, un petit craquement
   ========================================================================== */
.intro {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 6vh;
  background: var(--fk-expresso);
  transition: opacity 0.14s linear;
}

html.js:not(.sans-intro) .intro { display: grid; }

.intro.part { opacity: 0; pointer-events: none; }

.platine {
  position: relative;
  width: min(54vmin, 480px);
  aspect-ratio: 1;
  animation: secoue-platine 0.18s steps(3) 1.45s both;
}

/* le plateau de la platine */
.platine::before {
  content: "";
  position: absolute;
  inset: -6%;
  border: var(--fk-contour) solid var(--fk-creme);
  border-radius: var(--fk-rayon);
  background: var(--fk-caramel);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.4);
}

.disque {
  position: absolute;
  inset: 5%;
  overflow: hidden;
  border: var(--fk-contour) solid var(--fk-creme);
  border-radius: 50%;
  background: var(--fk-chocolat);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4);
}

.disque-tour {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    conic-gradient(
      from 20deg,
      transparent 0 18deg,
      rgba(245, 230, 200, 0.14) 18deg 48deg,
      transparent 48deg 198deg,
      rgba(245, 230, 200, 0.14) 198deg 228deg,
      transparent 228deg 360deg
    ),
    repeating-radial-gradient(circle at center, var(--fk-expresso) 0 3px, var(--fk-chocolat) 3px 7px);
  animation: fk-tourne 1.8s linear 1.45s infinite;
}

.disque-etiquette {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border: var(--fk-contour) solid var(--fk-creme);
  border-radius: 50%;
  background: var(--fk-orange);
}

.disque-etiquette::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--fk-chocolat);
}

.disque-etiquette::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 12%;
  width: 12%;
  aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--fk-creme);
}

/* Le bras de lecture */
.bras {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bras-pivot {
  transform-origin: 90px 10px;
  transform: rotate(-26deg);
  animation: pose-bras 0.9s cubic-bezier(0.3, 1.6, 0.5, 1) 0.6s forwards;
}

.bras-tige {
  fill: none;
  stroke: var(--fk-creme);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bras-tete {
  fill: none;
  stroke: var(--fk-orange);
  stroke-width: 3.4;
  stroke-linecap: round;
}

.bras-base {
  fill: var(--fk-moutarde);
  stroke: var(--fk-creme);
  stroke-width: 1.4;
}

/* Petits grains de poussière : le craquement visuel */
.poussiere {
  position: absolute;
  left: 62%;
  top: 58%;
  width: 4px;
  height: 4px;
  background: var(--fk-creme);
  opacity: 0;
  box-shadow:
    14px -22px 0 var(--fk-creme),
    -30px 12px 0 var(--fk-sable),
    40px 20px 0 var(--fk-creme),
    -12px -36px 0 var(--fk-sable),
    26px 44px 0 var(--fk-creme),
    -46px -8px 0 var(--fk-creme);
  animation: craque 0.5s steps(5) 1.45s both;
}

.intro-mot {
  margin: 0;
  color: var(--fk-creme);
  font-family: var(--fk-titre);
  font-size: 8.5vh;
  line-height: 1;
  text-shadow: 0.5vh 0.5vh 0 var(--fk-orange);
  opacity: 0;
  animation: mot-arrive 0.6s var(--fk-rebond) 1.7s both;
}

.intro-passe {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5vh;
  margin: 0;
  color: var(--fk-sable);
  font-size: max(2.6vh, 16px);
  text-align: center;
  opacity: 0;
  animation: apparait 0.5s ease-out 1s both;
}

@keyframes pose-bras {
  from { transform: rotate(-26deg); }
  to   { transform: rotate(0deg); }
}

@keyframes craque {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  40%  { opacity: 0.2; }
  60%  { opacity: 1; }
  80%  { opacity: 0.3; }
  100% { opacity: 0; }
}

@keyframes secoue-platine {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(3px, -2px); }
  66%  { transform: translate(-3px, 2px); }
  100% { transform: translate(0, 0); }
}

@keyframes mot-arrive {
  from { opacity: 0; transform: translateY(3vh) scale(0.7) rotate(-4deg); }
  to   { opacity: 1; transform: none; }
}

/* ==========================================================================
   7. Mode fête (clic sur la boule à facettes) : le grand moment
   ========================================================================== */
body.fete { --pic: 0.75; }

body.fete .spot { animation-duration: 1.1s; }
body.fete .facettes { animation-duration: 1.2s; }

body.fete .pochette {
  animation: danse 0.46s ease-in-out infinite alternate;
  animation-delay: calc(var(--i, 0) * 90ms);
}

@keyframes danse {
  from { transform: translateY(0) rotate(-1.5deg); }
  to   { transform: translateY(-1.8vh) rotate(1.5deg); }
}

.paillettes {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  pointer-events: none;
}

.pailette {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 2px;
  will-change: transform;
}

/* ==========================================================================
   8. Adaptations
   ========================================================================== */

/* Écrans tactiles : pas de survol, l'accroche reste visible */
@media (hover: none) {
  .accroche {
    opacity: 1;
    transform: translateY(0) rotate(-2deg);
  }
}

/* Écrans étroits ou en hauteur : grille 2×2, la page peut défiler */
@media (max-aspect-ratio: 5/4), (max-width: 820px) {
  .entete { padding-top: 12vh; }
  .logo-image { height: 13.2vh; }            /* 11 vh × 1,2 */
  .logo-image.logo-etab { height: 11vh; }
  .logo-texte { font-size: 12vh; }           /* 10 vh × 1,2 */
  .marque-coin-image { height: 5.5vh; }

  .plaque { bottom: calc(6.5vh + 8vh); max-width: 60vw; }

  .bac { align-content: start; padding-bottom: 22vh; }   /* laisse la place aux boutons du pied de page */

  .jeux {
    --tuile: min(38vw, 30vh);
    display: grid;
    grid-template-columns: repeat(2, var(--tuile));
    gap: 4vh 7vw;
  }

  .outils { bottom: calc(6.5vh + 1vh); }
}
