/* ============================================================
   Pa_Capona_Prune_derniers_3.css
   FEN_Pa_Capona_Prune_derniers_3
   ─────────────────────────────────────────────────────────
   Layout flex-colonne (100dvh) :
     • .zone-haut    → fond #2F98BB, texte blanc, centré
     • .milieu-zone  → flex:1, position:relative
         ├ .fond-img     → Fond irrigation 3.png, absolu, cover
         ├ .prune-img    → Prune Pder3.png, absolu bas-gauche
         └ .texte-pder3  → bulle #DFA9FF, absolu droite
     • .bas-zone     → coffre+score (gauche) | flèche (droite)
   Fullscreen toggle : tap sur fond / zones texte / image
   Navigation        : uniquement IMG_SansNom1 (flèche droite)
============================================================ */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;          /* empêche le scroll parasite du body sur iOS */
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: #2F98BB;
}

/* ============================================================
   ECRAN PRINCIPAL -- colonne flex pleine hauteur
============================================================ */
.screen {
  position: relative;
  isolation: isolate;
  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) */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #2F98BB;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ============================================================
   ZONE TEXTE HAUTE -- fond #2F98BB, texte blanc, centré
============================================================ */
.zone-haut {
  flex: 0 0 auto;
  background: #2F98BB;
  padding: clamp(8px, 1.6dvh, 18px) clamp(14px, 5%, 28px) clamp(6px, 1.2dvh, 14px);
  text-align: center;
  z-index: 2;
}

.zone-p {
  color: #ffffff;
  font-weight: 400;
  font-size: clamp(0.68rem, 3.3vw, 1.02rem);
  line-height: 1.55;
}

