/* War of Paperia — vitrine « page de cahier en guerre ».
   Palette = identité du jeu : papier crème, encre, marge rouge, lignes bleues,
   surligneurs Stabilo. Typo maison : Scribble (titres), Next Sunday (courant),
   Quirky Shading (gros chiffres). */

@font-face { font-family: 'Quirky Shading'; src: url('fonts/QuirkyShading.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Next Sunday'; src: url('fonts/NextSunday.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'WarOfPaperia Scribble'; src: url('fonts/WarOfPaperiaScribble-Regular.ttf') format('truetype'); font-display: swap; }
/* Patrick Hand = police d'interface DU JEU (accents complets, contrairement à
   Next Sunday qui perd les diacritiques). Corps de texte du site. */
@font-face { font-family: 'Patrick Hand'; src: url('fonts/patrick-hand-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; font-display: swap; }
@font-face { font-family: 'Patrick Hand'; src: url('fonts/patrick-hand-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF; font-display: swap; }

:root {
  --paper: #fbf7e9;
  --card: #fffdf5;
  --ink: #2b2b33;
  --rule: #cfe0f2;
  --red: #e24b4b;
  --blue: #3f6fe0;
  --graphite: #9a99a6;
  --muted: #5c5a66;
  --shadow: rgba(43, 43, 51, 0.18);
  --hl-yellow: #fff14d;
  --hl-cyan: #5ff0e0;
  --hl-pink: #ff8fc8;
  --hand: 'Patrick Hand', 'Comic Sans MS', 'Segoe Print', system-ui, sans-serif;
  --display: 'WarOfPaperia Scribble', 'Next Sunday', 'Comic Sans MS', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--hand);
  font-size: clamp(16px, 4vw, 19px);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

/* La feuille : lignes de cahier + marge rouge, fixe derrière tout. */
.sheet {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to right, transparent 42px, rgba(226, 75, 75, 0.35) 42px, rgba(226, 75, 75, 0.35) 44px, transparent 44px),
    repeating-linear-gradient(to bottom, transparent 0 32px, var(--rule) 32px, var(--rule) 33px),
    var(--paper);
}

a { color: var(--blue); }
:focus-visible { outline: 3px dashed var(--red); outline-offset: 3px; border-radius: 4px; }

/* ---- Boutons « croqués » Stabilo ---- */
.btn {
  --hl: var(--hl-yellow);
  display: inline-block; font-family: inherit; font-size: 1.05rem; font-weight: bold;
  color: var(--ink); text-decoration: none;
  border: 2.5px solid var(--ink);
  border-radius: 255px 14px 225px 16px / 16px 225px 14px 255px;
  padding: 0.5em 1.2em; cursor: pointer; position: relative;
  background-color: transparent;
  background-image: linear-gradient(100deg, transparent 3%, var(--hl) 3%, var(--hl) 97%, transparent 97%);
  background-repeat: no-repeat; background-size: 100% 54%; background-position: 0 62%;
  transition: transform 0.07s ease;
}
.btn:active { transform: translate(1px, 2px) rotate(-0.5deg); }
.btn--cyan { --hl: var(--hl-cyan); }
.btn--mini { font-size: 0.9rem; padding: 0.35em 0.9em; }

/* Badge Google Play */
.playbtn {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--ink); color: #fff; text-decoration: none;
  border: 2.5px solid var(--ink); border-radius: 14px;
  padding: 10px 20px; box-shadow: 4px 4px 0 var(--shadow);
  transition: transform 0.08s ease;
}
.playbtn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
.playbtn span { display: flex; flex-direction: column; line-height: 1.15; text-align: left; font-weight: bold; font-size: 1.25rem; }
.playbtn span small { font-size: 0.62rem; font-weight: normal; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; }

/* ---- Cartes ---- */
.card {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 18px 12px 18px 12px / 12px 18px 12px 18px;
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 18px 20px;
}

/* ---- Titres de sections : Scribble + coup de surligneur ---- */
.h2 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 6vw, 2.7rem);
  font-weight: normal;
  text-align: center; margin: 0 0 10px;
  text-wrap: balance;
}
.hl {
  --hl: var(--hl-yellow);
  background: linear-gradient(104deg, transparent 2%, var(--hl) 2%, var(--hl) 98%, transparent 98%);
  background-repeat: no-repeat; background-size: 100% 46%; background-position: 0 74%;
  padding: 0 6px;
}
.hl--cyan { --hl: var(--hl-cyan); }
.hl--pink { --hl: var(--hl-pink); }
.secsub {
  text-align: center; color: var(--muted); max-width: 54ch;
  margin: 0 auto 26px; text-wrap: balance;
}

/* ---- Nav ---- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px clamp(14px, 5vw, 40px);
  background: rgba(251, 247, 233, 0.92);
  backdrop-filter: blur(4px);
  border-bottom: 2.5px solid var(--ink);
}
.nav__brand { display: flex; align-items: center; gap: 9px; font-weight: bold; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.nav__brand img { border-radius: 8px; }
.nav__right { display: flex; align-items: center; gap: 10px; }
.langsel { display: flex; align-items: center; gap: 4px; font-size: 0.95rem; }
.langsel select {
  font-family: inherit; font-size: 0.9rem; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 8px; background: var(--card);
  padding: 4px 6px; cursor: pointer;
}

/* ---- Conteneur ---- */
main { display: block; max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 40px); }
section { position: relative; padding: clamp(44px, 8vw, 84px) 0; }

/* ---- Héros ---- */
.hero { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(20px, 4vw, 44px); align-items: center; padding-top: clamp(30px, 5vw, 60px); }
.kicker {
  margin: 0 0 6px; color: var(--red); font-size: 1rem;
  letter-spacing: 0.04em; transform: rotate(-1.2deg);
}
.title { margin: 0 0 14px; line-height: 0.9; }
.title__warof { font-family: var(--hand); font-size: clamp(1.6rem, 6vw, 2.6rem); display: inline-block; transform: rotate(-3deg); font-weight: bold; }
.title__paperia { font-family: 'WarOfPaperia Scribble', 'Quirky Shading', 'Comic Sans MS', sans-serif; font-size: clamp(3rem, 12vw, 5.6rem); color: var(--red); letter-spacing: 0.02em; font-weight: normal; }
.tagline { font-size: clamp(1.15rem, 3.5vw, 1.45rem); margin: 0 0 10px; }
.tagline strong { background: linear-gradient(transparent 55%, var(--hl-yellow) 55%); padding: 0 2px; }
.subtag { color: var(--muted); margin: 0 0 22px; max-width: 38ch; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.cta--center { justify-content: center; }
.note { font-size: 0.85rem; color: var(--muted); margin: 12px 0 0; max-width: 46ch; }
.note__ver { white-space: nowrap; color: var(--red); }

/* Le terrain jouable : carte scotchée, canvas dedans. */
.hero__demo { min-width: 0; }
.fieldcard {
  position: relative;
  background:
    repeating-linear-gradient(to bottom, transparent 0 26px, var(--rule) 26px 27px),
    var(--card);
  border: 3px solid var(--ink);
  border-radius: 14px 10px 16px 10px / 10px 16px 10px 14px;
  box-shadow: 5px 6px 0 var(--shadow);
  padding: 14px 14px 8px;
  transform: rotate(0.6deg);
}
.fieldcard__hint {
  margin: 0 0 4px; text-align: center; font-size: 0.92rem; color: var(--muted);
}
#battle {
  display: block; width: 100%; height: clamp(260px, 38vw, 400px);
  touch-action: none; cursor: crosshair;
}
.fieldcard__tally {
  margin: 2px 4px 4px; text-align: right; font-size: 0.95rem; color: var(--red);
  transform: rotate(-0.6deg);
}
.fieldcard__tally output { font-family: 'Quirky Shading', var(--hand); font-size: 1.2em; }

/* Scotch (washi) */
.tape {
  position: absolute; width: 92px; height: 26px;
  background: rgba(95, 240, 224, 0.5);
  border-left: 2px dashed rgba(43, 43, 51, 0.25);
  border-right: 2px dashed rgba(43, 43, 51, 0.25);
  box-shadow: 0 1px 3px rgba(43, 43, 51, 0.15);
  pointer-events: none;
}
.tape--tl { top: -12px; left: 18px; transform: rotate(-8deg); }
.tape--tr { top: -12px; right: 18px; transform: rotate(6deg); }
.tape--br { bottom: -12px; right: 26px; transform: rotate(-5deg); background: rgba(255, 241, 77, 0.55); }

/* ---- Vidéo du front ---- */
.trailer { text-align: center; }
.tv {
  position: relative; margin: 0 auto; max-width: 780px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 12px 16px 12px 16px / 16px 12px 16px 12px;
  box-shadow: 5px 6px 0 var(--shadow);
  padding: 12px; transform: rotate(-0.5deg);
}
.tv video { display: block; width: 100%; border-radius: 8px; }

/* ---- 3 gestes ---- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.step { display: flex; align-items: flex-start; gap: 14px; }
.step__n {
  flex: 0 0 auto; width: 50px; height: 50px; border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%;
  background: var(--hl-yellow); border: 3px solid var(--ink);
  display: grid; place-items: center;
  font-family: 'Quirky Shading', var(--hand); font-size: 1.7rem; line-height: 1;
}
.step h3 { margin: 2px 0 4px; font-size: 1.15rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.step:nth-child(2) .step__n { background: var(--hl-cyan); transform: rotate(4deg); }
.step:nth-child(3) .step__n { background: var(--hl-pink); transform: rotate(-5deg); }

/* ---- Mode Graphiste ---- */
.lineup {
  display: flex; justify-content: center; align-items: flex-end;
  gap: clamp(10px, 4vw, 40px); flex-wrap: wrap;
}
.lineup img {
  height: clamp(190px, 30vw, 330px); width: auto; max-width: 100%;
  filter: drop-shadow(4px 5px 0 var(--shadow));
  transition: transform 0.15s ease;
}
.lineup img:nth-child(1) { transform: rotate(-2deg); }
.lineup img:nth-child(3) { transform: rotate(2.2deg); }
.lineup img:hover { transform: translateY(-8px) rotate(0deg); }

/* ---- Fair-play ---- */
.fair__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.fair__list h3 { margin: 4px 0 4px; font-size: 1.15rem; }
.fair__list p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.fair__ic { font-size: 1.7rem; }

/* ---- CTA final ---- */
.final { text-align: center; }
.final__march { display: flex; justify-content: center; margin-bottom: 6px; }
.final__vid { width: min(200px, 44vw); height: auto; }

/* ---- Props gribouillés dans les marges (desktop) ---- */
.doodle { position: absolute; z-index: -1; opacity: 0.9; display: none; }
.doodle--tank  { right: -30px; bottom: 30px;  height: 110px; transform: rotate(3deg) scaleX(-1); }
.doodle--tree  { left: -40px;  bottom: 20px;  height: 150px; transform: rotate(-2deg); }
.doodle--tower { right: -44px; top: 60px;     height: 170px; transform: rotate(2deg); }
.doodle--stop  { left: -20px;  bottom: 10px;  height: 120px; transform: rotate(-6deg); }
@media (min-width: 1240px) { .doodle { display: block; } }

/* ---- Footer ---- */
.footer { text-align: center; padding: 30px 20px calc(40px + env(safe-area-inset-bottom, 0px)); border-top: 2.5px dashed var(--ink); margin-top: 20px; }
.footer p { margin: 4px 0; }
.footer__small { font-size: 0.8rem; color: var(--muted); }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .subtag, .note { margin-left: auto; margin-right: auto; }
  .cta { justify-content: center; }
  .kicker { transform: none; }
  .fieldcard { transform: none; }
}

/* ---- Avions en papier ---- */
.planes { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: 0.6; }
.plane { position: absolute; left: -90px; animation: glide linear infinite; }
.plane svg { display: block; height: auto; animation: planebob 2.6s ease-in-out infinite; }
.p1 { top: 14%; width: 34px; animation-duration: 13s; animation-delay: 0s; }
.p2 { top: 30%; width: 26px; animation-duration: 17s; animation-delay: 4s; }
.p3 { top: 9%;  width: 30px; animation-duration: 15s; animation-delay: 8s; }
.p1 svg { width: 34px; } .p2 svg { width: 26px; } .p3 svg { width: 30px; }
@keyframes glide { to { transform: translateX(calc(100vw + 200px)); } }
@keyframes planebob { 0%, 100% { transform: rotate(7deg) translateY(0); } 50% { transform: rotate(2deg) translateY(-7px); } }
.nav, main, .footer { position: relative; z-index: 1; }

/* ---- Révélation au scroll ---- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.steps .step:nth-child(2), .fair__list li:nth-child(2) { transition-delay: 0.08s; }
.steps .step:nth-child(3), .fair__list li:nth-child(3) { transition-delay: 0.16s; }

/* ---- Survol des cartes ---- */
.step, .fair__list .card { transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.6s ease; }
.step:hover, .fair__list .card:hover { transform: translate(-1px, -3px); box-shadow: 6px 7px 0 var(--shadow); }
.step.reveal:not(.is-visible) { transform: translateY(26px); }

/* ---- Accessibilité : réduire les animations ---- */
@media (prefers-reduced-motion: reduce) {
  .planes { display: none; }
  .plane, .plane svg, .final__vid { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
