/* ============================================================
   Pa_Capona_Culture.css
   FEN_Pa_Capona_Culture
   ─────────────────────────────────────────────────────────
   Fond   : img/Fond Culture_150dpi.jpg via ::before
   Layout flex-colonne (100dvh) :
     • .content-scroll  → flex:1, scrollable
         └ .zone-intro    → fond #969D37, texte blanc centré
         └ .zone-consigne → fond #969D37, consigne centrée
         └ .categories-bar→ fond #E05E4F, 3 colonnes égales
         └ .lignes-zone   → 6 lignes label + dropdown
     • .bas-zone        → retour | lézard | coffre+score
   Panels :
     • #GR_Groupe_Bravo    → bordure #969D37, scrollable
     • #GR_Groupe_Erreur   → bordure #E05E4F, scrollable
============================================================ */

/* ============================================================
   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: #7a8630;   /* fallback couleur proche de la photo */
}

/* ============================================================
   ECRAN PRINCIPAL
   ::before → img/Fond Culture_150dpi.jpg (couverture totale)
   isolation → confine le z-index:-1 du ::before
============================================================ */
.screen {
  position: relative;
  isolation: isolate;
  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;
  -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 Culture_150dpi.jpg');
  background-size: cover;
  background-position: center center;
  z-index: -1;
  pointer-events: none;
}

/* ============================================================
   ZONE DÉFILABLE
   flex:1 — prend toute la hauteur disponible entre haut et bas-zone
============================================================ */
.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(255,255,255,0.35); border-radius: 4px; }

/* ============================================================
   BLOC INTRO — fond #969D37, texte blanc centré
   Deux blocs séparés par un léger espace laissant voir la photo
============================================================ */
.zone-intro {
  background: #969D37;
  color: #ffffff;
  text-align: center;
  padding: clamp(10px, 1.8dvh, 18px) clamp(12px, 4%, 22px);
  /*margin: clamp(7px, 1.3dvh, 13px) 0 clamp(6px, 1.1dvh, 11px);*/
  margin-left: 3%;
  margin-right: 3%;
  margin-top: 3%;
}

.zone-consigne {
  background: #969D37;
  color: #ffffff;
  text-align: center;
  padding: clamp(8px, 1.4dvh, 14px) clamp(12px, 4%, 22px);
  margin-bottom: clamp(6px, 1.1dvh, 20px);
  margin-left: 3%;
  margin-right: 3%
}

.zone-intro p,
.zone-consigne p {
  font-size: clamp(0.72rem, 3.2vw, 1.05rem);
  line-height: 1.55;
  margin-bottom: clamp(5px, 0.9dvh, 20px);
}

.zone-intro p:last-child,
.zone-consigne p:last-child { margin-bottom: 0; }

/* "MyRules MyWater" en rouge clair (#E05E4F) */
.myrules {
  color: #E05E4F;
  font-weight: 700;
}

/* ============================================================
   BARRE CATÉGORIES — fond #E05E4F, 3 colonnes égales
   Texte blanc, gras, centré
============================================================ */
.categories-bar {
  display: flex;
  flex-direction: row;
}

.cat-item {
  flex: 1;
  background: #E05E4F;
  color: #ffffff;
  font-weight: 700;
  font-size: clamp(0.68rem, 3vw, 1rem);
  text-align: center;
  padding: clamp(6px, 1.2dvh, 12px) clamp(3px, 1%, 6px);
  line-height: 1.3;
  border-left: 1.5px solid rgba(255, 255, 255, 0.30);
  margin-left: 3%;
  margin-right: 3%;
  margin-top: 3%;
  margin-bottom: 3%;
}

.cat-item:first-child { border-left: none; }

/* ============================================================
   LIGNES DROPDOWN — 6 lignes label | select
   Label  : fond #E05E4F, texte noir gras (~46% largeur)
   Select : fond blanc, select natif + coche éventuelle (~54%)
============================================================ */
.lignes-zone {
  /* transparent — laisse voir la photo de fond entre les lignes */
  margin-top: 12px;      /* ★ espace sous la barre catégories */
}

.ligne-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 36px;     /* ★ hauteur réduite */
  margin-bottom: 10px;   /* ★ espace entre les lignes */
}

