:root {
  --purple-dark: #1a0b3b;
  --purple: #4b1fa8;
  --blue: #1fb5ff;
  --yellow: #ffe600;
  --pink: #ff3da6;
  --white: #fff;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: var(--white);
  position: relative;
  overflow-x: hidden;
  padding-bottom: calc(26vh + 16px);   /* place pour les personnages en bas (mobile) */
  background:
    linear-gradient(rgba(26, 11, 59, .30), rgba(26, 11, 59, .55)),   /* voile léger : la map reste visible */
    url("images/map.jpg") center / cover no-repeat,
    radial-gradient(circle at 20% 15%, rgba(31, 181, 255, .45), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(255, 61, 166, .40), transparent 45%),
    linear-gradient(160deg, var(--purple) 0%, var(--purple-dark) 100%);
  background-color: #0f55a0;   /* bleu océan, comme les bords de la map */
  background-attachment: fixed;
}

.card-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.logo {
  margin: 0;
  font-size: clamp(2rem, 9vw, 3.5rem);
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: .02em;
  transform: skew(-6deg);
  text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 rgba(0, 0, 0, .35);
}
.logo span { color: var(--yellow); }

.card {
  width: 100%;
  padding: 28px 22px 32px;
  background: rgba(255, 255, 255, .96);
  color: var(--purple-dark);
  border: 4px solid var(--yellow);
  border-radius: 20px;
  box-shadow: 0 8px 0 var(--pink), 0 18px 40px rgba(0, 0, 0, .45);
  transform: rotate(-1.2deg);
  position: relative;
}

.label {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 14px;
  background: var(--blue);
  color: var(--white);
  font-weight: 800;
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-radius: 999px;
}

.fact {
  margin: 0;
  font-size: clamp(1.3rem, 5.5vw, 2rem);
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.btn {
  display: inline-block;
  min-height: 56px;            /* grande zone tactile */
  padding: 14px 32px;
  background: var(--yellow);
  color: var(--purple-dark);
  font-size: 1.2rem;
  font-weight: 900;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 14px;
  box-shadow: 0 6px 0 #c9b400;
  transition: transform .08s, box-shadow .08s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 #c9b400;
}
.btn:focus-visible { outline: 4px solid var(--white); outline-offset: 4px; }

footer {
  margin-top: 32px;
  font-size: .75rem;
  opacity: .6;
  text-align: center;
}

@media (min-width: 700px) {
  .card { padding: 44px 40px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* Personnages décoratifs : images de fond, invisibles si le fichier est absent */
.mascot {
  position: fixed;
  bottom: 0;
  z-index: 0;
  height: 26vh;
  width: 45vw;
  background: no-repeat bottom / contain;
  pointer-events: none;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .5));
}
.mascot-left  { left: 0;  background-image: url("images/perso-gauche.png"); background-position: bottom left; }
.mascot-right { right: 0; background-image: url("images/perso-droite.png"); background-position: bottom right; }

@media (min-width: 700px) {
  body { padding-bottom: 16px; }
  .mascot { height: 70vh; width: 28vw; }
}

/* Spinner « tempête » : anneau violet qui se referme + tête de Peely au centre. Visible après 150 ms de chargement. */
.spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border: 7px solid rgba(75, 31, 168, .25);
  border-top-color: var(--pink);
  border-right-color: var(--purple);
  border-radius: 50%;
  background: url("images/favicon.png") center / 60% no-repeat;
  opacity: 0;
  pointer-events: none;
  animation: spin .9s linear infinite;
  transition: opacity .15s;
}
.card[aria-busy="true"] .spinner { opacity: 1; transition-delay: .15s; }
.card[aria-busy="true"] .fact { opacity: 0; }
.fact { transition: opacity .15s; }
.btn[aria-busy="true"] { opacity: .75; cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  .fact { transition: none; }
}
