/* ============================================================
   Pa_Capona_Prune_derniers_4.css
   FEN_Pa_Capona_Prune_derniers_4
   ─────────────────────────────────────────────────────────
   Transparence : body blanc + ::before opacity 0.55
                  (identique Pa_Capona_26)
   Layout flex-colonne (100dvh) :
     • .img-top-zone      → img/Diversite.png centré
     • .choix-texte-zone  → flex:1, fond #2F98BB, 4 réponses
     • .radio-zone        → ligne horizontale a/b/c/d
     • .bas-zone          → retour | lézard | coffre+score
============================================================ */

/* ============================================================
   RESET & BASE
   body blanc → la transparence de ::before laisse transparaître
   ce blanc et éclaircit l'image de fond (technique Pa_Capona_26)
============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: #ffffff;  /* blanc derrière l'image semi-transparente */
}

/* ============================================================
   ECRAN PRINCIPAL
   ::before  → img/Fond irrigation2.png à opacity 0.55
   isolation → confine le z-index:-1 du ::before dans .screen
============================================================ */
.screen {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('img/Fond irrigation2.png');
  background-size: cover;
  background-position: center center;
  opacity: 0.55;         /* 0.4 = très clair · 0.7 = plus sombre */
  z-index: -1;
  pointer-events: none;
}

/* ============================================================
   IMAGE HAUTE -- img/Diversite.png
   Centré horizontalement, hauteur auto proportionnelle
============================================================ */
.img-top-zone {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(6px, 1.2dvh, 14px) clamp(10px, 4%, 22px) clamp(4px, 0.8dvh, 10px);
}

.diversite-img {
  max-width: clamp(200px, 78%, 440px);
  height: auto;
  display: block;
  border-radius: clamp(4px, 1.5vw, 10px);
  -webkit-user-drag: none;
  pointer-events: none;
}

/* ============================================================
   ZONE CHOIX -- fond #2F98BB, texte blanc
   4 paragraphes a/b/c/d scrollables si nécessaire
============================================================ */
.choix-texte-zone {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #2F98BB;
  border-radius: clamp(5px, 1.5vw, 10px);
  margin: 0 clamp(8px, 3%, 18px);
  padding: clamp(6px, 1.2dvh, 14px) clamp(10px, 3%, 18px);
}

/* Scrollbar discrète (WebKit desktop) */
.choix-texte-zone::-webkit-scrollbar        { width: 4px; }
.choix-texte-zone::-webkit-scrollbar-track  { background: transparent; }
.choix-texte-zone::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.40); border-radius: 4px; }

.choix-p {
  color: #ffffff;
  font-size: clamp(0.70rem, 3.4vw, 1.05rem);
  line-height: 1.55;
  margin-bottom: clamp(4px, 0.9dvh, 10px);
}
.choix-p:last-child { margin-bottom: 0; }

.choix-p strong {
  font-weight: 700;
}

/* ============================================================
   ZONE RADIO -- ligne horizontale a / b / c / d
   WinDev : SEL_Choix (1=a, 2=b, 3=c, 4=d)
============================================================ */
.radio-zone {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(5px, 1dvh, 12px) clamp(10px, 3%, 18px);
}

/* Capsule blanche arrondie contenant les 4 options */
.radio-capsule {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-evenly;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.88);
  border-radius: clamp(20px, 6vw, 36px);
  border: 2px solid rgba(0, 0, 0, 0.15);
  padding: clamp(5px, 1dvh, 10px) clamp(8px, 3%, 16px);
  gap: clamp(6px, 2vw, 14px);
}

/* Chaque option : cercle + lettre */
.radio-opt {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(5px, 1.4vw, 9px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Input radio natif masqué (accessible) */
.radio-opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Cercle radio custom */
.radio-circle {
  flex-shrink: 0;
  width: clamp(18px, 5vw, 28px);
  height: clamp(18px, 5vw, 28px);
  border-radius: 50%;
  border: 2.5px solid #555555;
  background: #ffffff;
  position: relative;
  transition: border-color 0.15s ease;
}

/* Point intérieur (cœur du radio) */
.radio-circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44%;
  height: 44%;
  border-radius: 50%;
  background: #1565c0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* Coché → point visible + bordure bleue */
.radio-opt input[type="radio"]:checked + .radio-circle {
  border-color: #1565c0;
}
.radio-opt input[type="radio"]:checked + .radio-circle::after {
  opacity: 1;
}

/* Lettre a / b / c / d */
.radio-label {
  font-size: clamp(0.84rem, 4.2vw, 1.25rem);
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1;
}

/* ============================================================
   TOAST
============================================================ */
.toast {
  position: fixed;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.82);
  color: #ffffff;
  padding: clamp(8px, 1.5dvh, 14px) clamp(14px, 4vw, 24px);
  border-radius: 10px;
  font-size: clamp(0.70rem, 3vw, 1rem);
  text-align: center;
  max-width: 82vw;
  line-height: 1.5;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: none;
}
.toast.toast-visible { opacity: 1; }

/* ============================================================
   BARRE BAS : retour | lézard | coffre+score
============================================================ */
.bas-zone {
  flex: 0 0 auto;
  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);
}

