/* Wonder Parks Tycoon : site de téléchargement, aux couleurs de la fête foraine du jeu */

@font-face { font-family: "Lilita One"; src: url("fonts/LilitaOne.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito-Variable.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --night: #2b1d3a;
  --night-2: #3d2a52;
  --red: #d93a4a;
  --red-dark: #a8202f;
  --cream: #fff3dc;
  --paper: #fffaf0;
  --gold: #ffc93c;
  --ink: #4a1018;
  --muted: #8a5a5f;
  --grass: #5fae5c;
  --grass-dark: #3f8f4e;
  --outline: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 500 1.0625rem/1.6 "Nunito", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; border-radius: 10px; }

h1, h2, h3 { font-family: "Lilita One", "Nunito", sans-serif; font-weight: 400; line-height: 1.05; margin: 0; }

/* ------------------------------------------------------------------ nuit de fête foraine */

.night {
  position: relative;
  overflow: hidden;
  color: var(--cream);
  background:
    radial-gradient(900px 500px at 75% 30%, rgba(255, 201, 60, .16), transparent 60%),
    radial-gradient(700px 600px at 10% 100%, rgba(217, 58, 74, .25), transparent 60%),
    var(--night);
  padding: 0 24px 0;
}
/* étoiles : quelques points fixes */
.night::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(2px 2px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(2px 2px at 38% 9%, #fff6 50%, transparent 51%),
    radial-gradient(2px 2px at 62% 22%, #fff7 50%, transparent 51%),
    radial-gradient(2px 2px at 88% 12%, #fff5 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 52% 40%, #fff5 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 22% 55%, #fff4 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 94% 48%, #fff5 50%, transparent 51%);
  pointer-events: none;
}

.top {
  position: relative;
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: "Lilita One", sans-serif; font-size: 1.3rem; }
.brand img { border-radius: 12px; border: 3px solid var(--ink); }
.top-link {
  font-weight: 800; text-decoration: none; color: var(--gold);
  padding: 8px 16px; border: 3px solid var(--gold); border-radius: 999px;
}
.top-link:hover { background: var(--gold); color: var(--ink); }

.hero {
  position: relative;
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
  padding: 24px 0 210px;
}

/* enseigne à ampoules autour du ticket */
.marquee {
  position: relative;
  width: 220px; height: 160px;
  display: grid; place-items: center;
  margin-bottom: 18px;
}
.marquee .logo { width: 190px; transform: rotate(-4deg); filter: drop-shadow(0 6px 0 rgba(0,0,0,.25)); }
.bulbs {
  position: absolute; inset: 0;
  border-radius: 28px;
  border: 5px solid var(--red);
  background:
    radial-gradient(circle, var(--gold) 0 4px, transparent 5px) 0 0 / 22px 22px;
  -webkit-mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  padding: 9px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  50% { background-position: 11px 11px; filter: brightness(1.25); }
}

h1 {
  font-size: clamp(3.2rem, 8vw, 6.2rem);
  color: var(--cream);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink);
  letter-spacing: .5px;
  display: flex; flex-direction: column; align-items: flex-start;
}
h1 .ribbon {
  margin-top: 10px;
  font-size: .5em;
  color: var(--ink);
  -webkit-text-stroke: 0;
  text-shadow: none;
  background: var(--gold);
  padding: 4px 26px 6px;
  border: var(--outline) solid var(--ink);
  border-radius: 12px;
  transform: rotate(-3deg);
  box-shadow: 0 5px 0 var(--ink);
}
.lead { max-width: 34em; font-size: 1.15rem; color: #f3e6ff; margin: 26px 0 30px; }

/* ------------------------------------------------------------------ boutons en ticket d'entrée */

.tickets { display: flex; flex-wrap: wrap; gap: 18px; }
.ticket {
  --c: var(--red);
  position: relative;
  display: flex; align-items: stretch;
  text-decoration: none;
  color: var(--ink);
  filter: drop-shadow(0 6px 0 var(--ink));
  transition: transform .12s ease;
}
.ticket:hover { transform: translateY(-3px) rotate(-1deg); }
.ticket:active { transform: translateY(2px); filter: drop-shadow(0 2px 0 var(--ink)); }
.ticket-main, .ticket-stub {
  display: flex; align-items: center;
  border: var(--outline) solid var(--ink);
}
.ticket-main {
  gap: 14px;
  padding: 14px 22px 14px 18px;
  background: var(--cream);
  border-right: 0;
  border-radius: 16px 0 0 16px;
  /* encoches du ticket */
  -webkit-mask: radial-gradient(circle 11px at right 0 top 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle 11px at right 0 bottom 0, #0000 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle 11px at right 0 top 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle 11px at right 0 bottom 0, #0000 98%, #000) bottom / 100% 51% no-repeat;
}
.ticket-main b { display: block; font-family: "Lilita One", sans-serif; font-weight: 400; font-size: 1.5rem; line-height: 1; }
.ticket-main small { display: block; font-weight: 700; color: var(--muted); font-size: .9rem; margin-top: 2px; }
.os { width: 34px; height: 34px; fill: var(--c); flex: none; }
.ticket-stub {
  padding: 0 20px;
  background: var(--c);
  color: #fff;
  font-family: "Lilita One", sans-serif; font-size: 1.15rem;
  border-left: 3px dashed var(--ink);
  border-radius: 0 16px 16px 0;
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
}
.ticket[data-os="windows"] { --c: #3d8bd9; }
.ticket.mine .ticket-main { background: #fff; }
.ticket.mine::after {
  content: attr(data-badge);
  position: absolute; top: -14px; left: 14px;
  font: 800 .78rem/1 "Nunito", sans-serif;
  background: var(--gold); color: var(--ink);
  padding: 5px 10px; border: 3px solid var(--ink); border-radius: 999px;
}
.meta { margin: 22px 0 0; color: #d8c7ea; font-weight: 700; font-size: .95rem; }

/* ------------------------------------------------------------------ téléphones */

.phone {
  margin: 0;
  border: 6px solid var(--ink);
  border-radius: 34px;
  background: var(--ink);
  overflow: hidden;
  box-shadow: 0 10px 0 rgba(0,0,0,.25);
}
.phone img { width: 100%; height: auto; border-radius: 28px; }
.hero-phone { width: min(320px, 100%); justify-self: center; transform: rotate(4deg); box-shadow: 0 14px 0 rgba(0,0,0,.35), 0 0 0 6px var(--gold); }

/* Gus qui passe la tête */
.gus {
  position: absolute; left: max(16px, calc(50% - 600px)); bottom: -6px;
  display: flex; align-items: flex-end; gap: 6px;
  pointer-events: none;
}
.gus img { width: 170px; height: auto; }
.bubble {
  pointer-events: auto;
  max-width: 330px;
  margin: 0 0 84px;
  background: var(--cream); color: var(--ink);
  font-weight: 700; font-size: .98rem; line-height: 1.4;
  padding: 14px 18px;
  border: var(--outline) solid var(--ink);
  border-radius: 20px 20px 20px 4px;
  box-shadow: 0 5px 0 var(--ink);
}

/* ------------------------------------------------------------------ auvent rayé */

.awning {
  height: 46px;
  background:
    radial-gradient(circle at 50% 0, transparent 0 0, transparent 0) ,
    repeating-linear-gradient(90deg, var(--red) 0 48px, var(--paper) 48px 96px);
  -webkit-mask: radial-gradient(24px at 24px 100%, #0000 98%, #000) 0 0 / 48px 100% repeat-x;
          mask: radial-gradient(24px at 24px 100%, #0000 98%, #000) 0 0 / 48px 100% repeat-x;
  margin-top: -1px;
  position: relative; z-index: 1;
  filter: drop-shadow(0 4px 0 rgba(74, 16, 24, .25));
  background-color: var(--night);
}

/* ------------------------------------------------------------------ sections */

main section { max-width: 1120px; margin: 0 auto; padding: 72px 24px 24px; }
h2 { font-size: clamp(2rem, 4.4vw, 3rem); color: var(--red); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); }
.section-lead { margin: 8px 0 28px; color: var(--muted); font-weight: 700; }

/* manège : piste qui défile vers la droite, comme le Pass du jeu */
.ride-track {
  list-style: none; margin: 0; padding: 8px 4px 28px;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 22px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-color: var(--red) transparent;
}
.ride-track li { scroll-snap-align: start; }
.ride-track .phone { max-width: 270px; }
.ride-track h3 { font-size: 1.45rem; margin: 22px 0 6px; color: var(--ink); }
.ride-track p { margin: 0; max-width: 30ch; color: #6b3a40; }

.install-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 28px; }
.install-card {
  background: var(--paper);
  border: var(--outline) solid var(--ink);
  border-radius: 24px;
  padding: 26px 28px 22px;
  box-shadow: 0 6px 0 var(--ink);
}
.install-card h3 { font-size: 1.7rem; }
#install-android h3 { color: var(--red); }
#install-windows h3 { color: #2f74bd; }
.install-card ol { counter-reset: step; list-style: none; padding: 0; margin: 18px 0 0; }
.install-card li { counter-increment: step; position: relative; padding: 2px 0 14px 50px; }
.install-card li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 34px; height: 34px; display: grid; place-items: center;
  font-family: "Lilita One", sans-serif; font-size: 1.1rem;
  background: var(--gold); border: 3px solid var(--ink); border-radius: 50%;
}
.install-card a { font-weight: 800; color: var(--red-dark); }
.install-card em { font-style: normal; font-weight: 800; }
.note { margin: 4px 0 0; padding-top: 12px; border-top: 3px dashed #e8cfae; color: var(--muted); font-size: .95rem; }

.faq { padding-bottom: 88px !important; }
.faq h2 { margin-bottom: 22px; }
details {
  max-width: 760px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 18px;
  margin-bottom: 12px;
}
summary { cursor: pointer; padding: 16px 22px; font-weight: 800; font-size: 1.08rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: "Lilita One", sans-serif; font-size: 1.5rem; line-height: 1; color: var(--red); }
details[open] summary::after { content: "–"; }
details p { margin: 0; padding: 0 22px 18px; max-width: 62ch; }

/* ------------------------------------------------------------------ pied : pelouse et barrière */

.grass {
  position: relative;
  background: var(--grass);
  color: #fff;
  text-align: center;
  padding: 58px 24px 34px;
  font-weight: 700;
}
.grass a { color: #fff; }
.fence {
  position: absolute; left: 0; right: 0; top: -22px; height: 34px;
  background:
    linear-gradient(var(--paper) 0 0) 0 10px / 100% 6px no-repeat,
    linear-gradient(var(--paper) 0 0) 0 22px / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 22px, var(--paper) 22px 32px);
  filter: drop-shadow(0 3px 0 var(--grass-dark));
}

/* ------------------------------------------------------------------ téléphones et petites tablettes */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-bottom: 28px; }
  /* Gus passe sous le téléphone, dans le flux de la page */
  .gus { position: relative; left: auto; bottom: auto; margin: 0 auto; max-width: 560px; }
  .hero-phone { width: min(260px, 70%); }
  .install-cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .night { padding: 0 16px; }
  main section { padding-left: 16px; padding-right: 16px; }
  .top-link { display: none; }
  .ticket { width: 100%; }
  .ticket-main { flex: 1; }
  .gus img { width: 120px; height: auto; }
  .bubble { font-size: .9rem; margin-bottom: 52px; max-width: 230px; }
  .marquee { width: 180px; height: 132px; }
  .marquee .logo { width: 150px; }
}

/* ------------------------------------------------------------------ petits effets */

/* entrée en scène, une seule fois au chargement : l'enseigne s'allume, le titre tombe, les tickets arrivent */
.intro .marquee { animation: swing-in .7s cubic-bezier(.3, 1.5, .5, 1) both; }
.intro h1 > span:first-child { animation: drop .55s .15s cubic-bezier(.3, 1.6, .5, 1) both; }
.intro h1 .ribbon { animation: stamp .45s .45s cubic-bezier(.3, 1.8, .5, 1) both; }
.intro .lead { animation: rise .5s .55s ease-out both; }
.intro .ticket { animation: rise .5s ease-out both; }
.intro .ticket:nth-child(1) { animation-delay: .7s; }
.intro .ticket:nth-child(2) { animation-delay: .82s; }
.intro .hero-phone { animation: phone-in .8s .35s cubic-bezier(.3, 1.3, .5, 1) both; }
.intro .gus { animation: peek .6s 1.1s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes swing-in { from { opacity: 0; transform: rotate(-14deg) scale(.6); } }
@keyframes drop { from { opacity: 0; transform: translateY(-40px); } }
@keyframes stamp { from { opacity: 0; transform: rotate(-3deg) scale(1.6); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes phone-in { from { opacity: 0; transform: translateY(60px) rotate(12deg); } }
@keyframes peek { from { transform: translateY(110%); } }

/* le talon du ticket se plie un peu au survol */
.ticket-stub { transform-origin: left center; transition: transform .18s ease; }
.ticket:hover .ticket-stub { transform: perspective(300px) rotateY(-14deg); }

/* le téléphone suit doucement la souris (variables posées par app.js) */
.hero-phone { transition: transform .25s ease-out; transform: rotate(4deg) perspective(900px) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg)); }

/* Gus respire, et on peut le faire parler */
.gus-btn { all: unset; cursor: pointer; pointer-events: auto; display: block; border-radius: 20px; }
.gus-btn img { transform-origin: 50% 100%; animation: breathe 3.2s ease-in-out infinite; }
.gus-btn:active img { animation: none; transform: scale(1.06, .94); }
.gus.talk .gus-btn img { animation: shake .35s ease-in-out; }
.bubble { transform-origin: 0 100%; }
.gus.talk .bubble { animation: pop .3s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes breathe { 50% { transform: scale(1.012, .985); } }
@keyframes shake { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
@keyframes pop { from { transform: scale(.85); } }

/* manège : les captures penchent un peu, et se redressent au survol */
.ride-track .phone { transition: transform .2s ease; }
.ride-track li:nth-child(odd) .phone { transform: rotate(-1.5deg); }
.ride-track li:nth-child(even) .phone { transform: rotate(1.5deg); }
.ride-track li:hover .phone { transform: rotate(0) translateY(-6px); }

/* confettis du clic sur un ticket */
.confetti { position: fixed; width: 9px; height: 9px; border-radius: 2px; pointer-events: none; z-index: 10;
  animation: confetti .9s cubic-bezier(.2, .6, .4, 1) forwards; }
@keyframes confetti { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro *, .gus-btn img, .gus.talk *, .ticket-stub, .hero-phone, .ride-track .phone { animation: none !important; transition: none !important; }
  .confetti { display: none; }
  .bulbs { animation: none; }
  .ticket, .ticket:hover { transition: none; transform: none; }
}
