/* base.css — fondamenta comuni: colori, caratteri, cornice, pulsanti, schede, effetti.
   Direzione: "astronave televisiva". Nero profondo, quattro luci elettriche (ciano, magenta, ambra, verde aurora),
   vetro scuro, bordi luminosi. Si animano solo transform e opacity. */

:root {
  --void: #03040a;
  --deep: #070a16;
  --panel: rgba(13, 17, 36, .64);
  --panel-solid: #0b0f22;
  --line: rgba(150, 180, 255, .15);
  --line-strong: rgba(170, 200, 255, .34);
  --tx: #eef2ff;
  --tx2: #aab4d8;
  --tx3: #7882a6;
  --cy: #1fe5ff;
  --mg: #ff2f8e;
  --am: #ffc233;
  --gr: #37f5a6;
  --live: #ff3355;
  --ah: 188; /* tinta dell'accento: cambia con il canale o con il poster */
  --font-display: "Bahnschrift", "DIN Alternate", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --r1: 10px;
  --r2: 16px;
  --r3: 26px;
  --top: 68px;
  --tabs: 0px;
  --gut: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
/* I colori derivati si ricalcolano dove cambia la tinta. */
:root, [style*="--ah"] {
  --accent: hsl(var(--ah) 100% 62%);
  --accent-hi: hsl(var(--ah) 100% 80%);
  --accent-soft: hsl(var(--ah) 100% 60% / .16);
  --accent-glow: hsl(var(--ah) 100% 55% / .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--void); color-scheme: dark; -webkit-text-size-adjust: 100%; scrollbar-color: #2a3156 transparent; }
/* il fondo sta su <html>: così il cielo animato (dietro, con z-index negativo) resta visibile */
body { margin: 0; min-height: 100dvh; background: transparent; color: var(--tx); font: 400 16px/1.55 var(--font-body); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; letter-spacing: .005em; text-wrap: balance; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, svg, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px var(--accent-glow); border-radius: 8px; }
::selection { background: var(--accent); color: #02030a; }
.dim { color: var(--tx2); }
.grow { flex: 1; }

/* ---------- cielo animato ---------- */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
/* lo sfondo (nebulosa, fasci, grana) è in v3.css */
.fx-paused #aurora i, .fx-off #aurora i { animation-play-state: paused; }

/* ---------- sequenza di accensione ---------- */
#boot { position: fixed; inset: 0; z-index: 100; background: var(--void); display: grid; place-items: center; transition: opacity .5s ease, transform .7s var(--ease); }
#boot.gone { opacity: 0; transform: scale(1.08); pointer-events: none; }
.boot-in { display: grid; justify-items: center; gap: 20px; padding: 24px; width: min(92vw, 420px); }
.boot-logo { position: relative; display: grid; place-items: center; width: 150px; height: 150px; }
.boot-logo .mark { width: 132px; height: 132px; overflow: visible; }
.boot-logo::after { content: ""; position: absolute; inset: -60%; border-radius: 50%; background: radial-gradient(closest-side, rgba(31, 229, 255, .55), rgba(255, 47, 142, .18) 45%, transparent 70%); opacity: 0; transform: scale(.4); }
#boot.lit .boot-logo::after { animation: pulse-once .9s ease-out both; } /* un solo impulso di luce */
@keyframes pulse-once { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: .9; } 100% { opacity: 0; transform: scale(1.5); } }
/* il logo vive in js/logo.js; qui solo come si disegna. Tempi: 0–650 ms la P, 450–850 ms il fascio, 700–1000 ms barretta e nome */
.mark { overflow: visible; }
#boot .mark .lg-stroke { stroke-dasharray: 1; stroke-dashoffset: 1; }
#boot .mark .lg-fill { opacity: 0; transform-box: fill-box; transform-origin: left center; transform: scaleX(.2); }
#boot.run .mark .lg-segno-0 { animation: draw .65s 0s cubic-bezier(.5, 0, .2, 1) forwards; }
#boot.run .mark .lg-fill { animation: beam-on .4s .45s var(--ease) forwards; }
#boot.run .mark .lg-segno-2 { animation: draw .3s .7s var(--ease) forwards; }
#boot.run .mark .lg-stroke:not(.lg-segno-0):not(.lg-segno-2) { animation: draw .4s .5s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes beam-on { to { opacity: 1; transform: none; } }
/* il fascio di luce che esce dal segno quando il sistema è pronto */
.boot-logo::before { content: ""; position: absolute; left: 62%; top: 50%; width: 46vmax; height: 30vmax; transform-origin: left center; transform: translateY(-58%) scaleX(0); opacity: 0; pointer-events: none; background: conic-gradient(from 78deg at 0 50%, transparent 0deg, rgba(22, 211, 235, .34) 6deg, rgba(22, 211, 235, .12) 14deg, transparent 24deg); -webkit-mask-image: linear-gradient(90deg, #000, transparent 85%); mask-image: linear-gradient(90deg, #000, transparent 85%); }
#boot.lit .boot-logo::before { animation: beam-sweep 1s ease-out both; }
@keyframes beam-sweep { 0% { opacity: 0; transform: translateY(-58%) scaleX(0); } 35% { opacity: 1; } 100% { opacity: 0; transform: translateY(-58%) scaleX(1); } }
.boot-word { font: 600 30px/1 var(--font-display); letter-spacing: .04em; opacity: 0; transform: translateY(8px); color: #f0f5ff; min-height: 34px; display: grid; place-items: center; }
#boot.run .boot-word { animation: rise .3s .7s var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.boot-bar { width: 250px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.boot-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cy), var(--am), var(--mg)); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; box-shadow: 0 0 12px var(--cy); }
.boot-steps { min-height: 124px; width: 250px; font-size: 13.5px; color: var(--tx3); display: grid; align-content: start; gap: 4px; }
.boot-steps li { display: flex; align-items: center; gap: 10px; opacity: 0; transform: translateY(4px); animation: rise .3s calc(.25s + var(--i, 4) * .13s) ease forwards; }
.boot-steps li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tx3); flex: none; transition: background .2s, box-shadow .2s; }
.boot-steps li span { flex: 1; }
.boot-steps li em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--tx3); font-size: 12px; }
.boot-skip { font-size: 12.5px; color: var(--tx3); opacity: 0; animation: rise .4s 1.1s ease forwards; min-height: 18px; }
#boot.boot-short .boot-skip, #boot.boot-kids .boot-skip { display: none; }
.boot-steps li.ok { color: var(--tx2); } .boot-steps li.ok::before { background: var(--gr); box-shadow: 0 0 8px var(--gr); }
.boot-steps li.ko::before { background: var(--am); }
.boot-steps .boot-ready { color: #fff; font-weight: 600; animation-delay: 0s; } .boot-steps .boot-ready::before { background: var(--cy); box-shadow: 0 0 10px var(--cy); }
/* versione breve: logo già disegnato, niente righe */
#boot.boot-short .mark .lg-stroke { stroke-dashoffset: 0; animation: none; }
#boot.boot-short .mark .lg-fill, #boot.boot-short .boot-word { opacity: 1; transform: none; animation: none; }
#boot.boot-short .boot-steps { display: none; }
/* versione Kids: la mascotte dorme, quattro stelle si accendono mentre le cose si caricano, poi si sveglia */
#boot.boot-kids { background: linear-gradient(#2a4bd8, #49b6ff 70%, #bfeeff); }
#boot.boot-kids .boot-logo > .mark, #boot.boot-kids .boot-bar { display: none; }
#boot.boot-kids .boot-logo { width: 190px; height: 210px; }
#boot.boot-kids .boot-logo::after { background: radial-gradient(closest-side, rgba(255, 240, 150, .8), transparent 70%); }
#boot.boot-kids .boot-word { color: #fff; }
#boot.boot-kids .boot-steps { display: flex; min-height: 0; width: auto; gap: 14px; font-size: 0; }
#boot.boot-kids .boot-steps li { animation-delay: calc(var(--i, 4) * .1s); }
#boot.boot-kids .boot-steps li::before { width: 34px; height: 34px; border-radius: 0; background: rgba(255, 255, 255, .35); clip-path: polygon(50% 0, 62% 35%, 98% 36%, 69% 58%, 80% 94%, 50% 72%, 20% 94%, 31% 58%, 2% 36%, 38% 35%); transition: background .3s, transform .4s var(--ease); box-shadow: none; }
#boot.boot-kids .boot-steps li.ok::before, #boot.boot-kids .boot-steps li.ko::before { background: #ffe14a; transform: scale(1.25) rotate(12deg); }
#boot.boot-kids .boot-ready { display: none; }
body.booting #top, body.booting #app, body.booting #tabs { opacity: 0; }
#top, #app, #tabs { transition: opacity .4s ease; }
/* l'interfaccia entra come un desktop che si carica */
body.entered #top { animation: drop .7s var(--ease) both; }
body.entered #tabs { animation: lift .7s var(--ease) both; }
body.entered :is(.home, .live, .guide, .cinema, .kids-view) > * { animation: lift .8s var(--ease) both; }
body.entered :is(.home, .live, .guide, .cinema, .kids-view) > :nth-child(2) { animation-delay: .1s; }
body.entered :is(.home, .live, .guide, .cinema, .kids-view) > :nth-child(3) { animation-delay: .2s; }
body.entered :is(.home, .live, .guide, .cinema, .kids-view) > :nth-child(n+4) { animation-delay: .3s; }
@keyframes drop { from { opacity: 0; transform: translateY(-24px); } }
@keyframes lift { from { opacity: 0; transform: translateY(34px) scale(.985); } }

/* ---------- cornice ---------- */
.skip { position: fixed; left: 12px; top: -60px; z-index: 90; background: #fff; color: #000; padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 12px; }
#top { position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 40; display: flex; align-items: center; gap: clamp(12px, 3vw, 40px); padding: 0 var(--gut); background: linear-gradient(rgba(3, 4, 10, .92), rgba(3, 4, 10, .55) 70%, transparent); }
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo .mark { flex: none; filter: drop-shadow(0 0 7px rgba(22, 211, 235, .45)); }
.logo .lg-word, .logo .lg-text { color: #f0f5ff; flex: none; }
.lg-text { font: 600 19px/1 var(--font-display); letter-spacing: .03em; white-space: nowrap; }
.lg-measure { position: absolute; left: -9999px; top: 0; }
.brand .mark .lg-segno-1 { transform-box: fill-box; transform-origin: left center; transition: transform .35s var(--ease); }
.brand:hover .mark .lg-segno-1, .brand:focus-visible .mark .lg-segno-1 { transform: scaleX(1.18); }
#boot.boot-kids .boot-logo .mascot3d { width: 190px; height: 190px; }
@keyframes ray-flick { 40% { opacity: .35; transform: translateX(3px); } }
.mainnav { display: flex; gap: clamp(2px, 1vw, 10px); flex: 1; }
.navlink { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; font: 500 16px/1 var(--font-display); letter-spacing: .05em; color: var(--tx2); transition: color .2s; }
.navlink .ic { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.navlink:hover { color: #fff; } .navlink:hover .ic { transform: translateY(-2px) scale(1.12); }
.navlink::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--cy), var(--mg)); box-shadow: 0 0 10px var(--cy); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.navlink[aria-current]::after { transform: scaleX(1); }
.navlink[aria-current] { color: #fff; }
.navkids { color: var(--am); } .navkids::after { background: linear-gradient(90deg, var(--am), var(--mg)); box-shadow: 0 0 10px var(--am); }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.langpick { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px 0 10px; height: 38px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--tx2); }
.langpick .ic { width: 16px; height: 16px; }
.langsel { appearance: none; background: none; border: 0; padding: 6px 8px 6px 2px; font-size: 14px; color: var(--tx); cursor: pointer; }
select option { background: #0b0f22; color: var(--tx); }
#app { padding-top: var(--top); padding-bottom: var(--tabs); min-height: 100dvh; }
#app:focus-visible { box-shadow: none; outline: none; }
#tabs { display: none; }

/* ---------- pulsanti, chip, campi ---------- */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--tx); font-weight: 600; font-size: 15px; white-space: nowrap; transition: transform .15s var(--ease), border-color .2s, background .2s; }
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn .ic { width: 19px; height: 19px; }
.btn.primary { background: linear-gradient(120deg, var(--accent-hi), var(--accent)); color: #02030a; border-color: transparent; box-shadow: 0 6px 26px -6px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn.primary .ic { fill: currentColor; stroke: none; }
.btn.primary .ic path { stroke: currentColor; stroke-width: 1.8; }
.btn.ghost { background: rgba(255, 255, 255, .04); }
.btn.danger { background: #ff3355; border-color: transparent; color: #fff; }
.btn.big { min-height: 54px; padding: 0 26px; font-size: 17px; }
.btn.small { min-height: 34px; padding: 0 13px; font-size: 13.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .35); transform: scale(0); opacity: .7; animation: ripple .6s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.iconbtn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--tx); transition: background .2s, transform .15s; }
.iconbtn:hover { background: rgba(255, 255, 255, .12); } .iconbtn:active { transform: scale(.9); }
.iconbtn.big { width: 48px; height: 48px; background: rgba(255, 255, 255, .1); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; overflow: hidden; min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--tx2); font-weight: 600; font-size: 14.5px; transition: color .2s, border-color .2s, background .2s; }
.chip:hover { color: #fff; border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: transparent; color: #02030a; box-shadow: 0 0 22px -4px var(--accent-glow); }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12.5px; color: var(--tx2); white-space: nowrap; }
.pill.live { border-color: transparent; background: var(--live); color: #fff; font-weight: 700; }
.field-inline { display: inline-flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--tx3); min-width: 0; }
.field-inline select, select.mini, .search, .input { height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(8, 11, 26, .8); color: var(--tx); font-size: 14.5px; max-width: 100%; }
select.mini { height: 32px; font-size: 13px; }
.field-inline select:hover, .search:hover, .input:hover { border-color: var(--accent); }

/* ---------- locandine e schede ---------- */
.poster { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: var(--r2); overflow: hidden; background: #10152e; }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster-none { display: flex; flex-direction: column; justify-content: space-between; padding: 14px; background: linear-gradient(160deg, hsl(var(--ph) 85% 34%), hsl(calc(var(--ph) + 60) 70% 12%) 80%); }
.poster-none::before { content: ""; position: absolute; right: -30%; top: -12%; width: 90%; aspect-ratio: 1; border-radius: 50%; border: 2px solid hsl(var(--ph) 100% 75% / .5); box-shadow: 0 0 0 14px hsl(var(--ph) 100% 75% / .12); }
.poster-kind { position: relative; font-size: 12px; color: rgba(255, 255, 255, .8); }
.poster-title { position: relative; font: 600 clamp(15px, 1.5vw, 20px)/1.08 var(--font-display); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
[data-tilt] { transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s var(--ease); transform-style: preserve-3d; will-change: transform; }
[data-tilt].tilting { transition: transform .08s linear; }
.card-glow { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(circle 190px at var(--gx, 50%) var(--gy, 0%), hsl(var(--ah) 100% 75% / .38), transparent 70%); }
.tilting > .card-glow, .tilting .card-glow { opacity: 1; }
.card { position: relative; display: block; border-radius: var(--r2); }
.card .poster { box-shadow: 0 0 0 1px var(--line), 0 18px 40px -22px #000; transition: box-shadow .3s; }
.card:hover .poster, .card:focus-visible .poster { box-shadow: 0 0 0 1.5px var(--accent), 0 0 34px -6px var(--accent-glow), 0 22px 44px -20px #000; }
.card > .card-glow { bottom: auto; aspect-ratio: 2 / 3; }
.card-body { display: block; padding: 10px 2px 0; }
.card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.card-meta { display: block; margin-top: 3px; font-size: 12.5px; color: var(--tx3); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 0; color: var(--tx2); font-size: 15px; }
.meta li + li::before { content: ""; display: inline-block; width: 1px; height: .9em; margin: 0 12px; background: var(--line-strong); vertical-align: -1px; }

/* scheda canale */
.chnum { font: 700 22px/1 var(--font-display); letter-spacing: .06em; font-variant-numeric: tabular-nums; color: var(--accent); text-shadow: 0 0 14px var(--accent-glow); }
.chlogo { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 10px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); font-size: 17px; line-height: 1; font-weight: 700; }
.chcard { position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; min-height: 176px; padding: 18px; border-radius: var(--r3); border: 1px solid var(--line); background: linear-gradient(150deg, hsl(var(--ah) 80% 50% / .16), rgba(13, 17, 36, .7) 55%); overflow: hidden; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: border-color .3s, box-shadow .3s; }
.chcard:hover, .chcard:focus-visible { border-color: var(--accent); box-shadow: 0 0 40px -10px var(--accent-glow); }
.chcard-top { display: flex; align-items: center; gap: 10px; }
.chcard-top .chnum { font-size: 34px; }
.chcard-top .bars { margin-left: auto; }
.chname { font-size: 13px; color: var(--tx2); }
.chnow { font: 600 19px/1.15 var(--font-display); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chtime, .chnext { font-size: 13px; color: var(--tx3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chcard .prog { margin-top: auto; }
.chcard.off { background: rgba(13, 17, 36, .5); } .chcard.off .chnow { color: var(--tx2); }
.prog { display: block; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 4px; transform-origin: left; transform: scaleX(0); transition: transform 1s linear; background: linear-gradient(90deg, var(--accent), #fff); box-shadow: 0 0 12px var(--accent); }
.prog.thick { height: 6px; }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.bars i { width: 3px; height: 100%; border-radius: 2px; background: var(--live); transform-origin: bottom; animation: eq 1s ease-in-out infinite alternate; }
.bars i:nth-child(2) { animation-duration: .7s; animation-delay: -.3s; } .bars i:nth-child(3) { animation-duration: 1.2s; animation-delay: -.6s; }
@keyframes eq { from { transform: scaleY(.3); } to { transform: scaleY(1); } }

/* ---------- righe scorrevoli ---------- */
.rail { position: relative; margin-top: clamp(26px, 4vw, 44px); }
.rail-head { display: flex; align-items: baseline; gap: 16px; padding: 0 var(--gut); margin-bottom: 14px; }
.rail-head h2, .band h2 { font-size: clamp(22px, 2.4vw, 30px); }
.more { margin-left: auto; font-size: 14px; color: var(--tx2); border-bottom: 1px solid var(--line-strong); padding-bottom: 1px; }
.more:hover { color: #fff; border-color: var(--accent); }
.rail-wrap { position: relative; }
.rail-track { display: flex; gap: clamp(12px, 1.4vw, 20px); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: var(--gut); padding: 8px var(--gut) 18px; scrollbar-width: none; }
.rail-track::-webkit-scrollbar { display: none; }
.rail-item { flex: 0 0 auto; width: clamp(128px, 14.5vw, 196px); scroll-snap-align: start; }
.rail.wide .rail-item { width: clamp(248px, 24vw, 330px); }
.rail-arrow { position: absolute; top: 50%; z-index: 3; width: 46px; height: 46px; margin-top: -30px; border-radius: 50%; display: grid; place-items: center; background: rgba(8, 11, 26, .85); border: 1px solid var(--line-strong); color: #fff; opacity: 0; transition: opacity .2s, transform .2s, border-color .2s; }
.rail-arrow.prev { left: 10px; } .rail-arrow.next { right: 10px; }
.rail:hover .rail-arrow, .rail-arrow:focus-visible { opacity: 1; }
.rail-arrow:hover { border-color: var(--accent); transform: scale(1.08); }
.rail-arrow:disabled { opacity: 0 !important; pointer-events: none; }
@media (hover: none) { .rail-arrow { display: none; } }
[data-reveal] { opacity: 0; transform: translateY(22px); }
[data-reveal].in { opacity: 1; transform: none; transition: opacity .5s ease var(--d, 0ms), transform .6s var(--ease) var(--d, 0ms); }
.band { padding: 0 var(--gut); margin-top: clamp(30px, 4.5vw, 54px); }
.band h2 { margin-bottom: 16px; }

/* ---------- vuoti, errori, scheletri ---------- */
.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: clamp(28px, 6vw, 64px) 20px; margin: 0 auto; max-width: 560px; color: var(--tx2); grid-column: 1 / -1; }
.empty h3 { font-size: clamp(22px, 2.6vw, 30px); color: var(--tx); }
.empty p { max-width: 46ch; }
.empty-art { position: relative; display: grid; place-items: center; width: 92px; height: 92px; margin-bottom: 8px; border-radius: 50%; border: 1px solid var(--line-strong); background: radial-gradient(circle at 30% 25%, var(--accent-soft), transparent 70%); color: var(--accent); }
.empty-art::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; border: 1px dashed var(--line-strong); animation: spin 26s linear infinite; }
.empty-art .ic { width: 38px; height: 38px; }
.empty.is-error .empty-art { color: var(--am); }
.empty.slim { padding: 22px 16px; } .empty.slim .empty-art { width: 60px; height: 60px; } .empty.slim .empty-art .ic { width: 26px; height: 26px; } .empty.slim h3 { font-size: 19px; }
@keyframes spin { to { transform: rotate(360deg); } }
.sk { position: relative; overflow: hidden; border-radius: var(--r2); background: rgba(150, 180, 255, .08); }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(100deg, transparent 20%, rgba(190, 220, 255, .16) 50%, transparent 80%); animation: sheen 1.4s ease-in-out infinite; }
@keyframes sheen { to { transform: translateX(100%); } }
.sk-card { aspect-ratio: 2 / 3; } .rail.wide .sk-card { aspect-ratio: auto; height: 176px; border-radius: var(--r3); }
.sk-title { height: 26px; width: 180px; margin: 0 var(--gut) 14px; }
.sk-line { height: 14px; margin-top: 12px; border-radius: 7px; } .sk-big { height: 64px; margin-top: 14px; } .sk-row { height: 62px; margin: 10px; }
.w30 { width: 30%; } .w60 { width: 60%; }

/* ---------- finestre e avvisi ---------- */
.dlg-back { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(2, 3, 8, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fade .2s ease both; }
.dlg { width: min(100%, 620px); max-height: min(88dvh, 820px); display: flex; flex-direction: column; border-radius: var(--r3); border: 1px solid var(--line-strong); background: linear-gradient(160deg, #111735, #080b1a); box-shadow: 0 0 0 1px var(--accent-soft), 0 40px 120px -20px #000, 0 0 80px -30px var(--accent-glow); animation: pop .3s var(--ease) both; }
.dlg:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--accent-soft), 0 40px 120px -20px #000; }
.dlg-small { width: min(100%, 440px); } .dlg-wide { width: min(100%, 900px); }
.dlg-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 14px 6px 24px; }
.dlg-head h2 { flex: 1; font-size: 26px; padding-top: 6px; overflow-wrap: anywhere; }
.dlg-body { padding: 8px 24px 20px; overflow: auto; display: grid; gap: 12px; }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 24px 22px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.toasts { position: fixed; left: 50%; bottom: calc(var(--tabs) + 22px); z-index: 95; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: #10162f; box-shadow: 0 20px 50px -14px #000; animation: pop .3s var(--ease) both; transition: opacity .35s, transform .35s; }
.toast.ok { border-left: 3px solid var(--gr); } .toast.err { border-left: 3px solid var(--live); }
.toast.out { opacity: 0; transform: translateY(10px); }

/* ---------- transizioni di pagina ---------- */
::view-transition-old(root) { animation: vt-out .2s ease both; }
::view-transition-new(root) { animation: vt-in .4s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: scale(.985); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(16px); } }
html[data-vt="kids"]::view-transition-old(root) { animation: none; z-index: 1; }
html[data-vt="kids"]::view-transition-new(root) { animation: vt-circle .75s var(--ease) both; z-index: 2; }
@keyframes vt-circle { from { clip-path: circle(0 at var(--vx) var(--vy)); } to { clip-path: circle(150vmax at var(--vx) var(--vy)); } }
.page-in { animation: vt-in .4s var(--ease) both; }

/* coriandoli */
.confetti { position: fixed; inset: 0; z-index: 98; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; left: var(--x); top: -20px; width: 10px; height: 16px; border-radius: 3px; background: hsl(var(--ch) 100% 62%); animation: fall 2.4s var(--dl) cubic-bezier(.3, .6, .6, 1) both; }
@keyframes fall { from { opacity: 1; transform: translate3d(0, 0, 0) rotate(0); } to { opacity: 0; transform: translate3d(var(--dx), 105vh, 0) rotate(var(--rot)); } }

/* ---------- telefono ---------- */
@media (max-width: 760px) {
  :root { --top: 56px; --tabs: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .mainnav { display: none; }
  #top { justify-content: space-between; }
  .logo-word { font-size: 18px; }
  #tabs { position: fixed; inset: auto 0 0 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabs); padding-bottom: env(safe-area-inset-bottom, 0px); background: rgba(6, 8, 20, .9); border-top: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .tab { position: relative; overflow: hidden; display: grid; justify-items: center; align-content: center; gap: 3px; font-size: 11px; color: var(--tx3); }
  .tab .ic { width: 22px; height: 22px; transition: transform .3s var(--ease); }
  .tab[aria-current] { color: #fff; } .tab[aria-current] .ic { color: var(--cy); transform: translateY(-2px) scale(1.12); filter: drop-shadow(0 0 6px var(--cy)); }
  .tab:last-child { color: var(--am); }
  .chcard { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- versione calma ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
  #aurora i { animation: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
  #boot .mark .ray, #boot .mark .lens { stroke-dashoffset: 0; } #boot .mark .core, .boot-word { opacity: 1; transform: none; }
  #boot.gone { transform: none; }
  .boot-steps { display: none; }
}

/* link che portano fuori dal sito */
.extlink { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-hi); border-bottom: 1px solid currentColor; } .extlink .ic { width: 14px; height: 14px; } .extlink:hover { color: #fff; }
