/* ============================================================
   LE PIRE SITE DU MONDE — feuille de style (de mauvais goût)
   ============================================================ */

* { box-sizing: border-box; }

html { background: #7fff00; }

body {
  margin: 0;
  padding: 16px 16px 180px;
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Comic Neue", cursive;
  color: #8b008b;
  background: repeating-linear-gradient(45deg, #ffff66 0 40px, #66ffcc 40px 80px);
  overflow-x: hidden;
  cursor: help;
}

body.bloque { overflow: hidden; }

h1 {
  font-family: Papyrus, Impact, fantasy;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: clamp(30px, 7vw, 60px);
  text-align: center;
  margin: 10px 0 26px;
  text-shadow:
    0 0 4px #fff,
    0 0 10px #fff,
    0 0 18px #fff,
    0 0 38px #ff00de,
    0 0 70px #ff00de,
    0 0 90px #ff00de,
    0 0 110px #ff00de,
    0 0 160px #ff00de;
  animation:
    neon-secoue 2.6s ease-in-out infinite,
    neon-arc-en-ciel 2.4s linear infinite,
    neon-flicker 3.1s linear infinite;
}

h1::before, h1::after {
  content: '💥';
  display: inline-block;
  margin: 0 16px;
  animation: neon-boom 1.1s ease-in-out infinite;
}

@keyframes neon-secoue {
  0%, 100% { transform: rotate(-2deg) scale(1); }
  25% { transform: rotate(1.5deg) scale(1.04); }
  50% { transform: rotate(-1deg) scale(.98); }
  75% { transform: rotate(2deg) scale(1.06); }
}

@keyframes neon-arc-en-ciel {
  to { filter: hue-rotate(360deg); }
}

@keyframes neon-flicker {
  0%, 2%, 4%, 8%, 70%, 100% { opacity: 1; }
  1%, 3%, 5% { opacity: .35; }
  69% { opacity: .5; }
}

@keyframes neon-boom {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.4) rotate(15deg); }
}

h2, h3 { font-family: Impact, "Arial Black", sans-serif; color: #0000cc; letter-spacing: 2px; }

p, li { max-width: 720px; font-size: 17px; }

.petit { font-size: 10px; opacity: .6; }

marquee {
  background: #000;
  color: #00ff00;
  font-family: "Courier New", monospace;
  padding: 4px 0;
  border: 3px dotted #ff0000;
}

.clignote { animation: clignote 1s steps(2) infinite; }
@keyframes clignote { 50% { visibility: hidden; } }

.encart {
  background: #ffffffcc;
  border: 5px ridge #ff6600;
  padding: 12px 16px;
  margin: 20px auto;
  max-width: 760px;
}

/* ------------------------------------------------------------
   TOUS LES BOUTONS SONT DES TRIANGLES (et le texte dépasse)
   ------------------------------------------------------------ */
button.tri {
  position: relative;
  width: 0;
  height: 0;
  padding: 0;
  margin: 30px 150px 50px 30px;
  background: transparent;
  border-style: solid;
  border-color: transparent;
  border-width: 0 55px 95px 55px;
  border-bottom-color: var(--couleur, #0000ff);
  transform: rotate(var(--rot, 0deg));
  cursor: pointer;
  font: inherit;
  flex: none;
  vertical-align: middle;
}

button.tri.tri-bas {
  border-width: 95px 55px 0 55px;
  border-top-color: var(--couleur, #0000ff);
  border-bottom-color: transparent;
}

button.tri .tri-txt {
  position: absolute;
  top: 48px;
  left: -14px;
  white-space: nowrap;
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 3px #000, 2px 2px 0 #000;
  pointer-events: none;
}

button.tri.tri-bas .tri-txt { top: -62px; }

button.tri:hover { filter: hue-rotate(180deg) saturate(3); }
button.tri:active { transform: rotate(var(--rot, 0deg)) scale(.8); }

.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 20px 0 60px;
}

/* ------------------------------------------------------------
   BARRE DU BAS (recherche + volume)
   ------------------------------------------------------------ */
#barre {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 500;
  background: #ff4500;
  border-top: 6px ridge #ffd700;
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  font-size: 14px;
  color: #ffff00;
}

#recherche { margin: 0; }

#q {
  font: inherit;
  font-size: 16px;
  padding: 6px;
  width: min(280px, 70vw);
  border: 3px inset #00ff00;
  background: #000;
  color: #00ff00;
}

#vol { display: flex; align-items: center; gap: 6px; }
#vol-slider { width: 120px; accent-color: #ff00ff; }
#astuce { font-size: 10px; opacity: .75; flex-basis: 100%; }

