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

/* ============================================================
   OVERLAY ROBERT GRAND -- plein ecran, init (600 ms)
   z-index 60 -> au-dessus de tout (y compris transition-overlay 100)
   Le display:none est gere par JS apres la transition
============================================================ */
.robert-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;  /* ne bloque pas les events pendant la disparition */
  transition: opacity 0.35s ease;
}

.robert-grand-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

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

/* ============================================================
   ZONE CONTENU -- flex column, titre fixe en haut
   Le centrage vertical est delegue a .middle-content
============================================================ */
.content-zone {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(10px, 2.5dvh, 22px) clamp(14px, 5%, 30px) clamp(6px, 1.2dvh, 14px);
  animation: fadeIn 0.5s ease 0.1s both;
}

/* ============================================================
   CONTENU CENTRAL -- prend tout l'espace sous CONSORTAGE
   et centre verticalement paragraphes + Robert P
   overflow-y:auto -> scroll si contenu depasse sur petit ecran
============================================================ */
.middle-content {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Titre intro */
.titre-intro {
  text-align: center;
  font-size: clamp(0.76rem, 3.2vw, 1.1rem);
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: clamp(2px, 0.4dvh, 5px);
}

/* CONSORTAGE en vert */
.titre-mot {
  text-align: center;
  font-size: clamp(1rem, 5.5vw, 1.8rem);
  font-weight: 900;
  color: #22aa44;
  margin-bottom: clamp(8px, 3dvh, 40px);
}

/* Paragraphe definition (centre) */
.para-def {
  text-align: center;
  font-size: clamp(0.68rem, 3.5vw, 2rem);
  color: #222;
  line-height: 1.55;
  margin-bottom: clamp(8px, 3dvh, 40px);
}

/* Paragraphe vignoble (gras, centre) */
.para-vignoble {
  text-align: center;
  font-size: clamp(0.68rem, 3.5vw, 2rem);
  font-weight: 700;
  color: #111;
  line-height: 1.5;
  margin-bottom: clamp(8px, 3dvh, 40px);
}

/* ============================================================
   BLOC ROBERT P : texte (gauche) + image (droite)
============================================================ */
.robert-block {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: clamp(6px, 2%, 14px);
}

.robert-texte {
  flex: 1;
  font-size: clamp(0.68rem, 3.5vw, 2rem);
  color: #222;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 1dvh, 10px);
}

/* Mots en rouge (MyRules MyWater, MyRMyW) */
.red { color: #cc0000; }

/* Robert P -- image cliquable */
.robert-p-img {
  flex-shrink: 0;
  width: clamp(68px, 26%, 135px);
  height: auto;
  display: block;
  pointer-events: none; /* transparent au toggle fullscreen */
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

/* ============================================================
   BARRE BAS : coffre+score (gauche) | fleche suivant (droite)
============================================================ */
.bas-zone {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: clamp(4px, 0.8dvh, 10px) clamp(10px, 3%, 20px) clamp(6px, 1.2dvh, 12px);
  border-top: 1px solid #e8e8e8;
  animation: fadeIn 0.5s ease 0.15s both;
}

/* Coffre + points */
.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;
}

.points-box {
  background: #cc0000;
  color: #fff;
  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;
}

/* Fleche suivant (BTN_Suivant) */
.suivant-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}

.suivant-img {
  height: clamp(32px, 7dvh, 52px);
  width: auto;
  display: block;
  filter: drop-shadow(1px 1px 4px rgba(0, 0, 0, 0.30));
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  transition: transform 0.12s ease;
}
.suivant-btn:active .suivant-img { transform: scale(0.90); }

/* ============================================================
   OVERLAY DE TRANSITION
============================================================ */
.transition-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  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) {
  .titre-mot      { font-size: 1rem; }
  .titre-intro      { font-size: 0.8rem; }
  .para-def       { font-size: 0.8rem; }
  .para-vignoble  { font-size: 0.8rem; }
  .robert-texte   { font-size: 0.8rem; }
  .robert-p-img   { width: 56px; }
  .coffre-img     { height: 22px; }
  .points-box     { font-size: 0.68rem; min-width: 26px; }
  .suivant-img    { height: 26px; }
}

/* ============================================================
   RESPONSIVE -- TABLETTE (>= 600px)
============================================================ */
@media (min-width: 600px) {
  .titre-intro    { font-size: clamp(0.90rem, 3vw, 1.3rem); }
  .titre-mot      { font-size: clamp(1.2rem, 5vw, 2rem); }
  .para-def       { font-size: clamp(0.68rem, 3.5vw, 2rem); }
  .para-vignoble  { font-size: clamp(0.68rem, 3.5vw, 2rem); }
  .robert-texte   { font-size: clamp(0.68rem, 3.5vw, 2rem); }
  .robert-p-img   { width: clamp(90px, 24%, 180px); }
  .coffre-img     { height: clamp(34px, 6dvh, 54px); }
  .points-box     { font-size: clamp(0.9rem, 2.2vw, 1.15rem); }
  .suivant-img    { height: clamp(38px, 7dvh, 58px); }
}

/* ============================================================
   RESPONSIVE -- TABLETTE PORTRAIT CONTRAINTE (>= 600px, <= 1099px h)
============================================================ */
@media (min-width: 600px) and (max-height: 1099px) {
  .content-zone   { padding: clamp(8px, 1.8dvh, 16px) clamp(14px, 5%, 30px) clamp(4px, 0.9dvh, 10px); }
  .bas-zone       { padding: clamp(3px, 0.6dvh, 7px) clamp(10px, 3%, 20px) clamp(4px, 0.8dvh, 8px); }
}

/* ============================================================
   RESPONSIVE -- PAYSAGE MOBILE (hauteur <= 450px)
============================================================ */
@media (max-height: 450px) and (orientation: landscape) {
  .content-zone   { padding: 3px 10px 3px; }
  .titre-intro    { font-size: 0.48rem; margin-bottom: 1px; }
  .titre-mot      { font-size: 0.70rem; margin-bottom: 3px; }
  .para-def       { font-size: 0.44rem; line-height: 1.3; margin-bottom: 3px; }
  .para-vignoble  { font-size: 0.46rem; margin-bottom: 3px; }
  .robert-texte   { font-size: 0.42rem; line-height: 1.3; }
  .robert-p-img   { width: 46px; }
  .bas-zone       { padding: 2px 10px 3px; }
  .coffre-img     { height: 20px; }
  .points-box     { font-size: 0.62rem; min-width: 24px; }
  .suivant-img    { height: 22px; }
}
