/* style.css — DA calquée sur geo-nerd.com (voir docs/superpowers/specs) */

@font-face {
  font-family: "Bangers";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/bangers-v25-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/roboto-v51-latin-variable.woff2") format("woff2");
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/roboto-v51-latin-variable.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/poppins-v24-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("fonts/poppins-v24-latin-900.woff2") format("woff2");
}

:root {
  --bg-start: #362496;
  --bg-end: #0e0a67;
  --primary: #402db3;
  --accent-start: #402db3;
  --accent-end: #a855f7;
  --red: #f05050;
  --green: #1dd710;
  --yellow: #ffe300;
  --ink: #1b134d;
}

* { box-sizing: border-box; }

html { font-size: clamp(14px, 11px + 0.35vw, 20px); }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overscroll-behavior-y: none;
}

/* Fond aussi sur html : évite les bandes blanches quand le bounce/rubber-band
   mobile révèle une zone au-delà du body (barre d'adresse qui show/hide). */
html {
  background: var(--bg-end);
}

body {
  background: #402db3;
  background: radial-gradient(circle, var(--bg-start) 0%, var(--bg-end) 63%);
  background-attachment: fixed;
  font-family: "Roboto", sans-serif;
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-height: 100dvh;
}

.pages {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  text-align: center;
}

.screen { display: none; width: 100%; max-width: 60rem; flex-direction: column; align-items: center; gap: 1rem; }
.screen.active { display: flex; }

.logo {
  font-family: "Bangers", cursive;
  font-size: 3rem;
  letter-spacing: 0.05em;
  margin: 0;
  text-shadow: 0.15rem 0.15rem 0 rgba(0, 0, 0, 0.25);
}

.birthday-message {
  font-size: 1.2rem;
  line-height: 1.5;
}

.btn {
  font-family: "Poppins", sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  color: #fff;
  border: none;
  border-radius: 1000px;
  padding: 0.8rem 2rem;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0.5rem 0.5rem 3rem 1rem rgba(0, 0, 0, 0.19);
  transition: transform 0.2s ease;
  background: var(--primary);
}
.btn:hover { transform: scale(1.05); }
.btn-big { padding: 1rem 2.5rem; font-size: 1.1rem; }
.btn-small { padding: 0.5rem 1.2rem; font-size: 0.75rem; box-shadow: none; }

.game-header { width: 100%; display: flex; justify-content: flex-start; gap: 0.6rem; }

.mode-buttons { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.mode-classic { background: linear-gradient(90deg, var(--accent-start), var(--accent-end)); }
.mode-hard { background: var(--red); }

.progress-bar {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.lives { display: flex; gap: 0.3rem; font-size: 1.4rem; }
.heart { filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.3)); transition: opacity 0.2s ease; }
.heart.is-lost { opacity: 0.25; filter: grayscale(1); }

.department-name {
  font-family: "Poppins", sans-serif;
  font-weight: 900;
  font-size: 2rem;
  margin: 0.2rem 0 0.8rem;
}

.question-hard form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0.5rem 0 1rem;
}
.question-hard input {
  font-family: "Roboto", sans-serif;
  font-size: 1rem;
  padding: 0.6rem 1rem;
  border-radius: 1000px;
  border: none;
  color: var(--ink);
}
.question-hard input#hard-name-input { min-width: 12rem; }
.question-hard input#hard-code-input { width: 6rem; }

.feedback-code {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  color: var(--yellow);
  font-size: 1.1rem;
  margin: 0;
}

.maps-row { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center; align-items: flex-start; width: 100%; }
.maps-row .map-container { flex: 3 1 26rem; }
.map-inset-panel { flex: 1 1 14rem; max-width: 16rem; }
.map-inset-label {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  margin: 0 0 0.4rem;
}

.map-container { width: 100%; max-width: 40rem; touch-action: manipulation; }
.map-container svg { width: 100%; height: auto; display: block; }

.department {
  fill: #fff;
  stroke: var(--primary);
  stroke-width: 1;
  cursor: pointer;
  transition: fill 0.15s ease;
}
.department:hover { fill: #e6e1fb; }
.department.is-found { fill: #bff5b8; }
.department.is-correct { fill: var(--green) !important; }
.department.is-wrong { fill: var(--red) !important; }
.department.is-highlighted { fill: var(--yellow) !important; }

.big-emoji { font-size: 3rem; margin: 0; }
.win-message { font-style: italic; font-size: 1rem; line-height: 1.5; max-width: 32rem; }
.final-score { font-family: "Poppins", sans-serif; font-weight: 900; font-size: 1.3rem; }

.loss-actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

.help-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 10;
}
.help-popup-overlay[hidden] { display: none; }
.help-popup {
  background: #fff;
  color: var(--ink);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 24rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.help-popup h2 { font-family: "Poppins", sans-serif; font-weight: 900; margin-top: 0; }
.dont-show-again { display: block; margin: 1rem 0; font-size: 0.9rem; }

.photo-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 20;
}
.photo-popup-overlay[hidden] { display: none; }
.photo-popup {
  background: #fff;
  color: var(--ink);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 26rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.photo-popup h2 { font-family: "Poppins", sans-serif; font-weight: 900; margin-top: 0; }
.photo-popup-image {
  width: 100%;
  max-width: 20rem;
  max-height: 55vh;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  margin: 0 auto 1rem;
}

#photo-popup-image {
  cursor: zoom-in;
}

#gallery-lightbox-overlay .photo-popup {
  max-width: 90vw;
}

#gallery-lightbox-image {
  max-width: 90vw;
  max-height: 85vh;
}

.gallery-title { font-family: "Poppins", sans-serif; font-weight: 900; margin: 0; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr));
  gap: 0.8rem;
  width: 100%;
  max-width: 40rem;
}
.gallery-cell {
  aspect-ratio: 1;
  border-radius: 12px;
  border: none;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.gallery-cell:not(:disabled):hover { transform: scale(1.05); }
.gallery-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-cell.is-locked {
  background: rgba(255, 255, 255, 0.12);
  cursor: default;
}
.gallery-lock-label {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  padding: 0 0.3rem;
  text-align: center;
}
