/* ============================================================
   Pa_Capona_Fleurs3_Cle.css
   FEN_Pa_Capona_Fleurs3_Cle
   ─────────────────────────────────────────────────────────
   Fond     : #4D0378 (violet foncé) — écran + textes + bas
   Layout flex-colonne (100dvh) :
     • .texte-haut   → texte blanc, fond violet, flex:3
     • .ensemble     → fond blanc, position:relative, flex:4
                       img/Cle.png (absolu haut-droite)
                       3 .sous-ensemble en escalier (GR_Rep1-3)
                       chaque : .comb-texte (violet) + .comb-btn (carré)
     • .texte-bas    → texte blanc, fond violet, flex:2
     • .bas-zone     → fond #4D0378, retour | lézard | coffre+score
   Popups :
     • GR_Groupe_Bravo_tout_trouve → fond blanc
     • GR_Groupe_pas_zout_trouve   → fond blanc cassé
============================================================ */

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

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

/* ============================================================
   ZONE TEXTE HAUT — blanc sur fond violet
============================================================ */
.texte-haut {
  flex: 3 3 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  background: #4D0378;
}

.texte-haut::-webkit-scrollbar        { width: 3px; }
.texte-haut::-webkit-scrollbar-track  { background: transparent; }
.texte-haut::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.28); border-radius: 3px; }

/* ============================================================
   ZONE TEXTE BAS — blanc sur fond violet
============================================================ */
.texte-bas {
  flex: 2 2 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  background: #4D0378;
}

.texte-bas::-webkit-scrollbar        { width: 3px; }
.texte-bas::-webkit-scrollbar-track  { background: transparent; }
.texte-bas::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.28); border-radius: 3px; }

/* Paragraphe commun aux deux zones texte */
.texte-principal {
  color: #ffffff;
  font-size: clamp(0.83rem, 3.4vw, 1.15rem);
  font-weight: 500;
  line-height: 1.55;
  text-align: center;
  max-width: 580px;
}

/* ============================================================
   ENSEMBLE — fond blanc, clé absolu + 3 sous-ensembles en escalier
============================================================ */
.ensemble {
  flex: 4 4 0;
  min-height: 0;
  position: relative;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: 10px 12px 10px 10px;
}

