/* Gelatia pages: the game's blueberry world inside the night, as in its store art and its jelly UI.
   Same skeleton as site.css, the game's own fonts and colours. */

@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/fredoka-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/fredoka-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Lilita One";
  src: url("/assets/fonts/lilita-one-latin-ext-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

.g {
  --berry: #21184d;
  --berry-deep: #170f38;
  --plum: #2a1540;
  --plum-hi: #3b2368;
  --grape: #3a2c7a;
  --gold: #ffbd36;
  --gold-hi: #ffe27a;
  --pink: #ff6eaa;
  --pink-hi: #ff9ccb;
  --outline: #140b2c;
  --ink: #fff6fb;
  --ink-soft: #cdbfee;
  --title: "Lilita One", "Fredoka", system-ui, sans-serif;
  --round: "Fredoka", system-ui, sans-serif;
  background: var(--berry);
  color: var(--ink);
  font-family: var(--round);
  font-weight: 450;
}
.g a { color: var(--pink-hi); }
.g a:hover { color: #fff; }
.g :focus-visible { outline-color: var(--gold-hi); }
.g .skip { background: var(--gold); color: var(--outline); }
.g .logo, .g .nav a { color: var(--ink); }
.g .nav a { font-weight: 600; }
.g .nav .lang { border-color: rgb(255 255 255 / .22); background: rgb(255 255 255 / .06); }

/* Jelly buttons, like the game's: glossy, with a dark outline. */
.g .btn {
  --face: var(--pink); --edge: var(--outline);
  border: 3px solid var(--outline);
  background: linear-gradient(180deg, rgb(255 255 255 / .32), transparent 55%), var(--face);
  color: #fff; font: 400 1.05rem/1 var(--title); letter-spacing: .02em;
  text-shadow: 0 2px 0 rgb(20 11 44 / .45);
}
.g .btn:hover { color: #fff; }
.g .btn--ghost { --face: var(--grape); }

/* Hero: the feature graphic, alive. Rays turn behind the knight, coins float, the gold adds up. */
.g-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 7.5rem 0 3.5rem;
  border-bottom: 3px solid var(--outline);
  background: #271d56;
}
.g-hero__inner { position: relative; z-index: 1; display: grid; gap: 1rem; align-items: center; justify-items: center; text-align: center; }
.g-logo {
  font: 400 clamp(4.2rem, 16vw, 9rem)/.95 var(--title);
  color: var(--gold);
  background: linear-gradient(180deg, #ffe680 20%, #ffb21f 85%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: .09em var(--outline); paint-order: stroke fill;
  filter: drop-shadow(0 .07em 0 var(--outline));
  letter-spacing: .01em;
  transform-origin: 50% 100%;
  animation: logo-drop .9s var(--spring) .1s both;
}
@keyframes logo-drop { from { opacity: 0; translate: 0 -3rem; scale: 1.2 .8; } 30% { opacity: 1; } }
.g-lead { margin-top: .5rem; font-size: clamp(1.15rem, 2.4vw, 1.45rem); font-weight: 500; max-width: 34rem; text-wrap: balance; }
.g-hero .cta { justify-content: center; margin-top: .8rem; }
.g-note { margin-top: 1.1rem; font-size: .95rem; color: var(--ink-soft); font-weight: 500; }
.g-hero__inner > div > :not(.g-logo) { animation: settle .7s var(--out) .45s both; }
.g-hero .cta { animation-delay: .55s; }
.g-hero .g-note { animation-delay: .65s; }

.g-knight {
  padding: 0; border: 0; background: none; cursor: pointer; border-radius: 1rem;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
/* The rays are centred on the knight's grid cell, so they start behind him at every width. The hero clips them. */
.g-hero__inner::before {
  content: ""; position: absolute; grid-area: 2 / 1; inset: -150vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle, rgb(255 228 160 / .55), rgb(255 189 54 / .14) 14rem, transparent 26rem),
    radial-gradient(circle, transparent 24vmax, rgb(14 8 36 / .6) 80vmax),
    repeating-conic-gradient(from var(--spin), #271d56 0 9deg, #43305a 9deg 18deg);
  animation: rays 8s linear infinite;
}
.g-knight img {
  width: min(64vw, 19rem); transform-origin: 50% 100%;
  filter: drop-shadow(0 18px 14px rgb(10 5 30 / .5));
  animation: knight-in .9s var(--spring) .35s both, jelly 2.6s ease-in-out 1.3s infinite;
}
.g-knight.is-poked img { animation: poke .7s var(--out), jelly 2.6s ease-in-out .7s infinite; }
@keyframes knight-in { from { opacity: 0; translate: 0 2rem; scale: .7 1.3; } 50% { opacity: 1; } }
@keyframes poke { 15% { scale: 1.18 .8; } 35% { scale: .88 1.14; } 55% { scale: 1.06 .95; } 75% { scale: .98 1.02; } }

.g-coins { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.g-coin { pointer-events: auto; cursor: pointer; animation: coin-in .5s var(--spring) both, coin-bob 3.4s ease-in-out var(--delay, 0s) infinite; }
.g-coin:hover { filter: drop-shadow(0 6px 6px rgb(10 5 30 / .45)) brightness(1.15); }
.g-coin.is-collected { pointer-events: none; animation: collect .7s var(--out) forwards; }
@keyframes coin-in { from { opacity: 0; scale: 0; } }
@keyframes collect { to { opacity: 0; translate: 0 -5rem; rotate: y 540deg; scale: 1.3; } }
.g-coin:nth-child(1) { --x: 6%; --y: 64%; --s: 2.6rem; }
.g-coin:nth-child(2) { --x: 82%; --y: 62%; --s: 2.2rem; --delay: -1.1s; }
.g-coin:nth-child(3) { --x: 12%; --y: 86%; --s: 3rem; --delay: -2s; }
.g-coin:nth-child(4) { --x: 84%; --y: 84%; --s: 2.8rem; --delay: -.5s; }
.g-coin:nth-child(5) { --x: 1%; --y: 76%; --s: 1.8rem; --delay: -2.7s; }
.g-coin:nth-child(6) { --x: 92%; --y: 73%; --s: 1.9rem; --delay: -1.6s; }
.g-gold {
  position: absolute; z-index: 2; top: 5.3rem; right: var(--gutter);
  display: flex; align-items: center; gap: .45rem; padding: .25rem 1rem .25rem .3rem;
  background: rgb(20 11 44 / .75); border: 2px solid #4a3a8a; border-radius: 999px;
  font: 400 1.25rem/1 var(--title); color: #fff; letter-spacing: .02em;
  opacity: 0; scale: .5; transition: opacity .3s ease, scale .5s var(--spring);
}
.g-gold img { width: 1.9rem; height: 1.9rem; }
.g-gold.is-shown { opacity: 1; scale: 1; }
.g-gold.is-bump b { animation: pop .35s var(--spring); }

/* Sections */
.g-section { padding-block: clamp(4rem, 9vw, 7rem); }
.g-section + .g-section { padding-top: 0; }
/* Section titles are the game's pink pills. */
.g-h2 {
  display: inline-block; margin-bottom: 1.4rem; padding: .18em .8em .24em;
  font: 400 clamp(1.7rem, 4.6vw, 2.6rem)/1.1 var(--title); letter-spacing: .01em; color: #fff;
  background: linear-gradient(180deg, var(--pink-hi), var(--pink) 60%);
  border: 3px solid var(--outline); border-radius: .9em;
  box-shadow: inset 0 3px 0 rgb(255 255 255 / .3), 0 5px 0 var(--outline);
  -webkit-text-stroke: .07em var(--outline); paint-order: stroke fill;
  text-shadow: 0 .06em 0 var(--outline);
  text-wrap: balance;
}
.g-intro { font-size: 1.15rem; max-width: 40rem; color: var(--ink-soft); }

.g-story { display: grid; gap: 2rem; align-items: center; }
.g-story__text { display: grid; gap: 1rem; justify-items: start; font-size: 1.12rem; max-width: 36rem; }
.g-story__cast { display: flex; justify-content: center; align-items: flex-end; gap: clamp(1rem, 5vw, 3rem); }
.g-story__cast figure { display: grid; justify-items: center; gap: .6rem; }
.g-story__cast img {
  height: clamp(9rem, 22vw, 13rem); width: auto; transform-origin: 50% 100%;
  filter: drop-shadow(0 12px 10px rgb(10 5 30 / .45));
  transition: transform .5s var(--spring);
}
.g-story__cast figure:first-child img { animation: fly 3.6s ease-in-out infinite; }
.g-story__cast figure:hover img { transform: rotate(-4deg) scale(1.05); }
.g-story__cast figcaption { font-weight: 600; font-size: .95rem; color: var(--ink-soft); }
@keyframes fly { 50% { translate: 0 -10px; rotate: -2deg; } }

/* Lands: sour (washed out, lemony) until you tap them sweet. */
.lands {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(15rem, 1fr); gap: 1rem;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: .5rem .25rem 1.25rem; margin-top: 1.4rem; list-style: none;
  view-timeline-name: --lands;
}
.land {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 11; padding: 0; overflow: hidden;
  border: 3px solid var(--outline); border-radius: 1.25rem; cursor: pointer;
  background: var(--plum); scroll-snap-align: start;
  box-shadow: 0 6px 0 var(--outline);
  transition: transform .08s ease, box-shadow .08s ease;
  font: inherit; color: inherit; text-align: left;
}
.land:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--outline); }
.land:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--outline); }
.land__bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.45) sepia(.4) hue-rotate(28deg) brightness(.85);
  transition: filter .7s ease;
}
.land[aria-pressed="true"] .land__bg { filter: none; }
.land__boss {
  position: absolute; left: 50%; bottom: 2.9rem; height: 62%; width: auto; max-width: 92%; object-fit: contain; translate: -50% 0;
  filter: drop-shadow(0 6px 4px rgb(0 0 0 / .3));
  transition: opacity .25s ease, scale .45s cubic-bezier(.34, 1.8, .5, 1);
}
.land__boss--sweet { opacity: 0; scale: .7; }
.land[aria-pressed="true"] .land__boss--sour { opacity: 0; scale: .7; }
.land[aria-pressed="true"] .land__boss--sweet { opacity: 1; scale: 1; }
.land__name {
  position: absolute; inset: auto 0 0; display: grid; padding: .5rem .8rem .55rem;
  background: rgb(42 21 64 / .92); border-top: 3px solid var(--outline);
  font-size: .85rem; line-height: 1.25; color: var(--ink-soft);
}
.land__name b { font: 400 1.1rem/1.1 var(--title); color: #fff; letter-spacing: .01em; }
/* Sweetened: a burst of sprinkles. */
.land::after {
  content: ""; position: absolute; left: 50%; top: 42%; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; opacity: 0;
  box-shadow: -58px -34px 0 #ff6eaa, 52px -46px 0 #ffe27a, -36px 30px 0 #7fd3ff, 64px 18px 0 #9bd41f, -8px -62px 0 #fff,
    12px 44px 0 #ff9ccb, -70px 4px 0 #ffe27a, 40px -10px 0 #7fd3ff, -24px -48px 0 #9bd41f, 30px 52px 0 #ff6eaa;
}
.land.is-pop::after { animation: sprinkles .8s var(--out); }
@keyframes sprinkles { from { opacity: 1; scale: .2; } 70% { opacity: 1; } to { opacity: 0; scale: 1.7; } }
.lands-count {
  display: inline-block; margin-top: 1.2rem; padding: .35rem 1rem;
  border: 2px solid #4a3a8a; border-radius: 999px; background: rgb(20 11 44 / .6);
  color: var(--ink-soft); font-weight: 600;
  transition: background .3s ease, border-color .3s ease;
}
.lands-count b { font: 400 1.3rem/1 var(--title); color: var(--gold); }
.lands-count.is-done { border-color: var(--gold); background: rgb(255 189 54 / .16); animation: pop .5s var(--spring); }
.lands-hint { margin-top: .4rem; font-size: .95rem; color: var(--ink-soft); }

.g-features { display: grid; gap: 1rem; margin-top: 1rem; list-style: none; padding: 0; }
.g-features li {
  display: grid; gap: .35rem; align-content: start; padding: 1.2rem 1.3rem;
  background: linear-gradient(180deg, var(--plum-hi), var(--plum) 45%);
  border: 3px solid var(--outline); border-radius: 1.25rem;
  box-shadow: inset 0 2px 0 rgb(255 255 255 / .12), 0 5px 0 var(--outline);
  transition: transform .4s var(--spring);
}
.g-features li:hover { transform: translateY(-4px) rotate(-.6deg); }
.g-features h3 { font: 400 1.35rem/1.1 var(--title); color: var(--gold); letter-spacing: .01em; }
.g-features p { color: var(--ink-soft); }

.g-shots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(11rem, 14rem); gap: 1.2rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .5rem .25rem 1.25rem; margin-top: 1rem; list-style: none; }
.g-shots li { scroll-snap-align: start; }
.g-shots img {
  width: 100%; height: auto; border-radius: 1.4rem; border: 5px solid var(--outline);
  box-shadow: 0 14px 30px rgb(5 2 20 / .45); background: var(--outline);
  transition: transform .5s var(--spring);
}
.g-shots li:hover img { transform: translateY(-6px) rotate(-1deg); }