/* ============================================================
   ZONE CENTRALE -- fond image + Prune + bulle
   Position relative pour les enfants absolus
============================================================ */
.milieu-zone {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* ---- Image de fond (bisse du Sillonin) ---- */
.fond-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* ================================================================
   ★  POSITIONS PRUNE & BULLE TEXTE  ──  RÉGLAGE FACILE ICI  ★
   ─────────────────────────────────────────────────────────────
   Prune (img/Prune Pder3.png) :
     --px : depuis la gauche    (left)    0% = bord gauche
     --py : depuis le bas       (bottom)  0% = bord bas
   Bulle texte (#DFA9FF) :
     --tx : depuis la gauche    (left)
     --ty : depuis le haut      (top)
     --tw : largeur de la bulle (width)
================================================================ */
.prune-img   { --px: 8%;   --py: 20%;  }
.texte-pder3 { --tx: 38%;  --ty: 5%;  --tw: 49%; }

/* ---- Personnage Prune ---- */
.prune-img {
  position: absolute;
  left:   var(--px);
  bottom: var(--py);
  height: clamp(130px, 75dvh, 400px);
  width: auto;
  z-index: 2;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* ---- Bulle de texte violet (#DFA9FF) ---- */
.texte-pder3 {
  position: absolute;
  left:  var(--tx);
  top:   var(--ty);
  width: var(--tw);
  background: #DFA9FF;
  border-radius: clamp(6px, 2vw, 12px);
  padding: clamp(6px, 1.3dvh, 14px) clamp(8px, 2.5%, 16px);
  z-index: 3;
  pointer-events: none;  /* laisse le tap passer au milieu-zone pour fullscreen */
}

.texte-p {
  font-size: clamp(0.64rem, 3.1vw, 0.98rem);
  color: #000000;
  line-height: 1.5;
}

/* "nouveaux moyens" en rouge gras */
.rouge {
  color: #cc0000;
  font-weight: 700;
}

/* ============================================================
   BARRE BAS
   Gauche  : coffre + LIB_Total_Points
   Droite  : Fleche_suivant 1.png
============================================================ */
.bas-zone {
  /* Positionné en absolu sur l'écran pour laisser la photo s'étendre dessous */
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: clamp(5px, 1dvh, 12px) clamp(10px, 3%, 20px) clamp(7px, 1.4dvh, 16px);
  background: transparent;
  z-index: 10;
}

/* -- Coffre + score (gauche) -- */
.score-zone {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(4px, 1.2vw, 10px);
}

.coffre-img {
  height: clamp(28px, 6dvh, 48px);
  width: auto;
  display: block;
  -webkit-user-drag: none;
  pointer-events: none;
}

.points-box {
  background: #cc0000;
  color: #ffffff;
  font-weight: 700;
  font-size: clamp(0.80rem, 2.8vw, 1.1rem);
  min-width: clamp(32px, 9vw, 58px);
  padding: clamp(3px, 0.6dvh, 6px) clamp(4px, 1vw, 9px);
  border-radius: 5px;
  text-align: center;
  line-height: 1.2;
  border: 2px solid #cc0000;
}

/* -- Flèche suivant (droite) -- */
.fleche-img {
  height: clamp(36px, 8dvh, 64px);
  width: auto;
  display: block;
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  filter: drop-shadow(1px 2px 4px rgba(0, 0, 0, 0.30));
  transition: transform 0.12s ease;
}
.fleche-img:active { transform: scale(0.90); }

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

/* ============================================================
   RESPONSIVE -- PORTRAIT ÉTROIT (<= 360px)
============================================================ */
@media (max-width: 360px) {
  .zone-p    { font-size: 0.8rem; line-height: 1.4; }
  .texte-p   { font-size: 0.8rem; }
  .prune-img { height: 250px; }
  .coffre-img { height: 22px; }
  .points-box { font-size: 0.68rem; min-width: 26px; }
  .fleche-img { height: 28px; }
  .prune-img   { --px: 7%;   --py: 20%;  }
  .texte-pder3 { --tx: 40%;  --ty: 5%;  --tw: 49%; }
}

/* ============================================================
   RESPONSIVE -- SMARTPHONES PORTRAIT (375-430px)
   iPhone SE, 12 Pro, 16 Pro, S24 Ultra…
   Sans condition de hauteur : fix iOS 18 / iPhone 16 Pro
   (hauteur visible ~682px < 700px → ancienne condition jamais déclenchée)
============================================================ */
@media (min-width: 375px) and (max-width: 430px) {
  .zone-p    { font-size: clamp(0.70rem, 3.4vw, 1.05rem); line-height: 1.6; }
  .texte-p   { font-size: clamp(0.66rem, 3.2vw, 1.0rem); }
  .prune-img { height: clamp(140px, 65dvh, 320px); }
  .coffre-img { height: clamp(30px, 5.5dvh, 44px); }
  .fleche-img { height: clamp(38px, 7.5dvh, 58px); }
}

/* ============================================================
   RESPONSIVE -- TABLETTE (>= 600px)
============================================================ */
@media (min-width: 600px) {
  .zone-p    { font-size: clamp(0.80rem, 2.5vw, 1.35rem); line-height: 1.7; }
  .texte-p   { font-size: clamp(0.76rem, 2.6vw, 1.5rem); }
  .prune-img { height: clamp(160px, 75dvh, 420px); }
  .coffre-img { height: clamp(34px, 6dvh, 54px); }
  .points-box { font-size: clamp(0.9rem, 2.2vw, 1.15rem); }
  .fleche-img { height: clamp(44px, 8dvh, 70px); }
}

/* ============================================================
   RESPONSIVE -- TABLETTES PORTRAIT MOYEN (768px–1023px, >= 900px)
   iPad 6ème génération (768×1024), 
============================================================ */
@media (min-width: 768px) and (max-width: 1023px) and (min-height: 900px) {
  .zone-p      { font-size: clamp(0.96rem, 2.2vw, 1.55rem); line-height: 1.72; }
  .texte-p     { font-size: clamp(0.92rem, 2.0vw, 1.5rem); line-height: 1.70; }
  /* Prune plus grande + ancrée moins haut (--py réduit) */
  .prune-img   { height: clamp(180px, 52dvh, 560px); --py: 15%; }
  .texte-pder3 { border-radius: 14px; padding: clamp(10px, 1.8dvh, 20px) clamp(12px, 2%, 22px); }
  .coffre-img  { height: clamp(40px, 5.5dvh, 64px); }
  .points-box  { font-size: clamp(1.0rem, 2.0vw, 1.35rem); min-width: clamp(42px, 8vw, 70px); }
  .fleche-img  { height: clamp(50px, 7.5dvh, 84px); }
  .bas-zone    { padding: clamp(8px, 1.4dvh, 18px) clamp(14px, 3%, 26px) clamp(10px, 1.8dvh, 22px); }
}

/* ============================================================
   RESPONSIVE -- TABLETTES GRAND FORMAT (>= 1024px, >= 1200px)
   iPad Pro 12.9" (1024×1366) Galaxy Tab A8 (800×1280)
============================================================ */
@media (min-width: 799px) and (min-height: 1200px) {
  .zone-p      { font-size: clamp(1.10rem, 1.8vw, 1.80rem); line-height: 1.75; }
  .texte-p     { font-size: clamp(1.05rem, 1.8vw, 1.9rem); line-height: 1.8; }
  /* Prune plus grande + quasi au bas de zone (--py minimal) */
  .prune-img   { height: clamp(240px, 50dvh, 700px); --py: 10%; --px: 13%; }
  .texte-pder3 { border-radius: 16px; padding: clamp(14px, 2.0dvh, 26px) clamp(16px, 2%, 28px); }
  .coffre-img  { height: clamp(48px, 5.0dvh, 74px); }
  .points-box  { font-size: clamp(1.1rem, 1.8vw, 1.55rem); min-width: clamp(50px, 7vw, 80px); }
  .fleche-img  { height: clamp(58px, 7.0dvh, 96px); }
  .bas-zone    { padding: clamp(10px, 1.6dvh, 22px) clamp(16px, 3%, 30px) clamp(12px, 2.0dvh, 26px); }
}

/* ============================================================
   RESPONSIVE -- PAYSAGE MOBILE (hauteur <= 430px)
============================================================ */
@media (max-height: 430px) and (orientation: landscape) {
  .zone-haut  { padding: 3px 14px 2px; }
  .zone-p     { font-size: 0.36rem; line-height: 1.25; }
  .texte-p    { font-size: 0.36rem; line-height: 1.25; }
  .texte-pder3 { padding: 3px 6px; border-radius: 4px; }
  .prune-img  { height: 80px; }
  .bas-zone   { padding: 2px 10px 3px; }
  .coffre-img { height: 18px; }
  .points-box { font-size: 0.58rem; min-width: 20px; padding: 1px 3px; }
  .fleche-img { height: 22px; }
}
