/* =====================================================================
   NOUVEAUX EASTER EGGS (v22) - signaux, vie à bord, calendrier, radio
   ---------------------------------------------------------------------
   Scripts : js/eggs/signaux.js, console.js, vie-a-bord.js, calendrier.js
   et la radio de bord de js/easter-eggs.js.
   Les éléments « .decor » (position fixe, sans clic) viennent de
   js/eggs/decor.js et se retirent tout seuls.
   ===================================================================== */

/* ---------- Radio de bord : le clavier de ceux qui n'en ont pas ---------- */
.radio-bord {
  position: fixed;
  left: 50%; bottom: 1rem;
  z-index: 950;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: min(92vw, 360px);
  padding: 0.45rem 0.5rem 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--bordure-forte);
  background: color-mix(in srgb, var(--fond) 94%, transparent);
  box-shadow: var(--ombre);
  transform: translateX(-50%);
  animation: radio-arrivee 0.3s ease;
}
.radio-bord input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--texte);
  font: 500 1rem var(--police-texte);   /* 16 px : pas de zoom automatique sur iPhone */
  outline: none;
}
.radio-bord input::placeholder { color: var(--texte-doux); }
.radio-bord button {
  width: 2rem; height: 2rem;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--texte);
  cursor: pointer;
}
@keyframes radio-arrivee { from { opacity: 0; transform: translate(-50%, 14px); } }

/* Bouton « Radio de bord » du carnet */
.carnet-radio { margin: 0.2rem 0 0.9rem; font-size: 0.82rem; color: var(--texte-doux); }
.carnet-radio button { margin-top: 0.4rem; font-size: 0.82rem; padding: 0.4rem 0.9rem; }

/* ---------- 42 ---------- */
.pas-de-panique {
  left: 50%; top: 58%;
  padding: 0.9rem 1.6rem;
  border-radius: 1.2rem;
  background: #c62828;
  color: #ffe9a8;
  font: 700 clamp(1.6rem, 6vw, 3rem)/1.05 var(--police-titre);
  letter-spacing: 0.08em;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  animation: panique 5.2s ease forwards;
}
@keyframes panique {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-12deg); }
  12%, 82% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-4deg); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(0.9) rotate(4deg); }
}

/* ---------- Houston ---------- */
html.alerte-rouge body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 930;
  pointer-events: none;
  box-shadow: inset 0 0 140px 30px rgba(229, 57, 53, 0.55);
  animation: alerte-battement 1s ease-in-out infinite;
}
.alerte-voyant {
  left: 50%; top: 5.2rem;
  padding: 0.45rem 1.1rem;
  border-radius: 0.5rem;
  border: 2px solid #ff5252;
  background: rgba(60, 0, 0, 0.85);
  color: #ff8a80;
  font: 700 0.95rem ui-monospace, monospace;
  letter-spacing: 0.25em;
  transform: translateX(-50%);
  animation: alerte-battement 1s ease-in-out infinite;
}
@keyframes alerte-battement { 50% { opacity: 0.25; } }

/* ---------- Pluie de code ---------- */
.pluie-code { inset: 0; width: 100%; height: 100%; background: rgba(0, 8, 0, 0.55); }

/* ---------- Pluton ---------- */
.pluton { left: 0; top: 24%; animation: pluton-passage 9s linear forwards; }
.pluton-astre {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e8d9c5, #a58f7c 60%, #5f5148);
  box-shadow: 0 0 24px rgba(232, 217, 197, 0.35);
  animation: pluton-boude 1.6s ease-in-out infinite;
}
.pluton-astre i { font-style: normal; font-size: 1.7rem; color: #f6ece0; transform: translate(6px, 7px) rotate(-18deg); }
@keyframes pluton-passage { from { transform: translateX(-90px); } to { transform: translateX(calc(100vw + 90px)); } }
@keyframes pluton-boude { 50% { transform: translateY(9px) rotate(-8deg); } }

/* ---------- Le gâteau ---------- */
.gateau { left: 50%; top: 45%; font-size: clamp(5rem, 22vw, 9rem); animation: gateau 4.3s ease forwards; }
@keyframes gateau {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
  15%, 58% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: none; }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); filter: blur(0) hue-rotate(40deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(240deg); filter: blur(6px); }
}

/* ---------- Le glouton jaune ---------- */
.glouton { left: 0; animation: glouton-passage 5s linear forwards; }
.glouton span {
  display: block;
  width: 68px; height: 68px;
  border-radius: 50%;
  background: #ffd83a;
  animation: glouton-bouche 0.32s linear infinite alternate;
}
@keyframes glouton-passage { from { transform: translateX(-80px); } to { transform: translateX(calc(100vw + 80px)); } }
@keyframes glouton-bouche {
  from { clip-path: polygon(100% 50%, 50% 50%, 100% 50%, 100% 100%, 0 100%, 0 0, 100% 0); }
  to { clip-path: polygon(100% 12%, 50% 50%, 100% 88%, 100% 100%, 0 100%, 0 0, 100% 0); }
}

