/* Recap · index · dialogue de bienvenue (premier affichage) */
/* ---------- rien ne joue sur l'accueil tant que le dialogue de bienvenue n'est pas fermé ---------- */
body:not(.go) #start .topbar, body:not(.go) #start .content { opacity: 0 !important; }

/* ---------- dialogue de bienvenue : même carte « papier collé » que À propos / Contributeurs ---------- */
.tz-overlay { position: fixed; inset: 0; z-index: 10000; display: flex; justify-content: center; overflow-y: auto;
  padding: 84px 20px calc(24px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box;
  background: rgba(6,9,20,.7); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; animation: tz-overlay-in .01s 1s forwards; }
body.go .tz-overlay { display: none; }
@keyframes tz-overlay-in { to { opacity: 1; } }

.tz-card { position: relative; width: min(100%, 340px); margin: auto 0; box-sizing: border-box; padding: 0 22px 22px; text-align: center;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--card); color: var(--text); border: 2.5px solid var(--ink);
  border-radius: 20px 48px 24px 42px / 42px 20px 48px 24px;
  box-shadow: 4px 6px 0 color-mix(in srgb, var(--ink) 28%, transparent), 0 22px 44px rgba(0,0,0,.35);
  transform: translateY(40px) scale(.88) rotate(-2deg); opacity: 0;
  animation: tz-in .6s cubic-bezier(.34,1.5,.64,1) 1.1s both; }
@keyframes tz-in { to { transform: none; opacity: 1; } }

/* rubans adhésifs (comme la carte À propos) */
.tz-tape { position: absolute; top: -9px; left: 24px; width: 46px; height: 15px; rotate: -8deg; display: block;
  background: color-mix(in srgb, var(--teal) 62%, transparent); box-shadow: 0 2px 3px rgba(0,0,0,.2); }
.tz-tape.t2 { left: auto; right: 46px; width: 34px; rotate: 7deg; background: color-mix(in srgb, var(--gold) 62%, transparent); }

/* ---------- le personnage (détouré) + son ombre portée au sol ---------- */
.tz-hero { position: relative; width: 178px; margin: -70px auto 0; padding-bottom: 12px;
  opacity: 0; animation: tz-pop .7s cubic-bezier(.34,1.7,.64,1) 1.3s both; }
@keyframes tz-pop { from { opacity: 0; transform: translateY(18px) scale(.6); } to { opacity: 1; transform: none; } }
.tz-boy { position: relative; z-index: 1; display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; pointer-events: none;
  /* ombre propre : une ombre douce proche + une ombre longue diffuse, pour détacher le personnage de la carte */
  filter: drop-shadow(0 3px 2px rgba(20,24,50,.28)) drop-shadow(0 12px 10px rgba(20,24,50,.22));
  transform-origin: 50% 100%; animation: tz-float 3.2s ease-in-out 2.1s infinite; }
/* l'ombre au sol : ellipse floue + noyau de contact plus sombre, centrées sous les pieds */
.tz-ground { position: absolute; z-index: 0; left: -3%; right: -3%; bottom: 0; height: 22px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(10,14,36,.46) 0, rgba(10,14,36,.26) 42%, rgba(10,14,36,0) 72%);
  filter: blur(2.5px); transform-origin: 50% 50%; animation: tz-shadow 3.2s ease-in-out 2.1s infinite; }
.tz-ground::before { content: ""; position: absolute; left: 22%; right: 22%; top: 28%; bottom: 28%; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(10,14,36,.55) 0, rgba(10,14,36,0) 70%); }
@keyframes tz-float  { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes tz-shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.9); opacity: .68; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tz-ground { background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,.7) 0, rgba(0,0,0,.4) 42%, rgba(0,0,0,0) 72%); }
  :root:not([data-theme="light"]) .tz-ground::before { background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,.8) 0, rgba(0,0,0,0) 70%); }
  :root:not([data-theme="light"]) .tz-boy { filter: drop-shadow(0 3px 2px rgba(0,0,0,.45)) drop-shadow(0 12px 10px rgba(0,0,0,.35)); }
}
:root[data-theme="dark"] .tz-ground { background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,.7) 0, rgba(0,0,0,.4) 42%, rgba(0,0,0,0) 72%); }
:root[data-theme="dark"] .tz-ground::before { background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,.8) 0, rgba(0,0,0,0) 70%); }
:root[data-theme="dark"] .tz-boy { filter: drop-shadow(0 3px 2px rgba(0,0,0,.45)) drop-shadow(0 12px 10px rgba(0,0,0,.35)); }

/* ---------- textes ---------- */
.tz-up { opacity: 0; animation: tz-up .5s ease both; animation-delay: calc(1.5s + var(--i, 0) * 180ms); }
@keyframes tz-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.tz-title { margin: 14px 0 0; font-family: "Caveat", "Segoe Print", "Bradley Hand", cursive; font-weight: 700; line-height: 1.05; color: var(--ink);
  font-size: clamp(2.3rem, 12vw, 3rem); overflow-wrap: anywhere; }
.tz-hook { margin: 8px 0 0; font-size: .9rem; font-weight: 500; color: var(--text); line-height: 1.65; }
.tz-hook b { color: var(--ink); background: linear-gradient(transparent 58%, color-mix(in srgb, var(--gold) 42%, transparent) 58% 92%, transparent 92%); padding: 0 3px; }

/* ---------- bouton : le même que celui des autres cartes (.pwa-go) ---------- */
.tz-cta { width: 100%; box-sizing: border-box; margin-top: 18px; font: inherit; font-weight: 800; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, box-shadow .12s ease; animation: tz-up .5s ease 2.2s backwards; }

/* ---------- fermeture ---------- */
.tz-overlay.closing { animation: tz-out .32s ease both; pointer-events: none; }
@keyframes tz-out { to { opacity: 0; } }
.tz-overlay.closing .tz-card { animation: tz-card-out .32s cubic-bezier(.4,0,1,1) both; }
@keyframes tz-card-out { to { transform: translateY(26px) scale(.92); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .tz-overlay { animation: none !important; opacity: 1; }
  .tz-card, .tz-hero, .tz-boy, .tz-ground, .tz-up, .tz-cta { animation: none !important; transform: none; opacity: 1; }
  body:not(.go) #start .topbar, body:not(.go) #start .content { opacity: 1 !important; }
}