.retour-img {
  height: clamp(36px, 8dvh, 64px);
  width: auto;
  display: block;
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  transition: transform 0.12s ease;
}
.retour-img:active { transform: scale(0.90); }

.lezard-img {
  height: clamp(46px, 10dvh, 90px);
  width: auto;
  display: block;
  cursor: pointer;
  border-radius: clamp(4px, 1.5vw, 10px);
  filter: drop-shadow(1px 2px 5px rgba(0, 0, 0, 0.40));
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  transition: transform 0.12s ease;
}
.lezard-img:active { transform: scale(0.93); }

.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;
}

.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;
}

/* ============================================================
   PANELS (Bravo / Erreur) -- style Pa_Capona_26Ter
============================================================ */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-box {
  background: #ffffff;
  border-radius: clamp(10px, 3vw, 20px);
  padding: clamp(16px, 3.5dvh, 32px) clamp(20px, 6vw, 44px);
  max-width: 86vw;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.8dvh, 16px);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
}

.panel-bravo { border: 3px solid #22aa44; }
.panel-erreur { border: 3px solid #cc0000; }

.panel-title {
  font-size: clamp(1.1rem, 5.5vw, 2rem);
  font-weight: 900;
  color: #222222;
}

.panel-text {
  font-size: clamp(0.74rem, 3.4vw, 1.1rem);
  color: #333333;
  line-height: 1.5;
}

.panel-pts {
  font-size: clamp(0.80rem, 3.5vw, 1.15rem);
  color: #22aa44;
  font-weight: 700;
  min-height: 1.2em;
}

/* Points en erreur : couleur orange/rouge */
.panel-pts-erreur {
  color: #cc6600;
}

.panel-arrow {
  height: clamp(36px, 7dvh, 56px);
  width: auto;
  display: block;
  cursor: pointer;
  filter: drop-shadow(1px 1px 3px rgba(0, 0, 0, 0.25));
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  transition: transform 0.12s ease;
}
.panel-arrow: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) {
  .choix-p    { font-size: 0.8rem; }
  .radio-label { font-size: 0.8rem; }
  .radio-circle { width: 16px; height: 16px; }
  .coffre-img { height: 22px; }
  .points-box { font-size: 0.68rem; min-width: 26px; }
  .lezard-img { height: 38px; }
  .retour-img { height: 28px; }
  .diversite-img { max-width: 92%; }
}

/* ============================================================
   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) {
  .choix-p    { font-size: clamp(0.72rem, 3.5vw, 1.08rem); line-height: 1.60; }
  .radio-label { font-size: clamp(0.88rem, 4.3vw, 1.28rem); }
  .coffre-img { height: clamp(30px, 5.5dvh, 44px); }
  .lezard-img { height: clamp(50px, 9dvh, 80px); }
}

/* ============================================================
   RESPONSIVE -- TABLETTE (>= 600px)
============================================================ */
@media (min-width: 600px) {
  .choix-p     { font-size: clamp(0.82rem, 2.5vw, 1.35rem); line-height: 1.65; }
  .radio-label { font-size: clamp(0.96rem, 3vw, 1.4rem); }
  .coffre-img  { height: clamp(34px, 6dvh, 54px); }
  .points-box  { font-size: clamp(0.9rem, 2.2vw, 1.15rem); }
  .lezard-img  { height: clamp(54px, 10dvh, 100px); }
  .retour-img  { height: clamp(44px, 8dvh, 70px); }
  .diversite-img { max-width: 60%; }
}

/* ============================================================
   RESPONSIVE -- PAYSAGE MOBILE (hauteur <= 430px)
============================================================ */
@media (max-height: 430px) and (orientation: landscape) {
  .img-top-zone  { padding: 2px 8px; }
  .diversite-img { max-width: 38%; }
  .choix-texte-zone { margin: 0 6px; padding: 3px 8px; }
  .choix-p       { font-size: 0.38rem; line-height: 1.3; margin-bottom: 2px; }
  .radio-zone    { padding: 2px 8px; }
  .radio-capsule { padding: 3px 8px; }
  .radio-circle  { width: 14px; height: 14px; }
  .radio-label   { font-size: 0.60rem; }
  .bas-zone      { padding: 2px 10px 3px; }
  .coffre-img    { height: 18px; }
  .points-box    { font-size: 0.58rem; min-width: 20px; padding: 1px 3px; }
  .lezard-img    { height: 28px; }
  .retour-img    { height: 22px; }
}