.ligne-row:last-child {
  margin-bottom: 0;
}

/* Label (#E05E4F) */
.ligne-label {
  flex: 0 0 46%;
  background: #E05E4F;
  color: #1a1a1a;
  font-weight: 700;
  font-size: clamp(0.68rem, 3vw, 1rem);
  display: flex;
  align-items: center;
  padding: clamp(5px, 1dvh, 10px) clamp(6px, 2%, 12px);
  line-height: 1.3;
  border-right: 2px solid rgba(255, 255, 255, 0.30);
  margin-left: 3%;
}

/* Wrapper blanc : coche + select */
.ligne-select-wrap {
  flex: 1;
  min-width: 0;
  background: #ffffff;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: clamp(4px, 0.8dvh, 8px) clamp(6px, 2%, 12px);
  gap: clamp(4px, 1.2vw, 8px);
  margin-right: 3%;
}

/* Coche (valider@dpi1x1.png) — masquée par défaut */
.coche-img {
  flex-shrink: 0;
  height: clamp(24px, 5dvh, 38px);
  width: auto;
  display: block;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Select natif — garde l'aspect OS pour le picker mobile */
.ligne-select {
  flex: 1;
  min-width: 0;
  border: none;
  border-bottom: 1.5px solid #E05E4F;
  background: transparent;
  color: #1a1a1a;
  /* 16px minimum → évite le zoom iOS Safari */
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  padding: clamp(2px, 0.4dvh, 5px) 2px;
  cursor: pointer;
}

/* "?" affiché en orange quand aucun choix */
.ligne-select.empty {
  color: #E05E4F;
  font-weight: 700;
}

/* Désactivé après réponse juste */
.ligne-select:disabled {
  color: #777777;
  border-bottom-color: transparent;
  cursor: default;
  opacity: 0.80;
}

/* ============================================================
   ESPACE BAS — empêche la dernière ligne d'être masquée
   par la barre basse quand le joueur a défilé jusqu'en bas
============================================================ */
.scroll-spacer {
  height: clamp(68px, 13dvh, 100px);
}

/* ============================================================
   TOAST — message centré sur fond sombre
   Utilisé par ToastAffiche("Désolé, rien/tout n'est pas juste…")
============================================================ */
.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(0, 0, 0, 0.28);   /* léger voile sombre sur la photo */
}

.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;
  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;
  border: 2px solid #cc0000;
}

/* ============================================================
   PANELS — overlay + boîte scrollable
   Bravo  : bordure #969D37 (olive vert)
   Erreur : bordure #E05E4F (rouge-orangé)
============================================================ */
.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.40);
}

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

.panel-bravo  { border: 3px solid #969D37; }
.panel-erreur { border: 3px solid #E05E4F; }

/* ── En-tête : 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;
}

/* Bravo : titre + sous-titre */
.panel-title {
  font-size: clamp(1.1rem, 5vw, 1.8rem);
  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);
}

/* Erreur : titre + liste réponses */
.panel-erreur-titre {
  font-size: clamp(0.76rem, 3.4vw, 1.05rem);
  font-weight: 700;
  color: #222222;
  line-height: 1.45;
  margin-bottom: clamp(4px, 0.8dvh, 8px);
}

.panel-reponse {
  font-size: clamp(0.70rem, 3.1vw, 1rem);
  color: #222222;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: clamp(2px, 0.5dvh, 5px);
}

/* Catégories en rouge dans la liste erreur */
.cat-rouge {
  color: #E05E4F;
  font-weight: 700;
}

/* ── Texte corps (phéromones) ── */
.panel-body-text {
  font-size: clamp(0.76rem, 3.4vw, 1.1rem);
  color: #222222;
  line-height: 1.55;
}

/* ── Photo diffuseur ── */
.diffuseur-img {
  width: clamp(160px, 68%, 320px);
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: clamp(4px, 1.5vw, 10px);
  -webkit-user-drag: none;
}

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

.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-touch-callout: none;
  -webkit-user-drag: none;
  transition: transform 0.12s ease;
}
.panel-fleche-img:active { transform: scale(0.90); }

