/* Geist Pixel (Vercel, licenza OFL: assets/fonts/OFL.txt), ospitato qui: nessuna richiesta a Google. */
@font-face {
  font-family: "Geist Pixel";
  src: url("/assets/fonts/GeistPixel-Square.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* OlympiCat – landing page. Palette PICO-8 come nel gioco. */
:root {
  --ink: #0b3f73; /* blu scuro al posto del nero pieno */
  --dark-blue: #1d2b53;
  --purple: #7e2553;
  --dark-green: #008751;
  --brown: #ab5236;
  --dark-gray: #5f574f;
  --light-gray: #c2c3c7;
  --white: #fff1e8;
  --red: #ff004d;
  --orange: #ffa300;
  --yellow: #ffec27;
  --green: #00e436;
  --blue: #29adff;
  --indigo: #83769c;
  --pixel: "Geist Pixel", ui-monospace, monospace;
  --body: "Geist Pixel", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--blue);
  color: var(--dark-blue);
  font-family: var(--body);
  font-size: 20px;
  line-height: 1.4;
}
img { image-rendering: pixelated; image-rendering: crisp-edges; max-width: 100%; }
a { color: var(--dark-blue); }

/* Barra in alto */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: var(--blue);
  border-bottom: 4px solid var(--ink);
}
.brand { text-transform: uppercase; display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--pixel); font-size: 20px; }
.brand img { height: 44px; width: auto; margin: -4px 0; }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar nav a { color: var(--dark-blue); text-decoration: none; font-family: var(--pixel); font-size: 18px; text-transform: uppercase; }
.topbar nav a:hover { color: var(--white); }
.lang {
  font-family: var(--pixel); font-size: 16px; color: var(--white);
  background: var(--dark-gray); border: 3px solid var(--ink); padding: 6px 8px; cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(11,63,115,.3), inset 0 3px 0 rgba(255,255,255,.2);
}

