/* ============================================================
   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; /* blanc derrière l'image semi-transparente → éclaircit */
}

/* ============================================================
   ECRAN -- fond img/Fond_P_Riri_Histoire.png (::before, opacity 0.55)
   Technique identique à Pa_Capona_26.
   Structure (flex colonne) :
     .main-zone → flex row : left-col (Riri + choix) | right-col (bulle + Q+R)
     .bas-zone  → retour | lézard | score
============================================================ */
.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_P_Riri_Histoire.png');
  background-size: cover;
  background-position: center center;
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
}

/* ============================================================
   ZONE PRINCIPALE -- flex row : colonne gauche | colonne droite
============================================================ */
.main-zone {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

/* ============================================================
   COLONNE GAUCHE -- Riri (haut, flex 1) + panel choix (bas)
============================================================ */
.left-col {
  flex: 0 0 36%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: clamp(4px, 0.8dvh, 10px) clamp(4px, 1.5%, 8px) clamp(6px, 1.2dvh, 12px);
}

/* Image Riri : remonte jusqu'en haut, object-position top */
.riri-img {
  flex: 1 1 0;
  min-height: 0;
  display: block;
  width: 100%;
  object-fit: contain;
  object-position: top center;
  -webkit-user-drag: none;
  pointer-events: none;
  margin-top: 30%;
}

/* ============================================================
   ZONE CHOIX HORIZONTALE -- ○ a  ○ b  ○ c
   Positionnée entre .main-zone et .bas-zone.
   margin-bottom: 5dvh → 5 % d'écran au-dessus du lézard.
   align-self: center → centrée dans la largeur de l'écran.
============================================================ */
.choix-zone {
  flex: 0 0 auto;
  align-self: center;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(14px, 6vw, 40px);
  margin-bottom: 5dvh;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.80);
  border-radius: clamp(8px, 2.5vw, 18px);
  padding: clamp(8px, 1.5dvh, 14px) clamp(20px, 8vw, 52px);
  /* Activer les interactions (radio buttons) */
  user-select: auto;
  -webkit-user-select: auto;
}

.choix-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(8px, 2.5vw, 16px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Radio bouton : cercle custom, bleu quand coché */
.choix-radio {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: clamp(24px, 7vw, 40px);
  height: clamp(24px, 7vw, 40px);
  border: 2.5px solid #aaaaaa;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease;
}

.choix-radio:checked {
  border-color: #3366cc;
  border-width: 3px;
}

.choix-radio:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54%;
  height: 54%;
  background: #3366cc;
  border-radius: 50%;
}

.choix-lettre {
  font-size: clamp(1.05rem, 5vw, 1.6rem);
  font-weight: 700;
  color: #111111;
  line-height: 1;
}

/* ============================================================
   COLONNE DROITE -- bulle + question + réponses (scrollable)
============================================================ */
.right-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: clamp(6px, 1.2dvh, 12px) clamp(8px, 2.5%, 16px) clamp(4px, 0.8dvh, 10px) clamp(4px, 1.5%, 8px);
  gap: clamp(8px, 1.5dvh, 14px);
}

/* ── Bulle de parole ─────────────────────────────────────── */
.bulle-wrapper {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(2px, 0.8vw, 6px);
}

/* Flèche horizontale pointant vers Riri (indique qu'il parle) */
.bulle-fleche {
  flex: 0 0 auto;
  height: clamp(14px, 6dvh, 66px);
  width: auto;
  display: block;
  -webkit-user-drag: none;
  pointer-events: none;
  margin-right: -7%;
  margin-top: 10%;
}

.bulle-box {
  flex: 1 1 0;
  background: rgba(255, 255, 255, 0.96);
  border-radius: clamp(6px, 2vw, 14px);
  padding: clamp(8px, 1.8dvh, 16px) clamp(10px, 3vw, 18px);
  color: #111111;
  font-size: clamp(0.78rem, 3.5vw, 1.05rem);
  font-weight: 500;
  line-height: 1.45;
}

/* ── Zone question + réponses ─────────────────────────────── */
.question-box {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.90);
  border-radius: clamp(6px, 2vw, 14px);
  padding: clamp(8px, 1.8dvh, 16px) clamp(10px, 3vw, 18px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.2dvh, 12px);
}

