/* crapule.geekedicy.fr - couleurs franches, cibles enormes, zero texte a lire
   pour Conor. Contrastes doux, aucune animation clignotante. */

:root {
  --nuit: #1b1035;
  --nuit-clair: #2a1a4f;
  --creme: #fff6e9;
  --rose: #ff5d8f;
  --jaune: #ffc93c;
  --menthe: #2ec4b6;
  --lavande: #9b6dff;
  --corail: #ff8360;
  --ombre: 0 12px 32px rgba(0, 0, 0, .35);
  --rayon: 28px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  background: var(--nuit);
  color: var(--creme);
  font-family: "Baloo 2", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

.ecran {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.ecran.actif { display: flex; }

/* ---------------------------------------------------------------- PIN --- */
#ecran-pin {
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 25%, var(--nuit-clair), var(--nuit) 70%);
}
.pin-boite { text-align: center; width: min(360px, 88vw); }
.pin-logo { font-size: 64px; line-height: 1; }
.pin-boite h1 {
  margin: 8px 0 2px;
  font-size: 34px;
  letter-spacing: .04em;
  color: var(--jaune);
}
.pin-sous { margin: 0 0 22px; opacity: .6; font-size: 15px; }

.pin-points { display: flex; gap: 14px; justify-content: center; height: 18px; }
.pin-points i {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 246, 233, .4);
  transition: transform .15s, background .15s;
}
.pin-points i.plein { background: var(--jaune); border-color: var(--jaune); transform: scale(1.15); }
.pin-points.faux { animation: secoue .4s; }
@keyframes secoue {
  25% { transform: translateX(-9px); } 75% { transform: translateX(9px); }
}
.pin-erreur { min-height: 22px; margin: 10px 0 4px; color: var(--rose); font-size: 14px; }

.pin-clavier {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.pin-clavier button {
  height: 66px;
  font-size: 26px;
  font-family: inherit;
  color: var(--creme);
  background: rgba(255, 246, 233, .08);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: transform .08s, background .15s;
}
.pin-clavier button:active { transform: scale(.93); background: rgba(255, 246, 233, .18); }
.pin-eff { font-size: 20px !important; opacity: .7; }

/* --------------------------------------------------------------- MENU --- */
#ecran-menu {
  background: radial-gradient(circle at 50% 0%, var(--nuit-clair), var(--nuit) 75%);
  padding: calc(env(safe-area-inset-top) + 18px) 16px 12px;
}
.menu-tete { text-align: center; margin-bottom: 14px; }
.menu-tete h1 { margin: 0; font-size: 24px; color: var(--jaune); font-weight: 700; }
.menu-age { display: block; font-size: 13px; opacity: .55; color: var(--creme); font-weight: 400; }

