/* ============================================================
   Pa_Capona_Question_Cornalin_53.css
   FEN_Pa_Capona_Question_Cornalin_53
   ─────────────────────────────────────────────────────────
   Layout flex-colonne (100dvh) :
     • .img-zone        → photo FlantheyZoom.jpg (flex fixe)
         └ .zone-question → overlay blanc, texte #004FA0, haut photo
         └ .zone-saisie   → overlay blanc, saisie "C'est la fête du", bas photo
     • .choix-zone      → flex:1, fond blanc
         └ .choix-question → texte #004FA0
         └ .choix-body   → verre (gauche) + radio-column (droite)
     • .bas-zone        → retour | lézard | coffre+score
   Panels :
     • #GR_Attention    → fond #FFFF99, bordure rouge clair
     • #GR_Groupe_Bravo → bordure verte
     • #GR_Groupe_Erreur → bordure rouge
============================================================ */

/* ============================================================
   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: #ffffff;
}

/* ============================================================
   ECRAN PRINCIPAL
============================================================ */
.screen {
  position: relative;
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ============================================================
   ZONE IMAGE — FlantheyZoom.jpg
   Hauteur fixe (flex-shrink interdit), overflow hidden
   pour confiner les overlays absolus.
============================================================ */
.img-zone {
  flex: 0 0 auto;
  position: relative;
  height: clamp(182px, 44dvh, 370px);
  overflow: hidden;
}

.flanthey-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 65% 40%;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* ── Overlay question (haut de la photo) ── */
.zone-question {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  padding: clamp(7px, 1.3dvh, 14px) clamp(12px, 4%, 22px);
  text-align: center;
}

.zone-question p {
  color: #004FA0;
  font-size: clamp(0.68rem, 3.5vw, 1.2rem);
  font-weight: 700;
  line-height: 1.52;
  text-shadow:
    0 0 6px #ffffff,
    0 0 10px #ffffff,
    1px 1px 0 #ffffff,
    -1px -1px 0 #ffffff,
    1px -1px 0 #ffffff,
    -1px  1px 0 #ffffff;
}

/* ── Overlay saisie (bas de la photo) ── */
.zone-saisie {
  position: absolute;
  bottom: clamp(8px, 1.8dvh, 14px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.97);
  border-radius: clamp(4px, 1.2vw, 8px);
  padding: clamp(5px, 1dvh, 10px) clamp(8px, 2.5%, 14px);
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.2vw, 8px);
  max-width: 88%;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.saisie-prefix {
  color: #004FA0;
  font-weight: 600;
  font-size: clamp(0.72rem, 3.2vw, 1.05rem);
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}

.saisie-input {
  border: none;
  border-bottom: 1.5px solid #004FA0;
  background: transparent;
  color: #004FA0;
  /* 16px minimum : évite le zoom iOS Safari */
  font-size: max(16px, clamp(0.72rem, 3.2vw, 1.05rem));
  font-family: inherit;
  font-weight: 500;
  outline: none;
  min-width: clamp(80px, 22vw, 150px);
  flex: 1 1 auto;
  -webkit-appearance: none;
  padding: 2px 0 2px;
}

.saisie-input::placeholder {
  color: #004FA0;
  opacity: 0.45;
  letter-spacing: 0.04em;
}

/* ============================================================
   ZONE CHOIX — fond blanc, flex:1 (prend l'espace restant)
   Structure :
     .choix-question → texte bleu centré
     .choix-body     → flex row : verre (gauche) + radios (droite)
============================================================ */
.choix-zone {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #ffffff;
  padding: clamp(7px, 1.4dvh, 14px) clamp(10px, 3%, 18px) clamp(5px, 1dvh, 10px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.2dvh, 12px);
}

.choix-zone::-webkit-scrollbar        { width: 4px; }
.choix-zone::-webkit-scrollbar-track  { background: transparent; }
.choix-zone::-webkit-scrollbar-thumb  { background: rgba(0, 79, 160, 0.3); border-radius: 4px; }

.choix-question {
  flex-shrink: 0;
  color: #004FA0;
  font-size: clamp(0.76rem, 3.5vw, 1.12rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}

.choix-body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: clamp(8px, 2.5%, 16px);
}

/* Photo verre de rouge — gauche */
.verre-img {
  flex: 0 0 auto;
  width: clamp(95px, 38%, 170px);
  object-fit: cover;
  object-position: 60%;
  border-radius: clamp(5px, 1.5vw, 10px);
  display: block;
  align-self: stretch;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* Colonne radios — droite, dans un cadre bordé #004FA0 */
.radio-column {
  flex: 1 1 0;
  border: 2px solid #004FA0;
  border-radius: clamp(8px, 2.5vw, 14px);
  padding: clamp(8px, 1.8dvh, 16px) clamp(10px, 3%, 16px);
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: clamp(6px, 1.4dvh, 12px);
  min-width: 0;
}

/* ── Options radio custom ── */
.radio-opt {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(6px, 1.5vw, 10px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

/* Cercle CSS custom */
.radio-circle {
  flex-shrink: 0;
  width: clamp(20px, 5.5vw, 30px);
  height: clamp(20px, 5.5vw, 30px);
  border-radius: 50%;
  border: 2.5px solid #004FA0;
  background: #ffffff;
  position: relative;
  transition: border-color 0.15s ease;
}

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

.radio-opt input[type="radio"]:checked + .radio-circle {
  border-color: #004FA0;
}
.radio-opt input[type="radio"]:checked + .radio-circle::after {
  opacity: 1;
}

/* Libellé */
.radio-label {
  font-size: clamp(0.80rem, 3.8vw, 1.15rem);
  font-weight: 700;
  color: #004FA0;
  line-height: 1.2;
  min-width: 0;
}

/* ============================================================
   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);
  background: #f8f8f8;
  border-top: 1px solid #e8e8e8;
}

.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;
  filter: drop-shadow(1px 2px 5px rgba(0, 0, 0, 0.35));
  -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 (Attention / Bravo / Erreur)
============================================================ */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  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, 30px) clamp(20px, 6vw, 42px);
  max-width: 88vw;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2dvh, 18px);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
}

/* ── Attention : fond jaune, bordure rouge clair ── */
.panel-attention {
  background: #FFFF99;
  border: 2px solid #ff6666;
}

.attention-title {
  color: #cc2200 !important;
}

/* ── Bravo : bordure verte ── */
.panel-bravo { border: 3px solid #22aa44; }

/* ── Erreur : bordure rouge ── */
.panel-erreur { border: 3px solid #cc0000; }

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

/* Texte explicatif */
.panel-text {
  font-size: clamp(0.74rem, 3.4vw, 1.08rem);
  color: #333333;
  line-height: 1.52;
  white-space: pre-line;   /* respecte les \n dans JS */
}

/* Points gagnés — bravo */
.panel-pts {
  font-size: clamp(0.82rem, 3.6vw, 1.15rem);
  color: #22aa44;
  font-weight: 700;
  min-height: 1.2em;
}

/* Points gagnés — erreur */
.panel-pts-erreur { color: #cc6600; }

/* Bouton fermer (Attention) */
.panel-close-img {
  height: clamp(28px, 6dvh, 44px);
  width: auto;
  display: block;
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  transition: transform 0.12s ease;
}
.panel-close-img:active { transform: scale(0.90); }

/* Flèche lézard (Bravo / Erreur) */
.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) {
  .img-zone        { height: clamp(155px, 40dvh, 260px); }
  .zone-question p { font-size: 0.8rem; }
  .saisie-prefix   { font-size: 0.8rem; }
  .saisie-input    { font-size: 0.8rem; }
  .choix-question  { font-size: 0.8rem; }
  .radio-label     { font-size: 0.8rem; }
  .radio-circle    { width: 16px; height: 16px; }
  .verre-img       { width: 150px; }
  .coffre-img      { height: 22px; }
  .points-box      { font-size: 0.68rem; min-width: 26px; }
  .lezard-img      { height: 38px; }
  .retour-img      { height: 28px; }
}

/* ============================================================
   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) {
  .img-zone        { height: clamp(190px, 43dvh, 350px); }
  .zone-question p { font-size: clamp(0.70rem, 3.5vw, 1.2rem); }
  .radio-label     { font-size: clamp(0.84rem, 4vw, 1.18rem); }
  .coffre-img      { height: clamp(30px, 5.5dvh, 44px); }
  .lezard-img      { height: clamp(50px, 9dvh, 80px); }
}

/* ============================================================
   RESPONSIVE — TABLETTE générique (>= 600px)
============================================================ */
@media (min-width: 600px) {
  .img-zone        { height: clamp(220px, 42dvh, 420px); }
  .zone-question p { font-size: clamp(0.84rem, 2.5vw, 1.5rem); }
  .choix-question  { font-size: clamp(0.90rem, 2.5vw, 1.5rem); }
  .radio-label     { font-size: clamp(0.92rem, 2.5vw, 1.5rem); }
  .verre-img       { width: clamp(130px, 40%, 220px); }
  .coffre-img      { height: clamp(34px, 6dvh, 54px); }
  .lezard-img      { height: clamp(54px, 10dvh, 100px); }
  .retour-img      { height: clamp(44px, 8dvh, 70px); }
  .radio-column    { padding: clamp(12px, 2.5dvh, 24px) clamp(14px, 4%, 24px); }
}

/* ============================================================
   RESPONSIVE — iPad 6 seul (768-1023px largeur, 900-1199px hauteur)
   iPad 6 CSS viewport : ~768 × 1024px
============================================================ */
@media (min-width: 768px) and (max-width: 1023px) and (min-height: 900px) and (max-height: 1199px) {
  .verre-img    { width: clamp(200px, 46%, 300px); }
  .radio-label  { font-size: clamp(1.0rem, 2.8vw, 1.35rem); }
  .radio-circle { width: clamp(24px, 3.5vw, 34px); height: clamp(24px, 3.5vw, 34px); }
}

/* ============================================================
   RESPONSIVE — Galaxy Tab A8 + iPad Pro 12.9" (>= 768px largeur, >= 1200px hauteur)
   Galaxy Tab A8 CSS viewport : ~800 × 1280px
   iPad Pro 12.9" CSS viewport : ~1024 × 1366px
============================================================ */
@media (min-width: 768px) and (min-height: 1200px) {
  .verre-img    { width: clamp(260px, 48%, 380px); }
  .radio-label  { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
  .radio-circle { width: clamp(28px, 3.2vw, 40px); height: clamp(28px, 3.2vw, 40px); }
}

/* ============================================================
   RESPONSIVE — PAYSAGE MOBILE (hauteur ≤ 430px)
============================================================ */
@media (max-height: 430px) and (orientation: landscape) {
  .img-zone          { height: clamp(95px, 48dvh, 185px); }
  .zone-question     { padding: 3px 8px; }
  .zone-question p   { font-size: 0.48rem; line-height: 1.3; }
  .zone-saisie       { bottom: 4px; padding: 3px 7px; left: 50%; transform: translateX(-50%); }
  .saisie-prefix     { font-size: 0.52rem; }
  .saisie-input      { font-size: 14px; min-width: 60px; }
  .choix-zone        { padding: 3px 8px; gap: 3px; }
  .choix-question    { font-size: 0.52rem; }
  .radio-label       { font-size: 0.58rem; }
  .radio-circle      { width: 14px; height: 14px; }
  .radio-column      { padding: 4px 8px; gap: 4px; }
  .verre-img         { width: 70px; }
  .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; }
}