/* img/Cle.png — absolu en haut à droite */
.cle-img {
  position: absolute;
  top: 0;
  right: 0;
  width: 62%;
  height: auto;
  max-height: 56%;
  object-fit: contain;
  object-position: top right;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* ── Sous-ensemble : texte violet + carré indicateur ── */
.sous-ensemble {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  align-self: flex-start;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.10s;
}
.sous-ensemble:active { opacity: 0.80; }

/* Décalage en escalier (gauche → droite) */
#GR_Rep1 { margin-left: 0; }
#GR_Rep2 { margin-left: 36px; }
#GR_Rep3 { margin-left: 90px; }

/* Zone texte combinaison (fond #4D0378) */
.comb-texte {
  background: #4D0378;
  padding: 8px 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.comb-texte p {
  color: #ffffff;
  font-size: clamp(0.73rem, 3.1vw, 0.98rem);
  font-weight: 500;
  line-height: 1.52;
}

/* Carré indicateur de sélection */
.comb-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: #ffffff;
  border: 2px solid #4D0378;
  border-radius: 2px;
  transition: background 0.15s ease;
}

/* État sélectionné → vert */
.comb-btn.selectionne {
  background: #00bb00;
}

/* ============================================================
   BARRE BAS — fond #4D0378 : retour | lézard | coffre+score
============================================================ */
.bas-zone {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 8px;
  background: #4D0378;
}

.retour-img {
  height: clamp(36px, 8vh, 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, 10vh, 90px);
  width: auto;
  display: block;
  cursor: pointer;
  filter: drop-shadow(1px 2px 5px rgba(0, 0, 0, 0.40));
  -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: 6px;
}

.coffre-img {
  height: clamp(28px, 6vh, 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: 3px 6px;
  border-radius: 5px;
  text-align: center;
  line-height: 1.2;
  border: 2px solid #cc0000;
}

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

/* ============================================================
   POPUPS BRAVO / FAUX
============================================================ */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.panel-box {
  border-radius: 10px;
  padding: 16px 14px;
  width: 90%;
  max-width: 380px;
}

.panel-bravo { background: #ffffff; }
.panel-faux  { background: #fff8f8; }

.panel-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.panel-icon {
  flex: 0 0 auto;
  height: 50px;
  width: auto;
  display: block;
  -webkit-user-drag: none;
}

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

.panel-main-text {
  color: #333333;
  font-size: clamp(0.78rem, 3.2vw, 1.02rem);
  font-weight: 600;
  line-height: 1.40;
}

.panel-faux-text { color: #c0392b; }

.panel-points-text {
  color: #4D0378;
  font-size: clamp(0.68rem, 2.8vw, 0.88rem);
  font-weight: 600;
  margin-top: 5px;
}

.panel-faux-points { color: #777777; }

.panel-fleche-img,
.panel-fermer-img {
  flex: 0 0 auto;
  height: 44px;
  width: auto;
  display: block;
  cursor: pointer;
  -webkit-user-drag: none;
  transition: transform 0.12s ease;
}
.panel-fleche-img:active,
.panel-fermer-img:active { transform: scale(0.90); }

/* ============================================================
   RESPONSIVE — PORTRAIT ÉTROIT (≤ 360px)
============================================================ */
@media (max-width: 360px) {
  .texte-principal  { font-size: 0.80rem; }
  .texte-haut       { padding: 10px 14px; }
  .texte-bas        { padding: 8px 14px; }
  .comb-texte p     { font-size: 0.8rem; }
  .comb-texte       { padding: 6px 8px; }
  .comb-btn         { width: 24px; height: 24px; }
  #GR_Rep2          { margin-left: 24px; }
  #GR_Rep3          { margin-left: 60px; }
  .coffre-img       { height: 22px; }
  .points-box       { font-size: 0.68rem; min-width: 26px; }
  .retour-img       { height: 28px; }
  .lezard-img       { height: 36px; }
  .panel-icon       { height: 38px; }
  .panel-fleche-img,
  .panel-fermer-img { height: 34px; }
  .panel-main-text  { font-size: 0.8rem; }
}

/* ============================================================
   RESPONSIVE — SMARTPHONES (375-430px, >= 700px)
============================================================ */
@media (min-width: 375px) and (max-width: 430px) and (min-height: 700px) {
  .texte-principal  { font-size: clamp(0.86rem, 3.5vw, 1.12rem); }
  .retour-img       { height: clamp(38px, 8vh, 56px); }
}

/* ============================================================
   RESPONSIVE — TABLETTE (>= 600px)
============================================================ */
@media (min-width: 600px) {
  .texte-principal  { font-size: clamp(1.00rem, 3vw, 1.70rem); }
  .texte-haut       { padding: 20px 32px; }
  .texte-bas        { padding: 14px 32px; }
  .comb-texte p     { font-size: clamp(0.88rem, 2.6vw, 1.20rem); }
  .comb-texte       { padding: 10px 16px; }
  .comb-btn         { width: 40px; height: 40px; }
  #GR_Rep2          { margin-left: 50px; }
  #GR_Rep3          { margin-left: 120px; }
  .coffre-img       { height: clamp(34px, 6vh, 54px); }
  .retour-img       { height: clamp(44px, 8vh, 70px); }
  .lezard-img       { height: clamp(54px, 10vh, 80px); }
  .panel-icon       { height: 60px; }
  .panel-fleche-img,
  .panel-fermer-img { height: 54px; }
  .panel-main-text  { font-size: clamp(0.90rem, 2.8vw, 1.20rem); }
  .cle-image        { 
                      width: 95%;
                      height: auto;
                      max-height: 95%; }
}

/* ============================================================
   RESPONSIVE — iPad 6 seul (768-1023px, 900-1199px)
============================================================ */
@media (min-width: 768px) and (max-width: 1023px) and (min-height: 900px) and (max-height: 1199px) {
  .texte-principal  { font-size: clamp(1.0rem, 2.5vw, 1.45rem); }
  .comb-texte p     { font-size: clamp(0.95rem, 2.4vw, 1.35rem); }
  .cle-img          { width: 95%; height: auto; max-height: 95%; }
}

/* ============================================================
   RESPONSIVE — Galaxy Tab A8 + iPad Pro (>= 768px, >= 1200px)
============================================================ */
@media (min-width: 768px) and (min-height: 1199px) {
  .texte-principal  { font-size: clamp(1.05rem, 3vw, 1.75rem); }
  .cle-img          { width: 95%; height: auto; max-height: 95%; }
}

/* ============================================================
   RESPONSIVE — PAYSAGE MOBILE (hauteur ≤ 430px)
============================================================ */
@media (max-height: 430px) and (orientation: landscape) {
  .texte-principal  { font-size: 0.56rem; line-height: 1.3; }
  .texte-haut       { padding: 5px 10px; }
  .texte-bas        { padding: 5px 10px; }
  .comb-texte p     { font-size: 0.58rem; line-height: 1.3; }
  .comb-texte       { padding: 4px 6px; }
  .comb-btn         { width: 20px; height: 20px; }
  .ensemble         { gap: 4px; padding: 6px 8px; }
  #GR_Rep2          { margin-left: 20px; }
  #GR_Rep3          { margin-left: 55px; }
  .bas-zone         { padding: 2px 10px 3px; }
  .coffre-img       { height: 18px; }
  .points-box       { font-size: 0.58rem; min-width: 20px; padding: 1px 3px; }
  .retour-img       { height: 22px; }
  .lezard-img       { height: 28px; }
  .panel-icon       { height: 30px; }
  .panel-fleche-img,
  .panel-fermer-img { height: 28px; }
  .panel-main-text  { font-size: 0.62rem; }
}
