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

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

/* ============================================================
   ECRAN -- flex colonne, 100dvh
   Ordre des zones (flow normal) :
     .zone-texte      (auto)
     .image-container (flex 1 → remplit le reste)
   Éléments en avant-plan (position absolute) :
     .fleche-suivant  z-index 10, haut droite
     .score-zone      z-index 10, bas gauche
============================================================ */
.screen {
  position: relative;
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #B6904A;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ============================================================
   ZONE TEXTE -- fond #B6904A, texte blanc, centré
   Padding-right majoré pour laisser de la place à la flèche.
============================================================ */
.zone-texte {
  flex: 0 0 auto;
  background: #B6904A;
  padding: clamp(10px, 2dvh, 20px)
           clamp(56px, 13%, 80px)     /* droite : espace pour la flèche */
           clamp(10px, 2dvh, 20px)
           clamp(14px, 4%, 26px);
  text-align: center;
}

.zone-p {
  color: #ffffff;
  font-weight: 700;
  font-size: clamp(0.70rem, 3.4vw, 1.05rem);
  line-height: 1.6;
}

/* ============================================================
   IMAGE FOND (IMG_Fond) -- prend tout l'espace restant
============================================================ */
.image-container {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.fond-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  -webkit-user-drag: none;
}

/* ============================================================
   FLÈCHE SUIVANT -- avant-plan, coin haut droite
   z-index 10 → passe au-dessus de la zone texte ET de l'image
============================================================ */
.fleche-suivant {
  position: absolute;
  top: clamp(8px, 1.8dvh, 18px);
  right: clamp(8px, 2.5%, 18px);
  z-index: 10;
  height: clamp(34px, 7dvh, 56px);
  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-suivant:active { transform: scale(0.90); }

/* ============================================================
   ZONE SCORE -- avant-plan, coin bas gauche
   z-index 10 → passe au-dessus de l'image
============================================================ */
.score-zone {
  position: absolute;
  bottom: clamp(8px, 1.8dvh, 18px);
  left: clamp(8px, 2.5%, 16px);
  z-index: 10;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(4px, 1.2vw, 10px);
}

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

.points-box {
  background: #cc0000;
  color: #ffffff;
  font-weight: 700;
  font-size: clamp(0.78rem, 2.6vw, 1.05rem);
  min-width: clamp(30px, 8vw, 52px);
  padding: clamp(2px, 0.5dvh, 5px) clamp(4px, 1vw, 8px);
  border-radius: 5px;
  text-align: center;
  line-height: 1.2;
}

/* ============================================================
   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.56rem; line-height: 1.4; }
  .fleche-suivant { height: 26px; top: 6px; right: 6px; }
  .coffre-img     { height: 22px; }
  .points-box     { font-size: 0.64rem; min-width: 22px; }
}

/* ============================================================
   RESPONSIVE -- SMARTPHONES (375-430px, >= 700px hauteur)
   iPhone 12 Pro (390×844), iPhone 16 Pro (402×874), S24 Ultra (412×915)
============================================================ */
@media (min-width: 375px) and (max-width: 430px) and (min-height: 700px) {
  .zone-p         { font-size: clamp(0.76rem, 3.5vw, 1.1rem); line-height: 1.65; }
  .fleche-suivant { height: clamp(36px, 6.5dvh, 50px); }
  .coffre-img     { height: clamp(30px, 5dvh, 42px); }
}

/* ============================================================
   RESPONSIVE -- TABLETTE (>= 600px)
============================================================ */
@media (min-width: 600px) {
  .zone-p         { font-size: clamp(0.84rem, 2.5vw, 1.4rem); line-height: 1.7; }
  .fleche-suivant { height: clamp(42px, 7dvh, 64px); }
  .coffre-img     { height: clamp(34px, 5.5dvh, 52px); }
  .points-box     { font-size: clamp(0.9rem, 2.2vw, 1.15rem); }
}

/* ============================================================
   RESPONSIVE -- PAYSAGE MOBILE (hauteur <= 430px)
============================================================ */
@media (max-height: 430px) and (orientation: landscape) {
  .zone-texte     { padding: 3px 50px 3px 10px; }
  .zone-p         { font-size: 0.40rem; line-height: 1.3; }
  .fleche-suivant { height: 22px; top: 4px; right: 6px; }
  .coffre-img     { height: 18px; }
  .points-box     { font-size: 0.58rem; min-width: 20px; padding: 1px 3px; }
  .score-zone     { bottom: 5px; left: 6px; gap: 3px; }
}
