/* reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  background: #000;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* pages (SPA) */
.page{
  min-height: 100vh;
  display: none;
  place-items: center;
  background: #000;
}
.page.is-active{
  display: grid;
}

/* Frame = référence overlays */
.frame{
  position: relative;
  width: min(100vw, calc(100vh * (16 / 9)));
  aspect-ratio: 16 / 9;
  padding: 18px; /* marge sécurité pour éviter les coupes */
}

/* L'image ne capture pas les clics */
.frame-img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
  pointer-events: none;
}

/* boutons invisibles */
button{
  border: none;
  padding: 0;
  background: rgba(255,255,255,0);
}

/* ======================
   PAGE 01 – bouton secret (piloté par JS)
   - position aléatoire via left/top en JS
   - apparait après délai (classe is-visible)
   - flash/glitch via classe flash
   ====================== */
.secret-btn{
  position: absolute;
  z-index: 5;

  /* ✅ IMPORTANT: pas de right/bottom ici, sinon il reste bas-droite */
  left: 50%;
  top: 50%;

  /* très petit */
  width: 2.6%;
  height: 3.8%;
  border-radius: 50%;

  transform: translate(-50%, -50%);
  cursor: pointer;

  /* invisible au repos */
  opacity: 0;
  pointer-events: none;
}

/* activé (cliquable) */
.secret-btn.is-visible{
  opacity: 0.02;       /* quasi invisible */
  pointer-events: auto;
}

/* Flash très visible + glitch (mobile-friendly) */
.secret-btn.flash{
  opacity: 1 !important;

  outline: 3px solid rgba(255, 0, 0, 0.92);
  outline-offset: 6px;

  box-shadow:
    0 0 0 6px rgba(255, 0, 0, 0.22),
    0 0 28px rgba(255, 0, 0, 0.70);

  animation: secretFlash 350ms ease-in-out 1;
}

@keyframes secretFlash{
  0%   { transform: translate(-50%,-50%) scale(1) rotate(0deg); }
  20%  { transform: translate(-50%,-50%) scale(1.14) rotate(-2deg); }
  45%  { transform: translate(-50%,-50%) scale(0.94) rotate(2deg); }
  70%  { transform: translate(-50%,-50%) scale(1.10) rotate(-1deg); }
  100% { transform: translate(-50%,-50%) scale(1) rotate(0deg); }
}

/* ======================
   PAGE 02 – visages
   ====================== */
.face{
  position: absolute;
  cursor: pointer;
  z-index: 5;
}

.face-1 { left: 2.5%;  top: 44%; width: 18%; height: 48%; }
.face-2 { left: 22.5%; top: 22%; width: 21%; height: 50%; }
.face-3 { left: 40.5%; top: 44%; width: 18%; height: 45%; }
.face-4 { left: 56.5%; top: 24%; width: 22%; height: 54%; }
.face-5 { left: 80.0%; top: 42%; width: 18%; height: 48%; }

/* ======================
   BACK (bouton rouge) — corrigé pour ne plus être coupé
   ====================== */
.back-btn{
  position: absolute;
  left: calc(5.5% + 18px);
  top:  calc(6.5% + 18px);
  width: 19%;
  height: 14%;
  cursor: pointer;
  z-index: 5;
}

/* ======================
   NEXT – PAGE 07
   ====================== */
.next-btn{
  position: absolute;
  right: calc(6.5% + 18px);
  bottom: calc(7.5% + 18px);
  width: 22%;
  height: 14%;
  cursor: pointer;
  z-index: 5;
}

/* ======================
   PAGE 08 – zones cliquables
   ====================== */
.ei{
  position: absolute;
  display: block;
  cursor: pointer;
  z-index: 5;
}

.ei-importants{ left: 9%;  top: 18%; width: 34%; height: 16%; }
.ei-clock     { left: 55%; top: 8%;  width: 16%; height: 22%; }
.ei-gps       { left: 14%; top: 58%; width: 12%; height: 22%; }
.ei-date      { left: 44%; top: 55%; width: 16%; height: 24%; }

/* ======================
   EFFETS HORREUR (page 07)
   ====================== */
.shake{ animation: shake 420ms linear; }
@keyframes shake{
  0% { transform: translate(0,0); }
  15% { transform: translate(-6px,3px); }
  30% { transform: translate(6px,-3px); }
  45% { transform: translate(-5px,2px); }
  60% { transform: translate(5px,-2px); }
  75% { transform: translate(-4px,2px); }
  100% { transform: translate(0,0); }
}

.horror-overlay{
  position: absolute;
  inset: 18px;
  pointer-events: none;
  opacity: 0;
  background: rgba(130,0,0,0.6);
  z-index: 20;
}
.horror-overlay.flash{ animation: flash 500ms ease; }
@keyframes flash{
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

.blood-drip{
  position: absolute;
  left: 18px;
  right: 18px;
  top: calc(-25% + 18px);
  height: 45%;
  pointer-events: none;
  opacity: 0;
  z-index: 21;
  background:
    radial-gradient(circle at 15% 20%, rgba(140,0,0,.85) 0 18%, transparent 19%),
    radial-gradient(circle at 35% 15%, rgba(140,0,0,.75) 0 14%, transparent 15%),
    radial-gradient(circle at 60% 25%, rgba(140,0,0,.85) 0 16%, transparent 17%),
    radial-gradient(circle at 80% 15%, rgba(140,0,0,.75) 0 13%, transparent 14%),
    linear-gradient(to bottom, rgba(140,0,0,.85), rgba(140,0,0,0));
}
.blood-drip.drip{ animation: drip 900ms ease-in; }
@keyframes drip{
  0% { opacity: 0; transform: translateY(0); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(60%); }
}

/* ======================
   MODAL (page 07)
   ====================== */
.modal{
  position: absolute;
  inset: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  z-index: 50;
}
.modal.is-open{ display: flex; }

.modal-card{
  position: relative;
  width: min(520px, 92%);
  background: rgba(10,10,10,0.9);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 18px;
  backdrop-filter: blur(8px);
}

.modal-title{
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}
.modal-sub{
  margin-top: 6px;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
}

.modal-row{
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.modal-input{
  flex: 1;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.35);
  color: #fff;
  padding: 0 12px;
}

.modal-ok{
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
}

.modal-close{
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

/* (optionnel) debug zones
.secret-btn { background: rgba(255,255,0,0.15); }
*/
