/* La soglia della beta (beta.html, docs/beta-gate.md). Il giocatore, 2026-11-18/19: «più cinematografica», «più stile
   videogames», «evita errori di puntini», «testi più accattivanti, anche FRAGMENTS BETA e il countdown, e distinguibili
   bene», «elimina il tasto dell'audio», «aggiungi salva nel calendario». Quindi:

   - **Cinema**: le bande nere si aprono come un sipario e alla fine si richiudono sul nero (di là c'è lo splash); la
     camera spinge dentro a Via Nizza — il disegno vero del Fragment — con un lampo, poi i titoli entrano uno dopo
     l'altro: il marchio che si mette a fuoco, FRAGMENTS che si stringe, BETA che si sbatte di traverso, il quadro del timer
     che si chiude dagli angoli. Il sipario se ne va del tutto: la scena prende tutto lo schermo. Dopo, la scena vive: la
     matrice del menu che cade, nebbia che scorre, un fulmine
     lontano ogni tredici secondi, il riflesso orizzontale che attraversa il timer, il battito di ogni secondo; negli
     ultimi dieci secondi il quadro si accende d'arancio.
   - **Videogioco**: il disegno in pixel nitidi, le righe dello schermo, il timer come un quadro di gioco fra quattro
     angoli, la barra a segmenti del tempo passato, il codice in dodici caselle, ENTRA col triangolo di avvio.
   - **Testi che si distinguono**: le cifre in Bungee, larghe e piene, a rilievo come i titoli dei giochi (lo zero di
     Orbitron ha la barra, e da lontano si confondeva); FRAGMENTS grande, con la luce che lo attraversa; BETA una
     targhetta arancio; le etichette più chiare. Ogni cifra ha la sua cella fissa: cambiando non sposta le altre.
   - **Niente puntini**: nessuna favilla, nessuna polvere, nessuna grana, nessun due punti fra le cifre (ci sono divisori),
     nessun punto in mezzo alle scritte. Ogni segno a schermo è una riga, un riquadro, una luce larga o una lettera.

   ## Le misure

   Niente scorrimento, su nessuno schermo: ogni cosa cresce coi `vmin` fino a un tetto, e `--zoom` alza tutto insieme
   sugli schermi larghi come un televisore (quel che il menu principale fa con `--menu-zoom`). In verticale una colonna:
   marchio, timer, calendario, codice. Di traverso — telefono girato, computer, televisore — due colonne: a sinistra
   marchio, timer e calendario, a destra il codice. Lo decide il verso dello schermo, non la larghezza. */

:root {
  --zoom: 1;
  --digit: calc(var(--zoom) * clamp(34px, 12vmin, 80px));
  --card: min(100% - 28px, 440px);
  color-scheme: dark;
}
@media (min-width: 1600px) and (min-height: 800px) { :root { --zoom: 1.3; } }
@media (orientation: landscape) and (min-aspect-ratio: 1/1) {
  :root { --digit: calc(var(--zoom) * clamp(30px, min(11vmin, 6.2vw), 92px)); --card: clamp(300px, 32vw, 480px); }
}

