/* ==========================================================================
   Carte d'anniversaire de Violette — feuille de style
   Mobile d'abord, une seule page, aucune ressource externe.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Variables & thème
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  --cream: #FFF7EA;
  --cream-deep: #FBE9D2;
  --paper: #FFFDF8;
  --card: #FFFDF8;
  --card-2: #FFF3E2;

  --ink: #2B2140;
  --ink-soft: #5C5070;
  --line: #2B2140;
  --line-soft: rgba(43, 33, 64, .16);

  --lake: #2E86C1;
  --lake-deep: #17527D;
  --sky: #BFE6F5;
  --sky-deep: #8FD3EE;

  --sun: #FFD24A;
  --coral: #FF6F61;
  --coral-deep: #D8433C;
  --pink: #FFB6C7;
  --cheese: #FFC93C;
  --cheese-deep: #B7791F;
  --mint: #6FC7A8;
  --mint-deep: #2F7D62;
  --peach: #FFD9CC;

  --link: #17527D;
  --focus: #17527D;
  --danger: #B02A36;

  --shadow-soft: 0 22px 50px -28px rgba(43, 33, 64, .45);
  --shadow-hard: 0 6px 0 var(--line);

  --radius-lg: 32px;
  --radius-md: 22px;
  --radius-sm: 14px;

  --font-display: "Trebuchet MS", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-hand: "Bradley Hand", "Segoe Print", "Comic Sans MS", "Trebuchet MS", cursive;

  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

/* Thème nuit : la fête continue après le coucher du soleil. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --cream: #141021;
    --cream-deep: #1C1630;
    --paper: #221C38;
    --card: #241E3B;
    --card-2: #2A2344;

    --ink: #FFF4E4;
    --ink-soft: #CFC3E0;
    --line: #F6D9B8;
    --line-soft: rgba(246, 217, 184, .18);

    --lake: #6FB8E0;
    --lake-deep: #8FD3EE;
    --sky: #16233F;
    --sky-deep: #1E3358;

    --coral: #FF8A7A;
    --coral-deep: #FFB3A7;
    --cheese: #FFD65C;
    --cheese-deep: #FFE08A;
    --mint: #8FDDBE;
    --mint-deep: #B7F0DA;

    --link: #8FD3EE;
    --focus: #FFD65C;

    --shadow-soft: 0 24px 60px -28px rgba(0, 0, 0, .75);
  }
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, .96rem + .18vw, 1.08rem);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, blockquote, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

button, textarea, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }

a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }

svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}

::selection { background: var(--cheese); color: #2B2140; }

.wrap {
  width: min(1120px, 100% - 2.25rem);
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Sans JavaScript : on cache ce qui ne peut pas fonctionner, le reste reste lisible. */
.no-js .js-only,
.no-js .art-hint,
.no-js .synchro-score { display: none !important; }
/* Sans JS, les illustrations restent visibles mais ne font pas semblant d'être cliquables. */
.no-js .canoe-hit,
.no-js .lobster-hit { pointer-events: none; cursor: default; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: .7em 1.1em;
  background: var(--paper);
  color: var(--ink);
  border: 2.5px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 16px; }

.nojs-banner {
  margin: 0;
  padding: 10px 18px;
  text-align: center;
  background: var(--cheese);
  color: #2B2140;
  font-weight: 700;
  font-size: .92rem;
}

/* --------------------------------------------------------------------------
   3. Typographie & composants
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-display);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--lake-deep);
}
.eyebrow::before {
  content: "";
  width: .55em;
  height: .55em;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 22%, transparent);
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  min-height: 48px;
  padding: .82em 1.35em;
  border: 2.5px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--line);
  transition: transform .18s var(--ease-bounce), box-shadow .18s ease, background-color .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--line); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--line); }

.btn--primary { background: var(--coral); color: #2B2140; }
.btn--ghost { background: var(--paper); }
.btn--quiet {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: .2em;
  color: var(--ink-soft);
  font-weight: 700;
}
.btn--quiet:hover { box-shadow: none; transform: none; background: var(--cream-deep); }
.btn--small { min-height: 42px; padding: .62em 1.05em; font-size: .93rem; box-shadow: 0 4px 0 var(--line); }
.btn--small:hover { box-shadow: 0 6px 0 var(--line); }
.btn--small:active { box-shadow: 0 1px 0 var(--line); }
.btn--cheese { background: var(--cheese); color: #2B2140; }
.btn--lake { background: var(--lake-deep); color: var(--cream); }
.btn--peach { background: var(--peach); color: #2B2140; }
.btn__icon { display: inline-flex; align-items: center; justify-content: center; width: 11px; height: 14px; flex: none; }
.icon-play { width: 0; height: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 2px; }
.icon-pause { display: none; width: 9px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.btn.is-playing .icon-play { display: none; }
.btn.is-playing .icon-pause { display: block; }

.nowrap { white-space: nowrap; }

/* Apparition au défilement (désactivée sans JS et en mouvement réduit). */
.js .reveal {
  opacity: 0;
  translate: 0 26px;
  transition: opacity .7s ease, translate .8s var(--ease-bounce);
}
.js .reveal.is-in { opacity: 1; translate: 0 0; }

