/* ============================================================
   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 Fond Grappe 2.png semi-transparent
   Technique identique à Pa_Capona_26 :
     ::before avec opacity pour laisser transparaître le fond blanc
   Colonne flex pour les zones de texte + choix + bas
   Marc est en position: absolute (droite)
============================================================ */
.screen {
  position: relative;
  isolation: isolate;          /* ::before z-index:-1 reste dans .screen */
  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 Grappe 2.png');
  background-size: cover;
  background-position: center center;
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
}

/* ============================================================
   PERSONNAGE MARC -- absolu, côté droit
============================================================ */
.marc-img {
  position: absolute;
  height: clamp(200px, 46dvh, 560px);
  bottom: 12%;
  right: 0;
  z-index: 3;
  pointer-events: none;        /* ne capte pas les taps */
  -webkit-user-drag: none;
}

/* ============================================================
   ZONES DE TEXTE
============================================================ */
.zone-texte {
  flex: 0 0 auto;
  border-radius: clamp(5px, 1.5vw, 10px);
  padding: clamp(6px, 1.3dvh, 16px) clamp(14px, 5%, 28px);
  margin: clamp(6px, 1.2dvh, 12px) clamp(10px, 4%, 20px) 0;
  text-align: center;
  z-index: 2;
}

/* Zone 1 : fond bleu */
.zone1 {
  background: #2f98bb;
}

/* Zone 2 : fond vert, prend l'espace restant, padding droite pour Marc */
.zone2 {
  flex: 1 1 0;
  min-height: 0;
  background: #98B900;
  overflow: hidden;
  /* Réserve la colonne droite pour Marc */
  padding-right: clamp(90px, 36%, 220px);
  text-align: left;
}

.zone-p {
  font-size: clamp(0.68rem, 5vw, 2rem); 
  color: #ffffff;
  line-height: 1.5;
}

/* ============================================================
   CHOICE BOX -- fond bleu, grille 2×2
============================================================ */
.choix-zone {
  flex: 0 0 auto;
  background: #2f98bb;
  border-radius: clamp(5px, 1.5vw, 10px);
  margin: clamp(5px, 1dvh, 10px) 0 0 clamp(10px, 4%, 20px);
  padding: clamp(6px, 1.2dvh, 14px) clamp(10px, 4%, 20px);
  z-index: 2;
  width: 60%;                  /* laisse 40% à droite pour Marc */
}

.choix-titre {
  font-size: clamp(0.80rem, 3.8vw, 1.15rem);
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  margin-bottom: clamp(5px, 1dvh, 10px);
}

/* Grille 2 colonnes */
.choix-grille {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(4px, 0.9dvh, 10px) clamp(6px, 2vw, 14px);
}

/* ---- Option radio (label) ---- */
.choix-option {
  display: flex;
  align-items: center;
  gap: clamp(5px, 1.5vw, 10px);
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: clamp(4px, 1.5vw, 8px);
  padding: clamp(5px, 0.9dvh, 10px) clamp(7px, 2vw, 13px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.choix-option:active {
  background: rgba(255, 255, 255, 0.25);
}

/* Masquer le radio natif tout en le gardant accessible */
.choix-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Cercle radio custom : blanc, avec point intérieur bleu quand coché */
.radio-circle {
  width: clamp(16px, 4.5vw, 24px);
  height: clamp(16px, 4.5vw, 24px);
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  background: #ffffff;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s ease;
}

/* Point intérieur (invisible par défaut) */
.radio-circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46%;
  height: 46%;
  border-radius: 50%;
  background: #2f98bb;
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* Quand l'input est coché → afficher le point */
.choix-option input[type="radio"]:checked + .radio-circle::after {
  opacity: 1;
}

/* Bordure plus lumineuse sur l'option sélectionnée */
.choix-option:has(input[type="radio"]:checked) {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
}

.radio-label {
  font-size: clamp(0.72rem, 3.4vw, 1.05rem);
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}

/* ============================================================
   BARRE BAS : retour (gauche) | lézard (centre) | coffre+score (droite)
============================================================ */
.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(4px, 0.8dvh, 10px);
  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 (essais restants)
============================================================ */
.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;   /* permet les \n dans textContent */
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: none;
}
.toast.toast-visible { opacity: 1; }

/* ============================================================
   PANELS (Bravo / Erreur) -- identiques Pa_Capona_25Ter
   overlay + boîte centrée
============================================================ */
.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(18px, 4dvh, 36px) clamp(20px, 6vw, 44px);
  max-width: 82vw;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2dvh, 20px);
  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-pts {
  font-size: clamp(0.80rem, 3.5vw, 1.2rem);
  color: #22aa44;
  font-weight: 700;
}

.panel-text {
  font-size: clamp(0.78rem, 3.5vw, 1.15rem);
  color: #333333;
  line-height: 1.5;
}

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

/* ============================================================
   ANIMATIONS
============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   RESPONSIVE -- PORTRAIT ETROIT (<= 360px)
============================================================ */
@media (max-width: 360px) {
  .zone-p        { font-size: 0.9rem; }
  .choix-titre   { font-size: 0.80rem; }
  .radio-label   { font-size: 0.7rem; }
  .coffre-img    { height: 22px; }
  .points-box    { font-size: 0.68rem; min-width: 26px; }
  .lezard-img    { height: 38px; }
  .retour-img    { height: 28px; }
  .marc-img      { height: 220px; }
  .zone2         { padding-right: clamp(70px, 33%, 160px); }
  .choix-zone    { width: 68%; }
}

/* ============================================================
   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.68rem, 5vw, 1rem); }
  .marc-img   { height: clamp(180px, 42dvh, 430px); }
  .zone2      { padding-right: clamp(85px, 35%, 200px); }
  .choix-zone { width: 68%; }
}

/* ============================================================
   RESPONSIVE -- TABLETTE (>= 600px)
============================================================ */
@media (min-width: 600px) {
  .zone-p      { font-size: clamp(0.68rem, 5vw, 1.7rem); }
  .choix-titre { font-size: clamp(0.88rem, 2.8vw, 1.25rem); }
  .radio-label { font-size: clamp(0.80rem, 2.5vw, 1.1rem); }
  .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); }
  .marc-img    { height: clamp(280px, 48dvh, 640px); }
  .zone2       { padding-right: clamp(120px, 32%, 260px); }
  .choix-zone  { width: 60%; }
}

/* ============================================================
   RESPONSIVE -- PAYSAGE MOBILE (hauteur <= 450px)
============================================================ */
@media (max-height: 450px) and (orientation: landscape) {
  .zone-texte  { padding: 3px 10px; margin: 3px 8px 0; }
  .zone-p      { font-size: 0.46rem; line-height: 1.3; }
  .choix-titre { font-size: 0.52rem; margin-bottom: 3px; }
  .radio-label { font-size: 0.46rem; }
  .choix-zone  { padding: 3px 8px; margin: 2px 0 0 8px; width: 60%; }
  .zone2       { padding-right: 30%; }
  .bas-zone    { padding: 2px 10px 3px; margin-top: 2px; }
  .coffre-img  { height: 20px; }
  .points-box  { font-size: 0.62rem; min-width: 24px; }
  .lezard-img  { height: 28px; }
  .retour-img  { height: 22px; }
  .marc-img    { height: 120px; }
}
