/* ============================================================
   Pa_Capona_Couleur_vins.css
   FEN_Pa_Capona_Couleur_vins
   ─────────────────────────────────────────────────────────
   Layout flex-colonne (100dvh) :
     • .zone-haut    → fond #2F98BB, texte blanc centré
     • .images-zone  → flex:1, 9 verres en position absolue
     • .zone-bas     → fond blanc, question noire en gras
     • .bas-zone     → retour | lézard | coffre+score
============================================================ */

/* ============================================================
   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 PRINCIPAL
============================================================ */
.screen {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ============================================================
   ZONE TEXTE HAUT -- fond #2F98BB, texte blanc, centré
============================================================ */
.zone-haut {
  flex: 0 0 auto;
  background: #2F98BB;
  border-radius: 0 0 clamp(6px, 1.5vw, 12px) clamp(6px, 1.5vw, 12px);
  padding: clamp(8px, 1.5dvh, 18px) clamp(12px, 4%, 24px);
  z-index: 2;
}

.zone-p {
  font-size: clamp(0.68rem, 3.6vw, 1.25rem);
  color: #ffffff;
  line-height: 1.55;
  text-align: center;
}

/* ============================================================
   ZONE IMAGES -- conteneur flexible, verres en absolu
============================================================ */
.images-zone {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* ================================================================
   ★  POSITIONS DES VERRES  ──  RÉGLAGE FACILE ICI  ★
   ─────────────────────────────────────────────────────────────
   Chaque verre est positionné indépendamment.
   Modifiez uniquement --ix et --iy pour le déplacer :
     --ix : position horizontale (left)   0% = gauche · 100% = droite
     --iy : position verticale   (top)    0% = haut   · 100% = bas
   ─────────────────────────────────────────────────────────────
   Disposition cible (fidèle au PDF) :
     Ligne 1  : Rouge · Jaune · [vide] · Gris
     Ligne 1½ :              Orange (décalé droite)
     Ligne 2  : Blanc · Vert  · [vide] · Rosé
     Ligne 3  :        Bleu  ·  Noir
================================================================ */
#item-rouge  { --ix: 5%;  --iy: 2%;  }
#item-jaune  { --ix: 40%; --iy: 2%;  }
#item-gris   { --ix: 80%; --iy: 2%;  }
#item-orange { --ix: 60%; --iy: 25%; }
#item-blanc  { --ix: 2%;  --iy: 45%; }
#item-vert   { --ix: 31%; --iy: 41%; }
#item-rose   { --ix: 80%; --iy: 41%; }
#item-bleu   { --ix: 19%; --iy: 68%; }
#item-noir   { --ix: 60%; --iy: 68%; }

/* ---- Chaque item : verre + libellé + case à cocher ---- */
.vin-item {
  position: absolute;
  left: var(--ix);
  top:  var(--iy);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
}

.vin-item:active .vin-img {
  opacity: 0.72;
}

/* ---- Image du verre ---- */
.vin-img {
  height: clamp(48px, 12dvh, 88px);
  width: auto;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  transition: opacity 0.12s ease;
}

/* ---- Libellé couleur ---- */
.vin-label {
  font-size: clamp(0.70rem, 3.4vw, 1rem);
  font-weight: 700;
  color: #1a1a1a;
  margin-top: clamp(2px, 0.4dvh, 5px);
  text-align: center;
  pointer-events: none;
  line-height: 1.2;
}

/* ---- Case à cocher (custom) ---- */
/* Non coché : gris clair       Coché : bleu #1565c0 avec ✓ blanc */
.vin-check {
  width:  clamp(22px, 5.5vw, 30px);
  height: clamp(22px, 5.5vw, 30px);
  border-radius: clamp(3px, 1vw, 6px);
  border: 2px solid #9e9e9e;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: clamp(3px, 0.6dvh, 6px);
  font-size: clamp(14px, 3.8vw, 22px);
  font-weight: 900;
  line-height: 1;
  color: transparent;           /* ✓ invisible par défaut */
  pointer-events: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* État coché : fond bleu + coche blanche */
.vin-item.checked .vin-check {
  background:   #1565c0;
  border-color: #1565c0;
  color: #ffffff;
}

/* ============================================================
   ZONE TEXTE BAS -- fond blanc, question en gras, centrée
============================================================ */
.zone-bas {
  flex: 0 0 auto;
  background: #ffffff;
  padding: clamp(6px, 1.2dvh, 14px) clamp(12px, 4%, 24px);
  z-index: 2;
}

.zone-bas-p {
  font-size: clamp(0.76rem, 3.7vw, 1.1rem);
  color: #000000;
  text-align: center;
  line-height: 1.45;
}

/* ============================================================
   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);
  background: #ffffff;
  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;
  border: 2px solid #cc0000;
}

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

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

/* Icône rire (panel erreur uniquement) */
.panel-icon {
  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;
}

/* Titre erreur : couleur orange-marron pour le rire */
.panel-title-rire {
  color: #cc6600;
}

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

.panel-pts {
  font-size: clamp(0.80rem, 3.5vw, 1.15rem);
  color: #22aa44;
  font-weight: 700;
  min-height: 1.2em; /* évite que le panel saute si vide */
}

.panel-pts-rire {
  color: #cc6600;
}

.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) {
  .zone-p     { font-size: 0.8rem; }
  .zone-bas-p { font-size: 0.8rem; }
  .vin-img    { height: 40px; }
  .vin-label  { font-size: 0.80rem; }
  .vin-check  { width: 18px; height: 18px; font-size: 11px; }
  .coffre-img { height: 22px; }
  .points-box { font-size: 0.68rem; min-width: 26px; }
  .lezard-img { height: 38px; }
  .retour-img { height: 28px; }
}

/* ============================================================
   RESPONSIVE -- TABLETTE (>= 600px)
============================================================ */
@media (min-width: 600px) {
  .zone-p     { font-size: clamp(0.70rem, 3.6vw, 1.35rem); }
  .zone-bas-p { font-size: clamp(0.82rem, 2.8vw, 1.2rem); }
  .vin-img    { height: clamp(60px, 12dvh, 100px); }
  .vin-label  { font-size: clamp(0.80rem, 2.5vw, 1.1rem); }
  .vin-check  { width: clamp(26px, 4.5vw, 36px); height: clamp(26px, 4.5vw, 36px); }
  .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); }
}

/* ============================================================
   RESPONSIVE -- PAYSAGE MOBILE (hauteur <= 450px)
============================================================ */
@media (max-height: 450px) and (orientation: landscape) {
  .zone-haut  { padding: 3px 10px; }
  .zone-p     { font-size: 0.42rem; line-height: 1.3; }
  .zone-bas   { padding: 2px 10px; }
  .zone-bas-p { font-size: 0.48rem; }
  .vin-img    { height: 30px; }
  .vin-label  { font-size: 0.44rem; margin-top: 1px; }
  .vin-check  { width: 14px; height: 14px; font-size: 9px; margin-top: 1px; }
  .bas-zone   { padding: 2px 10px 3px; }
  .coffre-img { height: 20px; }
  .points-box { font-size: 0.62rem; min-width: 24px; }
  .lezard-img { height: 28px; }
  .retour-img { height: 22px; }
}
