/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: #000;
}

/* ============================================================
   ÉCRAN PRINCIPAL
============================================================ */
.screen {
  position: relative;
  width: 100%;
  height: 100dvh;                  /* dvh : dynamique, s'ajuste avec la barre Safari */
  height: var(--real-vh, 100dvh);  /* JS-driven : hauteur visible réelle (iPhone 16 Pro) */
  overflow: hidden;
}

/* ============================================================
   IMAGE DE FOND — pleine page
============================================================ */
.bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
}

/* ============================================================
   BARRE NOIRE DU HAUT
   Tête de mort à gauche, slogan centré
============================================================ */
.header-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: #000;
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 20px);
  padding: clamp(5px, 1.2dvh, 12px) clamp(8px, 2vw, 18px);
  min-height: clamp(48px, 9dvh, 88px);
}

.skull-img {
  flex: 0 0 auto;
  height: clamp(34px, 6.5dvh, 68px);
  width: auto;
}

.header-text {
  flex: 1;
  color: #fff;
  font-size: clamp(0.85rem, 3.2vw, 1.9rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}

/* ============================================================
   ZONE BULLE + FLÈCHE VERTICALE
   La flèche est la "queue" de la bulle, pointant vers Prune
============================================================ */
.speech-area {
  position: absolute;
  top: clamp(72px, 15dvh, 140px);     /* légèrement abaissé sous la barre noire */
  left: clamp(6px, 1.5vw, 18px);
  right: clamp(6px, 1.5vw, 18px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;                /* la zone entière remonte le clic à l'écran */
  animation: fadeIn 0.6s ease 0.2s both;
}

/* Bulle de dialogue — passe DEVANT la flèche */
.speech-bubble {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.95);
  border-radius: clamp(12px, 2vw, 22px);
  padding: clamp(10px, 2dvh, 22px) clamp(12px, 2.5vw, 28px);
  width: 100%;
  max-width: clamp(220px, 88vw, 600px);
  text-align: center;
}

.speech-bubble p {
  font-size: clamp(0.78rem, 3.5vw, 1.5rem);
  line-height: 1.55;
  color: #1a3266;
}

/* "MyRules MyWater" en rouge */
.txt-red {
  color: #cc2200;
}

/* Flèche verticale blanche — DERRIÈRE la bulle */
.arrow-vertical {
  position: relative;
  z-index: 1;          /* passe derrière la bulle (z-index: 2) */
  display: block;
  height: clamp(36px, 7dvh, 90px);
  width: auto;
  margin-top: -14px;   /* remontée : la flèche s'enfonce sous la bulle */
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.25));
}

/* ============================================================
   PERSONNAGE PRUNE / CLOE  (bas gauche, cliquable)
   IMG_Cloe → Son("Prune_page4.wav")
============================================================ */
.cloe-img {
  position: absolute;
  bottom: clamp(24px, 6dvh, 70px);   /* remontée par rapport au bas */
  left: clamp(2px, 1vw, 16px);
  z-index: 2;
  height: clamp(370px, 70dvh, 680px);
  width: auto;
  cursor: pointer;
  animation: fadeIn 0.7s ease 0.4s both;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.cloe-img:active {
  transform: scale(0.97);
}

/* ============================================================
   BOUTON SUIVANT — flèche bas droite
   BTN_Suivant → OuvreFenêtreMobile(FEN_Pa_Capona_5_Cloe_et_Marc)
============================================================ */
.btn-suivant {
  position: absolute;
  bottom: clamp(10px, 2.5dvh, 36px);
  right: clamp(10px, 2.5vw, 34px);
  z-index: 4;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  -webkit-tap-highlight-color: transparent;
  line-height: 0;
}
.btn-suivant img {
  height: clamp(32px, 6.5dvh, 78px);
  width: auto;
  display: block;
  filter: drop-shadow(1px 1px 3px rgba(0,0,0,0.45));
}
.btn-suivant:active img {
  transform: scale(0.90);
}

/* ============================================================
   OVERLAY DE TRANSITION (fondu noir entrée / sortie)
============================================================ */
.transition-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  opacity: 1;
  pointer-events: all;
  transition: opacity 0.4s ease;
}

/* ============================================================
   ANIMATIONS
============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   RESPONSIVE — PORTRAIT ÉTROIT (≤ 360px)
============================================================ */
@media (max-width: 360px) {
  .header-text     { font-size: 0.72rem; }
  .speech-bubble p { font-size: 0.68rem; }
  .arrow-vertical  { height: 28px; }
  .cloe-img        { height: clamp(320px, 60dvh, 520px); }  /* était 300px fixe → dvh adapté (S21 800px : 480px) */
}

/* ============================================================
   RESPONSIVE — SMARTPHONES PORTRAIT (largeur 375–430px)
   Cible : iPhone SE, 12 Pro, 16 Pro, S24 Ultra…
   Sans condition de hauteur : fix iOS 18 / iPhone 16 Pro
   (la hauteur visible ~682px < 700px → l'ancienne condition
    ne se déclenchait jamais sur iPhone 16 Pro)
============================================================ */
@media (min-width: 375px) and (max-width: 430px) {
  .cloe-img { height: clamp(347px, 45dvh, 427px); }  /* +1/3 par rapport à la v4 */
}

/* ============================================================
   RESPONSIVE — IPAD 768×1024 PORTRAIT
   Largeur très précise 760–780px, hauteur ≥ 1000px
   N'affecte PAS les tablettes aux dimensions différentes.
============================================================ */
@media (min-width: 760px) and (max-width: 780px) and (min-height: 1000px) {
  .cloe-img { height: clamp(296px, 56dvh, 644px); }
}

/* ============================================================
   RESPONSIVE — PAYSAGE MOBILE (hauteur ≤ 450px)
============================================================ */
@media (max-height: 450px) and (orientation: landscape) {
  .header-bar      { min-height: 34px; padding: 3px 10px; }
  .skull-img       { height: 26px; }
  .header-text     { font-size: 0.68rem; }
  .speech-area     { top: 36px; }
  .speech-bubble p { font-size: 0.58rem; }
  .arrow-vertical  { height: 22px; }
  .cloe-img        { height: 120px; }
  .btn-suivant img { height: 28px; }
}