/* Hero: come la splash dell'app */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--blue);
  text-align: center;
  padding: 56px 0 0;
}
.stars::before, .stars::after {
  content: ""; position: absolute; width: 6px; height: 6px; background: var(--white);
  box-shadow: 40px 60px var(--white), 20vw 30px var(--white), 70vw 90px var(--white), 85vw 40px var(--white),
              55vw 20px var(--white), 10vw 160px var(--white), 90vw 180px var(--white);
  opacity: .7;
}
.stars::after { top: 120px; left: 30vw; animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.logo { width: min(520px, 88vw); height: auto; display: block; margin: 0 auto; }
.tagline { font-family: var(--pixel); font-size: clamp(22px, 4vw, 34px); margin: 28px 0 8px; color: var(--white); text-shadow: 3px 3px 0 var(--dark-blue); }
.sub { font-size: 24px; max-width: 620px; margin: 0 auto 28px; color: var(--dark-blue); }
.store {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  padding: 10px 22px; background: var(--ink); color: var(--white); text-decoration: none;
  border: 4px solid var(--white); box-shadow: 6px 6px 0 var(--dark-blue);
}
.store-small { font-size: 18px; }
.store-big { font-family: var(--pixel); font-size: 24px; }
.store[aria-disabled="true"] { cursor: default; }
/* 4° salto: il pulsante si illumina di giallo (due pulsazioni con ease). */
.store.glow { animation: store-glow 1.8s ease-in-out; }
@keyframes store-glow {
  0%, 100% { border-color: var(--white); color: var(--white); box-shadow: 6px 6px 0 var(--dark-blue); }
  20%, 60% { border-color: var(--yellow); color: var(--yellow); box-shadow: 6px 6px 0 var(--dark-blue), 0 0 0 4px var(--yellow), 0 0 28px 6px rgba(255, 236, 39, .85); }
  40%, 80% { border-color: var(--white); color: var(--white); box-shadow: 6px 6px 0 var(--dark-blue), 0 0 12px 2px rgba(255, 236, 39, .5); }
}
.track {
  position: relative; height: 150px; margin-top: 72px;
  background: linear-gradient(var(--green) 0 16px, var(--dark-green) 16px 100%);
}
.track::before { /* pista */
  content: ""; position: absolute; left: 0; right: 0; top: 38px; height: 8px;
  background: repeating-linear-gradient(90deg, var(--white) 0 32px, transparent 32px 64px);
  opacity: .6;
}
.hero { cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.hero a { cursor: default; }
.runner {
  position: absolute; bottom: 118px; left: -200px; width: 168px;
  animation: run 7s linear infinite;
}
.runner img { display: block; width: 100%; }
.runner img.jumping { animation: hop .55s cubic-bezier(.2, .7, .4, 1); }
@keyframes hop { 50% { transform: translateY(-110px); } }
.jumps { position: absolute; right: 16px; top: 60px; display: flex; gap: 8px; }
.jumps i { width: 16px; height: 16px; border: 3px solid var(--ink); background: var(--dark-green); }
.jumps i.on { background: var(--yellow); }
.jump-hint { position: absolute; left: 0; right: 0; bottom: 14px; margin: 0; font-size: 19px; color: var(--white); text-shadow: 2px 2px 0 var(--ink); }
@keyframes run { to { transform: translateX(calc(100vw + 400px)); } }

/* Sezioni */
.section { padding: 64px 16px; max-width: 1100px; margin: 0 auto; text-align: center; }
.section.alt { max-width: none; background: #5cc3ff; border-top: 4px solid var(--ink); border-bottom: 4px solid var(--ink); }
.section.alt > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
h2 { font-family: var(--pixel); font-size: clamp(26px, 4.5vw, 40px); color: var(--white); margin: 0 0 16px; text-shadow: 3px 3px 0 var(--ink); }
h3 { font-family: var(--pixel); font-size: 20px; color: var(--ink); margin: 16px 0 8px; line-height: 1.5; }
.lead { font-size: 24px; max-width: 720px; margin: 0 auto 32px; color: var(--dark-blue); }

/* Griglia giochi: pulsanti come nel menu dell'app */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; text-align: left; }
.game {
  position: relative;
  border: 4px solid var(--ink);
  background: var(--c, var(--indigo));
  padding: 14px 14px 12px;
  box-shadow: inset 0 -4px 0 rgba(11,63,115,.3), inset 0 4px 0 rgba(255,255,255,.25), 4px 4px 0 var(--ink);
  min-height: 118px;
  /* Le card fuori schermo non vengono disegnate: scroll molto più leggero con 19 card e immagini. */
  content-visibility: auto;
  contain-intrinsic-size: 260px 320px;
}
.game img {
  display: block; width: calc(100% + 28px); max-width: none; height: auto; aspect-ratio: 96 / 60;
  margin: -14px -14px 12px; border-bottom: 4px solid var(--ink);
}
.game h3 { margin: 0 0 8px; font-size: 18px; color: var(--white); text-shadow: 2px 2px 0 var(--ink); }
.game p { margin: 0; font-size: 18px; color: var(--white); text-shadow: 1px 1px 0 rgba(11,63,115,.6); }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; text-align: left; display: grid; gap: 12px; }
.faq details { background: var(--white); border: 4px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.faq summary { cursor: pointer; padding: 14px 16px; font-family: var(--pixel); font-size: 19px; line-height: 1.4; color: var(--ink); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "▶ "; color: var(--red); }
.faq details[open] summary::before { content: "▼ "; }
.faq p { margin: 0; padding: 0 16px 16px; color: var(--dark-blue); }

/* Caratteristiche */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.feature img { height: 110px; width: auto; }
.feature img.wide { height: 64px; margin-top: 46px; } /* gatto che dorme: più piccolo, stessa linea di base */
.feature p { margin: 0; color: var(--dark-blue); }

.busts { overflow: hidden; padding-bottom: 8px; }
.busts-track { display: flex; width: max-content; animation: busts-scroll 28s linear infinite; }
.busts:hover .busts-track, .busts:active .busts-track { animation-play-state: paused; }
.busts img { flex: none; max-width: none; height: 112px; width: auto; margin-right: 12px; }
@keyframes busts-scroll { to { transform: translateX(-50%); } }
@media (max-width: 700px) { .busts img { height: 84px; margin-right: 9px; } }
@media (prefers-reduced-motion: reduce) {
  .busts { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .busts-track { animation: none; }
}

.button {
  display: inline-block; font-family: var(--pixel); font-size: 20px; color: var(--white); text-decoration: none;
  background: var(--purple); border: 4px solid var(--ink); padding: 14px 18px;
  box-shadow: inset 0 -4px 0 rgba(11,63,115,.3), inset 0 4px 0 rgba(255,255,255,.25), 4px 4px 0 var(--ink);
}
.button:hover { background: var(--red); }
.button { color: var(--white); }

.footer { text-align: center; padding: 40px 16px 56px; border-top: 4px solid var(--ink); }
.footer p { margin: 8px 0 0; }
.footer .small { color: var(--dark-blue); opacity: .7; }

/* Pagina privacy */
.page { max-width: 760px; margin: 0 auto; padding: 48px 16px 64px; }
.page h1 { font-family: var(--pixel); font-size: clamp(28px, 5vw, 40px); color: var(--white); text-shadow: 3px 3px 0 var(--ink); }
.page h2 { font-size: 24px; text-align: left; margin-top: 32px; }
.page p, .page li { color: var(--dark-blue); }

@media (max-width: 520px) {
  body { font-size: 18px; }
  .topbar nav { gap: 10px; }
  .topbar nav a { font-size: 15px; }
  .brand { font-size: 16px; }
  .runner { width: 120px; bottom: 124px; }
  .jump-hint { font-size: 17px; padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .runner, .stars::after { animation: none; }
  .runner { left: 12%; }
}

/* Menu hamburger su mobile */
.burger { display: none; }
@media (max-width: 700px) {
  .burger {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 40px; padding: 0 9px; cursor: pointer;
    background: var(--dark-gray); border: 3px solid var(--ink);
    box-shadow: inset 0 -3px 0 rgba(11,63,115,.3), inset 0 3px 0 rgba(255,255,255,.2);
  }
  .burger span { display: block; height: 4px; background: var(--white); }
  .topbar.open .burger span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
  .topbar.open .burger span:nth-child(2) { opacity: 0; }
  .topbar.open .burger span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
  .topbar nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 4px 16px 16px; background: var(--blue); border-bottom: 4px solid var(--ink);
  }
  .topbar.open nav { display: flex; }
  .topbar nav a { font-size: 22px; padding: 14px 4px; border-bottom: 2px solid rgba(11,63,115,.15); }
  .topbar nav .lang { align-self: flex-start; margin-top: 14px; font-size: 18px; padding: 8px 12px; }
}

/* Scheda "in breve" */
/* In breve: tre numeri grandi e le schede dei dettagli (due colonne). */
.stats { list-style: none; max-width: 760px; margin: 0 auto 18px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats li { background: var(--ink); padding: 14px 8px 12px; text-align: center; display: grid; gap: 2px; }
.stats b { font-family: var(--pixel); font-size: clamp(34px, 8vw, 54px); line-height: 1; color: var(--yellow); }
.stats span { color: var(--white); font-size: 18px; }
.facts { max-width: 760px; margin: 0 auto; text-align: left; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.facts div { display: grid; gap: 4px; align-content: start; padding: 12px 14px; background: rgba(11,63,115,.22);
}
.facts div:nth-child(1), .facts div:last-child { grid-column: 1 / -1; }
.facts dt { font-family: var(--pixel); color: var(--yellow); text-transform: none; font-size: 18px; }
.facts dd { margin: 0; color: var(--white); }
@media (max-width: 600px) { .facts { grid-template-columns: 1fr; } .facts div:nth-child(n) { grid-column: auto; } .stats span { font-size: 16px; } }

/* Scritta OLYMPICAT (SVG) accanto al gatto */
.brand .wordmark { height: 24px; width: auto; margin: 0; }
@media (max-width: 520px) { .brand .wordmark { height: 18px; } }

/* Hero: sole, nuvole, api e alberi (dietro ai testi) */
.scenery { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.scenery img { image-rendering: pixelated; }
.sun { position: absolute; top: 22px; right: 6%; width: 68px; height: auto; }
.cloud { position: absolute; left: 0; height: auto; animation: drift linear infinite; opacity: .95; }
.c1 { top: 70px; width: 80px; animation-duration: 75s; animation-delay: -22s; }
.c2 { top: 150px; width: 120px; animation-duration: 115s; animation-delay: -70s; }
.c3 { top: 290px; width: 64px; animation-duration: 95s; animation-delay: -40s; opacity: .8; }
@keyframes drift { from { transform: translateX(-160px); } to { transform: translateX(calc(100vw + 40px)); } }
.bee { position: absolute; width: 32px; animation: fly 11s ease-in-out infinite; }
.bee img { display: block; width: 100%; height: auto; animation: bob .45s ease-in-out infinite alternate; }
.b1 { left: 10%; bottom: 250px; }
.b2 { left: 62%; top: 118px; animation-duration: 14s; animation-delay: -5s; }
.b3 { right: 12%; bottom: 300px; animation-duration: 9s; animation-delay: -3s; }
@keyframes fly {
  0% { transform: translate(0, 0) scaleX(1); }
  22% { transform: translate(70px, -22px) scaleX(1); }
  45% { transform: translate(150px, 8px) scaleX(1); }
  50% { transform: translate(150px, 8px) scaleX(-1); }
  72% { transform: translate(70px, -18px) scaleX(-1); }
  95% { transform: translate(0, 0) scaleX(-1); }
  100% { transform: translate(0, 0) scaleX(1); }
}
@keyframes bob { to { transform: translateY(5px); } }
.tree { position: absolute; bottom: calc(100% - 22px); height: auto; pointer-events: none; }
.t1 { left: 3%; }
.t2 { left: 15%; width: 44px; }
.t3 { right: 4%; }
@media (max-width: 520px) {
  .track { margin-top: 64px; }
  .sun { width: 51px; top: 14px; right: 4%; }
  .cloud { transform-origin: left; }
  .c2 { top: 130px; width: 90px; }
  .c3 { display: none; }
  .tree { width: 48px; }
  .t2 { display: none; }
  .b1 { left: 6%; bottom: 230px; }
  .b3 { right: 8%; bottom: 270px; }
  .b2 { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cloud, .bee, .bee img { animation: none; }
  .c1 { left: 6%; } .c2 { left: 55%; } .c3 { left: 30%; }
}

/* Angoli smussati a gradini grossi (3 gradini da 4px), come i box del gioco.
   Cornice: border-image SVG a 9 parti; lo sfondo si ferma al bordo, così gli angoli restano tagliati.
   L'ombra segue la forma a gradini con drop-shadow (box-shadow resterebbe rettangolare). */
:root {
  --frame: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='7' height='7' viewBox='0 0 7 7' shape-rendering='crispEdges' fill='%230b3f73'><rect x='3' y='0' width='1' height='1'/><rect x='3' y='6' width='1' height='1'/><rect x='0' y='3' width='1' height='1'/><rect x='6' y='3' width='1' height='1'/><rect x='2' y='0' width='1' height='1'/><rect x='1' y='1' width='1' height='1'/><rect x='0' y='2' width='1' height='1'/><rect x='4' y='0' width='1' height='1'/><rect x='5' y='1' width='1' height='1'/><rect x='6' y='2' width='1' height='1'/><rect x='0' y='4' width='1' height='1'/><rect x='1' y='5' width='1' height='1'/><rect x='2' y='6' width='1' height='1'/><rect x='6' y='4' width='1' height='1'/><rect x='5' y='5' width='1' height='1'/><rect x='4' y='6' width='1' height='1'/></svg>");
  --frame-white: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='7' height='7' viewBox='0 0 7 7' shape-rendering='crispEdges' fill='%23ffffff'><rect x='3' y='0' width='1' height='1'/><rect x='3' y='6' width='1' height='1'/><rect x='0' y='3' width='1' height='1'/><rect x='6' y='3' width='1' height='1'/><rect x='2' y='0' width='1' height='1'/><rect x='1' y='1' width='1' height='1'/><rect x='0' y='2' width='1' height='1'/><rect x='4' y='0' width='1' height='1'/><rect x='5' y='1' width='1' height='1'/><rect x='6' y='2' width='1' height='1'/><rect x='0' y='4' width='1' height='1'/><rect x='1' y='5' width='1' height='1'/><rect x='2' y='6' width='1' height='1'/><rect x='6' y='4' width='1' height='1'/><rect x='5' y='5' width='1' height='1'/><rect x='4' y='6' width='1' height='1'/></svg>");
  --frame-yellow: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='7' height='7' viewBox='0 0 7 7' shape-rendering='crispEdges' fill='%23ffec27'><rect x='3' y='0' width='1' height='1'/><rect x='3' y='6' width='1' height='1'/><rect x='0' y='3' width='1' height='1'/><rect x='6' y='3' width='1' height='1'/><rect x='2' y='0' width='1' height='1'/><rect x='1' y='1' width='1' height='1'/><rect x='0' y='2' width='1' height='1'/><rect x='4' y='0' width='1' height='1'/><rect x='5' y='1' width='1' height='1'/><rect x='6' y='2' width='1' height='1'/><rect x='0' y='4' width='1' height='1'/><rect x='1' y='5' width='1' height='1'/><rect x='2' y='6' width='1' height='1'/><rect x='6' y='4' width='1' height='1'/><rect x='5' y='5' width='1' height='1'/><rect x='4' y='6' width='1' height='1'/></svg>");
}
.game, .faq details, .button, .store {
  border-image: var(--frame) 3 / 12px stretch;
  background-clip: padding-box;
}
.store { border-image-source: var(--frame-white); }
.button:hover { background-clip: padding-box; }
.faq details { box-shadow: none; filter: drop-shadow(4px 4px 0 var(--ink)); }
.button { box-shadow: inset 0 -4px 0 rgba(11,63,115,.3), inset 0 4px 0 rgba(255,255,255,.25); filter: drop-shadow(4px 4px 0 var(--ink)); }
.store { box-shadow: none; filter: drop-shadow(6px 6px 0 var(--dark-blue)); }
@keyframes store-glow {
  0%, 100% { border-image-source: var(--frame-white); color: var(--white); filter: drop-shadow(6px 6px 0 var(--dark-blue)); }
  20%, 60% { border-image-source: var(--frame-yellow); color: var(--yellow); filter: drop-shadow(6px 6px 0 var(--dark-blue)) drop-shadow(0 0 14px rgba(255, 236, 39, .85)); }
  40%, 80% { border-image-source: var(--frame-white); color: var(--white); filter: drop-shadow(6px 6px 0 var(--dark-blue)) drop-shadow(0 0 6px rgba(255, 236, 39, .5)); }
}
/* Card dei giochi: la cornice sta sopra l'immagine (::after), altrimenti l'immagine coprirebbe gli angoli. */
.game {
  border: 4px solid transparent; border-image: none;
  box-shadow: inset 0 -4px 0 rgba(11,63,115,.3), inset 0 4px 0 rgba(255,255,255,.25);
  filter: drop-shadow(4px 4px 0 var(--ink));
}
.game::after {
  content: ""; position: absolute; inset: -4px; z-index: 2; pointer-events: none;
  border: 4px solid transparent; border-image: var(--frame) 3 / 12px stretch;
}
/* Riquadri senza bordo: stessa forma ritagliata. */
.stats li, .facts div {
  clip-path: polygon(0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0,
    calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px));
}

/* Giochi: gruppo gratis e gruppo app completa, con etichetta su ogni card. */
.games-group { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 8px 0 18px; font-size: 20px; color: var(--dark-blue); }
.games + .games-group { margin-top: 44px; }
.tag, .badge { font-family: var(--pixel); text-transform: uppercase; line-height: 1; }
.tag { font-size: 16px; padding: 6px 10px; clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)); }
.tag-free, .badge-free { background: var(--yellow); color: var(--ink); }
.tag-full, .badge-full { background: var(--purple); color: var(--white); }
.badge { position: absolute; top: 12px; left: 12px; z-index: 3; font-size: 13px; padding: 4px 6px; box-shadow: 2px 2px 0 var(--ink); }
.games[data-group="free"] { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } /* 6 gratis: 3x2 su desktop */

/* Giochi dell'app completa: lucchetto pixel (come nell'app) nell'etichetta FULL. */
.badge-full { display: inline-flex; align-items: center; gap: 5px; }
.badge-full::before { content: ""; width: 14px; height: 16px; background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='7' height='8' viewBox='0 0 7 8' shape-rendering='crispEdges'><rect x='2' y='0' width='1' height='1' fill='%23000'/><rect x='3' y='0' width='1' height='1' fill='%23000'/><rect x='4' y='0' width='1' height='1' fill='%23000'/><rect x='1' y='1' width='1' height='1' fill='%23000'/><rect x='5' y='1' width='1' height='1' fill='%23000'/><rect x='1' y='2' width='1' height='1' fill='%23000'/><rect x='5' y='2' width='1' height='1' fill='%23000'/><rect x='0' y='3' width='1' height='1' fill='%23000'/><rect x='1' y='3' width='1' height='1' fill='%23000'/><rect x='2' y='3' width='1' height='1' fill='%23000'/><rect x='3' y='3' width='1' height='1' fill='%23000'/><rect x='4' y='3' width='1' height='1' fill='%23000'/><rect x='5' y='3' width='1' height='1' fill='%23000'/><rect x='6' y='3' width='1' height='1' fill='%23000'/><rect x='0' y='4' width='1' height='1' fill='%23000'/><rect x='1' y='4' width='1' height='1' fill='%23ffec27'/><rect x='2' y='4' width='1' height='1' fill='%23ffec27'/><rect x='3' y='4' width='1' height='1' fill='%23ffec27'/><rect x='4' y='4' width='1' height='1' fill='%23ffec27'/><rect x='5' y='4' width='1' height='1' fill='%23ffec27'/><rect x='6' y='4' width='1' height='1' fill='%23000'/><rect x='0' y='5' width='1' height='1' fill='%23000'/><rect x='1' y='5' width='1' height='1' fill='%23ffec27'/><rect x='2' y='5' width='1' height='1' fill='%23ffec27'/><rect x='3' y='5' width='1' height='1' fill='%23000'/><rect x='4' y='5' width='1' height='1' fill='%23ffec27'/><rect x='5' y='5' width='1' height='1' fill='%23ffec27'/><rect x='6' y='5' width='1' height='1' fill='%23000'/><rect x='0' y='6' width='1' height='1' fill='%23000'/><rect x='1' y='6' width='1' height='1' fill='%23ffec27'/><rect x='2' y='6' width='1' height='1' fill='%23ffec27'/><rect x='3' y='6' width='1' height='1' fill='%23000'/><rect x='4' y='6' width='1' height='1' fill='%23ffec27'/><rect x='5' y='6' width='1' height='1' fill='%23ffec27'/><rect x='6' y='6' width='1' height='1' fill='%23000'/><rect x='0' y='7' width='1' height='1' fill='%23000'/><rect x='1' y='7' width='1' height='1' fill='%23000'/><rect x='2' y='7' width='1' height='1' fill='%23000'/><rect x='3' y='7' width='1' height='1' fill='%23000'/><rect x='4' y='7' width='1' height='1' fill='%23000'/><rect x='5' y='7' width='1' height='1' fill='%23000'/><rect x='6' y='7' width='1' height='1' fill='%23000'/></svg>") center / contain no-repeat; image-rendering: pixelated; }

/* Selettore della lingua (IT/EN): ogni lingua è una pagina a sé, il select ci naviga. */
.lang {
  appearance: none; -webkit-appearance: none; border-radius: 0;
  padding-right: 26px;
  background: var(--dark-gray) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='5' height='3' viewBox='0 0 5 3' shape-rendering='crispEdges'%3E%3Cpath fill='%23fff1e8' d='M0 0h5v1H4v1H3v1H2V2H1V1H0z'/%3E%3C/svg%3E") no-repeat right 8px center / 10px 6px;
}
.lang:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.lang option { color: var(--ink); background: #fff; font-family: system-ui, sans-serif; }
@media (max-width: 700px) { .topbar nav .lang { padding-right: 30px; } }

/* Card animate: la striscia di fotogrammi scorre a scatti solo quando la card è attiva (.playing: hover con il mouse,
   fascia centrale dello schermo su telefono); fermo, si vede il primo fotogramma. */
.game .anim {
  display: block; position: relative; overflow: hidden;
  width: calc(100% + 28px); aspect-ratio: 96 / 60; margin: -14px -14px 12px; border-bottom: 4px solid var(--ink);
}
.game .anim img {
  display: block; width: calc(100% * var(--n)); max-width: none; height: 100%; margin: 0; border: 0;
  aspect-ratio: auto; image-rendering: pixelated;
}
.game.playing .anim img { animation: anim-strip var(--ms) steps(var(--n)) infinite; }
@keyframes anim-strip { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .game.playing .anim img { animation: none; } }

/* Pulsante SCARICA sempre visibile: la barra in alto è fissa (sticky), il pulsante sta nella barra, anche su mobile
   (accanto al menu hamburger). Senza link App Store porta alla hero e accende il pulsante "Presto su App Store". */
.dl {
  order: 2; flex: none; font-family: var(--pixel); font-size: 17px; line-height: 1; text-transform: uppercase; text-decoration: none;
  color: var(--ink); background: var(--yellow); padding: 9px 14px;
  box-shadow: inset 0 -3px 0 rgba(11,63,115,.25), inset 0 3px 0 rgba(255,255,255,.45), 3px 3px 0 var(--ink);
  clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
}
.dl:hover { background: var(--white); }
.dl:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.topbar nav { order: 1; }
@media (max-width: 700px) {
  .dl { order: 0; margin-left: auto; font-size: 15px; padding: 8px 11px; }
  .topbar { gap: 8px; }
}
@media (max-width: 380px) { .dl { padding: 8px 8px; } .brand .wordmark { height: 15px; } }

/* ===================== Proposta B: più accogliente ===================== */
/* Hero a due colonne su desktop: testo e pulsanti a sinistra, un piccolo portatile grigio a destra che mostra a
   rotazione i giochi animati. Su telefono si impila (portatile sotto il testo). */
.hero { background: linear-gradient(#29adff 0%, #4cbcff 55%, #7fd0ff 100%); padding-top: 40px; }
.hero-inner {
  position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 0 16px;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; text-align: left;
}
.hero-copy .logo { width: min(420px, 80vw); margin: 0; image-rendering: pixelated; }
.hero-copy .tagline { margin: 18px 0 8px; }
.hero-copy .sub { margin: 0 0 22px; max-width: 520px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: stretch; gap: 14px; }
/* "Presto su App Store" e "Guarda i 20 giochi" alti uguali */
.hero-cta > .store, .hero-cta > .button { box-sizing: border-box; height: 68px; display: inline-flex; flex-direction: column; justify-content: center; }
.hero-cta > .button { padding-top: 0; padding-bottom: 0; }
.button.ghost { background: var(--white); color: var(--ink); }
.button.ghost:hover { background: var(--yellow); }
.perks { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.perks li { font-family: var(--pixel); font-size: 16px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.perks li::before { content: ""; width: 10px; height: 10px; background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); }

/* Piccolo portatile grigio in orizzontale, grande quanto il video del gioco (tra un telefono e un Game Boy):
   croce a sinistra, A/B a destra, schermo con il gioco animato e il nome sotto. */
.hero-phone { display: flex; justify-content: center; }
.handheld {
  --step: 8px;
  width: min(470px, 92vw); display: grid; grid-template-columns: 58px 1fr 58px; align-items: center; gap: 10px;
  padding: 14px 12px; background: #cfcac0;
  box-shadow: inset -5px -5px 0 #aaa498, inset 5px 5px 0 #ece8e0;
  clip-path: polygon(0 calc(var(--step) * 2), var(--step) calc(var(--step) * 2), var(--step) var(--step), calc(var(--step) * 2) var(--step), calc(var(--step) * 2) 0,
    calc(100% - var(--step) * 2) 0, calc(100% - var(--step) * 2) var(--step), calc(100% - var(--step)) var(--step), calc(100% - var(--step)) calc(var(--step) * 2), 100% calc(var(--step) * 2),
    100% calc(100% - var(--step) * 2), calc(100% - var(--step)) calc(100% - var(--step) * 2), calc(100% - var(--step)) calc(100% - var(--step)), calc(100% - var(--step) * 2) calc(100% - var(--step)), calc(100% - var(--step) * 2) 100%,
    calc(var(--step) * 2) 100%, calc(var(--step) * 2) calc(100% - var(--step)), var(--step) calc(100% - var(--step)), var(--step) calc(100% - var(--step) * 2), 0 calc(100% - var(--step) * 2));
  filter: drop-shadow(8px 8px 0 rgba(11,63,115,.55));
  animation: float 5s ease-in-out infinite;
}
.hh-screen { background: #2e2a44; padding: 8px 8px 6px; box-shadow: inset 0 0 0 3px #1e1a30; }
.hh-screen .anim { position: relative; overflow: hidden; aspect-ratio: 96 / 60; }
.hh-screen .anim img { display: block; height: 100%; width: calc(100% * var(--n, 12)); max-width: none; image-rendering: pixelated;
  animation: anim-strip var(--ms, 1200ms) steps(var(--n, 12)) infinite; }
.hh-screen .anim.swap { animation: screen-blink .25s steps(2); }
@keyframes screen-blink { 50% { filter: brightness(2.2); } }
.hh-label { margin: 6px 0 0; text-align: center; font-family: var(--pixel); font-size: 14px; color: var(--yellow); letter-spacing: 1px; }
.hh-side { position: relative; height: 70px; }
.hh-dpad { position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; transform: translate(-50%, -50%);
  background: linear-gradient(#3a3550 0 0) center / 14px 42px no-repeat, linear-gradient(#3a3550 0 0) center / 42px 14px no-repeat; }
.hh-a, .hh-b { position: absolute; width: 22px; height: 22px; background: var(--red); box-shadow: inset -3px -3px 0 #a8003a;
  clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)); }  /* tondi a gradini */
.hh-a { right: 4px; top: 10px; }
.hh-b { left: 4px; bottom: 10px; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* Come si gioca: tre passi in card morbide */
.how { padding-top: 72px; }
.steps { list-style: none; padding: 0; margin: 0 auto; max-width: 960px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps li {
  position: relative; background: var(--white); padding: 34px 18px 22px; text-align: center;
  border: 4px solid transparent; border-image: var(--frame) 3 / 12px stretch; background-clip: padding-box;
  filter: drop-shadow(4px 4px 0 var(--ink));
}
.steps img { height: 66px; width: auto; image-rendering: pixelated; display: block; margin: 0 auto 10px; }
.steps h3 { margin: 0 0 6px; font-family: var(--pixel); font-size: 19px; color: var(--ink); }
.steps p { margin: 0; color: var(--dark-blue); }
.step-n { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 32px; height: 32px; line-height: 32px;
  font-family: var(--pixel); font-size: 18px; color: var(--ink); background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }

/* Card dei giochi: si sollevano un poco al passaggio */
.game { transition: transform .18s ease-out; }
.game:hover { transform: translateY(-4px); }

/* Comparsa morbida delle sezioni mentre si scorre (solo con JS e senza "riduci movimento") */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease-out, transform .6s ease-out; }
.js .reveal.in { opacity: 1; transform: none; }
.js .games .game { opacity: 0; transform: translateY(18px); transition: opacity .5s ease-out, transform .5s ease-out; }
.js .games .game.in { opacity: 1; transform: none; }
.js .games .game.in:hover { transform: translateY(-4px); }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; gap: 24px; }
  .hero-copy .logo { margin: 0 auto; }
  .hero-copy .sub { margin: 0 auto 22px; }
  .hero-cta, .perks { justify-content: center; }
  .handheld { grid-template-columns: 40px 1fr 40px; gap: 6px; padding: 12px 8px; }
  .hh-dpad { width: 32px; height: 32px; background-size: 11px 32px, 32px 11px; }
  .hh-a, .hh-b { width: 18px; height: 18px; }
  .steps { grid-template-columns: 1fr; max-width: 420px; }
  .hero-copy .logo { width: min(320px, 78vw); }
  .hero-copy .tagline { font-size: 22px; margin-top: 12px; }
  .hero-copy .sub { font-size: 19px; }
  .hero-cta .store { padding: 0 16px; }
  .hero-cta .button { font-size: 17px; padding: 0 14px; }
  .hero-cta > .store, .hero-cta > .button { height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .handheld, .hh-screen .anim img { animation: none; }
  .js .reveal, .js .games .game { opacity: 1; transform: none; transition: none; }
}

/* Barra in alto: Scarica, selettore lingua e hamburger della stessa altezza */
.lang, .dl, .burger { box-sizing: border-box; height: 38px; }
.dl { display: inline-flex; align-items: center; padding-top: 0; padding-bottom: 0; }
.lang { padding-top: 0; padding-bottom: 0; }
@media (max-width: 700px) {
  .dl { padding-top: 0; padding-bottom: 0; }
  .burger { height: 38px; }
  .topbar nav .lang { height: 38px; padding-top: 0; padding-bottom: 0; }
}

/* ===================== Pagina 404 ===================== */
.nf-body { background: linear-gradient(#29adff 0%, #5cc3ff 60%, #8fd6ff 100%); min-height: 100vh; display: flex; flex-direction: column; }
.nf { position: relative; flex: 1; max-width: 760px; margin: 0 auto; padding: 40px 16px 56px; text-align: center; overflow: hidden; }
.nf-sky { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.nf-cloud { position: absolute; image-rendering: pixelated; animation: drift linear infinite; }
.nf-cloud.a { top: 40px; animation-duration: 38s; }
.nf-cloud.b { top: 140px; animation-duration: 52s; animation-delay: -20s; }
.nf-code { margin: 0; font-family: var(--pixel); font-size: clamp(88px, 22vw, 168px); line-height: 1; color: var(--white);
  text-shadow: 6px 6px 0 var(--ink); letter-spacing: 6px; display: flex; justify-content: center; gap: .08em; }
.nf-zero { color: var(--yellow); display: inline-block; animation: nf-wobble 2.4s steps(4) infinite; }
@keyframes nf-wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.nf-scene { margin: 18px auto 26px; width: min(480px, 100%); padding: 10px; background: #2e2a44; box-shadow: inset 0 0 0 4px #1e1a30, 8px 8px 0 rgba(11,63,115,.45);
  clip-path: polygon(0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px)); }
.nf-anim { position: relative; overflow: hidden; aspect-ratio: 96 / 60; }
.nf-anim img { display: block; height: 100%; width: calc(100% * var(--n)); max-width: none; image-rendering: pixelated;
  animation: anim-strip var(--ms) steps(var(--n)) infinite; }
.nf-title { margin: 0 auto 6px; max-width: 620px; font-family: var(--pixel); font-size: clamp(22px, 4.4vw, 32px); line-height: 1.25; color: var(--white); text-shadow: 3px 3px 0 var(--ink); }
.nf-en { margin: 0 0 18px; font-size: 19px; color: var(--ink); font-style: italic; }
.nf-sub { margin: 0 auto 26px; max-width: 560px; font-size: 19px; color: var(--dark-blue); }
.nf-sub span { opacity: .75; }
.nf-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
@media (prefers-reduced-motion: reduce) { .nf-zero, .nf-anim img, .nf-cloud { animation: none; } }

/* Menu (hamburger) e selettore lingua con gli stessi angoli a gradini e lo stesso rilievo del pulsante Scarica */
.burger, .lang {
  border: 0;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.28), inset 0 3px 0 rgba(255,255,255,.2), 3px 3px 0 var(--ink);
  clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
}

/* FAQ "Chi ha creato OlympiCat?": la foto di Gobolina (ritagliata, sfondo trasparente) */
.faq-photo { margin: 0; padding: 0 16px 18px; text-align: center; }
.faq-photo img { display: block; width: min(320px, 80%); height: auto; margin: 0 auto; filter: drop-shadow(4px 4px 0 rgba(11,63,115,.35)); }
.faq-photo figcaption { margin-top: 8px; font-size: 16px; color: var(--dark-blue); font-style: italic; }

/* Pulsante store nella hero: DOWNLOAD grande e "soon" piccolo sotto, nello stesso font pixel del pulsante accanto */
.hero-cta > .store { align-items: center; text-align: center; padding: 0 22px; }
.hero-cta > .store .store-big { font-family: var(--pixel); font-size: 20px; line-height: 1.1; text-transform: uppercase; }
.hero-cta > .store .store-small { font-family: var(--pixel); font-size: 13px; line-height: 1.2; text-transform: uppercase; letter-spacing: 1px; opacity: .85; }

/* "Scarica presto" / "Download soon": più lungo di prima, quindi un po' più compatto su telefono */
@media (max-width: 700px) { .dl { font-size: 13px; padding-left: 9px; padding-right: 9px; white-space: nowrap; } }
@media (max-width: 380px) { .dl { font-size: 12px; padding-left: 7px; padding-right: 7px; } }

/* Pulsanti più corti: meno spazio ai lati e testi più compatti */
.hero-cta > .store { padding: 0 14px; }
.hero-cta > .store .store-big { font-size: 18px; }
.hero-cta > .store .store-small { font-size: 11px; letter-spacing: 0; }
.hero-cta > .button { padding: 0 14px; font-size: 18px; }
.dl { padding-left: 11px; padding-right: 11px; font-size: 15px; }
.hero-cta { gap: 10px; }
@media (max-width: 700px) {
  .dl { font-size: 12px; padding-left: 8px; padding-right: 8px; }
  .hero-cta .store, .hero-cta .button { font-size: 16px; }
}

/* Pulsante "Giochi": stessa forma del Download, colori invertiti */
.hero-cta > .button.ghost {
  box-shadow: none; filter: drop-shadow(6px 6px 0 var(--dark-blue));
  font-family: var(--pixel); font-size: 18px; line-height: 1.1; text-transform: uppercase;
  align-items: center; text-align: center; background: var(--white); color: var(--ink);
}
.hero-cta > .button.ghost:hover { background: var(--yellow); }

/* Download giallo (hero) */
.hero-cta > .store { background: var(--yellow); color: var(--ink); border-image-source: var(--frame); }
.hero-cta > .store .store-small { opacity: .8; }
.hero-cta > .store.glow { animation: store-glow-y 1.8s ease-in-out; }
@keyframes store-glow-y {
  0%, 100% { filter: drop-shadow(6px 6px 0 var(--dark-blue)); }
  20%, 60% { filter: drop-shadow(6px 6px 0 var(--dark-blue)) drop-shadow(0 0 14px rgba(255, 255, 255, .95)); }
  40%, 80% { filter: drop-shadow(6px 6px 0 var(--dark-blue)) drop-shadow(0 0 6px rgba(255, 255, 255, .6)); }
}

/* Sezione finale di download: stesso pulsante giallo della hero */
.final-cta { text-align: center; }
.final-cta .store { box-sizing: border-box; height: 68px; display: inline-flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 22px; }
.final-cta .store .store-big { font-family: var(--pixel); font-size: 20px; line-height: 1.1; text-transform: uppercase; }
.final-cta .store .store-small { font-family: var(--pixel); font-size: 12px; line-height: 1.2; text-transform: uppercase; opacity: .8; }
.final-cta .store { background: var(--yellow); color: var(--ink); border-image-source: var(--frame); }

/* Badge ufficiale App Store nel footer */
.footer > img { display: block; margin: 0 auto 10px; }
.appstore-badge { display: block; width: fit-content; line-height: 0; margin: 6px auto 12px; }
.appstore-badge img { height: 50px; width: auto; display: block; }
.appstore-badge:hover, .appstore-badge:focus-visible { filter: brightness(1.15); }

/* Effetto CRT: scanline, griglia RGB leggera, vignettatura e flicker su tutta la pagina (overlay che non blocca i click). */
body::before, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9999; }
body::before {
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(11,20,40,.10) 2px, rgba(11,20,40,.10) 3px),
    repeating-linear-gradient(to right, rgba(255,0,60,.025) 0 1px, rgba(0,255,120,.025) 1px 2px, rgba(0,120,255,.025) 2px 3px);
  animation: crt-flicker 6s steps(1) infinite;
}
body::after {
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 62%, rgba(5,15,40,.28) 100%);
}
@keyframes crt-flicker { 0%, 100% { opacity: 1; } 47% { opacity: .85; } 48% { opacity: 1; } 83% { opacity: .9; } 84% { opacity: 1; } }

/* Schermo della console: CRT più marcato (scanline fitte, bagliore, riga che scorre). */
.hh-screen .anim::before, .hh-screen .anim::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.hh-screen .anim::before {
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.22) 2px 3px);
  box-shadow: inset 0 0 18px rgba(0,0,0,.55); z-index: 2;
}
.hh-screen .anim::after {
  height: 18%; background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,.10), rgba(255,255,255,0));
  animation: crt-roll 4.5s linear infinite; z-index: 3;
}
.hh-screen .anim img { filter: saturate(1.15) contrast(1.05); }
@keyframes crt-roll { from { transform: translateY(-120%); } to { transform: translateY(560%); } }

@media (prefers-reduced-motion: reduce) {
  body::before, .hh-screen .anim::after { animation: none; }
}
@media print { body::before, body::after { display: none; } }