.question-titre {
  color: #111111;
  font-size: clamp(0.78rem, 3.5vw, 1.05rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}

.reponse-item {
  color: #222222;
  font-size: clamp(0.74rem, 3.2vw, 1.0rem);
  line-height: 1.45;
}

.rep-lettre {
  font-weight: 900;
  color: #111111;
}

/* ============================================================
   BARRE BAS : retour (G) | lézard (C) | score (D)
============================================================ */
.bas-zone {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: clamp(4px, 0.9dvh, 10px) clamp(10px, 3%, 20px) clamp(6px, 1.3dvh, 14px);
  margin-top: clamp(2px, 0.4dvh, 6px);
  z-index: 4;
}

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

/* ============================================================
   TOAST -- message temporaire
============================================================ */
.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;
  white-space: pre-line;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: none;
}
.toast.toast-visible { opacity: 1; }

/* ============================================================
   PANELS (Bravo / Erreur)
============================================================ */
.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: 82vw;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.8dvh, 18px);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
}

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

.panel-emoticone {
  height: clamp(44px, 9dvh, 72px);
  width: auto;
  display: block;
  -webkit-user-drag: none;
}

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

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

.panel-text {
  font-size: clamp(0.76rem, 3.3vw, 1.1rem);
  color: #333333;
  line-height: 1.55;
  text-align: left;
}

.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) {
  .left-col       { flex: 0 0 34%; padding: 3px 4px 6px; }
  .choix-zone     { padding: 6px 12px; gap: 10px; margin-bottom: 4dvh; }
  .choix-radio    { width: 20px; height: 20px; }
  .choix-lettre   { font-size: 0.85rem; }
  .bulle-box      { font-size: 0.7rem; padding: 5px 7px; }
  .question-titre { font-size: 0.7rem; }
  .reponse-item   { font-size: 0.7rem; }
  .coffre-img     { height: 22px; }
  .points-box     { font-size: 0.66rem; min-width: 24px; }
  .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) {
  .choix-zone     { gap: clamp(14px, 6vw, 28px); padding: clamp(9px, 1.6dvh, 14px) clamp(22px, 8vw, 40px); }
  .bulle-box      { font-size: clamp(0.82rem, 3.5vw, 1.0rem); }
  .question-titre { font-size: clamp(0.82rem, 3.5vw, 1.0rem); }
  .reponse-item   { font-size: clamp(0.78rem, 3.2vw, 0.95rem); }
  .lezard-img     { height: clamp(52px, 9dvh, 76px); }
}

/* ============================================================
   RESPONSIVE -- TABLETTE (>= 600px)
============================================================ */
@media (min-width: 600px) {
  .left-col       { flex: 0 0 30%; max-width: 210px; }
  .choix-zone     { gap: clamp(22px, 6vw, 52px); padding: clamp(10px, 1.8dvh, 18px) clamp(36px, 10vw, 80px); }
  .choix-radio    { width: clamp(30px, 5vw, 44px); height: clamp(30px, 5vw, 44px); }
  .choix-lettre   { font-size: clamp(1.1rem, 3.5vw, 1.6rem); }
  .bulle-box      { font-size: clamp(0.90rem, 2.8vw, 1.4rem); }
  .bulle-box      { margin-top: 5% }
  .question-box   { margin-top: 5% }
  .question-titre { font-size: clamp(0.90rem, 2.8vw, 1.3rem); }
  .reponse-item   { font-size: clamp(0.88rem, 2.5vw, 1.2rem); }
  .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, 72px); }
}

/* ============================================================
   RESPONSIVE -- PAYSAGE MOBILE (hauteur <= 430px)
============================================================ */
@media (max-height: 430px) and (orientation: landscape) {
  .left-col       { flex: 0 0 28%; padding: 2px 4px 4px; }
  .choix-zone     { padding: 3px 14px; gap: 10px; margin-bottom: 3dvh; border-radius: 6px; }
  .choix-radio    { width: 18px; height: 18px; }
  .choix-lettre   { font-size: 0.70rem; }
  .right-col      { padding: 3px 8px 3px 4px; gap: 3px; }
  .bulle-wrapper  { gap: 2px; }
  .bulle-fleche   { height: 12px; }
  .bulle-box      { font-size: 0.40rem; padding: 3px 6px; border-radius: 4px; }
  .question-box   { padding: 4px 6px; gap: 2px; border-radius: 4px; }
  .question-titre { font-size: 0.40rem; }
  .reponse-item   { font-size: 0.38rem; line-height: 1.3; }
  .bas-zone       { padding: 2px 10px 3px; margin-top: 1px; }
  .coffre-img     { height: 18px; }
  .points-box     { font-size: 0.58rem; min-width: 20px; padding: 1px 3px; }
  .lezard-img     { height: 26px; }
  .retour-img     { height: 20px; }
}
