/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: #1a1a2e;
}

/* ============================================================
   ÉCRAN PRINCIPAL
============================================================ */
.screen {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

/* ============================================================
   IMAGE DE FOND — pleine page
============================================================ */
.bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
}

/* ============================================================
   GROUPE : bulle + flèche + Prune (toujours solidaires)
   ─────────────────────────────────────────────────────
   Le conteneur occupe toute la zone utile (hors bouton).
   Flex-row : speech-area à gauche, Prune à droite,
   alignés par le bas (pieds de Prune = bas du groupe).
============================================================ */
.character-group {
  position: absolute;
  left: 0;
  right: 0;
  top: clamp(10px, 3dvh, 30px);
  bottom: clamp(100px, 17dvh, 170px);  /* laisse la place au bouton */
  z-index: 2;
  display: flex;
  align-items: flex-end;              /* aligne tout par le bas */
  padding: 0 clamp(8px, 10vw, 24px);
  padding-top: clamp(8px, 15vw, 84px);
  padding-left: clamp(8px, 15vw, 84px);
  gap: 0;
}

/* ============================================================
   ZONE BULLE DE DIALOGUE + FLÈCHE  (côté gauche du groupe)
============================================================ */
.speech-area {
  flex: 1 1 auto;
  min-width: 0;
  max-width: clamp(200px, 98vw, 540px);
  align-self: flex-start;             /* bulle ancrée en haut */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: clamp(6px, 4dvh, 24px);
  animation: fadeIn 0.6s ease 0.2s both;
}

/* Bulle : passe devant la flèche */
.speech-bubble {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255);
  border-radius: clamp(12px, 2vw, 20px);
  padding: clamp(10px, 2vw, 22px) clamp(12px, 2.5vw, 26px);
}

.speech-bubble p {
  font-size: clamp(0.82rem, 3vw, 2rem);  /* grossit avec l'écran */
  font-weight: 700;
  color: #1a3266;
  text-align: center;
  line-height: 1.5;
}

/* Flèche — passe derrière la bulle, pointe vers Prune */
.arrow-img {
  position: relative;
  z-index: 1;
  margin-top: clamp(-40px, -5vw, -12px);    /* overlap proportionnel à la largeur de l'écran */
  margin-left: clamp(16px, 25vw, 280px);       /* décale vers Prune */
  height: clamp(60px, 12dvh, 150px);           /* grandit avec l'écran */
  width: auto;
  display: block;
  filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.2));
}

/* ============================================================
   PERSONNAGE PRUNE  (côté droit du groupe, cliquable)
============================================================ */
.prune-img {
  flex: 0 0 auto;
  align-self: flex-end;                        /* pieds collés au bas */
  height: clamp(150px, 52dvh, 680px);          /* grossit avec l'écran */
  width: auto;
  cursor: pointer;
  animation: fadeIn 0.7s ease 0.4s both;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.prune-img:active {
  transform: scale(0.97);
}

/* ============================================================
   BOUTON INSCRIPTION  (bas gauche, indépendant)
============================================================ */
.btn-inscription {
  position: absolute;
  bottom: clamp(14px, 3dvh, 44px);
  left: clamp(12px, 4vw, 36px);
  z-index: 3;
  background: rgba(255, 255, 255);
  border: none;
  border-radius: clamp(10px, 1.5vw, 16px);
  padding: clamp(10px, 2dvh, 18px) clamp(14px, 3vw, 28px);
  font-size: clamp(0.82rem, 3vw, 2rem);   /* grossit avec l'écran */
  font-weight: 700;
  color: #1a3266;
  text-align: center;
  cursor: pointer;
  max-width: clamp(160px, 42vw, 420px);
  line-height: 1.5;
  transition: background 0.2s, transform 0.15s;
  animation: slideUp 0.65s cubic-bezier(.22,.68,0,1.2) 0.5s both;
}
.btn-inscription:hover,
.btn-inscription:focus {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.03);
  outline: none;
}
.btn-inscription:active {
  transform: scale(0.97);
}

/* ============================================================
   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; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE — PORTRAIT ÉTROIT (≤ 360px)
============================================================ */
@media (max-width: 360px) {
  .speech-bubble p { font-size: 0.72rem; }
  .btn-inscription { font-size: 0.68rem; }
  .arrow-img       { height: 40px; }
}

/* ============================================================
   RESPONSIVE — PAYSAGE MOBILE (hauteur ≤ 450px)
============================================================ */
@media (max-height: 450px) and (orientation: landscape) {
  .character-group  { top: 4px; bottom: 60px; }
  .speech-bubble p  { font-size: 0.65rem; }
  .arrow-img        { height: 26px; }
  .btn-inscription  { bottom: 4px; font-size: 0.65rem; }
}
