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

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

/* ============================================================
   ZONES IMAGES -- chaque zone prend la moitie de l'espace libre
   Les deux images sont cliquables (role button)
============================================================ */
.img-zone {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1.6dvh, 16px) clamp(12px, 4%, 24px) clamp(4px, 0.8dvh, 10px);
}

.img-zone1 {
  padding-top: clamp(10px, 2dvh, 20px);
  animation: fadeIn 0.5s ease 0.05s both;
}

.img-zone2 {
  animation: fadeIn 0.5s ease 0.12s both;
}

.carte-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: pointer;
  border-radius: clamp(4px, 1.5vw, 10px);
  filter: drop-shadow(2px 3px 8px rgba(0, 0, 0, 0.40));
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.carte-img:active {
  transform: scale(0.96);
  filter: drop-shadow(2px 3px 8px rgba(0, 0, 0, 0.55)) brightness(0.92);
}

/* ============================================================
   TEXTE INSTRUCTION
============================================================ */
.hint-text {
  flex: 0 0 auto;
  font-size: clamp(0.72rem, 3.2vw, 1.15rem);
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  padding: clamp(4px, 0.8dvh, 10px) clamp(16px, 6%, 36px);
  animation: fadeIn 0.5s ease 0.18s both;
}

/* ============================================================
   BARRE BAS -- fleche retour gauche (BTN_Suivant)
============================================================ */
.bas-zone {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(4px, 0.8dvh, 10px) clamp(10px, 3%, 20px) clamp(8px, 1.6dvh, 16px);
  animation: fadeIn 0.5s ease 0.22s both;
}

.retour-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}

.retour-img {
  height: clamp(36px, 8dvh, 60px);
  width: auto;
  display: block;
  filter: drop-shadow(1px 2px 5px rgba(0, 0, 0, 0.45));
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  transition: transform 0.12s ease;
}
.retour-btn:active .retour-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) {
  .hint-text  { font-size: 0.60rem; }
  .retour-img { height: 28px; }
}

/* ============================================================
   RESPONSIVE -- TABLETTE (>= 600px)
============================================================ */
@media (min-width: 600px) {
  .hint-text  { font-size: clamp(0.90rem, 2.8vw, 1.4rem); }
  .retour-img { height: clamp(44px, 8dvh, 70px); }
}

/* ============================================================
   RESPONSIVE -- TABLETTE PORTRAIT CONTRAINTE (>= 600px, <= 1099px h)
============================================================ */
@media (min-width: 600px) and (max-height: 1099px) {
  .img-zone   { padding: clamp(6px, 1.2dvh, 12px) clamp(12px, 4%, 24px) clamp(3px, 0.6dvh, 8px); }
  .bas-zone   { padding: clamp(3px, 0.6dvh, 7px) clamp(10px, 3%, 20px) clamp(5px, 1dvh, 10px); }
}

/* ============================================================
   RESPONSIVE -- PAYSAGE MOBILE (hauteur <= 450px)
============================================================ */
@media (max-height: 450px) and (orientation: landscape) {
  .img-zone   { padding: 2px 8px; }
  .hint-text  { font-size: 0.48rem; padding: 2px 10px; }
  .bas-zone   { padding: 2px 8px 3px; }
  .retour-img { height: 24px; }
}