.g-info { display: grid; gap: 2rem; }
.g-app { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-items: center; justify-content: start; }
.g-app img { grid-row: span 2; width: 4.5rem; height: 4.5rem; border-radius: 1.1rem; border: 3px solid var(--outline); box-shadow: 0 5px 0 var(--outline); }
.g-app b { align-self: end; font: 400 1.4rem/1.1 var(--title); color: #fff; letter-spacing: .01em; }
.g-app span { align-self: start; color: var(--ink-soft); }
.g-info dl { display: grid; grid-template-columns: max-content 1fr; gap: .6rem 1.5rem; font-size: 1.05rem; }
.g-info dt { color: var(--ink-soft); }
.g-info dd { font-weight: 600; }
.g-info .cta { margin-top: 0; }

/* Footer */
.g .foot { background: var(--berry-deep); color: var(--ink-soft); border-top: 3px solid var(--outline); }
.g .foot a { color: #fff; }

/* Long documents: a paper sheet on the blueberry sky */
.g .doc { background: radial-gradient(60rem 30rem at 50% 0%, #34246e, transparent 70%), var(--berry); }
.g .doc .sheet {
  background: #fff; color: #2b1660; border: 3px solid var(--outline); border-radius: 1.5rem;
  box-shadow: 0 8px 0 var(--outline); padding: clamp(1.4rem, 5vw, 3rem);
  font: 400 1.0625rem/1.65 var(--text);
}
.g .sheet a { color: #b0185f; }
.g .sheet a:hover { color: #3a1b6b; }
.g .sheet :focus-visible { outline-color: #3a1b6b; }
.g .doc h1 { font: 400 clamp(2rem, 6vw, 2.9rem)/1.05 var(--title); color: #3a1b6b; letter-spacing: .005em; }
.g .doc h2 { font: 600 1.25rem/1.3 var(--round); color: #3a1b6b; }
.g .doc p, .g .doc li { color: #3b2f63; }
.g .doc hr { border-top-color: #d6cdf0; }
.g .doc .switch a { border-color: #d6cdf0; color: #3a1b6b; }
.g .doc .meta { color: #5a4a8a; }

@media (min-width: 720px) {
  .g-hero { padding-bottom: 4rem; }
  .g-hero__inner { grid-template-columns: 1.2fr .8fr; text-align: left; justify-items: start; }
  .g-hero__inner::before { grid-area: 1 / 2; }
  .g-hero .cta { justify-content: flex-start; }
  .g-knight { justify-self: center; }
  .g-knight img { width: min(100%, 20rem); }
  .g-coin:nth-child(1) { --x: 56%; --y: 22%; --s: 3rem; }
  .g-coin:nth-child(2) { --x: 90%; --y: 16%; --s: 2.2rem; }
  .g-coin:nth-child(3) { --x: 93%; --y: 58%; --s: 3.2rem; }
  .g-coin:nth-child(4) { --x: 57%; --y: 78%; --s: 2.5rem; }
  .g-coin:nth-child(5) { --x: 73%; --y: 10%; --s: 1.8rem; }
  .g-coin:nth-child(6) { --x: 95%; --y: 86%; --s: 2rem; }
  .g-story { grid-template-columns: 1.1fr .9fr; }
  .g-features { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
  .g-info { grid-template-columns: 1fr auto; align-items: start; }
  .g-app { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .lands { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); overflow: visible; }
  .g-shots { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; }
}

/* Scroll-driven entrances, jelly style: things pop in. Sideways scrollers lend their own timeline. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .g-h2, .g-features li, .g-story__cast figure, .g-app, .lands-count {
      animation: pop-in linear both; animation-timeline: view(); animation-range: entry 0% entry 90%;
    }
    .g-story__text > p, .g-intro, .g-info dl, .g-info .cta, .lands-hint {
      animation: settle linear both; animation-timeline: view(); animation-range: entry 0% entry 80%;
    }
    .lands li { animation: pop-in linear both; animation-timeline: --lands; animation-range: entry 5% entry 60%; }
    .lands li:nth-child(5n + 2) { animation-range: entry 10% entry 65%; }
    .lands li:nth-child(5n + 3) { animation-range: entry 15% entry 70%; }
    .lands li:nth-child(5n + 4) { animation-range: entry 20% entry 75%; }
    .lands li:nth-child(5n) { animation-range: entry 25% entry 80%; }
  }
  @supports (animation-timeline: view()) {
    @media (max-width: 1099px) {
      /* The screenshot in the middle of the strip comes forward. */
      .g-shots li { animation: shot-focus linear both; animation-timeline: view(inline); }
    }
    @media (min-width: 1100px) {
      .g-shots li { animation: pop-in linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
    }
  }
}
@keyframes shot-focus { 0%, 100% { opacity: .6; scale: .9; } 30%, 70% { opacity: 1; scale: 1; } }

/* Fase 108: pagine legali in nove lingue, «In breve» in testa e indice */
.g .doc .switch { flex-wrap: wrap; }
.g .doc .switch a[aria-current] { background: #3a1b6b; border-color: #3a1b6b; color: #fff; }
.g .doc .brief { background: #fff4d6; border: 2px solid var(--gold); border-radius: 1rem; padding: .2rem 1.2rem 1.1rem; margin-top: 1.4rem; }
.g .doc .brief h2 { margin-top: 1rem; }
.g .doc .toc { margin-top: 1.4rem; font-size: .95rem; }
.g .doc .toc ol { margin-top: .4rem; }
.g .doc section { scroll-margin-top: 5rem; }