/* --------------------------------------------------------------------------
   4. Héros
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(28px, 6vh, 64px) 0 clamp(84px, 12vh, 140px);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 80% 6%, #FFF0B0 0%, rgba(255, 240, 176, 0) 52%),
    linear-gradient(175deg, #C9ECF9 0%, #E9F7FB 46%, #FFF3DC 100%);
}

@media (prefers-color-scheme: dark) {
  .hero {
    background:
      radial-gradient(120% 90% at 80% 6%, rgba(255, 226, 150, .18) 0%, rgba(255, 226, 150, 0) 55%),
      linear-gradient(175deg, #0C162D 0%, #14203C 55%, #251B38 100%);
  }
  /* En mode nuit, le surlignage devient un bloc plein : le mot reste lisible. */
  .hero .marker {
    background: var(--cheese);
    border-radius: 8px;
    padding: 0 .1em;
  }
}

.hero__sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.sun {
  position: absolute;
  top: 5%;
  right: 6%;
  width: clamp(110px, 18vw, 210px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #FFF6CE 0%, #FFE38C 45%, #FFC93C 100%);
  box-shadow: 0 0 0 18px rgba(255, 201, 60, .12), 0 0 80px rgba(255, 201, 60, .35);
}

.cloud {
  position: absolute;
  width: clamp(90px, 14vw, 150px);
  height: 36px;
  border-radius: 999px;
  background: #FFFDF8;
  opacity: .85;
  animation: cloud-drift 18s ease-in-out infinite alternate;
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}
.cloud::before { width: 58%; aspect-ratio: 1; left: 12%; bottom: 32%; }
.cloud::after { width: 42%; aspect-ratio: 1; right: 16%; bottom: 26%; }
.cloud--1 { top: 14%; left: 4%; animation-delay: -3s; }
.cloud--2 { top: 30%; right: 16%; scale: .72; animation-delay: -9s; opacity: .7; }
.cloud--3 { top: 6%; left: 46%; scale: .55; animation-delay: -14s; opacity: .6; }

@media (prefers-color-scheme: dark) {
  .cloud { background: #2B3D60; opacity: .7; }
  .sun { background: radial-gradient(circle at 38% 35%, #FFF7D6, #FFE08A); box-shadow: 0 0 0 18px rgba(255, 224, 138, .08), 0 0 90px rgba(255, 224, 138, .3); }
}

.star {
  position: absolute;
  width: 14px;
  aspect-ratio: 1;
  background: #FFF7EA;
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
  opacity: 0;
}
.star--1 { top: 12%; left: 22%; }
.star--2 { top: 24%; left: 36%; width: 9px; }
.star--3 { top: 8%; right: 30%; width: 11px; }

@media (prefers-color-scheme: dark) {
  .star { opacity: .9; animation: twinkle 4s ease-in-out infinite; }
  .star--2 { animation-delay: -1.4s; }
  .star--3 { animation-delay: -2.6s; }
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
}

.hero__copy { position: relative; z-index: 2; max-width: 640px; }

.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-size: clamp(.72rem, .68rem + .2vw, .82rem);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.flag { font-size: 1.15em; }

.hero__title {
  margin: .18em 0 .22em;
  font-family: var(--font-display);
  font-weight: 900;
  line-height: .88;
  letter-spacing: -.02em;
}
.hero__title-line {
  display: block;
  font-size: clamp(.8rem, .72rem + .5vw, 1rem);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: .55em;
}
.hero__title-12 {
  display: block;
  font-size: clamp(4.6rem, 20vw, 9rem);
  line-height: .78;
  letter-spacing: -.055em;
  color: var(--ink);
  text-shadow: clamp(4px, .8vw, 7px) clamp(4px, .8vw, 7px) 0 var(--cheese);
}
.hero__title-name {
  display: block;
  margin-top: .16em;
  font-size: clamp(2.5rem, 10.5vw, 4.6rem);
  line-height: 1;
}
.marker {
  position: relative;
  display: inline-block;
  padding: 0 .06em;
  color: #2B2140;
  background: linear-gradient(180deg, transparent 61%, var(--cheese) 61%, var(--cheese) 93%, transparent 93%);
  border-radius: 3px;
}
.hero__nickname {
  display: inline-block;
  margin-left: .12em;
  padding: .16em .42em .2em;
  font-family: var(--font-hand);
  font-size: clamp(.85rem, 3.2vw, 1.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 10px;
  rotate: -3deg;
  box-shadow: 2px 3px 0 var(--line-soft);
  vertical-align: middle;
}

.hero__sub {
  max-width: 44ch;
  margin-top: .55em;
  font-size: clamp(1rem, .95rem + .3vw, 1.13rem);
  color: var(--ink-soft);
}
.hero__sub strong {
  color: #2B2140;
  background: var(--cheese);
  padding: 0 .3em;
  border-radius: 5px;
  font-weight: 800;
  white-space: nowrap;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.35em;
}

.hero__hint {
  margin-top: 1.05em;
  font-size: .86rem;
  font-style: italic;
  color: var(--ink-soft);
}

.hero__distance {
  margin-top: 1.4em;
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: .8;
}

/* — Illustration de Violette — */
.hero__art {
  position: relative;
  justify-self: center;
  width: min(64vw, 250px);
  margin-top: 6px;
  order: -1;
}
.hero__halo {
  position: absolute;
  inset: -4% -9% -2%;
  border-radius: 48% 52% 44% 56% / 51% 45% 55% 49%;
  background: radial-gradient(circle at 50% 36%, #FFF8DF 0%, #FFE9A8 46%, #FFD24A 100%);
  box-shadow:
    inset 0 0 0 6px rgba(255, 255, 255, .55),
    0 24px 50px -26px rgba(43, 33, 64, .45);
}
.hero__halo::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: inherit;
  border: 2.5px dashed rgba(43, 33, 64, .25);
  animation: slow-spin 90s linear infinite;
}
.art--violette {
  position: relative;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 18px rgba(43, 33, 64, .18));
  animation: float-soft 7s ease-in-out infinite;
}

.hero__sticker {
  position: absolute;
  top: 2%;
  left: -6%;
  display: grid;
  place-items: center;
  width: clamp(64px, 12vw, 84px);
  aspect-ratio: 1;
  font-family: var(--font-display);
  font-size: .92rem;
  font-weight: 900;
  line-height: 1;
  color: #2B2140;
  text-align: center;
  background: var(--cheese);
  border: 3px solid #2B2140;
  border-radius: 50%;
  rotate: -12deg;
  box-shadow: 3px 4px 0 rgba(43, 33, 64, .25);
  z-index: 3;
}

.hero__wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: clamp(42px, 7vw, 82px);
  z-index: 1;
}
.hero__wave path { fill: var(--cream); }

/* --------------------------------------------------------------------------
   5. La lettre
   -------------------------------------------------------------------------- */
.letter-section { padding: clamp(26px, 5vw, 52px) 0 0; }

.letter {
  position: relative;
  padding: clamp(24px, 5vw, 58px);
  background:
    radial-gradient(rgba(43, 33, 64, .045) 1px, transparent 1.2px) 0 0 / 18px 18px,
    var(--paper);
  border: 3px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  rotate: -.35deg;
  overflow: hidden;
}
.letter::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 128px;
  height: 30px;
  translate: -50% 0;
  background: rgba(255, 201, 60, .55);
  border-left: 1px dashed rgba(43, 33, 64, .2);
  border-right: 1px dashed rgba(43, 33, 64, .2);
  rotate: -2deg;
}

.letter__stamp {
  position: absolute;
  top: clamp(18px, 3vw, 32px);
  right: clamp(16px, 3vw, 36px);
  width: clamp(54px, 9vw, 78px);
  rotate: 7deg;
  filter: drop-shadow(2px 3px 0 rgba(43, 33, 64, .12));
}
.letter__stamp svg { width: 100%; height: auto; }

.letter__title {
  margin: .25em 0 .55em;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.02em;
}

.letter__body { max-width: 62ch; }
.letter__body p + p { margin-top: 1em; }
.letter__wish {
  margin-top: 1.3em !important;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  font-weight: 800;
  color: var(--coral-deep);
}
.letter__signature {
  display: flex;
  align-items: center;
  gap: .5em;
  margin-top: .5em;
}
.signature-script {
  font-family: var(--font-hand);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--lake-deep);
  rotate: -2deg;
}
.letter__heart { font-size: 1.4rem; }

.letter__ps {
  max-width: 60ch;
  margin-top: 1.6em;
  padding-top: 1em;
  border-top: 2px dashed var(--line-soft);
  font-size: .93rem;
  color: var(--ink-soft);
}

.letter__postmark {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 1.4em;
  padding: .5em .8em;
  font-family: var(--font-display);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--lake-deep);
  border: 2px dashed var(--lake);
  border-radius: 8px;
  opacity: .8;
  rotate: -3deg;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   6. Les cartes souvenirs
   -------------------------------------------------------------------------- */
.memories { padding: clamp(48px, 8vw, 92px) 0 clamp(24px, 4vw, 48px); }

.section-head { max-width: 720px; margin-bottom: clamp(26px, 5vw, 46px); }
.section-head h2 {
  margin: .18em 0 .35em;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.6vw, 3.3rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -.025em;
}
.section-head__sub {
  max-width: 52ch;
  color: var(--ink-soft);
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: clamp(26px, 5vw, 44px);
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 0 var(--line-soft), var(--shadow-soft);
  overflow: hidden;
}

.card__art {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 260px;
  padding: clamp(20px, 4vw, 34px);
  background-color: var(--panel, #EDF7FC);
  background-image: radial-gradient(rgba(43, 33, 64, .10) 1.2px, transparent 1.3px);
  background-size: 17px 17px;
  border-bottom: 3px solid #2B2140;
  overflow: hidden;
}
.art-frame--sky { --panel: #DFF3FC; }
.art-frame--butter { --panel: #FFF0CC; }
.art-frame--mint { --panel: #E2F7EE; }
.art-frame--peach { --panel: #FFE6DE; }
.art-frame--pool { --panel: #DFF3FC; }
.art-frame--night { --panel: #14203C; }

.card__art .art {
  width: 100%;
  max-width: min(420px, 92%);
  height: auto;
  margin-inline: auto;
  rotate: -.6deg;
}
.card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .7rem;
  padding: clamp(22px, 4vw, 42px);
}
.card__title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.6vw, 2.15rem);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.card__text { color: var(--ink-soft); max-width: 46ch; }
.card__footnote {
  font-size: .82rem;
  color: var(--ink-soft);
}
.card__caption {
  font-family: var(--font-hand);
  font-size: 1.05rem;
  color: var(--lake-deep);
  rotate: -.6deg;
}

.stat { display: flex; flex-direction: column; gap: .28em; }
.stat__value {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3rem);
  font-weight: 900;
  line-height: 1;
  color: var(--coral-deep);
  letter-spacing: -.03em;
  text-decoration: underline wavy var(--cheese);
  text-decoration-thickness: 5px;
  text-underline-offset: 7px;
  padding-bottom: .5em;
}
.stat__label { font-size: .86rem; color: var(--ink-soft); }

/* — interactions dans les cartes — */
.canoe-hit, .lobster-hit {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  border-radius: 22px;
}
.canoe-hit:focus-visible, .lobster-hit:focus-visible { outline-offset: 6px; }
.canoe-hit .art, .lobster-hit .art { margin-inline: auto; transition: rotate .3s var(--ease-bounce); }
.canoe-hit:hover .art { rotate: 1deg; }
.lobster-hit:hover .art { rotate: -1deg; }
.canoe-group { transform-box: fill-box; transform-origin: 50% 80%; animation: canoe-bob 4.5s ease-in-out infinite; }
.is-rocking .canoe-group { animation: canoe-rock .7s var(--ease-bounce); }

.art-hint {
  font-size: .78rem;
  font-weight: 700;
  color: #2B2140;
  opacity: .8;
  text-align: center;
}
.art-hint span { color: #D8433C; }

.cheese-counter {
  display: flex;
  flex-direction: column;
  gap: .05em;
  margin-top: .2em;
  padding: .55em 1em .6em;
  background: var(--cream-deep);
  border: 2.5px dashed var(--cheese-deep);
  border-radius: var(--radius-md);
}
.cheese-counter__label {
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.cheese-counter__value {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  font-weight: 900;
  line-height: 1;
  color: var(--cheese-deep);
  transition: transform .2s var(--ease-bounce);
  transform-origin: left center;
  font-variant-numeric: tabular-nums;
}
.cheese-counter.is-bumping .cheese-counter__value { animation: bump .35s var(--ease-bounce); }

.play-count {
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.card__legal {
  padding: .7em .9em;
  font-size: .79rem;
  line-height: 1.5;
  color: var(--ink-soft);
  background: var(--cream-deep);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--lake);
}

.wave-meter {
  display: flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-display);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #2B2140;
  opacity: .78;
  text-align: center;
}
.wave-meter__label { border-top: 2px dashed rgba(43, 33, 64, .35); padding-top: .45em; }
.wave-msg {
  min-height: 1.6em;
  font-weight: 700;
  color: #A8322C;
}
@media (prefers-color-scheme: dark) {
  .wave-msg { color: var(--coral-deep); }
}
.wave-hand { transform-box: fill-box; transform-origin: 50% 90%; }
.is-waving .wave-hand--left { animation: wave-left .55s ease-in-out 4; }
.is-waving .wave-hand--right { animation: wave-right .55s ease-in-out 4; }

/* — Edgar — */
.edgar-stage .art--edgar { transition: opacity .3s ease, scale .35s var(--ease-out); }
.edgar-stage.is-here .art--edgar { opacity: .16; scale: .94; }
.edgar-pop {
  position: absolute;
  inset: 10% 12% 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform-origin: 50% 100%;
  animation: edgar-pop .5s var(--ease-bounce);
  pointer-events: none;
}
.edgar-pop .art { width: min(68%, 260px); height: auto; filter: drop-shadow(0 12px 14px rgba(43, 33, 64, .2)); }
.edgar-stage.is-here .edgar-pop { display: flex; }
.edgar-bubble {
  position: relative;
  max-width: 34ch;
  min-height: 4.1em;
  padding: .75em .95em;
  background: var(--cream-deep);
  border: 2.5px solid var(--line);
  border-radius: 16px 16px 16px 4px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
}
.edgar-bubble::before {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -11px;
  width: 16px;
  height: 16px;
  background: var(--cream-deep);
  border-right: 2.5px solid var(--line);
  border-bottom: 2.5px solid var(--line);
  transform: skewY(35deg) rotate(45deg);
}
.edgar-bubble.is-talking { animation: bump .35s var(--ease-bounce); }

/* — Natation synchronisée — */
.synchro-figure { transform-box: fill-box; transform-origin: 50% 55%; }
.is-spinning .synchro-figure { animation: synchro-spin 1.15s cubic-bezier(.45, .05, .2, 1) 1; }
.art-frame--pool::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 58%;
  width: 40%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid rgba(255, 253, 248, .8);
  translate: -50% -50%;
  opacity: 0;
  pointer-events: none;
}
.is-splashing.art-frame--pool::after { animation: ripple .9s ease-out 1; }
.synchro-score {
  position: absolute;
  right: clamp(12px, 3vw, 24px);
  bottom: clamp(12px, 3vw, 22px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .45em .9em .55em;
  background: var(--paper);
  border: 2.5px solid var(--line);
  border-radius: 12px;
  box-shadow: 3px 4px 0 rgba(43, 33, 64, .2);
  rotate: -4deg;
  opacity: 0;
  scale: .8;
  transition: opacity .3s ease, scale .4s var(--ease-bounce);
}
.synchro-score.is-scored { opacity: 1; scale: 1; }
.synchro-score__label {
  font-family: var(--font-display);
  font-size: .55rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.synchro-score__value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.1;
  color: var(--coral-deep);
}

/* --------------------------------------------------------------------------
   7. Le mini-jeu
   -------------------------------------------------------------------------- */
.game-section {
  padding: clamp(40px, 7vw, 76px) 0;
  background:
    radial-gradient(rgba(255, 255, 255, .07) 1.4px, transparent 1.5px) 0 0 / 22px 22px,
    linear-gradient(180deg, var(--cream) 0%, #DFF3FC 18%, #BFE6F5 50%, #DFF3FC 82%, var(--cream) 100%);
}
@media (prefers-color-scheme: dark) {
  .game-section {
    background:
      radial-gradient(rgba(255, 255, 255, .06) 1.4px, transparent 1.5px) 0 0 / 22px 22px,
      linear-gradient(180deg, var(--cream) 0%, #12213B 18%, #1B3355 50%, #12213B 82%, var(--cream) 100%);
  }
}

.game-card {
  position: relative;
  padding: clamp(22px, 4vw, 44px);
  color: #FFF7EA;
  background: #17527D;
  border: 3px solid #2B2140;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 0 rgba(43, 33, 64, .25), 0 30px 60px -30px rgba(23, 82, 125, .8);
  overflow: hidden;
}
.game-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(255, 247, 234, .22);
  border-radius: 24px;
  pointer-events: none;
}
.game-card .eyebrow { color: #FFD98A; }
.game-card .eyebrow::before { background: #FF8A7A; box-shadow: 0 0 0 3px rgba(255, 138, 122, .2); }
.game-head { position: relative; max-width: 640px; }
.game-head h2 {
  margin: .15em 0 .3em;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -.02em;
}
.game-intro { color: rgba(255, 247, 234, .82); max-width: 58ch; }

.game-stage { position: relative; margin-top: 1.3em; }

.game-hud {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: .7rem;
}
.game-hud__item {
  display: inline-flex;
  align-items: baseline;
  gap: .55em;
  padding: .4em .85em;
  background: #FFF7EA;
  color: #2B2140;
  border: 2.5px solid #2B2140;
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}
.game-hud__label {
  font-family: var(--font-display);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #5C5070;
}
.game-hud__value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #17527D;
}
.game-hud__value.is-low { color: #B02A36; }

.game-canvas-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  max-height: 480px;
  border: 3px solid #2B2140;
  border-radius: 24px;
  overflow: hidden;
  background: #BFE6F5;
  box-shadow: 0 10px 0 rgba(0, 0, 0, .2);
}
#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
#game-canvas:active { cursor: grabbing; }
#game-canvas:focus-visible { outline: 4px solid #FFD24A; outline-offset: -6px; }

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .45em;
  padding: 1.2rem;
  text-align: center;
  background: rgba(13, 45, 70, .78);
  backdrop-filter: blur(3px);
  transition: opacity .25s ease;
}
.game-overlay.is-hidden { opacity: 0; pointer-events: none; }
.game-overlay__title {
  font-family: var(--font-display);
  font-size: clamp(1.32rem, 4vw, 2.1rem);
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 2px 3px 0 rgba(0, 0, 0, .25);
}
.game-overlay__text {
  max-width: 40ch;
  margin-bottom: .4em;
  font-size: .9rem;
  color: rgba(255, 247, 234, .88);
}
.game-overlay .btn { color: #2B2140; }

.game-help {
  margin-top: .7em;
  font-size: .8rem;
  color: rgba(255, 247, 234, .68);
}
.game-result {
  min-height: 1.5em;
  margin-top: .5em;
  font-family: var(--font-display);
  font-weight: 800;
  color: #FFD98A;
}
.game-noscript {
  margin-top: 1em;
  padding: 1em;
  background: rgba(255, 247, 234, .1);
  border-radius: 12px;
  font-size: .9rem;
}

/* --------------------------------------------------------------------------
   8. Le final
   -------------------------------------------------------------------------- */
.final {
  padding: clamp(40px, 7vw, 80px) 0 clamp(40px, 6vw, 70px);
  background:
    radial-gradient(50% 40% at 88% 88%, rgba(255, 201, 60, .2) 0%, transparent 70%),
    radial-gradient(45% 35% at 8% 12%, rgba(111, 199, 168, .18) 0%, transparent 70%),
    var(--cream);
}

.final__wish {
  position: relative;
  padding: clamp(24px, 5vw, 58px);
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.final__wish::before {
  content: "12";
  position: absolute;
  right: -6px;
  top: -48px;
  font-family: var(--font-display);
  font-size: clamp(9rem, 24vw, 16rem);
  font-weight: 900;
  line-height: 1;
  color: var(--cheese);
  opacity: .16;
  pointer-events: none;
  rotate: 6deg;
}
.final__title {
  position: relative;
  max-width: 16ch;
  margin: .2em 0 .4em;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.4vw, 3.2rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -.025em;
}
.final__text { position: relative; max-width: 56ch; color: var(--ink-soft); }

.story {
  position: relative;
  margin-top: 1.7em;
  padding: clamp(14px, 3vw, 22px);
  background: var(--cream-deep);
  border: 2.5px dashed var(--line-soft);
  border-radius: var(--radius-md);
}
.story__ideas { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .9em; }
@media (min-width: 620px) { .story__ideas { display: flex; flex-wrap: wrap; } }
.chip {
  padding: .45em .8em;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 999px;
  min-width: 0;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  cursor: pointer;
  white-space: normal;
  box-shadow: 0 3px 0 var(--line-soft);
  transition: transform .15s var(--ease-bounce), background-color .2s ease;
}
.chip:hover { background: var(--cheese); transform: translateY(-1px); }
.chip:active { transform: translateY(2px); box-shadow: none; }

.story__label {
  display: block;
  margin-bottom: .35em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .9rem;
}
.story__input {
  display: block;
  width: 100%;
  min-height: 116px;
  padding: .85em .95em;
  background: var(--paper);
  color: var(--ink);
  border: 2.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-hand);
  font-size: 1.14rem;
  line-height: 1.5;
  resize: vertical;
}
.story__input::placeholder { color: var(--ink-soft); opacity: .55; font-family: var(--font-body); font-size: .95rem; }
.story__input:focus-visible { outline-offset: 2px; }

.story__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .15em;
  margin-top: .45em;
}
.story__status { align-self: flex-start; font-size: .78rem; color: var(--ink-soft); }
.story__status.is-saved { color: var(--mint-deep); font-weight: 700; }
.story__count {
  flex: none;
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 700;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.story__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .7em; }

.final__quote {
  position: relative;
  margin-top: clamp(26px, 5vw, 44px);
  padding: clamp(20px, 4vw, 34px) clamp(20px, 4vw, 38px);
  background: var(--card-2);
  border: 2.5px solid var(--line);
  border-left: 8px solid var(--coral);
  border-radius: 6px var(--radius-md) var(--radius-md) 6px;
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 1.8vw, 1.18rem);
  line-height: 1.55;
  box-shadow: 0 5px 0 var(--line-soft);
}
.final__quote::before {
  content: "“";
  position: absolute;
  left: .25em;
  top: -.28em;
  font-family: Georgia, serif;
  font-size: 5rem;
  line-height: 1;
  color: var(--cheese);
  opacity: .7;
}
.final__quote p { position: relative; }
.final__quote footer {
  margin-top: .7em;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  color: #B02A36;
  text-align: right;
}
@media (prefers-color-scheme: dark) {
  .final__quote footer { color: var(--coral-deep); }
}
.final__quote sup { font-size: .7em; }

.final__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: clamp(24px, 4vw, 38px);
}
.final__url {
  margin-top: .8em;
  font-size: .85rem;
  color: var(--ink-soft);
}
.final__url a { font-weight: 700; }

/* --------------------------------------------------------------------------
   9. Pied de page, toast, bouton musique
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 2.2rem 0 calc(6rem + env(safe-area-inset-bottom));
  border-top: 2px dashed var(--line-soft);
  background: var(--cream-deep);
  text-align: center;
}
.site-footer__line { font-family: var(--font-display); font-weight: 800; font-size: .95rem; }
.site-footer__meta {
  margin-top: .35em;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.site-footer__privacy {
  max-width: 56ch;
  margin: .9em auto 0;
  font-size: .76rem;
  color: var(--ink-soft);
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 130;
  max-width: min(90vw, 440px);
  padding: .7em 1.1em;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: .92rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, .4);
  opacity: 0;
  translate: -50% 16px;
  pointer-events: none;
  transition: opacity .25s ease, translate .3s var(--ease-bounce);
}
.toast.is-on { opacity: 1; translate: -50% 0; }

.music-fab {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: 10px 15px 10px 12px;
  background: var(--paper);
  color: var(--ink);
  border: 2.5px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 5px 0 var(--line);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .86rem;
  cursor: pointer;
  transition: transform .18s var(--ease-bounce), background-color .25s ease;
}
.music-fab:hover { transform: translateY(-2px); }
.music-fab:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.music-fab.is-playing { background: var(--cheese); }
.music-fab__icon { display: grid; place-items: center; width: 22px; height: 22px; }
.icon-note { width: 22px; height: 22px; }
.eq { display: none; align-items: flex-end; gap: 2.5px; height: 18px; }
.eq i { display: block; width: 3.5px; height: 7px; background: #2B2140; border-radius: 2px; animation: eq .62s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -.22s; }
.eq i:nth-child(3) { animation-delay: -.4s; }
.music-fab.is-playing .icon-note { display: none; }
.music-fab.is-playing .eq { display: flex; }
.music-fab.is-playing .music-fab__label { color: #2B2140; }

@media (max-width: 520px) {
  .music-fab { width: 54px; height: 54px; padding: 0; justify-content: center; gap: 0; }
  .music-fab__label { display: none; }
}

/* --------------------------------------------------------------------------
   10. Animations
   -------------------------------------------------------------------------- */
@keyframes cloud-drift {
  from { translate: -12px 0; }
  to { translate: 18px 6px; }
}
@keyframes slow-spin { to { rotate: 360deg; } }
@keyframes twinkle { 50% { opacity: .35; scale: .8; } }
@keyframes float-soft {
  50% { translate: 0 -10px; }
}
@keyframes canoe-bob {
  50% { transform: translateY(3px) rotate(.7deg); }
}
@keyframes canoe-rock {
  0%, 100% { transform: rotate(0) translateY(0); }
  20% { transform: rotate(-4deg) translateY(-3px); }
  45% { transform: rotate(4deg) translateY(-1px); }
  70% { transform: rotate(-2deg) translateY(-2px); }
}
@keyframes bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.28) rotate(-2deg); }
  100% { transform: scale(1); }
}
@keyframes wave-left {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-10deg) translateY(-2px); }
  65% { transform: rotate(7deg); }
}
@keyframes wave-right {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(10deg) translateY(-2px); }
  65% { transform: rotate(-7deg); }
}
@keyframes edgar-pop {
  0% { transform: translateY(60%) scale(.8); opacity: 0; }
  60% { transform: translateY(-4%) scale(1.03); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes synchro-spin {
  to { transform: rotate(360deg); }
}
@keyframes ripple {
  0% { opacity: .9; scale: .4; }
  100% { opacity: 0; scale: 1.8; }
}
@keyframes eq {
  from { height: 5px; }
  to { height: 17px; }
}
@keyframes pinch-shake {
  0%, 100% { translate: 0 0; }
  20% { translate: -7px 2px; }
  40% { translate: 6px -3px; }
  60% { translate: -5px 1px; }
  80% { translate: 4px -1px; }
}
body.is-pinched { animation: pinch-shake .45s ease-in-out 1; }

/* --------------------------------------------------------------------------
   11. Grands écrans
   -------------------------------------------------------------------------- */
@media (min-width: 820px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
    gap: clamp(24px, 4vw, 48px);
  }
  .hero__art { order: 0; width: min(100%, 440px); }
  .hero__copy { padding-top: .5rem; }
  .hero__title-12 { font-size: clamp(6.4rem, 11vw, 9.4rem); }

  .letter { padding: clamp(34px, 5vw, 62px) clamp(34px, 6vw, 76px); }

  .card { grid-template-columns: 1fr 1fr; min-height: 420px; }
  .card__art .art { max-width: 100%; }
  .card--flip .card__art { order: 2; border-left: 3px solid #2B2140; border-right: 0; }
  .card:not(.card--flip) .card__art { border-right: 3px solid #2B2140; border-bottom: 0; }
  .card--flip .card__art { border-bottom: 0; }
  .card__art { min-height: 100%; }
  .card--flip .card__body { order: 1; }
  .card__body { justify-content: center; }

  .card:nth-of-type(odd) { --tilt: -.35deg; }
  .card:nth-of-type(even) { --tilt: .35deg; }
  .card { rotate: var(--tilt, 0deg); }

  .game-canvas-wrap { aspect-ratio: 16 / 9; }
}

@media (min-width: 1100px) {
  .hero__title-name { font-size: 4.9rem; }
  .hero__art { width: min(100%, 470px); }
}

/* Téléphones étroits : le kicker tient sur une ligne. */
@media (max-width: 380px) {
  .hero__kicker { font-size: .66rem; letter-spacing: .08em; }
  .hero__title-12 { font-size: 19vw; }
}

/* Paysage de téléphone : on garde le héros compact et lisible. */
@media (max-height: 560px) and (min-width: 700px) {
  .hero { min-height: 0; padding-block: 22px 52px; }
  .hero__art { width: min(34vw, 240px); }
  .hero__title { margin: .05em 0 .15em; }
  .hero__title-line { margin-bottom: .35em; }
  .hero__title-12 { font-size: clamp(3.2rem, 9vw, 5rem); }
  .hero__title-name { font-size: clamp(1.9rem, 5.5vw, 3.1rem); }
  .hero__nickname { font-size: .9rem; }
  .hero__sub { font-size: .95rem; margin-top: .35em; }
  .hero__hint, .hero__distance { display: none; }
  .hero__actions { margin-top: .8em; }
  .hero__wave { height: 30px; }
}

/* --------------------------------------------------------------------------
   12. Mouvement réduit et impression
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal { opacity: 1; translate: 0 0; }
  .hero__halo::after { animation: none; }
  .art--violette, .cloud, .star, .canoe-group { animation: none; }
}

@media print {
  .hero__sky, .hero__wave, .confetti-canvas, .toast, .music-fab,
  .btn, .game-section, .story, .skip-link, .nojs-banner { display: none !important; }

  body { background: #FFF; color: #000; font-size: 11pt; }
  .hero { min-height: auto; background: none; padding: 0 0 1cm; }
  .hero__grid { display: block; }
  .hero__art { display: none; }
  .hero__title-12 { font-size: 42pt; text-shadow: none; }
  .card, .letter, .final__wish { box-shadow: none; border-color: #999; break-inside: avoid; }
  .js .reveal, .reveal { opacity: 1 !important; translate: none !important; }
  .card { grid-template-columns: 1fr; }
  .card__art { display: none; }
  .final__quote { break-inside: avoid; }
}