/* ------------------------------------------------------------
   TOAST
   ------------------------------------------------------------ */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  background: #000;
  color: #00ff00;
  padding: 12px 18px;
  border: 4px dashed #ff00ff;
  z-index: 3000;
  font-size: 16px;
  max-width: calc(100vw - 32px);
}

/* ------------------------------------------------------------
   CONTRAT D'UTILISATION
   ------------------------------------------------------------ */
.contrat {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(80, 0, 80, .88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.contrat[hidden] { display: none; }

.contrat-boite {
  position: relative;
  background: #f4f4f4;
  color: #555;
  width: min(620px, 100%);
  height: 85vh;
  padding: 20px;
  border: 8px double #999;
  display: flex;
  flex-direction: column;
  font-family: "Times New Roman", serif;
  cursor: default;
}

.contrat-boite h2 { font-family: "Times New Roman", serif; color: #333; letter-spacing: 0; margin: 0 40px 6px 0; font-size: 18px; }
.contrat-info { font-size: 12px; margin: 0 0 10px; color: #a00; }

.contrat-texte {
  flex: 1;
  overflow-y: scroll;
  scrollbar-width: none;
  user-select: none;
  -webkit-user-select: none;
  font-size: 12px;
  line-height: 1.5;
  text-align: justify;
  overscroll-behavior: contain;
}
.contrat-texte::-webkit-scrollbar { display: none; }
.contrat-texte p { font-size: 12px; max-width: none; margin: 0 0 10px; }

#vraie-croix { cursor: default; }

#fausse-croix {
  position: absolute;
  top: 4px;
  right: 10px;
  font-size: 34px;
  line-height: 1;
  color: #cc0000;
  cursor: pointer;
  user-select: none;
  transition: top .12s, left .12s;
  z-index: 2;
}

/* La vraie vraie croix : coin supérieur droit de la page, quasi invisible. */
#croix-secrete {
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  opacity: .02;
  cursor: default;
  z-index: 1001;
}

/* ------------------------------------------------------------
   BLOCAGE : SON TROP BAS
   ------------------------------------------------------------ */
body.bloque-volume { overflow: hidden; }

#vol-bloque {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: default;
  animation: vol-bloque-secoue .35s ease-in-out infinite, vol-bloque-flash 1.1s ease-in-out infinite;
}

#vol-bloque canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.vol-bloque-texte {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  text-align: center;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(20px, 5vw, 44px);
  line-height: 1.35;
  color: #ff3b3b;
  text-shadow: 0 0 10px #ff0000, 0 0 30px #ff0000, 0 0 60px #ff8800;
  text-transform: uppercase;
  animation: vol-bloque-clignote .5s steps(2) infinite;
}

.petit-rouge { font-size: .5em; color: #ffaaaa; text-shadow: none; }

@keyframes vol-bloque-secoue {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-6px, 4px); }
  50% { transform: translate(5px, -5px); }
  75% { transform: translate(-4px, -3px); }
}