/* ✕ rouge (erreur) */
.panel-close-img {
  flex-shrink: 0;
  height: clamp(28px, 6dvh, 44px);
  width: auto;
  display: block;
  cursor: pointer;
  -webkit-touch-callout: none;
  -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) {
  .zone-intro p,
  .zone-consigne p    { font-size: 0.70rem; }
  .cat-item           { font-size: 0.7rem; padding: 4px 2px; }
  .ligne-label        { font-size: 0.7rem; flex-basis: 44%; }
  .ligne-select       { font-size: 0.7rem; }
  .coche-img          { height: 20px; }
  .coffre-img         { height: 22px; }
  .points-box         { font-size: 0.68rem; min-width: 26px; }
  .lezard-img         { height: 38px; }
  .retour-img         { height: 28px; }
  .diffuseur-img      {width: clamp(140px, 58%, 300px);}
}

/* ============================================================
   RESPONSIVE — SMARTPHONES (375-430px, >= 700px hauteur)
   iPhone 12 Pro (390×844), iPhone 16 Pro (402×874), S24 Ultra (412×915)
============================================================ */
/* iPhone portrait — sans condition de hauteur (fix iOS 18 / iPhone 16 Pro) */
@media (min-width: 375px) and (max-width: 430px) {
  .zone-intro p,
  .zone-consigne p    { font-size: clamp(0.74rem, 3.3vw, 1.08rem); }
  .cat-item           { font-size: clamp(0.70rem, 3.1vw, 1.02rem); }
  .ligne-label        { font-size: clamp(0.70rem, 3.1vw, 1.02rem); }
  .coffre-img         { height: clamp(30px, 5.5dvh, 44px); }
  .lezard-img         { height: clamp(48px, 9dvh, 72px); }
}

/* ============================================================
   RESPONSIVE — TABLETTE générique (>= 600px)
============================================================ */
@media (min-width: 600px) {
  .zone-intro p,
  .zone-consigne p    { font-size: clamp(0.84rem, 2.5vw, 1.5rem); }
  .cat-item           { font-size: clamp(0.82rem, 2.5vw, 1.5rem); }
  .ligne-label        { font-size: clamp(0.82rem, 2.5vw, 1.5rem); flex-basis: 44%; }
  .coche-img          { height: clamp(28px, 5.5dvh, 44px); }
  .coffre-img         { height: clamp(34px, 6dvh, 54px); }
  .lezard-img         { height: clamp(54px, 10dvh, 100px); }
  .retour-img         { height: clamp(44px, 8dvh, 70px); }
  .ligne-row          { min-height: 42px; }
}

/* ============================================================
   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) {
  .zone-intro p,
  .zone-consigne p    { font-size: clamp(0.92rem, 2.5vw, 1.5rem); }
  .cat-item           { font-size: clamp(0.88rem, 2.5vw, 1.5rem); }
  .ligne-label        { font-size: clamp(0.88rem, 2.5vw, 1.5rem); }
}

/* ============================================================
   RESPONSIVE — Galaxy Tab A8 + iPad Pro (>= 768px, >= 1200px hauteur)
============================================================ */
@media (min-width: 768px) and (min-height: 1199px) {
  .zone-intro p,
  .zone-consigne p    { font-size: clamp(1.0rem, 3vw, 2rem); }
  .cat-item           { font-size: clamp(0.96rem, 2.5vw, 1.5rem); }
  .ligne-label        { font-size: clamp(0.96rem, 2.5vw, 1.5rem); }
  .ligne-row          { min-height: 50px; margin-bottom: 20px; }
}

/* ============================================================
   RESPONSIVE — PAYSAGE MOBILE (hauteur ≤ 430px)
============================================================ */
@media (max-height: 430px) and (orientation: landscape) {
  .zone-intro         { padding: 4px 8px; margin: 4px 0 3px; }
  .zone-consigne      { padding: 3px 8px; margin-bottom: 3px; }
  .zone-intro p,
  .zone-consigne p    { font-size: 0.48rem; line-height: 1.3; margin-bottom: 2px; }
  .cat-item           { font-size: 0.50rem; padding: 3px 2px; }
  .ligne-row          { min-height: 22px; }
  .ligne-label        { font-size: 0.50rem; padding: 2px 5px; }
  .ligne-select       { font-size: 14px; }
  .coche-img          { height: 18px; }
  .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; }
}
