/* ============================================================
   Pa_Capona_Manga.css
   FEN_Pa_Capona_Manga
   ─────────────────────────────────────────────────────────
   Fond écran : #CBE4FF (bleu clair, couleur directe sur body)
   Layout flex-colonne (100dvh) :
     • .content-scroll  → flex:1, scrollable
         └ .img-duo-zone    → 2 images manga côte à côte
         └ .zone-question1  → fond #C8A645, texte blanc centré
         └ .zone-radio      → fond #DFA9FF, grille 2×2 radios
         └ .zone-question2  → fond #C8A645, texte + select
     • .bas-zone         → retour | lézard | coffre+score
   Panels : Attention (#FFFF99) | Bravo | Erreur
============================================================ */

/* ============================================================
   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: #CBE4FF;   /* fond bleu clair de la page */
}

/* ============================================================
   ECRAN PRINCIPAL
   Fond : couleur body (#CBE4FF) — pas d'image de fond
============================================================ */
.screen {
  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: transparent;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ============================================================
   ZONE DÉFILABLE
============================================================ */
.content-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.content-scroll::-webkit-scrollbar        { width: 4px; }
.content-scroll::-webkit-scrollbar-track  { background: transparent; }
.content-scroll::-webkit-scrollbar-thumb  { background: rgba(0,0,0,0.18); border-radius: 4px; }

/* ============================================================
   DUO D'IMAGES — côte à côte, hauteur fixe, object-fit cover
============================================================ */
.img-duo-zone {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: clamp(200px, 42dvh, 360px);
  overflow: hidden;
}

.manga-img {
  flex: 1;
  width: 50%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Léger filet de séparation entre les deux images */
.manga-img:first-child { border-right: 1px solid #CBE4FF; }

/* ============================================================
   ZONE QUESTION 1 — fond #C8A645 (or doré), texte blanc
============================================================ */
.zone-question1 {
  background: #C8A645;
  color: #ffffff;
  text-align: center;
  padding: clamp(10px, 1.8dvh, 18px) clamp(14px, 5%, 26px);
}

.zone-question1 p {
  font-size: clamp(0.78rem, 3.4vw, 1.12rem);
  line-height: 1.55;
}

/* ============================================================
   ZONE RADIO — fond #DFA9FF (lavande), grille 2×2
============================================================ */
.zone-radio {
  background: #DFA9FF;
  padding: clamp(10px, 1.8dvh, 18px) clamp(10px, 3%, 20px);
}

.radio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1.8dvh, 16px) clamp(6px, 2vw, 14px);
}

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

/* L'input natif est masqué — on utilise un cercle CSS */
.radio-opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Cercle extérieur blanc avec bordure violette */
.radio-circle {
  flex-shrink: 0;
  width: clamp(22px, 6vw, 32px);
  height: clamp(22px, 6vw, 32px);
  border-radius: 50%;
  border: clamp(2px, 0.5vw, 3px) solid #8e24aa;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease;
}

/* Pastille intérieure (visible quand sélectionné) */
.radio-circle::after {
  content: '';
  width: 55%;
  height: 55%;
  border-radius: 50%;
  background: #7b1fa2;
  opacity: 0;
  transition: opacity 0.15s ease;
}

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

.radio-opt input[type="radio"]:checked + .radio-circle {
  border-color: #4a148c;
}

.radio-label {
  font-size: clamp(0.72rem, 3.2vw, 1.05rem);
  color: #1a1a1a;
  font-weight: 500;
  line-height: 1.3;
}

/* ============================================================
   ZONE QUESTION 2 — fond #C8A645 (or doré), texte blanc
   Contient aussi la ligne de saisie avec select
============================================================ */
.zone-question2 {
  background: #C8A645;
  color: #ffffff;
  padding: clamp(10px, 1.8dvh, 18px) clamp(14px, 5%, 26px);
}

.zone-question2 p {
  font-size: clamp(0.76rem, 3.2vw, 1.1rem);
  line-height: 1.55;
  margin-bottom: clamp(4px, 0.8dvh, 8px);
}

.zone-question2 p:last-of-type { margin-bottom: clamp(4px, 0.8dvh, 8px); }

.q2-intro {
  font-size: clamp(0.76rem, 4vw, 2rem);
  font-weight: 700;
  margin-bottom: clamp(6px, 1.2dvh, 12px) !important;
}

/* ── Ligne de saisie : label + select côte à côte ── */
.saisie-ligne {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(6px, 1.5vw, 12px);
  margin-top: clamp(4px, 0.8dvh, 8px);
}

.saisie-label {
  font-size: clamp(0.76rem, 3.2vw, 1.1rem);
  color: #ffffff;
  font-weight: 500;
}

/* Select natif (iOS picker) — fond blanc, min 16px (anti-zoom iOS) */
.combo-reponse {
  background: #ffffff;
  border: none;
  border-radius: 5px;
  padding: clamp(4px, 0.8dvh, 8px) clamp(8px, 2vw, 14px);
  font-size: 16px;   /* ← évite le zoom automatique iOS */
  font-family: inherit;
  font-weight: 600;
  color: #1a1a1a;
  min-width: clamp(65px, 16vw, 100px);
  cursor: pointer;
  outline: none;
}

/* "?" en orange quand aucune valeur sélectionnée */
.combo-reponse.empty {
  color: #E05E4F;
  font-weight: 700;
}

/* ============================================================
   ESPACE BAS du scroll (évite masquage par la barre)
============================================================ */
.scroll-spacer {
  height: clamp(64px, 12dvh, 96px);
}

/* ============================================================
   TOAST — message bref centré
============================================================ */
.toast {
  position: fixed;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.84);
  color: #ffffff;
  padding: clamp(10px, 1.8dvh, 16px) clamp(16px, 5vw, 28px);
  border-radius: 12px;
  font-size: clamp(0.72rem, 3.2vw, 1.05rem);
  text-align: center;
  max-width: 84vw;
  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);
  background: rgba(203, 228, 255, 0.70);  /* voile bleu clair */
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.retour-img {
  height: clamp(36px, 8dvh, 64px);
  width: auto;
  display: block;
  cursor: pointer;
  -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.30));
  -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 — overlay + boîte