@keyframes vol-bloque-flash {
  0%, 100% { background: #000; }
  50% { background: #330000; }
}

@keyframes vol-bloque-clignote {
  50% { opacity: .35; }
}

/* ------------------------------------------------------------
   STATISTIQUES
   ------------------------------------------------------------ */
.grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 20px;
  margin: 20px 0;
}

.carte {
  background: #ffffffdd;
  border: 4px outset #00ccff;
  padding: 12px 14px 20px;
  overflow: visible;
}
.carte h3 { margin: 0 0 8px; font-size: 18px; }
.floue { filter: blur(5px); user-select: none; font-size: 22px; }

.camembert {
  width: 200px; height: 200px; border-radius: 50%;
  background: conic-gradient(#ffcc00 0 100%);
  border: 6px solid #996600;
  margin: 10px auto;
}

/* ------------------------------------------------------------
   JAUGES / TÉLÉCHARGEMENT / VOLUME
   ------------------------------------------------------------ */
.jauge {
  height: 34px;
  max-width: 620px;
  border: 4px inset #888;
  background: #222;
  margin: 16px 0;
}
.jauge > div {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(90deg, #ff0000 0 10px, #ffff00 10px 20px);
  transition: width .3s;
}

#gros-vol {
  font-family: Impact, sans-serif;
  font-size: clamp(60px, 18vw, 160px);
  color: #ff0000;
  text-shadow: 6px 6px 0 #000;
  text-align: center;
}

/* ------------------------------------------------------------
   FORMULAIRES
   ------------------------------------------------------------ */
.formulaire label { display: block; margin: 12px 0; font-size: 16px; }
.formulaire input:not([type=checkbox]):not([type=range]), .formulaire textarea {
  font: inherit;
  display: block;
  width: min(360px, 100%);
  padding: 4px;
  border: 3px dashed #ff00ff;
  background: #ffffe0;
  color: #008000;
}
.formulaire input[type=range] { width: min(360px, 100%); display: block; }

/* ------------------------------------------------------------
   APOCALYPSE INTERDIMENSIONNELLE (fin du contrat)
   ------------------------------------------------------------ */
#apocalypse {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: #000;
  overflow: hidden;
  cursor: none;
}
#apocalypse canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.apo-flash {
  position: absolute; inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

.portail {
  position: absolute;
  left: 50%; top: 50%;
  width: 56vmin; height: 56vmin;
  margin: -28vmin 0 0 -28vmin;
  transform: scale(0) rotate(-180deg);
  transition: transform 1.4s cubic-bezier(.2, 1.5, .4, 1);
  pointer-events: none;
  z-index: 1;
}
.portail::before {
  content: "";
  position: absolute;
  inset: -15%;
  border-radius: 50%;
  background: radial-gradient(circle, #000 0 28%, rgba(140, 0, 255, .9) 38%, rgba(0, 255, 255, .35) 52%, transparent 70%);
  filter: blur(10px);
  animation: pulse-portail .6s ease-in-out infinite alternate;
}
.portail.ouvert { transform: scale(1) rotate(0deg); }
.portail.engloutit { transform: scale(8) rotate(360deg); transition: transform 3.2s cubic-bezier(.7, 0, .9, .4); }

.p-secondaire {
  left: 22%; top: 30%;
  width: 30vmin; height: 30vmin;
  margin: -15vmin 0 0 -15vmin;
}
.p-secondaire.implose { transform: scale(0) rotate(720deg); transition: transform .35s cubic-bezier(.6, -.6, .7, 0); }

.anneau {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(#ff00ff, #00ffff, #7f00ff, #00ff88, #ffea00, #ff0055, #ff00ff);
  -webkit-mask: radial-gradient(circle, transparent 0 38%, #000 41% 68%, transparent 71%);
          mask: radial-gradient(circle, transparent 0 38%, #000 41% 68%, transparent 71%);
  filter: blur(1px) saturate(2);
  animation: tourne-portail 1.1s linear infinite;
}
.anneau.a2 {
  inset: 14%;
  background: repeating-conic-gradient(#00ffff 0 8deg, transparent 8deg 20deg, #ff00ff 20deg 26deg, transparent 26deg 36deg);
  animation-duration: .6s;
  animation-direction: reverse;
}
.anneau.a3 {
  inset: 28%;
  background: conic-gradient(from 90deg, #fff, transparent 30%, #fff 50%, transparent 80%, #fff);
  -webkit-mask: radial-gradient(circle, transparent 0 30%, #000 45% 60%, transparent 70%);
          mask: radial-gradient(circle, transparent 0 30%, #000 45% 60%, transparent 70%);
  animation-duration: .35s;
}

@keyframes tourne-portail { to { transform: rotate(360deg); } }
@keyframes pulse-portail { to { transform: scale(1.12); opacity: .75; } }

.apo-texte {
  position: absolute;
  left: 16px; right: 16px; bottom: 12%;
  z-index: 2;
  text-align: center;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(26px, 6vw, 64px);
  color: #fff;
  letter-spacing: 3px;
  text-shadow: 3px 0 #ff00ff, -3px 0 #00ffff, 0 0 30px #fff;
  opacity: 0;
  transform: scale(2.5);
  pointer-events: none;
}
.apo-texte.montre { animation: apo-texte-in .45s cubic-bezier(.2, 1.6, .4, 1) forwards, apo-glitch .14s steps(2) .45s infinite; }
.apo-texte.rouge { color: #ff2020; text-shadow: 0 0 20px #f00, 4px 4px 0 #000; }
.apo-texte.arc {
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  text-shadow: none;
  font-size: clamp(34px, 9vw, 96px);
}
.apo-texte.calme {
  bottom: 45%;
  font-family: "Times New Roman", serif;
  font-style: italic;
  letter-spacing: 0;
  font-size: clamp(20px, 3.5vw, 36px);
  color: #ddd;
  text-shadow: 0 0 12px #8a2be2;
  transform: scale(.85);
}
.apo-texte.calme.montre { animation: apo-texte-in 1.8s ease forwards; }

@keyframes apo-texte-in { to { opacity: 1; transform: scale(1); } }
@keyframes apo-glitch { 50% { transform: translate(3px, -2px) skewX(-6deg); } }