.tuiles {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-height: 0;
}
.tuile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--rayon);
  color: #2b1b00;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--ombre);
  transition: transform .1s;
}
.tuile:active { transform: scale(.96); }
.tuile-emo { font-size: clamp(44px, 13vw, 82px); line-height: 1; }
.tuile-nom { font-size: clamp(13px, 3.4vw, 18px); font-weight: 700; }
.t-coucou { background: linear-gradient(150deg, var(--jaune), var(--corail)); }
.t-qui    { background: linear-gradient(150deg, var(--menthe), #7ae582); }
.t-tape   { background: linear-gradient(150deg, var(--rose), var(--lavande)); }
.t-piano  { background: linear-gradient(150deg, #7ae0ff, var(--lavande)); }

.menu-pied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 4px 4px;
  font-size: 12px;
  opacity: .5;
}
.lien-parent { color: var(--creme); text-decoration: none; border-bottom: 1px dotted; }
.menu-astuce { text-align: right; }

/* ---------------------------------------------------------------- JEU --- */
#ecran-jeu { background: var(--nuit); }
.scene { position: absolute; inset: 0; overflow: hidden; }

.sortie {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 6px);
  left: 6px;
  width: 54px; height: 54px;
  padding: 9px;
  background: none; border: none;
  opacity: .22;
  cursor: pointer;
  z-index: 20;
}
.sortie svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sortie .anneau {
  fill: none;
  stroke: var(--creme);
  stroke-width: 3;
  stroke-dasharray: 94.2;
  stroke-dashoffset: 94.2;
  transition: stroke-dashoffset .05s linear;
}
.sortie.presse { opacity: .8; }

/* --- Coucou --- */
.rideau { position: absolute; inset: 0; display: flex; z-index: 5; }
.rideau-pan {
  flex: 1;
  background: repeating-linear-gradient(90deg, var(--rose) 0 26px, #ff7ba5 26px 52px);
  transition: transform .55s cubic-bezier(.65, 0, .35, 1);
  box-shadow: 0 0 40px rgba(0, 0, 0, .4);
}
.rideau-pan.droite { background: repeating-linear-gradient(90deg, #ff7ba5 0 26px, var(--rose) 26px 52px); }
.rideau.ouvert .rideau-pan.gauche { transform: translateX(-101%); }
.rideau.ouvert .rideau-pan.droite { transform: translateX(101%); }
.rideau-invite {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(60px, 20vw, 140px);
  animation: respire 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes respire {
  0%, 100% { transform: scale(1); } 50% { transform: scale(1.09); }
}

.revele {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.revele img { width: 100%; height: 100%; object-fit: cover; }
.revele .emo-geant { font-size: clamp(120px, 45vw, 340px); }
.etiquette {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 26px;
  border-radius: 999px;
  background: rgba(27, 16, 53, .78);
  color: var(--jaune);
  font-size: clamp(26px, 7vw, 46px);
  font-weight: 700;
  white-space: nowrap;
  animation: monte .4s ease-out;
}
@keyframes monte {
  from { opacity: 0; transform: translate(-50%, 24px); }
}

/* --- Tape et decouvre --- */
.grille {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 6px;
  padding: 6px;
  padding-top: calc(env(safe-area-inset-top) + 6px);
  padding-bottom: 76px;
}
.case {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 22px;
  font-size: clamp(48px, 16vw, 110px);
  cursor: pointer;
  transition: transform .12s;
}
.case:active, .case.pouf { transform: scale(1.12) rotate(-3deg); }

.themes {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px calc(env(safe-area-inset-bottom) + 10px);
}
.theme-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 246, 233, .1);
  color: var(--creme);
  font-family: inherit;
  font-size: 22px;
  cursor: pointer;
  opacity: .45;
}
.theme-btn.on { opacity: 1; background: rgba(255, 246, 233, .24); }

/* --- Piano --- */
.piano { position: absolute; inset: 0; display: flex; gap: 5px; padding: 5px; }
.touche {
  flex: 1;
  border: none;
  border-radius: 18px;
  transition: transform .08s, filter .08s;
  cursor: pointer;
}
.touche:active, .touche.on { transform: scaleY(.965); filter: brightness(1.35); }

.etincelle {
  position: absolute;
  pointer-events: none;
  font-size: 44px;
  animation: envole .9s ease-out forwards;
}
@keyframes envole {
  to { transform: translateY(-130px) scale(1.7) rotate(22deg); opacity: 0; }
}

/* -------------------------------------------------------------- PAUSE --- */
#ecran-pause {
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #241645, #120b24);
}
.pause-boite { text-align: center; padding: 30px; max-width: 420px; }
.pause-lune { font-size: 70px; animation: respire 4s ease-in-out infinite; }
.pause-boite h2 { margin: 14px 0 6px; color: var(--jaune); font-size: 26px; }
.pause-boite p { opacity: .7; margin: 0 0 26px; }
.pause-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-doux, .btn-fade {
  padding: 16px;
  border: none;
  border-radius: 18px;
  font-family: inherit;
  font-size: 17px;
  cursor: pointer;
}
.btn-doux { background: var(--jaune); color: #2b1b00; font-weight: 700; }
.btn-fade { background: rgba(255, 246, 233, .1); color: var(--creme); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
