/* Niceplay Games — site styles
   One continuous canvas: the page background flows from white into each game's world
   (gallery blue, card-table green, night-pitch violet) and back. Everything is centred;
   each game is a full-height stage with one centrepiece that moves with the scroll. */

@font-face {
  font-family: "Bricolage";
  src: url("/assets/fonts/bricolage-latin.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  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: "Bricolage";
  src: url("/assets/fonts/bricolage-latin-ext.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  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;
}

@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --paper: #ffffff;
  --ink: #1d1c1a;
  --muted: #64615b;
  --line: #e6e3de;
  --wash: #f4f3f1;

  --v-wall: #1b2f4f;
  --v-paper: #efe6d2;
  --v-gilt: #b99963;

  --c-felt: #0e3a29;
  --c-felt-light: #1d6a4a;
  --c-gold: #e8c46a;

  --b-night: #14112a;
  --b-violet: #8f7dff;
  --b-lime: #d6f64a;
  --b-cyan: #62e2e4;

  --accent: var(--ink);
  --wrap: 78rem;
  --gutter: clamp(1.25rem, 4.5vw, 3rem);
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: light;
  font-family: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 100%;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 1.0625rem; background: var(--paper); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus, #3b6cff); outline-offset: 3px; border-radius: 4px; }
::selection { background: #ffe58a; color: #1d1c1a; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: .5rem; }
.skip:focus { top: 1rem; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* Film grain over the whole page: gives the dark worlds a printed, tactile surface. */
.grain { position: fixed; inset: -50%; z-index: 40; pointer-events: none; background: url("/assets/img/grain.png"); opacity: .07; mix-blend-mode: soft-light; }

/* ---------- Navigation: a floating glass capsule ---------- */
.nav { position: fixed; top: max(.8rem, env(safe-area-inset-top)); left: 0; right: 0; z-index: 45; display: flex; justify-content: center; padding-inline: .8rem; pointer-events: none; }
.nav-bar {
  pointer-events: auto;
  width: min(100%, 54rem);
  display: flex; align-items: center; gap: .3rem;
  padding: .38rem .4rem .38rem .45rem;
  border-radius: 999px;
  background: rgb(255 255 255 / .72);
  color: var(--ink);
  border: 1px solid rgb(0 0 0 / .07);
  box-shadow: 0 .6rem 2.2rem rgb(0 0 0 / .08);
  -webkit-backdrop-filter: saturate(1.7) blur(20px);
  backdrop-filter: saturate(1.7) blur(20px);
  transition: background-color .5s ease, color .5s ease, border-color .5s ease, box-shadow .5s ease, transform .7s var(--ease), opacity .7s ease;
}
.nav[data-tone="dark"] .nav-bar { background: rgb(26 23 40 / .5); color: #f4f2ff; border-color: rgb(255 255 255 / .13); box-shadow: 0 .6rem 2.4rem rgb(0 0 0 / .35); }
.js:not(.reduce) .nav.intro .nav-bar { opacity: 0; transform: translateY(-140%) scale(.9); }
.brand { display: flex; align-items: center; gap: .55rem; padding: .15rem .7rem .15rem .15rem; text-decoration: none; margin-right: auto; }
.brand-mark { width: 2.15rem; height: 2.15rem; flex: none; transition: transform .6s var(--ease); }
.brand-mark rect { fill: #1d1c1a; }
.brand-mark path { fill: #fff; }
.brand-mark circle { fill: var(--b-lime); }
.nav[data-tone="dark"] .brand-mark rect { fill: #fff; }
.nav[data-tone="dark"] .brand-mark path { fill: #1d1c1a; }
.brand:hover .brand-mark { transform: rotate(-10deg) scale(1.06); }
.brand-word { font-weight: 760; font-stretch: 78%; font-size: 1.4rem; letter-spacing: -.02em; line-height: 1; }
.nav-links { position: relative; display: flex; align-items: center; gap: .1rem; }
.nav-links a { position: relative; z-index: 1; display: flex; align-items: center; gap: .45rem; padding: .5rem .85rem; border-radius: 999px; text-decoration: none; font-size: .95rem; white-space: nowrap; }
.nav-links a img { width: 1.35rem; height: 1.35rem; border-radius: 23%; }
.nav-pill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: 999px; background: rgb(127 127 127 / .16); opacity: 0; transition: left .45s var(--ease), width .45s var(--ease), opacity .3s; }
.nav-lang { margin-left: .2rem; display: grid; place-items: center; min-width: 2.6rem; height: 2.4rem; padding-inline: .7rem; border-radius: 999px; font-size: .85rem; font-weight: 650; letter-spacing: .02em; text-decoration: none; background: currentColor; }
.nav-lang { color: inherit; }
.nav-lang, .nav-lang:visited { background: var(--ink); color: #fff; }
.nav[data-tone="dark"] .nav-lang { background: #fff; color: #1d1c1a; }
.nav-lang:hover { transform: scale(1.05); }
.nav-lang { transition: transform .3s var(--ease), background-color .5s, color .5s; }
.nav-toggle { display: none; align-items: center; gap: .6rem; height: 2.5rem; padding: 0 .75rem 0 1rem; border: 0; border-radius: 999px; font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; background: var(--ink); color: #fff; transition: background-color .5s, color .5s; }
.nav[data-tone="dark"] .nav-toggle { background: #fff; color: #1d1c1a; }
.nav-toggle i { position: relative; width: 1rem; height: 10px; }
.nav-toggle i::before, .nav-toggle i::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: currentColor; transition: transform .45s var(--ease), top .45s var(--ease); }
.nav-toggle i::before { top: 0; }
.nav-toggle i::after { top: 8px; }
.nav-toggle .t-close { display: none; }
.menu-open .nav-toggle i::before { top: 4px; transform: rotate(45deg); }
.menu-open .nav-toggle i::after { top: 4px; transform: rotate(-45deg); }
.menu-open .nav-toggle .t-open { display: none; }
.menu-open .nav-toggle .t-close { display: inline; }

/* Full-screen menu (small screens) */
.menu {
  position: fixed; inset: 0; z-index: 44;
  display: grid; align-content: center; gap: 2.2rem;
  padding: 7rem var(--gutter) 3rem;
  background: #0e0c16; color: #f4f2ff;
  clip-path: circle(0% at calc(100% - 3rem) 2.6rem);
  transition: clip-path .75s cubic-bezier(.7, 0, .2, 1);
  overflow-y: auto;
}
.menu.open { clip-path: circle(150% at calc(100% - 3rem) 2.6rem); }
.menu-games { display: grid; gap: 1.1rem; }
.m-game { display: flex; align-items: center; gap: 1rem; text-decoration: none; font-size: clamp(1.9rem, 8.5vw, 3.2rem); font-weight: 720; font-stretch: 80%; letter-spacing: -.03em; line-height: 1.02; }
.m-game img { width: 1.05em; height: 1.05em; border-radius: 23%; flex: none; box-shadow: 0 .4rem 1.2rem rgb(0 0 0 / .4); }
.menu-meta { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; font-size: 1.1rem; }
.menu-meta a { text-decoration: none; opacity: .8; }
.menu-mail { font-size: 1rem; opacity: .6; text-decoration: none; }
.m-item { opacity: 0; transform: translateY(28px); transition: opacity .5s ease, transform .8s var(--ease); }
.menu.open .m-item { opacity: 1; transform: none; transition-delay: calc(.28s + var(--i) * 70ms); }
.menu-open { overflow: hidden; }

/* old header class still used by nothing; keep link underline styles */
.doclinks a, .index nav a, .site-foot nav a, .mail {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size .45s var(--ease), opacity .2s, color .2s;
}
.doclinks a:hover, .index nav a:hover, .site-foot nav a:hover { background-size: 100% 2px; }

/* ---------- Hero: the studio's stage ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; align-content: center;
  text-align: center;
  padding-block: clamp(6.5rem, 12vh, 8rem) clamp(4.5rem, 9vh, 6rem);
  background: #0e0c16; color: #f4f2ff;
  overflow: hidden;
  --focus: var(--b-lime);
}
.hero .wrap { position: relative; width: 100%; }
.glow { position: absolute; inset: 0; pointer-events: none; }
.glow span { position: absolute; width: 52vmax; aspect-ratio: 1; border-radius: 50%; filter: blur(70px); opacity: .5; animation: breathe 10s ease-in-out infinite alternate; }
.glow span:nth-child(1) { background: #2b4f8f; left: -14vmax; top: 30%; }
.glow span:nth-child(2) { background: #1c7a50; left: 50%; top: 52%; translate: -50% 0; width: 44vmax; opacity: .42; animation-delay: -3s; }
.glow span:nth-child(3) { background: #5d47e8; right: -14vmax; top: 26%; animation-delay: -6s; }
@keyframes breathe { from { transform: scale(.9) translate(0, 0); } to { transform: scale(1.08) translate(2vmax, -2vmax); } }

.mega {
  margin: 0; display: flex; justify-content: center;
  font-size: clamp(5.2rem, min(14.5vw, 25vh), 15rem);
  line-height: .82; font-weight: 790; font-stretch: 76%; letter-spacing: -.035em;
  color: #fbfaff;
}
.mega .l { display: inline-block; transform-origin: 50% 100%; }
.mega .li { position: relative; }
.tittle { position: absolute; left: 50%; top: .015em; width: .19em; height: .19em; translate: -50% 0; transform-origin: 50% 100%; }
.tittle svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 .06em rgb(214 246 74 / .55)); }
.tittle circle { fill: #fff; stroke: var(--b-lime); stroke-width: 2.2; }
.tittle path { fill: #1d1c1a; }
.js:not(.reduce) .mega .l { animation: drop 1.15s both; animation-delay: calc(.2s + var(--i) * 70ms); }
.js:not(.reduce) .tittle { animation: balldrop 1.5s both 1s, hop 5s ease-in-out 3.4s infinite; }
@keyframes drop {
  0% { transform: translateY(-1.15em); opacity: 0; animation-timing-function: cubic-bezier(.55, 0, 1, .55); }
  14% { opacity: 1; }
  44% { transform: translateY(0) scale(1.1, .84); animation-timing-function: cubic-bezier(0, .45, .45, 1); }
  62% { transform: translateY(-.13em) scale(.97, 1.04); animation-timing-function: cubic-bezier(.55, 0, 1, .55); }
  78% { transform: translateY(0) scale(1.04, .95); animation-timing-function: cubic-bezier(0, .45, .45, 1); }
  89% { transform: translateY(-.025em); animation-timing-function: cubic-bezier(.55, 0, 1, .55); }
  100% { transform: none; opacity: 1; }
}
@keyframes balldrop {
  0% { transform: translateY(-5em) rotate(-200deg); opacity: 0; animation-timing-function: cubic-bezier(.55, 0, 1, .55); }
  10% { opacity: 1; }
  40% { transform: translateY(0) scale(1.25, .75) rotate(0deg); animation-timing-function: cubic-bezier(0, .45, .45, 1); }
  58% { transform: translateY(-1.6em) rotate(120deg); animation-timing-function: cubic-bezier(.55, 0, 1, .55); }
  74% { transform: translateY(0) scale(1.15, .85) rotate(200deg); animation-timing-function: cubic-bezier(0, .45, .45, 1); }
  86% { transform: translateY(-.45em) rotate(250deg); animation-timing-function: cubic-bezier(.55, 0, 1, .55); }
  96% { transform: translateY(0) scale(1.05, .95) rotate(270deg); }
  100% { transform: rotate(270deg); opacity: 1; }
}
@keyframes hop {
  0%, 82%, 100% { translate: -50% 0; }
  88% { translate: -50% -.9em; }
  94% { translate: -50% 0; }
}
.hero .sub { margin: clamp(1.2rem, 3vh, 2rem) auto 0; max-width: 52ch; font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: rgb(244 242 255 / .72); text-wrap: balance; }
.js:not(.reduce) .hero .sub { opacity: 0; animation: fadeup 1s var(--ease) 1.35s forwards; }

/* The deck: one card per game, dealt onto the table */
.deck { display: flex; justify-content: center; align-items: flex-end; margin: clamp(2.2rem, 6vh, 3.75rem) auto 0; perspective: 1400px; }
.tile {
  --rot: 0deg; --y: 0px;
  position: relative; flex: none;
  width: clamp(8.5rem, min(19vw, 27vh), 16rem);
  aspect-ratio: 4 / 5;
  margin-inline: clamp(-1rem, -.8vw, -.4rem);
  border-radius: 1.5rem;
  overflow: hidden;
  color: #fff; text-decoration: none;
  background: #1a1726;
  box-shadow: 0 1.6rem 3.4rem rgb(0 0 0 / .5), inset 0 0 0 1px rgb(255 255 255 / .12);
  transform: translateY(var(--y)) rotate(var(--rot)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .7s var(--ease), box-shadow .7s var(--ease);
  isolation: isolate;
}
.tile.v { --rot: -8deg; --y: 22px; }
.tile.c { --rot: 0deg; --y: 0px; z-index: 2; }
.tile.b { --rot: 8deg; --y: 22px; }
.tile:hover, .tile:focus-visible { --rot: 0deg; --y: -18px; z-index: 3; box-shadow: 0 2.4rem 4.4rem rgb(0 0 0 / .6), inset 0 0 0 1px rgb(255 255 255 / .2); }
.tile.tilting { transition: transform .15s linear, box-shadow .7s var(--ease); }
.tile-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); z-index: -1; }
.tile.v .tile-art { object-position: 30% 50%; }
.tile.c .tile-art { object-position: 50% 8%; }
.tile.b .tile-art { object-position: 50% 50%; }
.tile:hover .tile-art { transform: scale(1.08); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 38%, rgb(8 7 14 / .82)); z-index: -1; }
.tile-glare { position: absolute; inset: 0; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgb(255 255 255 / .35), transparent 55%); opacity: 0; transition: opacity .4s; mix-blend-mode: overlay; pointer-events: none; }
.tile:hover .tile-glare { opacity: 1; }
.tile-info { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(.8rem, 1.4vw, 1.15rem); display: grid; justify-items: start; gap: .15rem; text-align: left; }
.tile.b .tile-info { justify-items: end; text-align: right; }
.tile-icon { width: clamp(2rem, 3vw, 2.6rem); height: auto; aspect-ratio: 1; border-radius: 23%; margin-bottom: .5rem; box-shadow: 0 .3rem .9rem rgb(0 0 0 / .45); }
.tile-name { font-weight: 700; font-stretch: 84%; font-size: clamp(.95rem, 1.55vw, 1.35rem); letter-spacing: -.01em; line-height: 1.1; }
.tile-tag { font-size: clamp(.75rem, 1vw, .88rem); opacity: .75; line-height: 1.3; }
.js:not(.reduce) .tile { opacity: 0; }
.js:not(.reduce) .tile.dealt { opacity: 1; }

.cue { position: absolute; left: 50%; bottom: clamp(1.1rem, 3vh, 2rem); translate: -50% 0; display: grid; justify-items: center; gap: .55rem; font-size: .8rem; color: rgb(244 242 255 / .6); text-decoration: none; letter-spacing: .02em; }
.cue i { display: block; width: 1px; height: 2.6rem; background: rgb(255 255 255 / .16); position: relative; overflow: hidden; }
.cue i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: #fff; animation: drip 2.2s var(--ease) infinite; }
@keyframes drip { to { top: 100%; } }
.js:not(.reduce) .cue { opacity: 0; animation: fadeup 1s var(--ease) 2.2s forwards; }

/* Word reveal: game titles and the footer mark */
.w { display: inline-block; clip-path: inset(-.25em -.3em -.22em -.3em); }
.w > span { display: inline-block; }
@keyframes rise { to { transform: none; } }
@keyframes appear { to { opacity: 1; } }
@keyframes fadeup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Game stages ---------- */
.game {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  text-align: center;
  padding-block: clamp(6rem, 13vw, 10rem);
  overflow: hidden;
  --e: 1;
}
.vernisa { background: var(--v-wall); color: var(--v-paper); --focus: var(--v-paper); }
.cards { background: var(--c-felt); color: #f3efe2; --focus: var(--c-gold); }
.ballball { background: var(--b-night); color: #f1efff; --focus: var(--b-lime); }
.motion .hero, .motion .game, .motion .contact, .motion .home-foot { background: transparent; }

.game::before { content: ""; position: absolute; inset: 0; pointer-events: none; }
.vernisa::before { background: radial-gradient(42% 46% at 50% 58%, rgba(255, 236, 200, .13), transparent 70%); }
.cards::before { background: radial-gradient(55% 50% at 50% 62%, rgba(46, 140, 96, .5), transparent 72%); }
.ballball::before { background: radial-gradient(50% 45% at 50% 70%, rgba(143, 125, 255, .2), transparent 70%); }

.game .wrap { position: relative; width: 100%; }
.game-head { display: grid; justify-items: center; }
.game-icon { width: 5rem; height: 5rem; border-radius: 23%; box-shadow: 0 .8rem 2rem rgba(0, 0, 0, .35); margin-bottom: 1.75rem; }
.game h2 {
  margin: 0;
  font-size: clamp(2.8rem, 8.2vw, 7.6rem);
  line-height: .96;
  font-weight: 720;
  font-stretch: 78%;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.game .lede { margin: 1.4rem auto 0; max-width: 30ch; font-size: clamp(1.2rem, 2vw, 1.6rem); line-height: 1.35; opacity: .9; text-wrap: balance; }
.motion .game h2 .w > span { transition: transform 1.1s var(--ease); transition-delay: calc(var(--i) * 70ms); }
.motion .game:not(.in) h2 .w > span { transform: translateY(110%); }
.motion .game .lede, .motion .game .game-icon { transition: opacity 1s ease .35s, transform 1s var(--ease) .35s; }
.motion .game .game-icon { transition-delay: 0s; }
.motion .game:not(.in) .lede, .motion .game:not(.in) .game-icon { opacity: 0; transform: translateY(18px); }

.stage { margin: clamp(3rem, 7vw, 5.5rem) auto 0; position: relative; }

.features { list-style: none; margin: clamp(3rem, 6vw, 4.5rem) auto 0; padding: 0; max-width: 62rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem clamp(1.5rem, 4vw, 3.5rem); }
.features li { display: grid; gap: .3rem; padding-top: 1.1rem; border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.features strong { font-size: clamp(1.15rem, 1.6vw, 1.35rem); font-weight: 650; font-stretch: 88%; letter-spacing: -.01em; }
.features span { font-size: .97rem; opacity: .72; text-wrap: balance; }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.store {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: .65rem;
  padding: .7rem 1.35rem .7rem 1.05rem;
  border-radius: 999px;
  text-decoration: none; line-height: 1.1; font-weight: 600; text-align: left;
  transition: transform .3s var(--ease), box-shadow .3s;
}
.store::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .5) 50%, transparent 70%); transform: translateX(-130%); transition: transform .8s var(--ease); pointer-events: none; }
.store:hover { transform: translateY(-2px); box-shadow: 0 .7rem 1.6rem rgba(0, 0, 0, .28); }
.store:hover::after { transform: translateX(130%); }
.store svg { width: 1.4rem; height: 1.4rem; flex: none; }
.store small { display: block; font-size: .72rem; font-weight: 450; opacity: .8; }
.store.soon { opacity: .72; cursor: default; }
.store.soon:hover { transform: none; box-shadow: none; }
.store.soon::after { display: none; }
.vernisa .store { background: var(--v-paper); color: #172a46; }
.cards .store { background: var(--c-gold); color: #10301f; }
.ballball .store { background: var(--b-lime); color: #17181a; }

.doclinks { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.75rem; margin-top: 1.6rem; font-size: .98rem; }
.doclinks a { opacity: .8; }
.doclinks a:hover { opacity: 1; }

/* Vernisa: a painting hung on a gallery wall, assembled from jigsaw pieces */
.vernisa .stage { max-width: 54rem; transform: translateY(calc((1 - var(--e)) * 70px)) scale(calc(.9 + var(--e) * .1)); }
.frame {
  padding: clamp(.9rem, 2.4vw, 1.8rem);
  background: var(--v-paper);
  border: clamp(.6rem, 1.4vw, 1.05rem) solid var(--v-gilt);
  border-image: linear-gradient(135deg, #d8bd84, #8d6c39 35%, #d1b071 55%, #7b5a2a 80%, #caa766) 1;
  box-shadow: 0 2.6rem 5rem rgba(5, 12, 26, .55), 0 .5rem 1.2rem rgba(5, 12, 26, .35);
}
.frame img { width: 100%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.pz { position: relative; }
.pz canvas { position: absolute; left: -30%; top: -30%; width: 160%; height: 160%; pointer-events: none; z-index: 2; transition: opacity .9s ease; }
.pz canvas.fade { opacity: 0; }
.motion:not(.reduce) .vernisa .pz img { opacity: 0; transition: opacity .4s ease; }
.motion:not(.reduce) .vernisa .artwork.done .pz img { opacity: 1; }
.label {
  position: absolute; right: clamp(-1rem, -2vw, 0rem); bottom: clamp(-2.4rem, -3vw, -1.6rem);
  max-width: 17rem; text-align: left;
  background: #f8f4ea; color: #2a2a26;
  padding: .75rem 1rem; font-size: .82rem; line-height: 1.4;
  box-shadow: 0 .5rem 1.5rem rgba(5, 12, 26, .35);
  transition: opacity .7s ease .1s, transform .8s var(--ease) .1s;
}
.label strong { display: block; font-weight: 650; }
.label span { display: block; color: #5d5a52; }
.motion .vernisa .artwork:not(.done) .label { opacity: 0; transform: translateY(16px); }

/* Cards: three phones fanned out like a hand of cards; the fan opens with the scroll */
.cards .stage { max-width: 50rem; height: clamp(26rem, 58vw, 40rem); }
.phone {
  position: absolute; left: 50%; top: 0;
  width: clamp(10rem, 24vw, 17.5rem);
  translate: -50% 0;
  border-radius: clamp(1.6rem, 3vw, 2.5rem);
  border: clamp(.3rem, .6vw, .45rem) solid #0b0b0b;
  background: #0b0b0b;
  overflow: hidden;
  box-shadow: 0 2rem 4rem rgba(0, 0, 0, .5);
  transform-origin: 50% 120%;
  transition: transform .6s var(--ease);
}
.phone img { width: 100%; }
.phone.mid { z-index: 2; transform: translateY(calc((1 - var(--e)) * 30px)); }
.phone.l { transform: translateX(calc(var(--e) * -58%)) rotate(calc(var(--e) * -11deg)) translateY(6%); }
.phone.r { transform: translateX(calc(var(--e) * 58%)) rotate(calc(var(--e) * 11deg)) translateY(6%); }
@media (hover: hover) {
  .cards .stage:hover .phone.l { transform: translateX(calc(var(--e) * -66%)) rotate(calc(var(--e) * -15deg)) translateY(6%); }
  .cards .stage:hover .phone.r { transform: translateX(calc(var(--e) * 66%)) rotate(calc(var(--e) * 15deg)) translateY(6%); }
  .cards .stage:hover .phone.mid { transform: translateY(-14px); }
}

/* Ballball: the match screen rises like a stadium screen; pitch lines behind */
.ballball::after { content: ""; position: absolute; left: 50%; top: 58%; width: min(48rem, 95vw); aspect-ratio: 1; translate: -50% -50%; border: 2px solid rgba(255, 255, 255, .06); border-radius: 50%; pointer-events: none; scale: calc(.6 + var(--e) * .4); }
.pitchline { position: absolute; left: 0; right: 0; top: 58%; height: 2px; background: rgba(255, 255, 255, .06); pointer-events: none; }
.ballball .stage { max-width: 70rem; perspective: 1600px; }
.screen {
  margin: 0; padding: 3px; border-radius: 1.6rem;
  background: conic-gradient(from var(--spin), var(--b-cyan), var(--b-violet), #3b2f8f, var(--b-violet), var(--b-cyan));
  animation: spin 9s linear infinite;
  box-shadow: 0 2.5rem 6rem rgba(0, 0, 0, .6), 0 0 7rem rgba(143, 125, 255, .2);
  transform-origin: 50% 100%;
  transform: rotateX(calc((1 - var(--e)) * 34deg)) scale(calc(.86 + var(--e) * .14));
}
.screen img { border-radius: calc(1.6rem - 3px); width: 100%; }
@keyframes spin { to { --spin: 360deg; } }
.swoosh { display: block; width: min(100%, 24rem); height: auto; margin: 1.1rem auto 0; overflow: visible; }
.swoosh .trail { fill: none; stroke: url(#swg); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 420; stroke-dashoffset: 0; filter: drop-shadow(0 0 6px rgba(214, 246, 74, .55)); transition: stroke-dashoffset 1s cubic-bezier(.6, 0, .2, 1) .35s; }
.motion .ballball:not(.in) .swoosh .trail { stroke-dashoffset: 420; }
.swoosh .ball circle { fill: #fff; }
.swoosh .ball path { fill: #17181a; }
.motion .swoosh .ball:not(.go) { opacity: 0; }

/* ---------- Contact ---------- */
.contact { padding-block: clamp(6rem, 13vw, 10rem) clamp(4rem, 8vw, 6rem); text-align: center; background: var(--paper); }
.contact h2 { margin: 0 auto; max-width: 14em; font-size: clamp(2.4rem, 6vw, 5rem); line-height: 1; font-weight: 700; font-stretch: 80%; letter-spacing: -.03em; text-wrap: balance; }
.contact p { margin: 1.3rem auto 0; color: var(--muted); max-width: 46ch; text-wrap: balance; }
.mail { display: inline-block; margin-top: 2rem; font-size: clamp(1.6rem, 4.4vw, 3.2rem); font-weight: 620; font-stretch: 86%; letter-spacing: -.02em; background-size: 100% 2px; }
.mail:hover { background-size: 0 2px; background-position: 100% 100%; }
.index { list-style: none; margin: clamp(3.5rem, 7vw, 5rem) auto 0; padding: 0; max-width: 62rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 2rem; }
.index li { display: grid; justify-items: center; align-content: start; gap: .55rem; }
.index img { width: 3.5rem; height: 3.5rem; border-radius: 23%; box-shadow: 0 .4rem 1rem rgba(0, 0, 0, .15); margin-bottom: .3rem; transition: transform .4s var(--ease); }
.index li:hover img { transform: translateY(-3px) rotate(-5deg); }
.index strong { font-weight: 650; }
.index nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem 1rem; font-size: .93rem; color: var(--muted); }
.index nav a:hover { color: var(--ink); }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding-block: 2rem 2.5rem; font-size: .92rem; color: var(--muted); background: var(--paper); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; }
.site-foot p { margin: 0; }
.home-foot { border-top: 0; padding-top: 0; overflow: hidden; }
.home-foot .wrap { justify-content: center; text-align: center; flex-direction: column; align-items: center; }
.bigmark {
  display: block; text-align: center; color: var(--ink);
  font-size: clamp(5rem, 24vw, 22rem); line-height: .82;
  font-weight: 780; font-stretch: 78%; letter-spacing: -.025em;
  margin: 0 0 clamp(1.5rem, 3vw, 2.5rem); user-select: none;
}
.bigmark .w { clip-path: inset(-.1em -.05em -.3em -.05em); }
.motion .bigmark .w > span { transition: transform 1.2s var(--ease); transition-delay: calc(var(--i) * 45ms); }
.motion .bigmark:not(.in) .w > span { transform: translateY(135%); }

/* ---------- Document pages (support, privacy, terms…) ---------- */
.doc-head { color: #fff; --focus: #fff; text-align: center; padding-top: 5.2rem; }
.doc-head.v { background: var(--v-wall); }
.doc-head.c { background: radial-gradient(120% 140% at 50% 0%, var(--c-felt-light), var(--c-felt) 70%); }
.doc-head.b { background: var(--b-night); }
.doc-head.s { background: var(--wash); color: var(--ink); --focus: #3b6cff; }
.doc-game { display: grid; justify-items: center; gap: .9rem; padding-block: 1.5rem 1rem; }
.doc-game img { width: 4.5rem; height: 4.5rem; border-radius: 23%; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.doc-game .name { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; font-stretch: 80%; letter-spacing: -.025em; line-height: 1.05; }
.doc-game .name small { display: block; margin-top: .3rem; font-size: 1rem; font-weight: 400; font-stretch: 100%; letter-spacing: 0; opacity: .75; }
.tabs { display: flex; justify-content: safe center; gap: .25rem 1.75rem; overflow-x: auto; scrollbar-width: none; font-size: 1rem; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; text-decoration: none; padding: .8rem 0 .9rem; border-bottom: 3px solid transparent; opacity: .8; transition: opacity .2s; }
.tabs a:hover { opacity: 1; }
.tabs a[aria-current="page"] { opacity: 1; border-bottom-color: currentColor; font-weight: 600; }
.doc-head.v .tabs a[aria-current="page"] { border-bottom-color: var(--v-gilt); }
.doc-head.c .tabs a[aria-current="page"] { border-bottom-color: var(--c-gold); }
.doc-head.b .tabs a[aria-current="page"] { border-bottom-color: var(--b-lime); }

.doc { max-width: 46rem; margin-inline: auto; padding: clamp(2.5rem, 6vw, 4rem) var(--gutter) clamp(3rem, 7vw, 5rem); }
.doc.v { --accent: #1f3557; }
.doc.c { --accent: #0f5a3c; }
.doc.b { --accent: #4b3cc4; }
.doc > h1 { margin: 0; text-align: center; font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.05; font-weight: 700; font-stretch: 82%; letter-spacing: -.025em; text-wrap: balance; }
.doc > .meta { text-align: center; }
.doc .meta { margin: .6rem 0 0; color: var(--muted); font-size: .95rem; }
.doc .langs { display: flex; justify-content: center; gap: .5rem; margin: 1.25rem 0 2rem; font-size: .92rem; }
.doc .langs a { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .85rem; transition: border-color .2s; }
.doc .langs a:hover { border-color: var(--ink); }
.doc h2 { margin: 2.4rem 0 .5rem; font-size: 1.35rem; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; color: var(--accent); }
.doc h3 { margin: 1.8rem 0 .35rem; font-size: 1.1rem; line-height: 1.3; font-weight: 650; }
.doc p, .doc li { max-width: 68ch; }
.doc ul, .doc ol { padding-left: 1.3rem; }
.doc li { margin-block: .35rem; }
.doc a { color: var(--accent); }
.doc .box, .doc .card { background: var(--wash); border-left: 3px solid var(--accent); padding: 1rem 1.2rem; margin-block: 1.4rem; border-radius: 0 .5rem .5rem 0; }
.doc .box p:first-child, .doc .card p:first-child { margin-top: 0; }
.doc .box p:last-child, .doc .card p:last-child { margin-bottom: 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: .95rem; margin-block: 1rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: .6rem .5rem; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 650; }
.doc .scroll { overflow-x: auto; }
.doc .lead { font-size: 1.2rem; line-height: 1.5; }
.doc .shot { margin: 2rem 0; }
.doc .shot img { border-radius: 1rem; box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .18); margin-inline: auto; }
.doc .shot.tall img { max-width: 19rem; border-radius: 2rem; border: .4rem solid #0c0c0c; }
.doc .actions { justify-content: flex-start; margin-top: 1.5rem; }
.doc .actions .store { background: var(--ink); color: #fff; }
.translation { margin-top: 4rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.translation > .tr-title { margin-top: 0; text-align: center; font-size: clamp(1.8rem, 3.5vw, 2.4rem); color: var(--ink); font-weight: 700; font-stretch: 82%; letter-spacing: -.02em; }
.translation > .meta { text-align: center; }
.translation [id] { scroll-margin-top: 1rem; }
.mailbox { display: grid; gap: .25rem; background: var(--wash); padding: 1.25rem 1.4rem; border-radius: .75rem; margin-block: 1.5rem; }
.mailbox a { font-size: 1.35rem; font-weight: 600; }

.notfound { min-height: 70vh; padding-top: 6rem; display: grid; place-content: center; text-align: center; padding: 3rem var(--gutter); }
.notfound h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); margin: 0; font-weight: 700; font-stretch: 82%; letter-spacing: -.03em; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .features, .index { grid-template-columns: minmax(0, 1fr); max-width: 24rem; }
  .label { position: relative; right: auto; bottom: auto; margin: -1.2rem 0 0 auto; width: fit-content; }
  .game { min-height: 0; }
  .mega { font-size: 25vw; }
  .tile { width: 34vw; margin-inline: -3vw; border-radius: 1.1rem; }
  .tile-tag { display: none; }
  .tile-icon { margin-bottom: .35rem; }
}
@media (max-width: 900px) {
  .nav-links, .nav-lang { display: none; }
  .nav-toggle { display: inline-flex; }
}
@media (min-width: 901px) {
  .menu { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
