:root {
  --bg: #07070a;
  --surface: rgba(255, 255, 255, .035);
  --surface-hi: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .1);
  --text: #f5f5f6;
  --muted: #9d9da8;
  --gold: #ecbd06;
  --gold-hi: #ffd84a;
  --green: #1f9d55;
  --red: #d42a2a;
  --radius: 18px;
  --hero-gap: 32px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: "Saira", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Background ---------- */

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.bg__glow { position: absolute; border-radius: 50%; filter: blur(90px); will-change: transform; }
.bg__glow--a {
  width: 620px; height: 620px; top: -260px; left: 50%; margin-left: -310px;
  background: radial-gradient(circle, rgba(236, 189, 6, .26), transparent 65%);
  animation: drift-a 18s ease-in-out infinite alternate;
}
.bg__glow--b {
  width: 520px; height: 520px; bottom: -280px; right: -160px;
  background: radial-gradient(circle, rgba(212, 42, 42, .14), transparent 65%);
  animation: drift-b 24s ease-in-out infinite alternate;
}

.bg__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 20%, transparent 75%);
}

.bg__streaks { position: absolute; inset: 0; transform: skewX(-18deg); }
.bg__streaks i {
  position: absolute; left: -40%; height: 1px; width: 34%;
  background: linear-gradient(90deg, transparent, rgba(236, 189, 6, .55), transparent);
  animation: streak 7s linear infinite;
}
.bg__streaks i:nth-child(1) { top: 14%; animation-delay: -1s; }
.bg__streaks i:nth-child(2) { top: 37%; animation-delay: -4.2s; animation-duration: 9s; opacity: .6; }
.bg__streaks i:nth-child(3) { top: 62%; animation-delay: -2.6s; animation-duration: 11s; opacity: .45; }
.bg__streaks i:nth-child(4) { top: 86%; animation-delay: -6s; animation-duration: 8s; opacity: .7; }