============================================================ */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2dvh, 20px) clamp(8px, 2vw, 16px);
}

.panel-box {
  background: #ffffff;
  border-radius: clamp(10px, 3vw, 20px);
  padding: clamp(14px, 2.8dvh, 28px) clamp(16px, 5vw, 34px);
  max-width: 92vw;
  max-height: 88dvh;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.8dvh, 18px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.panel-box::-webkit-scrollbar        { width: 4px; }
.panel-box::-webkit-scrollbar-thumb  { background: rgba(0,0,0,0.20); border-radius: 4px; }

/* ── Attention (#FFFF99 fond, bordure rouge) ── */
.panel-attention {
  background: #FFFF99;
  border: 2px solid #cc3333;
  max-width: 82vw;
  text-align: center;
  padding: clamp(16px, 3dvh, 28px) clamp(16px, 5vw, 28px);
  gap: clamp(14px, 2.5dvh, 22px);
}

.attention-text {
  font-size: clamp(0.80rem, 3.5vw, 1.12rem);
  color: #1a1a1a;
  font-weight: 600;
  line-height: 1.55;
}

.attention-footer {
  display: flex;
  justify-content: center;
}

.attention-close-img {
  height: clamp(30px, 6.5dvh, 48px);
  width: auto;
  display: block;
  cursor: pointer;
  -webkit-user-drag: none;
  transition: transform 0.12s ease;
}
.attention-close-img:active { transform: scale(0.90); }

/* ── Bravo (bordure #C8A645) ── */
.panel-bravo  { border: 3px solid #C8A645; }

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

/* ── En-tête panels : image gauche + texte droite ── */
.panel-header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: clamp(8px, 2.5vw, 16px);
}

.panel-header-img {
  flex-shrink: 0;
  height: clamp(52px, 11dvh, 88px);
  width: auto;
  display: block;
  -webkit-user-drag: none;
}

.panel-emoticone { height: clamp(48px, 10dvh, 80px); }

.panel-header-text {
  flex: 1;
  min-width: 0;
}

.panel-title {
  font-size: clamp(1.2rem, 5.5vw, 1.9rem);
  font-weight: 900;
  color: #222222;
  line-height: 1.2;
}

.panel-subtitle {
  font-size: clamp(0.76rem, 3.4vw, 1.08rem);
  color: #333333;
  line-height: 1.45;
  margin-top: clamp(3px, 0.6dvh, 6px);
}

/* Message d'erreur avec whitespace préservé */
.panel-erreur-text {
  font-size: clamp(0.74rem, 3.3vw, 1.05rem);
  color: #222222;
  line-height: 1.55;
  white-space: pre-line;   /* respecte les \n passés via JS */
}

/* ── Pied de panel : points (gauche) + bouton (droite) ── */
.panel-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: clamp(8px, 2vw, 14px);
}

.panel-pts {
  font-size: clamp(0.78rem, 3.4vw, 1.1rem);
  color: #444444;
  font-style: italic;
  flex: 1;
}