html, body { margin: 0; height: 100%; background: #000; color: #fff; font-family: Manrope, sans-serif; overflow: hidden; }
body { -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  align-items: center;
  row-gap: clamp(8px, 2vmin, 22px);
  padding: max(env(safe-area-inset-top, 0px), clamp(10px, 2.6vmin, 30px)) max(env(safe-area-inset-right, 0px), 0px) max(env(safe-area-inset-bottom, 0px), clamp(12px, 2.8vmin, 32px)) max(env(safe-area-inset-left, 0px), 0px);
}

/* ── Il fondo ── */
.sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.pan { position: absolute; inset: 0; will-change: transform; animation: beta-pan 64s ease-in-out infinite alternate; }
/* Il disegno resta a pixel: ingrandito e sfumato sembrava una fotografia sfocata, non il gioco. All'inizio la camera ci
   spinge dentro dal nero. */
.street { position: absolute; left: 50%; top: 50%; width: 124%; height: 124%; object-fit: cover; transform: translate(-50%, -50%); image-rendering: pixelated; image-rendering: crisp-edges; filter: saturate(.9) brightness(.4) contrast(1.1); animation: beta-push 3.6s cubic-bezier(.2, .7, .2, 1) both; }
/* La nebbia: due luci larghe che scorrono piano a livello della strada */
/* La strada si spegne nel buio sotto al timer. Ingrandita, la parte bassa del disegno — il marciapiede, le sagome in
   strada — arrivava dietro alla scheda del codice come una macchia grigia sfocata, e sembrava un difetto (il giocatore,
   2026-11-19: «c'è ancora l'alone»). */
.floor { position: absolute; left: 0; right: 0; bottom: 0; height: 56%; background: linear-gradient(#04030d00 0%, #05041af2 30%, #04030d 46%); }
.fog { position: absolute; left: -30%; right: -30%; bottom: -8%; height: 62%; background: radial-gradient(40% 46% at 30% 70%, #8f78ff26, transparent 72%); animation: beta-fog 38s ease-in-out infinite alternate; }
/* ── La matrice del menu principale (shell.css, «Il mosaico»; LiveSky.js) ──
   Il mosaico acceso ai lati e le colonne di tessere che cadono le disegna beta.js su **una tela sola**, un punto per
   tessera, ingrandita qui coi pixel netti; le fughe fra le tessere le ritaglia la maschera (`--p` il passo, `--t` la
   tessera: li mette beta.js, interi). Erano un mosaico e sei piani a tutto schermo, ognuno con la sua maschera, e la scheda
   grafica di un telefono li rifondeva tutti a ogni fotogramma: la pagina perdeva fotogrammi (il giocatore, 2026-11-19). */
.matrix { position: absolute; left: 0; top: 0; image-rendering: pixelated; image-rendering: crisp-edges;
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 var(--t, 5px), transparent var(--t, 5px) var(--p, 6px)), repeating-linear-gradient(#000 0 var(--t, 5px), transparent var(--t, 5px) var(--p, 6px));
  -webkit-mask-composite: source-in;
  mask: repeating-linear-gradient(90deg, #000 0 var(--t, 5px), transparent var(--t, 5px) var(--p, 6px)), repeating-linear-gradient(#000 0 var(--t, 5px), transparent var(--t, 5px) var(--p, 6px));
  mask-composite: intersect; animation: beta-fade 2.4s .9s both; }
/* Un velo solo sopra a tutto: le righe dello schermo, la tinta della notte e la vignetta. Erano tre strati. */
.veil { position: absolute; inset: 0; background: repeating-linear-gradient(#0000 0 3px, #00000030 3px 4px), radial-gradient(120% 92% at 50% 48%, transparent 52%, #000000c2 100%), linear-gradient(#1a164659 0%, #0b082826 38%, #04030dc7 74%, #04030deb 100%); }
/* Il fulmine lontano: una luce larga che s'accende in alto e si spegne, due volte, ogni tredici secondi. Mai più di due
   lampi in un secondo, e tenui (le linee guida sui lampi chiedono meno di tre al secondo). */
.lightning { position: absolute; inset: 0; background: radial-gradient(70% 55% at 72% 4%, #f4f0ff 0%, #b8a2ff66 32%, transparent 70%); opacity: 0; animation: beta-lightning 13s linear 7s infinite; }
/* Il lampo d'apertura */
.flash { position: absolute; inset: 0; background: radial-gradient(70% 60% at 50% 46%, #fff 0%, #e9e3ff 40%, #8f78ff 100%); opacity: 0; animation: beta-flash 1.3s .55s ease-out both; }

/* ── Le bande del cinema: un sipario che si apre, con una luce che corre lungo l'orlo ── */
.bar { position: absolute; left: 0; right: 0; z-index: 3; height: 0; overflow-x: clip; background: #000; display: flex; align-items: center; justify-content: center; animation: beta-bars-open 1.5s .1s cubic-bezier(.7, 0, .2, 1) both; }
.bar.top { top: 0; padding-top: env(safe-area-inset-top, 0px); box-shadow: 0 1px 0 #8f78ff59, 0 8px 22px #000c; }
.bar.bottom { bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -1px 0 #ff8a1f66, 0 -8px 22px #000c; }
.bar::after { content: ''; position: absolute; left: -34vw; width: 34vw; height: 1px; background: linear-gradient(90deg, transparent, #e9e3ff, transparent); animation: beta-edge 7s linear 2s infinite; will-change: transform; }
.bar.top::after { bottom: -1px; }
.bar.bottom::after { top: -1px; background-image: linear-gradient(90deg, transparent, #ffd2a8, transparent); animation-delay: 5.5s; }
.when { margin: 0; display: flex; align-items: center; justify-content: center; gap: .9em; font: 700 calc(var(--zoom) * clamp(12px, 1.3vmin + 7px, 20px))/1 Orbitron, sans-serif; letter-spacing: .2em; color: #f4f1ff; white-space: nowrap; text-shadow: 0 0 10px #8f78ff80, 0 2px 8px #000c; animation: beta-rise 1s 2.75s cubic-bezier(.2, .8, .2, 1) both; }
.when span { margin-left: .2em; }
.when-sep { width: 1.5px; height: 1.3em; background: linear-gradient(#ffb06700, #ffb067, #ffb06700); }
/* L'ora in Bungee come le cifre del timer: lo zero di Orbitron ha la barra */
.when b { font: 400 1.1em/1 Bungee, Orbitron, sans-serif; letter-spacing: .1em; color: #ffb067; text-shadow: 0 0 12px #ff8a1fb3; }

/* ── La scena: marchio, titolo, timer, calendario ── */
.scene { position: relative; z-index: 1; isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(12px, 2.8vmin, 28px); width: 100%; min-height: 0; }
.portal { position: absolute; z-index: -1; left: 50%; top: 50%; width: clamp(260px, 98vmin, 760px); height: clamp(260px, 98vmin, 760px); transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; animation: beta-fade 2.2s 1.2s both; }
.portal::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, #8f78ff 0%, #fff 12%, #8f78ff 28%, #ff8a1f 50%, #8f78ff 68%, #3b347a 86%, #8f78ff 100%); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); opacity: .55; animation: beta-spin 18s linear infinite; }
.portal::after { content: ''; position: absolute; inset: -18%; border-radius: 50%; background: radial-gradient(circle, #8f78ff3d 0%, #8f78ff14 40%, transparent 66%); animation: beta-pulse 4.6s ease-in-out infinite; }

/* Un'ombra larga dietro alla scena: sopra alla matrice, marchio e titolo devono restare leggibili */
.scene::before { content: ''; position: absolute; z-index: -2; inset: -4% 0; background: radial-gradient(closest-side, #080620e6 0%, #0806209e 58%, transparent 100%); pointer-events: none; }
.brand { display: flex; flex-direction: column; align-items: center; gap: clamp(5px, 1.1vmin, 11px); }
.logo { display: block; width: calc(var(--zoom) * clamp(140px, 50vmin, 300px)); height: auto; filter: drop-shadow(0 6px 14px #000c); animation: beta-logo 1.3s .8s cubic-bezier(.2, .8, .2, 1) both; }
.cross { display: inline-flex; align-items: center; font: 800 calc(var(--zoom) * clamp(12px, 1.5vmin + 6px, 19px))/1 Manrope, sans-serif; letter-spacing: .22em; margin-left: .22em; background: linear-gradient(100deg, #8f78ff 0%, #e4dcff 35%, #fff 50%, #e4dcff 65%, #8f78ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; animation: beta-rise .9s 1.05s cubic-bezier(.2, .8, .2, 1) both; }
.o { display: inline-block; width: .78em; height: .78em; margin: 0 .06em; border-radius: 50%; border: .14em solid #b8a2ff; box-shadow: 0 0 8px #8f78ff99, inset 0 0 4px #8f78ff99; vertical-align: -.08em; }

/* Il titolo: FRAGMENTS grande, metallico, con la luce che lo attraversa; accanto, BETA, una targhetta arancio sbattuta
   di traverso. Accanto e non sopra: messa sull'angolo copriva le ultime lettere, e la parola non si leggeva più. */
.title-card { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 1.8vmin, 16px); margin: clamp(4px, 1vmin, 10px) 0 0; line-height: 1; }
.frag { display: block; font: 900 calc(var(--zoom) * clamp(26px, 8vmin, 60px))/1 Orbitron, sans-serif; letter-spacing: .1em; margin-right: -.1em; background: linear-gradient(100deg, #cfc4ff 0%, #fff 28%, #f3efff 44%, #fff 50%, #cfc4ff 66%, #a996ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 .06em 0 #2a1f6b) drop-shadow(0 .1em .2em #04030d) drop-shadow(0 0 .45em #8f78ffb3); animation: beta-tracking 1.5s 1.15s cubic-bezier(.2, .8, .2, 1) both; }
.beta { flex: none; display: block; padding: .4em .8em .36em; font: 900 calc(var(--zoom) * clamp(10px, 1.4vmin + 4.5px, 16px))/1 Orbitron, sans-serif; letter-spacing: .2em; color: #1a0d00; background: linear-gradient(#ffe39a 0%, #ffb03c 48%, #ff8a1f 100%); border-radius: 4px; transform: rotate(-8deg) skewX(-10deg); box-shadow: inset 0 0 0 1.5px #fff5e0, 0 3px 0 #8c3a0c, 0 0 14px #ff8a1f99; animation: beta-slam .62s 1.95s cubic-bezier(.2, 1.5, .4, 1) both; }
.beta span { display: block; margin-right: -.2em; transform: skewX(10deg); }

/* ── Il timer ── */
.hud { position: relative; padding: clamp(14px, 2.6vmin, 26px) clamp(16px, 3.4vmin, 34px) clamp(12px, 2.2vmin, 22px); background: linear-gradient(#0d0a2ccc, #04030de0); box-shadow: inset 0 1px 0 #c9bdff26, 0 20px 40px -20px #000; animation: beta-rise 1s 2.15s cubic-bezier(.2, .8, .2, 1) both; }
.hud::before { content: ''; position: absolute; left: 14%; right: 14%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, #c9bdff, transparent); }
.corner { position: absolute; width: clamp(12px, 2.4vmin, 22px); height: clamp(12px, 2.4vmin, 22px); border: 2px solid #c9bdff; filter: drop-shadow(0 0 6px #8f78ffcc); animation: beta-corner .8s 2.35s cubic-bezier(.2, .8, .2, 1) both; }
.corner.tl { left: 0; top: 0; border-right: 0; border-bottom: 0; --dx: -12px; --dy: -12px; }
.corner.tr { right: 0; top: 0; border-left: 0; border-bottom: 0; --dx: 12px; --dy: -12px; }
.corner.bl { left: 0; bottom: 0; border-right: 0; border-top: 0; border-color: #ffb067; filter: drop-shadow(0 0 6px #ff8a1fcc); --dx: -12px; --dy: 12px; }
.corner.br { right: 0; bottom: 0; border-left: 0; border-top: 0; border-color: #ffb067; filter: drop-shadow(0 0 6px #ff8a1fcc); --dx: 12px; --dy: 12px; }
/* Il battito di ogni secondo: il quadro si accende e si spegne */
.pulse { position: absolute; inset: 0; pointer-events: none; opacity: 0; border: 1px solid #c9bdff59; box-shadow: inset 0 0 22px #8f78ff40, 0 0 22px #8f78ff40; }
.hud.beat .pulse { animation: beta-beat .85s ease-out; }
/* Il riflesso orizzontale, come quello delle lenti del cinema, che attraversa il timer */
.flare { position: absolute; z-index: 0; left: -40%; right: -40%; top: 44%; height: 2px; background: linear-gradient(90deg, transparent 0%, #8f78ff00 18%, #c9bdffcc 46%, #fff 50%, #c9bdffcc 54%, #8f78ff00 82%, transparent 100%); box-shadow: 0 0 14px 2px #8f78ff66; opacity: 0; transform: scaleX(.2); pointer-events: none; animation: beta-flare 8s ease-in-out 4s infinite; }
.timer, .load { position: relative; z-index: 1; }
.timer { display: flex; align-items: stretch; justify-content: center; gap: clamp(8px, 2vmin, 20px); }
.unit { display: flex; flex-direction: column; align-items: center; gap: clamp(7px, 1.3vmin, 13px); }
/* Le cifre: piene e larghe, a rilievo come i titoli dei giochi — la faccia chiara, sotto il rilievo in strati che
   scuriscono, e un alone. I secondi in arancio. */
.num { display: flex; font: 400 var(--digit)/1 Bungee, Orbitron, sans-serif; }
.dg { display: inline-block; width: .76em; text-align: center; color: #fbf9ff; text-shadow: 0 .02em 0 #e4dcff, 0 .04em 0 #c9bdff, 0 .06em 0 #a996ff, 0 .08em 0 #8f78ff, 0 .1em 0 #6f5ed8, 0 .12em 0 #4e3fa8, 0 .14em 0 #33287a, 0 .22em .3em #000d, 0 0 .5em #8f78ff80; }
.num.tick .dg, .stage.final .num .dg { color: #fff6ec; text-shadow: 0 .02em 0 #ffe3c2, 0 .04em 0 #ffcf99, 0 .06em 0 #ffb067, 0 .08em 0 #ff9a3c, 0 .1em 0 #f07a1c, 0 .12em 0 #c85d10, 0 .14em 0 #8c3a0c, 0 .22em .3em #000d, 0 0 .5em #ff8a1f80; }
.dg.roll { animation: beta-roll .42s cubic-bezier(.2, .7, .2, 1); }
.lab { font: 700 calc(var(--zoom) * clamp(9px, .9vmin + 5px, 13px))/1 Orbitron, sans-serif; letter-spacing: .22em; margin-left: .22em; color: #eeeaff; text-shadow: 0 0 8px #8f78ff99; }
/* Il divisore fra i riquadri: una riga, non due punti */
.sep { flex: none; align-self: center; width: 2px; height: calc(var(--digit) * .62); margin-bottom: calc(var(--zoom) * clamp(15px, 1.8vmin + 11px, 24px)); background: linear-gradient(#8f78ff00, #a996ff, #8f78ff00); }
/* La barra del tempo passato dall'annuncio all'apertura: segmenti, come quella dell'esperienza */
.load { display: flex; align-items: center; gap: clamp(8px, 1.6vmin, 14px); margin-top: clamp(14px, 2.4vmin, 24px); font: 700 calc(var(--zoom) * clamp(8.5px, .8vmin + 4.5px, 12px))/1 Orbitron, sans-serif; letter-spacing: .22em; color: #e4dcff; }
.load-num { min-width: 3.2em; text-align: right; color: #ffb067; letter-spacing: .08em; text-shadow: 0 0 8px #ff8a1f80; }
.segs { flex: 1; display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: calc(var(--zoom) * clamp(8px, 1.3vmin, 12px)); }
.segs i { display: block; background: #2a2660; transform: skewX(-18deg); }
.segs i.on { background: linear-gradient(#e4dcff, #8f78ff); box-shadow: 0 0 6px #8f78ffb3; }
.segs i.now { background: linear-gradient(#ffe3c2, #ff8a1f); box-shadow: 0 0 8px #ff8a1fcc; animation: beta-blink 1s steps(2) infinite; }
/* Gli ultimi dieci secondi: il quadro si accende d'arancio, e il battito si fa forte */
.stage.final .corner { border-color: #ffb067; filter: drop-shadow(0 0 8px #ff8a1f); }
.stage.final .pulse { border-color: #ffb06799; box-shadow: inset 0 0 28px #ff8a1f59, 0 0 34px #ff8a1f80; }

/* ── Salva nel calendario: un tasto, che s'apre nelle due scelte ── */
.cal { position: relative; z-index: 2; display: flex; justify-content: center; width: var(--card); height: calc(var(--zoom) * clamp(40px, 5vmin, 48px)); animation: beta-rise 1s 2.95s cubic-bezier(.2, .8, .2, 1) both; }
.cal-main, .cal-pick { display: inline-flex; align-items: center; justify-content: center; gap: .8em; height: 100%; box-sizing: border-box; margin: 0; padding: 0 1.3em; border-radius: 10px; border: 1.5px solid #8f78ffb3; background: linear-gradient(#2a2660eb, #1a1646eb); color: #fff; font: 800 calc(var(--zoom) * clamp(10.5px, 1vmin + 6px, 14px))/1 Orbitron, sans-serif; letter-spacing: .16em; text-decoration: none; white-space: nowrap; cursor: pointer; box-shadow: 0 0 16px #8f78ff40, inset 0 1px 0 #c0b3ff40; transition: border-color .15s, box-shadow .15s, transform .08s; }
.cal-main svg { width: 1.45em; height: 1.45em; color: #ffb067; filter: drop-shadow(0 0 6px #ff8a1f80); }
.cal-main:active, .cal-pick:active { transform: translateY(2px); }
.cal-options { display: flex; gap: 10px; flex: 1; min-width: 0; height: 100%; }
.cal-options[hidden] { display: none; }
.cal-main[hidden] { display: none; }
.cal-pick { flex: 1; padding: 0 .6em; }
.cal-pick.google { border-color: #ffb067c0; box-shadow: 0 0 16px #ff8a1f40, inset 0 1px 0 #ffd2a840; }
:where(html:not([data-input="touch"])) .cal-main:hover, :where(html:not([data-input="touch"])) .cal-pick:hover { border-color: #e4dcff; box-shadow: 0 0 22px #8f78ff73, inset 0 1px 0 #c0b3ff59; }

/* ── Il codice ──
   Senza bagliori (il giocatore, 2026-11-19: «quel bagliore in basso dove c'è il codice dev sembra un errore»): niente
   alone attorno alla scheda né attorno a ENTRA, l'orlo tutto lavanda, la casella attiva chiara e non arancio — l'arancio
   attorno a un campo si legge come uno sbaglio —, e dietro la scena più buia. */
.card { position: relative; z-index: 1; width: var(--card); box-sizing: border-box; display: grid; gap: clamp(9px, 1.5vmin, 15px); margin: 0; padding: clamp(14px, 2.4vmin, 24px) clamp(14px, 2.2vmin, 22px) clamp(14px, 2.2vmin, 22px); text-align: center; border: 1.5px solid transparent; border-radius: 14px; background: linear-gradient(165deg, #1d1846f5, #110d2ef5) padding-box, linear-gradient(155deg, #c9bdff 0%, #9a6cff 30%, #514a9e 62%, #8f78ff 100%) border-box; box-shadow: 0 24px 30px -16px #020110e6; animation: beta-rise 1.1s 2.65s cubic-bezier(.2, .8, .2, 1) both; }
.title { justify-self: center; font: 800 calc(var(--zoom) * clamp(13px, 1.1vmin + 8px, 17px))/1.15 Orbitron, sans-serif; letter-spacing: .34em; margin-left: .34em; color: #fff; text-shadow: 0 0 10px #8f78ff80; }
.code { position: relative; }
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto repeat(4, minmax(0, 1fr)) auto repeat(4, minmax(0, 1fr)); align-items: center; gap: clamp(3px, .6vmin, 5px); }
.slot { display: grid; place-items: center; aspect-ratio: 5 / 7; border: 1px solid #514a9e; border-radius: 5px; background: #0a0818e6; box-shadow: inset 0 -3px 0 #2a266099; font: 500 calc(var(--zoom) * clamp(15px, 1.3vmin + 9px, 22px))/1 'DM Mono', ui-monospace, monospace; font-style: normal; color: #fff; text-shadow: 0 0 8px #8f78ffb3; }
.slot.full { border-color: #9a6cff; }
.slot.cursor { border-color: #e4dcff; box-shadow: inset 0 -3px 0 #a996ff; animation: beta-blink 1s steps(2) infinite; }
.code:not(:focus-within) .slot.cursor { animation: none; border-color: #514a9e; box-shadow: inset 0 -3px 0 #2a266099; }
.dash { width: clamp(5px, 1vmin, 9px); height: 2px; background: #8f78ff; }
/* Il campo vero: sopra alle caselle, invisibile, così la tastiera del telefono, l'incolla e i lettori di schermo lavorano
   come con un campo qualunque. Sedici pixel: sotto, l'iPhone ingrandisce la pagina al tocco. */
.input { position: absolute; inset: 0; width: 100%; height: 100%; box-sizing: border-box; margin: 0; padding: 0; border: 0; background: transparent; color: transparent; caret-color: transparent; font: 500 16px/1 'DM Mono', ui-monospace, monospace; text-align: center; opacity: 0; cursor: text; -webkit-appearance: none; appearance: none; }
.input:focus { outline: 0; }
.code.wrong .slots { animation: beta-shake .36s steps(6); }
.error { min-height: 1em; margin: -2px 0 0; font: 700 calc(var(--zoom) * clamp(11px, 1vmin + 6px, 13px))/1 Manrope, sans-serif; color: #ffb27a; }
.enter { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: .9em; height: calc(var(--zoom) * clamp(42px, 5.4vmin, 52px)); margin: 0; padding: 0; border-radius: 10px; border: 1.5px solid transparent; background: linear-gradient(#ffad60 0%, #f5832f 52%, #de611c 100%) padding-box, linear-gradient(90deg, #ffe39a, #ffc04d 50%, #ffe39a) border-box; color: #1a0d00; font: 900 calc(var(--zoom) * clamp(12px, 1vmin + 7px, 15px))/1 Orbitron, sans-serif; letter-spacing: .26em; box-shadow: 0 4px 0 #8c3a0c; cursor: pointer; transition: transform .08s, box-shadow .08s; }
.enter:active { transform: translateY(3px); box-shadow: 0 1px 0 #8c3a0c; }
.enter:disabled { opacity: .6; cursor: progress; }
.enter:focus-visible, .cal-main:focus-visible, .cal-pick:focus-visible { outline: 2px solid #fff3e6; outline-offset: 2px; }
/* Il triangolo di avvio */
.play { width: 0; height: 0; border-style: solid; border-width: .42em 0 .42em .7em; border-color: transparent transparent transparent #1a0d00; animation: beta-nudge 1s steps(2) infinite; }
.sheen { position: absolute; top: -50%; bottom: -50%; left: -60px; width: 34px; background: linear-gradient(90deg, #fff0, #ffffff80, #fff0); transform: skewX(-20deg); animation: beta-sweep 4.5s ease-in-out infinite; pointer-events: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Di traverso: due colonne ── */
@media (orientation: landscape) and (min-aspect-ratio: 1/1) {
  .stage { grid-template-rows: 1fr; grid-template-columns: minmax(0, 1fr) minmax(300px, 36%); column-gap: 0; }
  .scene { height: 100%; gap: clamp(8px, 2.4vmin, 28px); }
  .card { justify-self: center; }
  .cal { width: min(100% - 44px, 420px); }
}
/* Un telefono di traverso è basso: il marchio si stringe, e il timer tiene il posto */
@media (orientation: landscape) and (max-height: 460px) {
  .logo { width: clamp(90px, 26vmin, 140px); }
  .frag { font-size: clamp(18px, 5.6vmin, 26px); }
  .scene { gap: 7px; }
  .hud { padding: 9px 16px 8px; }
  .load { margin-top: 8px; }
  .cal { height: 32px; }
  .card { gap: 8px; padding: 12px 14px; }
}
/* Un telefono piccolo in verticale: un poco più stretto ovunque */
@media (orientation: portrait) and (max-height: 700px) {
  .scene { gap: clamp(8px, 2vmin, 14px); }
  .cal { height: 38px; }
}

/* ── Alla fine — o col codice giusto — le bande si chiudono sul nero, e la pagina si ricarica: di là c'è lo splash ── */
.stage.open .bar { animation: beta-bars-close .95s cubic-bezier(.7, 0, .3, 1) forwards; }
.stage.open .scene, .stage.open .card, .stage.open .matrix { animation: beta-fadeout .7s ease-in forwards; }
.stage.open .when { opacity: 0; transition: opacity .3s; }

@keyframes beta-bars-open { from { height: 51%; } to { height: 0; } }
@keyframes beta-bars-close { from { height: 0; } to { height: 51%; } }
@keyframes beta-push { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.24); } 30% { opacity: 1; } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes beta-flash { 0% { opacity: 0; } 10% { opacity: .5; } 100% { opacity: 0; } }
@keyframes beta-logo { from { opacity: 0; transform: scale(1.18); filter: blur(10px) drop-shadow(0 6px 14px #000c); } to { opacity: 1; transform: none; filter: blur(0) drop-shadow(0 6px 14px #000c); } }
@keyframes beta-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes beta-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes beta-tracking { from { opacity: 0; letter-spacing: .6em; } to { opacity: 1; letter-spacing: .1em; } }
@keyframes beta-slam { 0% { opacity: 0; transform: rotate(-8deg) skewX(-10deg) scale(2.4); } 55% { opacity: 1; transform: rotate(-8deg) skewX(-10deg) scale(.88); } 100% { opacity: 1; transform: rotate(-8deg) skewX(-10deg) scale(1); } }
@keyframes beta-corner { from { opacity: 0; translate: var(--dx) var(--dy); } to { opacity: 1; translate: 0 0; } }
@keyframes beta-beat { from { opacity: 1; } to { opacity: 0; } }
@keyframes beta-flare { 0%, 100% { opacity: 0; transform: scaleX(.2); } 8% { opacity: .9; transform: scaleX(1); } 18% { opacity: 0; transform: scaleX(1.15); } }
@keyframes beta-lightning { 0% { opacity: 0; } 1% { opacity: .3; } 2.2% { opacity: .05; } 3.2% { opacity: .22; } 7% { opacity: 0; } 100% { opacity: 0; } }
@keyframes beta-fog { from { transform: translate3d(-6%, 0, 0); } to { transform: translate3d(6%, -2%, 0); } }
@keyframes beta-edge { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(134vw, 0, 0); } }
@keyframes beta-pan { from { transform: translate3d(4%, 1%, 0) scale(1.02); } to { transform: translate3d(-4%, -1%, 0) scale(1.12); } }
@keyframes beta-spin { to { transform: rotate(360deg); } }
@keyframes beta-pulse { 0%, 100% { opacity: .7; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes beta-roll { from { transform: translateY(-38%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes beta-blink { 0% { opacity: 1; } 100% { opacity: .35; } }
@keyframes beta-nudge { 0% { transform: translateX(0); } 100% { transform: translateX(3px); } }
@keyframes beta-sweep { 0%, 60% { transform: skewX(-20deg) translateX(0); } 100% { transform: skewX(-20deg) translateX(560px); } }
@keyframes beta-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes beta-fadeout { to { opacity: 0; visibility: hidden; } }

/* Chi ha chiesto meno movimento: niente sequenza d'apertura, né pioggia, né fulmini, né rulli; restano l'orologio e le
   dissolvenze */
@media (prefers-reduced-motion: reduce) {
  .bar, .bar::after, .street, .flash, .logo, .cross, .frag, .beta, .hud, .corner, .card, .cal, .portal, .portal::before, .portal::after, .pan, .matrix, .when, .lightning, .fog, .flare, .sheen, .play { animation: none !important; }
  .lightning, .flash, .flare { display: none; }
  .dg.roll, .code.wrong .slots, .hud.beat .pulse { animation: none; }
}