@keyframes drift-a { to { transform: translate3d(60px, 50px, 0) scale(1.12); } }
@keyframes drift-b { to { transform: translate3d(-80px, -60px, 0) scale(1.15); } }
@keyframes streak { to { transform: translateX(420%); } }

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--hero-gap) 18px 40px;
  transition: padding-bottom .3s;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reveal {
  opacity: 0;
  animation: rise .8s var(--ease) forwards;
  animation-delay: calc(var(--i) * 90ms + 120ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* ---------- Hero ---------- */

.hero { text-align: center; margin-bottom: 14px; }
.hero__logo { margin: 0; }
.hero__logo img {
  display: block; width: min(100%, 400px); height: auto; margin: 0 auto;
  filter: drop-shadow(0 6px 28px rgba(236, 189, 6, .22));
}

.hero__tag {
  margin: var(--hero-gap) 0 0;
  font: italic 600 13px/1 var(--display);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__tag b { color: var(--gold); font-weight: 800; }

/* ---------- Cards ---------- */

.card {
  --mx: 50%; --my: 50%;
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 14px 18px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s, background-color .35s, box-shadow .35s;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(240px circle at var(--mx) var(--my), rgba(236, 189, 6, .16), transparent 70%);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.card:hover, .card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(236, 189, 6, .6);
  background-color: var(--surface-hi);
  box-shadow: 0 14px 40px -18px rgba(236, 189, 6, .45);
}
.card:hover::before { opacity: 1; }
.card:active { transform: translateY(-1px) scale(.99); }

.card__icon {
  flex: none;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 13px;
  background: rgba(236, 189, 6, .1);
  color: var(--gold);
  font-size: 21px;
  transition: transform .45s var(--ease), background-color .35s;
}
.card:hover .card__icon { transform: scale(1.08) rotate(-4deg); background: rgba(236, 189, 6, .18); }

.card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card__title { font: 700 17px/1.2 var(--display); letter-spacing: .01em; }
.card__sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

.card__arrow { flex: none; font-size: 20px; color: var(--muted); transition: transform .35s var(--ease), color .35s; }
.card:hover .card__arrow { transform: translate(3px, -3px); color: var(--gold); }


/* Avviso recruiting concluso: stessa forma delle card ma non cliccabile, bordo oro e pallino che pulsa */
.card--notice { border-color: rgba(236, 189, 6, .45); background: linear-gradient(120deg, rgba(236, 189, 6, .12), rgba(236, 189, 6, .03) 60%), var(--surface); cursor: default; }
.card--notice:hover { transform: none; border-color: rgba(236, 189, 6, .45); box-shadow: none; }
.card--notice:hover::before { opacity: 0; }
.card--notice:hover .card__icon { transform: none; }
.notice__tag { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; font: 700 10px/1.2 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.notice__dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: notice-dot 1.8s ease-out infinite; }
@keyframes notice-dot { 0% { box-shadow: 0 0 0 0 rgba(236, 189, 6, .6); } 100% { box-shadow: 0 0 0 8px rgba(236, 189, 6, 0); } }

/* Card del gioco: aspetto da "pista" (griglia, cordolo bianco-rosso, verde batteria) per distinguerla dai link */
.card--game {
  flex-wrap: wrap;
  row-gap: 12px;
  padding: 20px 16px 12px 18px;
  border-color: rgba(61, 220, 132, .35);
  background:
    radial-gradient(260px circle at 100% 0%, rgba(61, 220, 132, .16), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px) 0 0 / 22px 22px,
    #101014;
}
.card--game::after {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: repeating-linear-gradient(-45deg, var(--red) 0 9px, #f1f1f1 9px 18px);
}
.card--game::before { background: radial-gradient(240px circle at var(--mx) var(--my), rgba(61, 220, 132, .16), transparent 70%); }
.card--game:hover, .card--game:focus-visible {
  border-color: rgba(61, 220, 132, .75);
  background-color: #14141a;
  box-shadow: 0 14px 40px -18px rgba(61, 220, 132, .55);
}
.card--game .card__title { font: italic 800 21px/1.15 var(--display); text-transform: uppercase; }
.game-card__tag { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font: 700 10px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: #3ddc84; }
.game-card__tag svg { font-size: 15px; }
.game-card__cta {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 16px 0 12px;
  border-radius: 99px;
  background: #3ddc84;
  color: #07220f;
  font: 700 13px/1 var(--display);
  letter-spacing: .04em;
  transition: transform .35s var(--ease), background-color .3s;
}
.game-card__cta svg { font-size: 15px; }
.card--game:hover .game-card__cta { transform: scale(1.07); background: #5cf0a0; }

.game-card__lane { flex-basis: 100%; width: 100%; height: auto; stroke: none; overflow: hidden; }
.lane__line { stroke: rgba(255, 255, 255, .14); stroke-width: 1; stroke-dasharray: 6 6; }
.lane__car { transform: translate(40px, 12px); animation: lane-car 4.5s linear infinite; }
.lane__batt { fill: #3ddc84; transform-box: fill-box; transform-origin: center; animation: lane-batt 4.5s linear calc(4.5s * var(--at)) infinite; }
@keyframes lane-car { from { transform: translate(-20px, 12px); } to { transform: translate(320px, 12px); } }
/* ogni batteria sparisce quando passa la vettura e ricompare poco dopo */
@keyframes lane-batt {
  0% { opacity: 1; transform: scale(1); }
  4% { opacity: 0; transform: scale(2.2); }
  55% { opacity: 0; transform: scale(.2); }
  65%, 100% { opacity: 1; transform: scale(1); }
}

/* Card dell'offerta Prime Student (link di affiliazione): azzurra, con etichetta che la dichiara come tale */
.card--partner { border-color: rgba(76, 194, 255, .3); }
.card--partner::before { background: radial-gradient(240px circle at var(--mx) var(--my), rgba(76, 194, 255, .16), transparent 70%); }
.card--partner:hover, .card--partner:focus-visible { border-color: rgba(76, 194, 255, .7); box-shadow: 0 14px 40px -18px rgba(76, 194, 255, .5); }
.card--partner .card__icon { background: rgba(76, 194, 255, .12); color: #4cc2ff; }
.card--partner:hover .card__icon { background: rgba(76, 194, 255, .2); }
.card--partner:hover .card__arrow { color: #4cc2ff; }
/* variante con il logo dell'offerta in una fascia bianca in cima (il logo ha scritte scure e non va ricolorato) */
.card--banner { flex-wrap: wrap; gap: 0; padding: 0; }
.partner__banner { flex-basis: 100%; display: grid; place-items: center; padding: 14px 16px; background: #fff; }
.partner__banner img { display: block; width: auto; height: 48px; max-width: 100%; }
.card--banner .card__body { padding: 14px 8px 16px 16px; }
.card--banner .card__arrow { margin-right: 16px; }
.partner__tag { margin-bottom: 3px; font: 700 10px/1.2 var(--display); letter-spacing: .16em; text-transform: uppercase; color: #4cc2ff; }
.partner { display: grid; gap: 10px; width: 100%; margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--line); text-align: left; }
.partner__q { margin: 0; font: italic 800 13px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); text-align: center; }
.partner__note { margin: 0; font-size: 11px; color: var(--muted); opacity: .8; text-align: center; }

/* ---------- Sections ---------- */

.section-head { display: flex; align-items: center; gap: 14px; margin: 18px 2px 12px; }
.section-head h2 {
  margin: 0;
  font: italic 800 13px/1 var(--display);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}
.section-head__rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* ---------- Video ---------- */

.video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  transition: border-color .35s, box-shadow .35s;
}
.video__frame:hover { border-color: rgba(236, 189, 6, .6); box-shadow: 0 14px 40px -18px rgba(236, 189, 6, .45); }
.video__btn, .video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__btn img { width: 100%; height: 100%; object-fit: cover; opacity: .8; transition: transform .8s var(--ease), opacity .35s; }
.video__btn:hover img { transform: scale(1.05); opacity: 1; }
.video__btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0, 0, 0, .6)); }
.video__play {
  position: absolute; z-index: 1; top: 50%; left: 50%;
  display: grid; place-items: center;
  width: 68px; height: 68px; margin: -34px 0 0 -34px;
  border-radius: 50%;
  background: var(--gold);
  color: #0b0b0d;
  font-size: 26px;
  box-shadow: 0 0 0 0 rgba(236, 189, 6, .5);
  animation: ring 2.4s ease-out infinite;
  transition: transform .35s var(--ease);
}
.video__btn:hover .video__play { transform: scale(1.1); }
@keyframes ring { to { box-shadow: 0 0 0 22px rgba(236, 189, 6, 0); } }

/* ---------- Social ---------- */

.social { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card--social { min-height: 68px; padding: 12px; gap: 12px; }
.card--social .card__icon { width: 40px; height: 40px; border-radius: 11px; font-size: 19px; }
.card--social .card__title { font-size: 15px; }
.card--social .card__sub { font-size: 12px; }

/* ---------- Footer ---------- */

.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 26px; padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.footer button { text-decoration: underline; text-underline-offset: 3px; padding: 8px 0; }
.footer button:hover { color: var(--text); }

/* ---------- Cambio lingua, in fondo alla pagina ---------- */

.lang {
  display: flex; align-items: center; gap: 9px;
  width: fit-content;
  min-height: 40px;
  margin: 0 auto 36px;
  padding: 0 16px 0 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font: 700 13px/1 var(--display);
  letter-spacing: .04em;
  color: var(--muted);
  opacity: 0;
  animation: rise .8s var(--ease) .7s forwards;
  transition: border-color .3s, color .3s, background-color .3s;
}
.lang:hover { border-color: rgba(236, 189, 6, .6); background: var(--surface-hi); color: var(--text); }
.lang__flag { width: 22px; height: 15px; border-radius: 3px; stroke: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); }

/* ---------- Consent ---------- */

.consent {
  position: fixed; z-index: 10;
  left: 50%; bottom: max(14px, env(safe-area-inset-bottom));
  width: min(calc(100% - 28px), 532px);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px;
  padding: 14px 14px 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 16, 20, .88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, .8);
  animation: consent-in .6s var(--ease) both;
}
.consent[hidden] { display: none; }
body { transition: padding-bottom .3s; }
body:has(.consent:not([hidden])) { padding-bottom: 150px; }
.consent p { margin: 0; flex: 1; font-size: 13px; color: var(--muted); }
.consent__actions { display: flex; gap: 8px; flex: none; }
@keyframes consent-in { from { opacity: 0; transform: translate(-50%, 24px); } }

.btn {
  min-height: 40px; padding: 0 16px;
  border-radius: 99px;
  font: 700 13px/1 var(--display);
  letter-spacing: .04em;
  transition: background-color .25s, border-color .25s, transform .25s var(--ease);
}
.btn:active { transform: scale(.96); }
.btn--ghost { border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--text); }
.btn--gold { background: var(--gold); color: #0b0b0d; }
.btn--gold:hover { background: var(--gold-hi); }

/* ---------- 404 ---------- */

.notfound { min-height: calc(100dvh - 76px); align-items: center; justify-content: center; gap: 0; padding-bottom: var(--hero-gap); text-align: center; }
.notfound .hero__logo img { width: min(100%, 300px); }
/* Scena "fuori pista": la monoposto passa sotto il numero, la sua scia fa comparire le cifre una alla volta,
   poi arriva lunga alla curva e va in testacoda. Lo stato di base è quello finale, l'animazione parte una volta sola. */
.offtrack { --run: 1.7s; --wait: .25s; width: 100%; margin-top: 30px; container-type: inline-size; }

.notfound__code { margin: 0; font: italic 800 26vw/.86 var(--display); font-size: 26cqw; letter-spacing: -.02em; }
/* ogni cifra sale da dietro la pista, tagliata alla base, quando l'auto le passa sotto */
.notfound__code span { display: inline-block; clip-path: inset(-20% -30% -12% -30%); }
.notfound__code b {
  display: inline-block;
  /* margine extra: il colore sfumato viene dipinto solo dentro il box, le cifre tonde sporgono oltre */
  padding: .04em .14em .06em;
  margin: -.04em -.14em -.06em;
  font-weight: inherit;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, rgba(236, 189, 6, .25));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: digit-rise .42s cubic-bezier(.16, 1, .3, 1) both;
}
.notfound__code span:nth-child(1) b { animation-delay: calc(var(--wait) + var(--run) * .2); }
.notfound__code span:nth-child(2) b { animation-delay: calc(var(--wait) + var(--run) * .285); }
.notfound__code span:nth-child(3) b { animation-delay: calc(var(--wait) + var(--run) * .42); }

.offtrack__svg { display: block; width: 100%; height: auto; margin-top: -1cqw; overflow: visible; stroke: none; }
.offtrack__edge { stroke: url(#track-fade); stroke-width: 1.5; stroke-linecap: butt; }
.offtrack__skid { stroke: var(--gold); stroke-opacity: .55; stroke-width: 1.6; stroke-linecap: butt; stroke-dasharray: 1 2; animation: skid var(--run) linear var(--wait) both; }
.offtrack__puff {
  fill: rgba(255, 255, 255, .22);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: puff .7s ease-out calc(var(--wait) + var(--run) * var(--at)) both;
}

.offtrack__car { transform: translate(362px, 22px) rotate(522deg); animation: offtrack var(--run) linear var(--wait) both; }
.car__speed { stroke: rgba(255, 255, 255, .5); stroke-width: 1.2; opacity: 0; animation: speed var(--run) linear var(--wait) both; }
.car__arms { stroke: #6b6b76; stroke-width: 1.4; }
.car__tyre { fill: #050506; stroke: #4a4a54; stroke-width: .8; }
.car__wing { fill: var(--wing, #f1f1f1); }
.car__body { fill: var(--car, var(--gold)); }
.car__cockpit { fill: #0b0b0d; }
.car__helmet { fill: var(--helmet, var(--red)); }
.sc__body { fill: #dcdce2; }
.sc__glass { fill: #0b0b0d; }
.sc__light { fill: var(--gold); animation: sc-light .5s steps(1, end) infinite; }

/* Safety car e gruppo: partono a scena conclusa e seguono la pista in fila, in loop.
   Ogni auto percorre la pista nel primo 53% del ciclo: l'ultima sparisce prima che la safety car rientri. */
.convoy { opacity: 0; }
@supports (offset-path: path("M0 0H1")) {
  .convoy {
    offset-path: path("M-40 30H240Q285 30 285 78V100");
    offset-rotate: auto;
    animation: convoy 9s linear calc(3.9s + var(--k) * .95s) infinite;
  }
}
@keyframes convoy {
  0% { offset-distance: 0%; opacity: 0; }
  5.5% { opacity: 1; }
  45% { opacity: 1; }
  53%, 100% { offset-distance: 100%; opacity: 0; }
}
@keyframes sc-light { 50% { fill: #ff7a1a; } }

/* rettilineo a tutta, staccata con l'auto che si scompone, testacoda in scivolata e assestamento finale */
@keyframes offtrack {
  0% { transform: translate(-40px, 30px) rotate(0deg); }
  28% { transform: translate(190px, 30px) rotate(0deg); }
  32% { transform: translate(215px, 30px) rotate(-4deg); }
  36% { transform: translate(236px, 30px) rotate(3deg); }
  44% { transform: translate(268px, 31px) rotate(28deg); }
  52% { transform: translate(292px, 30px) rotate(100deg); }
  62% { transform: translate(316px, 28px) rotate(230deg); }
  72% { transform: translate(336px, 25px) rotate(360deg); }
  82% { transform: translate(350px, 23px) rotate(455deg); }
  90% { transform: translate(358px, 22px) rotate(510deg); }
  96% { transform: translate(361px, 22px) rotate(528deg); }
  100% { transform: translate(362px, 22px) rotate(522deg); }
}
/* stessi tempi dell'auto: i segni si allungano sotto le ruote */
@keyframes skid {
  0%, 36% { stroke-dashoffset: 1; }
  44% { stroke-dashoffset: .75; }
  52% { stroke-dashoffset: .55; }
  62% { stroke-dashoffset: .36; }
  72% { stroke-dashoffset: .2; }
  82% { stroke-dashoffset: .09; }
  90% { stroke-dashoffset: .03; }
  100% { stroke-dashoffset: 0; }
}
@keyframes speed {
  0%, 26% { opacity: 1; }
  36%, 100% { opacity: 0; }
}
@keyframes puff {
  0% { opacity: 0; transform: scale(.3); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: scale(2.6); }
}
@keyframes digit-rise { from { transform: translateY(125%); } }

/* Bandiera gialla: il banner entra da sinistra, "Safety car" lampeggia due volte, poi lascia il posto a "Fuori pista" */
.flag {
  --at: 1.6s;
  display: inline-grid;
  margin: 22px 0 0;
  padding: 9px 24px;
  background: var(--gold);
  color: #0b0b0d;
  font: italic 800 22px/1.1 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: skewX(-10deg);
  animation: flag-in .32s cubic-bezier(.2, .9, .2, 1) var(--at) both;
}
.flag span { grid-area: 1 / 1; transform: skewX(10deg); }
.flag__sc { opacity: 0; animation: flag-blink 1.5s ease-in-out calc(var(--at) + .2s) both; }
.flag__msg { animation: flag-msg .3s cubic-bezier(.2, .9, .2, 1) calc(var(--at) + 1.65s) both; }

@keyframes flag-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes flag-blink {
  0%, 18%, 50%, 82% { opacity: 1; }
  34%, 66%, 100% { opacity: 0; }
}
@keyframes flag-msg { from { opacity: 0; transform: skewX(10deg) translateY(60%); } }

.notfound__text { margin: 18px 0 28px; max-width: 320px; color: var(--muted); }
.notfound__btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px; font-size: 14px; }
.notfound__btn svg { font-size: 18px; transition: transform .35s var(--ease); }
.notfound__btn:hover svg { transform: translate(3px, -3px); }

/* ---------- Gioco: SRT Battery Run ---------- */

body.game-page { overflow: hidden; overscroll-behavior: none; padding-bottom: 0 !important; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

.game {
  display: flex; flex-direction: column; gap: 10px;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom));
  touch-action: none;
}
.game__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* in alto a sinistra il logo del team e la scritta "Battery Run" si alternano in loop */
.game__logo { display: grid; align-items: center; height: 30px; overflow: hidden; }
.game__logo > * { grid-area: 1 / 1; animation: logo-swap 8s var(--ease) infinite; }
.game__logo img { display: block; height: 30px; width: auto; }
.game__name { opacity: 0; font: italic 800 17px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; color: var(--gold); animation-delay: -4s; }
@keyframes logo-swap {
  0%, 44% { opacity: 1; transform: none; }
  50%, 93% { opacity: 0; transform: translateY(-110%); }
  94% { opacity: 0; transform: translateY(110%); }
  100% { opacity: 1; transform: none; }
}

.hud { display: flex; gap: 6px; }
.hud__pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface);
  font: 700 14px/1 var(--display);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.hud__pill svg { font-size: 17px; color: #3ddc84; }
.hud__pill b { color: var(--text); font-weight: 700; }
.hud__pill--time { min-width: 84px; padding: 0 10px; justify-content: center; color: var(--text); }
.hud__sound { width: 34px; padding: 0; justify-content: center; }
.hud__sound svg, .lang--sound svg { font-size: 17px; color: var(--gold); }
[data-sound][aria-pressed="false"] svg { color: var(--muted); }

.charge { display: flex; align-items: center; gap: 10px; }
.charge__label { font: 700 10px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.lives { display: flex; gap: 4px; font-size: 18px; }
.lives svg { fill: var(--red); stroke: var(--red); transition: fill .3s, stroke .3s, transform .3s; }
.lives svg.is-lost { fill: none; stroke: var(--muted); opacity: .5; transform: scale(.85); }
.charge__track { flex: 1; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.charge__bar { display: block; height: 100%; border-radius: 99px; background: #3ddc84; transform-origin: left; transition: background-color .3s; }
.charge[data-level="mid"] .charge__bar { background: var(--gold); }
.charge[data-level="low"] .charge__bar { background: var(--red); animation: charge-low .5s ease-in-out infinite alternate; }
@keyframes charge-low { to { opacity: .45; } }

.game__board { flex: 1; min-height: 0; display: grid; place-items: center; }
.game__frame {
  padding: 5px;
  border-radius: 14px;
  background: repeating-linear-gradient(45deg, var(--red) 0 10px, #f1f1f1 10px 20px);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .9);
  line-height: 0;
}
.game__frame canvas { display: block; border-radius: 10px; }

.overlay {
  position: fixed; inset: 0; z-index: 3;
  display: grid; place-items: center;
  padding: 24px 18px;
  background: rgba(7, 7, 10, .86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
  touch-action: pan-y;
  animation: overlay-in .35s var(--ease) both;
}
.overlay[hidden] { display: none; }
@keyframes overlay-in { from { opacity: 0; } }

.panel { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; max-width: 380px; text-align: center; }
.panel__eyebrow { margin: 0; font: italic 600 12px/1 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.panel__title { margin: 0; font: italic 800 38px/1 var(--display); text-transform: uppercase; color: var(--gold); }
.panel__title--sm { font-size: 30px; color: var(--text); }
.panel__text { margin: 0; color: var(--muted); }
.panel__hint { margin: 0; font-size: 13px; color: var(--muted); }
.panel__best, .panel__stat { margin: 0; font: 700 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.panel__best b, .panel__stat b { margin-left: 6px; font-size: 18px; letter-spacing: 0; color: var(--gold); }
.panel__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; }
.panel__foot { display: flex; gap: 20px; font-size: 12px; color: var(--muted); }
.panel__foot a, .panel__foot button { text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }
.panel .lang { margin: 0; opacity: 1; animation: none; }
.panel__toggles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn--lg { min-height: 50px; padding: 0 28px; font-size: 15px; }

.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; text-align: left; }
.rules li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 14px; }
.rules b { font: italic 800 16px/1 var(--display); color: var(--gold); }

.fault { margin: 0; padding: 7px 18px; background: var(--red); color: #fff; font: italic 800 16px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; transform: skewX(-10deg); animation: fault-blink .5s steps(1, end) 3; }
@keyframes fault-blink { 50% { opacity: .25; } }

/* Game over: carro attrezzi che attraversa la schermata trainando la monoposto, in loop.
   La posizione di base (senza animazioni) è al centro. */
.tow { width: 100%; height: auto; overflow: hidden; stroke: none; }
.tow__road { stroke: rgba(255, 255, 255, .16); stroke-width: 1.5; stroke-dasharray: 14 10; animation: tow-road .5s linear infinite; }
.tow__rig { transform: translateX(105px); animation: tow-drive 5s linear infinite; }
.tow__bob { animation: tow-bob .45s ease-in-out infinite alternate; }
.tow__wheel { transform-box: fill-box; transform-origin: center; animation: tow-spin .5s linear infinite; }
.tow__tyre { fill: #050506; stroke: #4a4a54; stroke-width: 1.2; }
.tow__spoke { stroke: #9d9da8; stroke-width: 1.4; }
.tow__hub { fill: #9d9da8; }
.tow__car, .tow__cab { fill: var(--gold); }
.tow__wing { fill: #f1f1f1; }
.tow__helmet { fill: var(--red); }
.tow__bed { fill: #2c2c34; }
.tow__chassis { fill: #17171b; }
.tow__glass { fill: #0b0b0d; }
.tow__boom { stroke: #9d9da8; stroke-width: 3.5; }
.tow__cable { stroke: #c9c9d1; stroke-width: 1.2; }
.tow__hook { stroke: #c9c9d1; stroke-width: 1.8; }
.tow__beacon { fill: #ff7a1a; animation: tow-beacon .6s steps(1, end) infinite; }

.recharge { display: none; width: 100%; height: auto; overflow: hidden; stroke: none; }
#ov-over[data-reason="battery"] .recharge { display: block; }
#ov-over[data-reason="battery"] .tow { display: none; }
.recharge__road { stroke: rgba(255, 255, 255, .16); stroke-width: 1.5; stroke-dasharray: 14 10; }
.recharge__shell { stroke: #f1f1f1; stroke-width: 2; }
.recharge__nub { fill: #f1f1f1; }
.recharge__seg { opacity: 0; animation: 5s linear infinite; }
.recharge__seg--1 { fill: var(--red); animation-name: seg-1; }
.recharge__seg--2 { fill: #ff7a1a; animation-name: seg-2; }
.recharge__seg--3 { fill: var(--gold); animation-name: seg-3; }
.recharge__seg--4 { fill: #3ddc84; animation-name: seg-4; }
.recharge__gauge { transform-box: fill-box; transform-origin: center; animation: gauge-full 5s ease-in-out infinite; }
.recharge__cable { stroke: #2c2c34; stroke-width: 4; }
.recharge__flow { stroke: var(--gold); stroke-width: 1.8; stroke-dasharray: 5 7; animation: recharge-flow .6s linear infinite; }
.recharge__post { fill: #2c2c34; }
.recharge__cap { fill: var(--gold); }
.recharge__screen { fill: #3ddc84; animation: recharge-blink 1s steps(1, end) infinite; }
.recharge__bolt { fill: var(--gold); }
.recharge__car { animation: none; }

/* i quattro segmenti si accendono uno dopo l'altro, restano pieni un attimo e si azzerano */
@keyframes seg-1 { 0%, 9% { opacity: 0; } 12%, 90% { opacity: 1; } 94%, 100% { opacity: 0; } }
@keyframes seg-2 { 0%, 29% { opacity: 0; } 32%, 90% { opacity: 1; } 94%, 100% { opacity: 0; } }
@keyframes seg-3 { 0%, 49% { opacity: 0; } 52%, 90% { opacity: 1; } 94%, 100% { opacity: 0; } }
@keyframes seg-4 { 0%, 69% { opacity: 0; } 72%, 90% { opacity: 1; } 94%, 100% { opacity: 0; } }
@keyframes gauge-full { 0%, 72%, 86%, 100% { transform: scale(1); } 77% { transform: scale(1.16); } }
@keyframes recharge-flow { to { stroke-dashoffset: -12; } }
@keyframes recharge-blink { 50% { fill: #17603a; } }

.tow__smoke { fill: #b9b9c4; opacity: 0; transform-box: fill-box; transform-origin: center; animation: tow-smoke 1.6s ease-out var(--d) infinite; }
@keyframes tow-smoke {
  0% { opacity: 0; transform: translate(0, 0) scale(.4); }
  15% { opacity: .65; }
  100% { opacity: 0; transform: translate(-30px, -30px) scale(2.6); }
}
@keyframes tow-drive { from { transform: translateX(-100px); } to { transform: translateX(370px); } }
@keyframes tow-bob { to { transform: translateY(-1.2px); } }
@keyframes tow-spin { to { transform: rotate(360deg); } }
@keyframes tow-road { to { stroke-dashoffset: 24; } }
@keyframes tow-beacon { 50% { fill: #5a2a08; } }

/* Licenza Creative Commons: nota in fondo alla schermata iniziale e schermata dedicata */
.license-note { margin: 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
.license-note a, .panel__link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.license-note a:hover, .panel__link:hover { color: var(--text); }
.license-note img { display: inline-block; width: 1.25em; height: 1.25em; margin-left: .25em; vertical-align: -.28em; }
.overlay--top { z-index: 6; }
#ov-license .license-note { font-size: 13px; }
.rules--license img { flex: none; width: 26px; height: 26px; }
.panel__link { font-size: 13px; color: var(--muted); }

/* Intro del gioco: cordoli, logo, batteria che si carica, titolo e monoposto che attraversa lo schermo */
.intro {
  position: fixed; inset: 0; z-index: 8;
  display: grid; place-content: center; justify-items: center; gap: 26px;
  background: radial-gradient(900px circle at 50% 0%, rgba(236, 189, 6, .2), transparent 60%), var(--bg);
  overflow: hidden;
  animation: intro-out .5s var(--ease) 2.75s forwards;
}
.intro[hidden] { display: none; }
.intro__kerb { position: absolute; left: 0; right: 0; height: 14px; background: repeating-linear-gradient(-45deg, var(--red) 0 14px, #f1f1f1 14px 28px); }
.intro__kerb--top { top: 0; animation: intro-kerb-l .7s var(--ease) both; }
.intro__kerb--bottom { bottom: 0; animation: intro-kerb-r .7s var(--ease) both; }
.intro__by { margin: 0; display: flex; align-items: center; gap: 12px; font: italic 600 15px/1 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); animation: intro-by .5s var(--ease) 1.6s both; }
.intro__by img { width: min(46vw, 210px); height: auto; }
.intro__battery { position: relative; width: 150px; height: 62px; border: 5px solid var(--text); border-radius: 15px; animation: intro-pop .5s var(--ease) .4s both; }
.intro__battery::after { content: ""; position: absolute; right: -14px; top: 15px; width: 8px; height: 22px; border-radius: 0 5px 5px 0; background: var(--text); }
.intro__level { position: absolute; inset: 6px; border-radius: 7px; transform-origin: left; animation: intro-charge 1s cubic-bezier(.5, 0, .2, 1) .6s both; }
.intro__title { margin: 0; display: flex; gap: .28em; font: italic 800 clamp(34px, 10.5vw, 56px)/1 var(--display); text-transform: uppercase; color: var(--gold); }
.intro__title span { animation: intro-word .45s cubic-bezier(.2, 1.3, .3, 1) both; }
.intro__title span:nth-child(1) { animation-delay: .1s; }
.intro__title span:nth-child(2) { animation-delay: .2s; }
.intro__title span:nth-child(3) { animation-delay: .3s; }
.intro__car { position: absolute; left: 0; bottom: 20%; width: 120px; height: auto; stroke: none; animation: intro-car .8s cubic-bezier(.5, 0, .9, .6) 1.95s both; }
.intro__streak { position: absolute; left: 0; right: 0; bottom: calc(20% + 32px); height: 4px; background: linear-gradient(90deg, transparent, var(--gold)); transform-origin: left; animation: intro-streak .8s cubic-bezier(.5, 0, .9, .6) 1.95s both; }

@keyframes intro-out { to { opacity: 0; visibility: hidden; transform: scale(1.1); } }
@keyframes intro-kerb-l { from { transform: translateX(-100%); } }
@keyframes intro-kerb-r { from { transform: translateX(100%); } }
@keyframes intro-pop { from { opacity: 0; transform: scale(.7); } }
@keyframes intro-charge {
  0% { transform: scaleX(.04); background: var(--red); }
  50% { background: var(--gold); }
  100% { transform: scaleX(1); background: #3ddc84; box-shadow: 0 0 26px rgba(61, 220, 132, .8); }
}
@keyframes intro-by { from { opacity: 0; transform: translateY(14px); } }
@keyframes intro-word { from { opacity: 0; transform: translateX(-40px) skewX(-18deg); } }
@keyframes intro-car { from { transform: translateX(-140px); } to { transform: translateX(calc(100vw + 20px)); } }
@keyframes intro-streak { 0% { transform: scaleX(0); opacity: 1; } 80% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }

.cert { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .9); }

/* Vittoria: coriandoli a tutto schermo, titolo e attestato che entrano in scena */
.confetti { position: fixed; inset: 0; z-index: 4; width: 100%; height: 100%; pointer-events: none; }
.confetti[hidden] { display: none; }
#ov-win .panel__title { color: var(--gold); animation: win-title .7s cubic-bezier(.2, 1.4, .3, 1) .1s both; }
#ov-win .panel__text { animation: rise .6s var(--ease) .25s both; }
#ov-win .cert { animation: cert-in .9s cubic-bezier(.2, 1.2, .3, 1) .35s both, cert-glow 2.4s ease-in-out 1.3s infinite alternate; }
#ov-win .field, #ov-win .panel__actions, #ov-win .btn--ghost, #ov-win .panel__foot, #ov-win .partner { animation: rise .6s var(--ease) .9s both; }
@keyframes win-title { from { opacity: 0; transform: scale(.4) rotate(-8deg); } }
@keyframes cert-in { from { opacity: 0; transform: perspective(900px) rotateX(55deg) translateY(60px) scale(.8); } }
@keyframes cert-glow { to { box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .9), 0 0 46px -6px rgba(236, 189, 6, .6); } }
.field { display: grid; gap: 8px; width: 100%; text-align: left; font: 700 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.field input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: 500 16px var(--body);
  -webkit-user-select: text; user-select: text;
}
.field input:focus { outline: none; border-color: var(--gold); }

@media (max-width: 480px) {
  .consent { flex-direction: column; align-items: stretch; padding: 16px; }
  .consent__actions .btn { flex: 1; }
  .card--social .card__sub { display: none; }
  .hero__tag { font-size: 11px; letter-spacing: .14em; }
  .hero__logo img { width: 84%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .bg__streaks { display: none; }
}

/* "Sfida un amico" solo su dispositivi touch: con mouse (desktop) non compare */
@media (hover: hover) and (pointer: fine) {
  [id^="btn-challenge"] { display: none; }
}

/* telefoni stretti: logo e scritta in alto un po' più piccoli, così il tempo con i millesimi ci sta */
.game__logo { flex: none; }
@media (max-width: 370px) {
  .game__logo, .game__logo img { height: 24px; }
  .game__name { font-size: 13.5px; }
}

/* unità di misura del tempo: "s" minuscola e più piccola, anche dove il resto è in maiuscolo */
.panel__best small { font-size: .7em; text-transform: none; }
