/* ============================================================
   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 -- fond FondGrappe100.png semi-transparent
   Même technique que Pa_Capona_26 / Pa_Capona_26Bis :
     ::before avec opacity pour laisser transparaître le fond blanc
   Colonne flex : zone1 | spacer (photo) | zone2 | choix | bas
   Pas de personnage absolu sur cette page.
============================================================ */
.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/FondGrappe100.png');
  background-size: cover;
  background-position: center center;
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
}

/* ============================================================
   ZONES DE TEXTE -- fond vert olive foncé
   Zone 1 : intro Petite Arvine
   Zone 2 : arômes + question
   "Petite Arvine" affiché en rouge dans les deux zones
============================================================ */
.zone-texte {
  flex: 0 0 auto;
  background: rgba(62, 74, 36, 0.90);
  border-radius: clamp(5px, 1.5vw, 10px);
  padding: clamp(8px, 1.6dvh, 20px) clamp(14px, 5%, 28px);
  margin: clamp(6px, 1.2dvh, 12px) clamp(10px, 4%, 20px) 0;
  text-align: center;
  z-index: 2;
}

.zone-p {
  font-size: clamp(0.72rem, 3.8vw, 1.7rem);
  color: #ffffff;
  line-height: 1.55;
}

/* "Petite Arvine" en rouge vif (fidèle à la maquette WinDev) */
.arvine {
  color: #e81820;
  font-weight: 700;
}

/* ============================================================
   SPACER PHOTO -- espace flexible entre zone 1 et zone 2
   Laisse apparaître la photo de grappes du fond
============================================================ */
.spacer-photo {
  flex: 1 1 0;
  min-height: clamp(30px, 8dvh, 120px);
}

/* ============================================================
   CHOICE BOX -- fond olive, grille 2×2 centrée
   (pas de titre : la question est dans zone 2)
============================================================ */
.choix-zone {
  flex: 0 0 auto;
  background: rgba(75, 90, 44, 0.88);
  border-radius: clamp(8px, 2vw, 14px);
  margin: clamp(5px, 1dvh, 10px) auto 0;
  padding: clamp(8px, 1.4dvh, 16px) clamp(12px, 4%, 24px);
  z-index: 2;
  width: min(82%, 360px);         /* centré, pas besoin de laisser place à un perso */
}

/* Grille 2 colonnes */
.choix-grille {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(5px, 1dvh, 12px) clamp(8px, 2.5vw, 18px);
}

/* ---- Option radio (label) ---- */
.choix-option {
  display: flex;
  align-items: center;
  gap: clamp(5px, 1.5vw, 10px);
  background: rgba(255, 255, 255, 0.10);
  border: 2px solid rgba(255, 255, 255, 0.40);
  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.22);
}

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

/* Cercle radio custom */
.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: #3e4a24;        /* olive foncé, cohérent avec le fond */
  opacity: 0;
  transition: opacity 0.15s ease;
}

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

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

.radio-label {
  font-size: clamp(0.76rem, 3.6vw, 1.1rem);
  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;
  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
============================================================ */
.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; }

/* Emoticone (panel erreur uniquement) */
.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;
}

.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; }
  .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; }
  .choix-zone  { width: min(90%, 300px); }
}

/* ============================================================
   RESPONSIVE -- TABLETTE (>= 600px)
============================================================ */
@media (min-width: 600px) {
  .zone-p      { font-size: clamp(0.72rem, 3.8vw, 1.7rem); }
  .radio-label { font-size: clamp(0.82rem, 2.4vw, 1.15rem); }
  .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); }
  .choix-zone  { width: min(70%, 440px); }
}

/* ============================================================
   RESPONSIVE -- PAYSAGE MOBILE (hauteur <= 450px)
============================================================ */
@media (max-height: 450px) and (orientation: landscape) {
  .zone-texte  { padding: 4px 10px; margin: 3px 8px 0; }
  .zone-p      { font-size: 0.48rem; line-height: 1.3; }
  .spacer-photo { min-height: 10px; }
  .choix-zone  { padding: 4px 10px; margin: 2px auto 0; width: min(75%, 380px); }
  .radio-label { font-size: 0.48rem; }
  .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; }
}