/* ---------- Spoutnik ---------- */
.spoutnik { right: 0; top: 18%; width: 110px; animation: spoutnik-passage 9s linear forwards; }
.spoutnik svg { display: block; width: 100%; animation: spoutnik-roulis 3s ease-in-out infinite; }
@keyframes spoutnik-passage { from { transform: translateX(130px); } to { transform: translateX(calc(-100vw - 130px)); } }
@keyframes spoutnik-roulis { 50% { transform: rotate(9deg) translateY(10px); } }

/* ---------- Sieste orbitale ---------- */
.sieste { left: 0; top: 30%; font-size: 3.2rem; animation: sieste-derive 14s linear forwards; }
.sieste span { display: inline-block; animation: sieste-roulis 5s ease-in-out infinite; }
.sieste i { position: absolute; left: 3.2rem; top: -0.4rem; font: 700 1.1rem var(--police-titre); color: var(--texte-doux); opacity: 0; animation: sieste-zzz 2.4s ease-out infinite; }
.sieste i:nth-of-type(2) { animation-delay: 0.8s; }
.sieste i:nth-of-type(3) { animation-delay: 1.6s; font-size: 1.5rem; }
@keyframes sieste-derive { from { transform: translate(-90px, 0); } to { transform: translate(calc(100vw + 90px), -14vh); } }
@keyframes sieste-roulis { 0%, 100% { transform: rotate(-70deg); } 50% { transform: rotate(-110deg); } }
@keyframes sieste-zzz { 0% { opacity: 0; transform: translate(0, 0) scale(0.6); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(26px, -38px) scale(1.25); } }

/* ---------- Voyage dans le temps : le Web de 1999 ---------- */
html.an-1999,
html.an-1999[data-theme="jour"] {
  --fond: #008080;
  --texte: #000000;
  --texte-doux: #1c1c1c;
  --accent: #0000ee;
  --accent-2: #551a8b;
  --carte: #c0c0c0;
  --carte-survol: #d4d4d4;
  --bordure: #808080;
  --bordure-forte: #000000;
  --curseur: #000000;
  --police-titre: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive;
  --police-texte: "Times New Roman", Times, serif;
  --rayon: 0px;
  color-scheme: light;
}
html.an-1999 #ciel { opacity: 0; }
html.an-1999 a { text-decoration: underline; }
html.an-1999 h1, html.an-1999 h2 { text-shadow: 2px 2px 0 #ff00ff; }
html.an-1999 .bouton, html.an-1999 .projet-carte, html.an-1999 .contact {
  border: 2px outset #f2f2f2;
  border-radius: 0;
  box-shadow: none;
}
.bandeau-1999 {
  left: 0; right: 0; top: 0;
  overflow: hidden;
  padding: 0.3rem 0;
  background: #000080;
  color: #ffff00;
  font: 700 0.95rem "Comic Sans MS", "Comic Sans", cursive;
  white-space: nowrap;
}
.bandeau-1999 span { display: inline-block; padding-left: 100%; animation: defilement-1999 10s linear forwards; }
@keyframes defilement-1999 { to { transform: translateX(-100%); } }

/* ---------- Calendrier de bord ---------- */
html.halloween:not(.retro):not(.an-1999) { --accent: #ff9a3c; --accent-2: #b98cff; --bordure-forte: rgba(255, 154, 60, 0.45); }
.lune-citrouille { right: 5vw; top: 5.5rem; z-index: 3; font-size: clamp(3rem, 9vw, 5.5rem); filter: drop-shadow(0 0 22px rgba(255, 154, 60, 0.6)); animation: citrouille 6s ease-in-out infinite; }
@keyframes citrouille { 50% { transform: translateY(-10px) rotate(6deg); } }

.traineau { right: 0; top: 14%; display: flex; align-items: flex-end; gap: 0.1rem; font-size: clamp(1.6rem, 5vw, 2.6rem); white-space: nowrap; animation: traineau-passage 12s linear forwards; }
.traineau span:first-child { letter-spacing: -0.25em; padding-right: 0.3em; }
.traineau span:last-child { margin-left: -1.1em; transform: translateY(-0.55em); font-size: 0.8em; }
@keyframes traineau-passage {
  from { transform: translate(110%, 30px) rotate(-6deg); }
  to { transform: translate(calc(-100vw - 110%), -70px) rotate(-6deg); }
}

html.a-l-envers main { animation: tonneau 3.2s cubic-bezier(0.6, -0.2, 0.3, 1.2) both; }
@keyframes tonneau { 0% { transform: rotate(0); } 30%, 68% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }

/* Animations réduites : les décors apparaissent sans traverser l'écran, la page ne tourne pas */
@media (prefers-reduced-motion: reduce) {
  .pluton, .glouton, .spoutnik, .sieste, .traineau, .bandeau-1999 span, .gateau, .pas-de-panique { animation-duration: 0.01s; }
  html.alerte-rouge body::after, .alerte-voyant { animation: none; }
  html.a-l-envers main { animation: none; }
}

/* Version CV et impression : aucun décor */
html.cv .radio-bord { display: none; }
@media print { .radio-bord, .decor { display: none !important; } }