.panel-pts-erreur { color: #666666; }

/* Flèche bleue → (bravo) */
.panel-fleche-img {
  flex-shrink: 0;
  height: clamp(36px, 7dvh, 54px);
  width: auto;
  display: block;
  cursor: pointer;
  filter: drop-shadow(1px 1px 3px rgba(0,0,0,0.20));
  -webkit-user-drag: none;
  transition: transform 0.12s ease;
}
.panel-fleche-img:active { transform: scale(0.90); }

/* ✕ fermer */
.panel-close-img {
  flex-shrink: 0;
  height: clamp(28px, 6dvh, 44px);
  width: auto;
  display: block;
  cursor: pointer;
  -webkit-user-drag: none;
  transition: transform 0.12s ease;
}
.panel-close-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) {
  .img-duo-zone      { height: clamp(140px, 34dvh, 200px); }
  .zone-question1 p,
  .zone-question2 p,
  .saisie-label      { font-size: 0.8rem; }
  .radio-label       { font-size: 0.80rem; }
  .radio-circle      { width: 18px; height: 18px; }
  .coffre-img        { height: 22px; }
  .points-box        { font-size: 0.68rem; min-width: 26px; }
  .lezard-img        { height: 36px; }
  .retour-img        { height: 28px; }
}

/* ============================================================
   RESPONSIVE — SMARTPHONES (375-430px, >= 700px hauteur)
============================================================ */
/* iPhone portrait — sans condition de hauteur (fix iOS 18 / iPhone 16 Pro) */
@media (min-width: 375px) and (max-width: 430px) {
  .img-duo-zone      { height: clamp(170px, 34dvh, 260px); }
  .zone-question1 p  { font-size: clamp(0.80rem, 3.5vw, 1.14rem); }
  .zone-question2 p,
  .saisie-label      { font-size: clamp(0.78rem, 3.4vw, 1.12rem); }
  .radio-label       { font-size: clamp(0.74rem, 3.3vw, 1.06rem); }
  .coffre-img        { height: clamp(30px, 5.5dvh, 44px); }
  .lezard-img        { height: clamp(48px, 9dvh, 72px); }
}

/* ============================================================
   RESPONSIVE — TABLETTE (>= 600px)
============================================================ */
@media (min-width: 600px) {
  .img-duo-zone      { height: clamp(240px, 42dvh, 400px); }
  .zone-question1 p  { font-size: clamp(0.88rem, 2.5vw, 1.5rem); }
  .zone-question2 p,
  .saisie-label      { font-size: clamp(0.86rem, 2.5vw, 1.5rem); }
  .radio-label       { font-size: clamp(0.84rem, 2.2vw, 1.2rem); }
  .radio-circle      { width: clamp(26px, 4.5vw, 36px); height: clamp(26px, 4.5vw, 36px); }
  .radio-grid        { gap: clamp(10px, 2dvh, 20px) clamp(8px, 2vw, 18px); }
  .coffre-img        { height: clamp(34px, 6dvh, 54px); }
  .lezard-img        { height: clamp(54px, 10dvh, 100px); }
  .retour-img        { height: clamp(44px, 8dvh, 70px); }
}

/* ============================================================
   RESPONSIVE — iPad 6 seul (768-1023px, 900-1199px hauteur)
============================================================ */
@media (min-width: 768px) and (max-width: 1023px) and (min-height: 900px) and (max-height: 1199px) {
  .img-duo-zone      { height: clamp(260px, 40dvh, 400px); }
  .zone-question1 p  { font-size: clamp(0.96rem, 2.5vw, 1.4rem); }
  .radio-label       { font-size: clamp(0.92rem, 2.3vw, 1.3rem); }
}

/* ============================================================
   RESPONSIVE — Galaxy Tab A8 + iPad Pro (>= 768px, >= 1200px)
============================================================ */
@media (min-width: 768px) and (min-height: 1199px) {
  .img-duo-zone      { height: clamp(300px, 38dvh, 480px); }
  .zone-question1 p  { font-size: clamp(1.0rem, 3vw, 2rem); }
  .zone-question2 p,
  .saisie-label      { font-size: clamp(0.98rem, 3vw, 2rem); }
  .radio-label       { font-size: clamp(0.96rem, 3vw, 2rem); }
}

/* ============================================================
   RESPONSIVE — PAYSAGE MOBILE (hauteur ≤ 430px)
============================================================ */
@media (max-height: 430px) and (orientation: landscape) {
  .img-duo-zone      { height: clamp(100px, 50dvh, 200px); }
  .zone-question1 p  { font-size: 0.52rem; line-height: 1.3; }
  .zone-question2 p,
  .saisie-label      { font-size: 0.52rem; line-height: 1.3; }
  .zone-question1,
  .zone-question2    { padding: 5px 10px; }
  .zone-radio        { padding: 5px 8px; }
  .radio-grid        { gap: 5px 8px; }
  .radio-label       { font-size: 0.50rem; }
  .radio-circle      { width: 16px; height: 16px; }
  .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; }
  .scroll-spacer     { height: 40px; }
}
