/* Campionato SØRSO in stile «carta d'imbarco» (scelto dall'utente il 2026-11-25): cielo chiaro, biglietto aereo
   bianco con la matrice tratteggiata, blu notte e arancio sole, SØRSO in primo piano come compagnia del volo.
   Caratteri serviti da qui (Inter, OFL, da @fontsource): nessuna richiesta a Google. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/inter-latin-800-normal.woff2') format('woff2'); }

:root {
  --sky-1: #bfe3ff;
  --sky-2: #eaf6ff;
  --paper: #ffffff;
  --paper-2: #f3f8fd;
  --line: #d9e7f5;
  --line-strong: #bcd5f0;
  --navy: #0b2545;
  --blue: #1d4e89;
  --blue-2: #3a7bd5;
  --muted: #5b7aa0;
  --faint: #8aa3c0;
  --sun: #f39c12;
  --sun-2: #ffb547;
  --red: #e83e3b;
  --ok: #1e9e63;
  --bad: #d64541;
  --font: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--navy); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background: linear-gradient(180deg, var(--sky-1) 0, var(--sky-2) 520px, #f8fbff 1100px) no-repeat, #f8fbff;
}
a { color: var(--blue-2); }
button { font: inherit; }
.num { font-variant-numeric: tabular-nums; }
.wrap { width: min(1120px, 100%); margin: 0 auto; padding: 0 16px; }

/* nuvole che passano piano */
.sky { position: absolute; inset: 0 0 auto; height: 560px; overflow: hidden; pointer-events: none; z-index: -1; }
.cloud { position: absolute; width: 220px; height: 64px; border-radius: 64px; background: rgba(255, 255, 255, 0.75); animation: drift 60s linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; border-radius: 50%; background: inherit; }
.cloud::before { width: 90px; height: 90px; left: 34px; top: -44px; }
.cloud::after { width: 120px; height: 120px; left: 90px; top: -62px; }
.cloud.c1 { top: 120px; left: -260px; }
.cloud.c2 { top: 300px; left: -260px; scale: 0.7; animation-duration: 85s; animation-delay: -40s; }
.cloud.c3 { top: 40px; left: -260px; scale: 0.5; animation-duration: 110s; animation-delay: -70s; opacity: 0.7; }
@keyframes drift { to { translate: calc(100vw + 520px) 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.7); opacity: 0; } 60% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(232, 62, 59, 0); } 100% { box-shadow: 0 0 0 0 rgba(232, 62, 59, 0); } }
@keyframes bump { 0% { background: #fff3d6; } 100% { background: var(--paper-2); } }
@keyframes fly { 0%, 100% { transform: translate(-6px, 3px) rotate(-3deg); } 50% { transform: translate(6px, -4px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- testata: SØRSO in primo piano ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0 8px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--navy); }
.brand img { height: 46px; width: auto; display: block; }
.brand span { font-size: 12px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); line-height: 1.3; border-left: 2px solid var(--line-strong); padding-left: 14px; }
.top .small, .small { color: var(--blue); font-size: 14px; font-weight: 700; text-decoration: none; }
@media (max-width: 560px) { .brand img { height: 36px; } .brand span { display: none; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 800 12px/1.4 var(--font); letter-spacing: 0.18em; text-transform: uppercase; color: var(--blue-2); margin: 0 0 10px; }

/* ---------- la carta d'imbarco ---------- */
.pass {
  margin: 18px 0 8px; display: grid; grid-template-columns: minmax(0, 1fr) 250px; background: var(--paper); border-radius: 26px;
  box-shadow: 0 24px 60px rgba(29, 78, 137, 0.2); overflow: hidden; animation: rise 0.6s both; position: relative;
}
.pass-band { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 30px; background: var(--navy); color: #fff; }
.pass-band img { height: 30px; display: block; }
.pass-band span { font-size: 12px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: #cfe0f5; }
.pass-main { padding: 28px 32px 30px; min-width: 0; }
.pass h1 { font: 800 clamp(40px, 6.6vw, 68px)/1 var(--font); letter-spacing: -0.03em; margin: 6px 0 14px; color: var(--navy); }
.pass h1 em { font-style: normal; color: var(--sun); }
.pass .claim { margin: 0; font-size: 18px; color: #284b74; max-width: 600px; }
.pass .claim b { color: var(--navy); }
.meta { display: flex; flex-wrap: wrap; gap: 14px 30px; margin-top: 22px; padding-top: 18px; border-top: 2px solid var(--paper-2); }
.meta div { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.meta b { display: block; margin-top: 4px; font-size: 22px; letter-spacing: -0.01em; text-transform: none; color: var(--navy); }
.meta .hot b { color: var(--sun); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.stub {
  position: relative; display: grid; align-content: center; justify-items: center; gap: 6px; text-align: center;
  padding: 26px 20px; background: var(--paper-2); border-left: 3px dashed var(--line-strong);
}
/* le tacche della matrice */
.stub::before, .stub::after { content: ''; position: absolute; left: -16px; width: 30px; height: 30px; border-radius: 50%; background: var(--sky-2); }
.stub::before { top: -15px; }
.stub::after { bottom: -15px; }
.stub small { font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.stub .seat { font: 800 76px/1 var(--font); color: var(--navy); letter-spacing: -0.04em; }
.stub .plane { font-size: 40px; line-height: 1; animation: fly 3.5s ease-in-out infinite; }
.barcode { width: 100%; height: 54px; margin-top: 10px; background: repeating-linear-gradient(90deg, var(--navy) 0 3px, transparent 3px 6px, var(--navy) 6px 7px, transparent 7px 11px, var(--navy) 11px 13px, transparent 13px 15px); }
.stub .who-you { font-size: 13px; font-weight: 700; color: var(--blue); }
@media (max-width: 760px) {
  .pass { grid-template-columns: 1fr; }
  .pass-band { padding: 12px 18px; }
  .pass-band span:not(.xmas-tag) { display: none; }
  .pass-main { padding: 22px 18px 24px; }
  .stub { border-left: 0; border-top: 3px dashed var(--line-strong); grid-template-columns: auto 1fr; justify-items: start; text-align: left; gap: 2px 16px; padding: 18px; }
  .stub::before, .stub::after { top: -16px; bottom: auto; }
  .stub::before { left: -15px; }
  .stub::after { left: auto; right: -15px; }
  .stub .seat { grid-row: 1 / span 3; font-size: 60px; }
  .stub .plane, .barcode { display: none; }
  .meta { gap: 12px 22px; }
  .meta b { font-size: 18px; }
}

/* ---------- pulsanti ---------- */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none;
  border: 2px solid var(--line-strong); background: var(--paper); color: var(--navy);
  font: 800 15px/1 var(--font); padding: 13px 18px; border-radius: 14px; transition: transform 0.12s, background 0.12s;
}
.btn:hover { background: var(--paper-2); }
.btn:active { transform: scale(0.97); }
.btn.primary { border-color: var(--sun); background: var(--sun); color: #fff; box-shadow: 0 10px 24px rgba(243, 156, 18, 0.35); }
.btn.primary:hover { background: #e58e06; }
.btn.big { min-height: 58px; font-size: 18px; padding: 16px 26px; border-radius: 16px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: #f1c4c2; background: #fff6f5; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn.small { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn.wide { width: 100%; }
@media (max-width: 560px) { .cta-row .btn { flex: 1 1 100%; } }

/* ---------- itinerario: come si vince ---------- */
.how { display: grid; gap: 12px; margin: 26px 0 6px; }
@media (min-width: 760px) { .how { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .how { grid-template-columns: repeat(4, 1fr); } }
.how-step { position: relative; display: grid; gap: 4px; padding: 18px 18px 18px 72px; border-radius: 20px; background: var(--paper); border: 2px solid var(--line); }
.how-step .n { position: absolute; left: 16px; top: 16px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font: 800 18px/1 var(--font); background: var(--navy); color: #fff; }
.how-step:last-child .n { background: var(--sun); }
.how-step b { font-size: 18px; font-weight: 800; }
.how-step span:last-child { color: var(--muted); font-size: 14px; }

/* ---------- tabellone delle partenze (le serate) ---------- */
.calendar { margin: 22px 0 6px; padding: 18px; border-radius: 22px; background: var(--navy); color: #fff; }
.calendar .eyebrow { color: #9cc3f0; }
.days { display: flex; gap: 10px; }
.day { flex: 1 1 0; min-width: 0; display: grid; justify-items: center; gap: 2px; padding: 12px 4px 10px; border-radius: 14px; background: #12325c; border: 2px solid #1f4677; }
.day .dw, .day .dm { font: 800 11px/1 var(--font); letter-spacing: 0.12em; text-transform: uppercase; color: #9cc3f0; }
.day b { font: 800 34px/1.05 var(--font); color: #fff; font-variant-numeric: tabular-nums; }
.day small { margin-top: 4px; font: 800 10px/1.2 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: #9cc3f0; }
.day.done small { color: #6ee0a6; }
.day.next { border-color: var(--sun); }
.day.next small { color: var(--sun-2); }
.day.tonight { background: var(--sun); border-color: var(--sun); animation: pop 0.6s both; }
.day.tonight .dw, .day.tonight .dm, .day.tonight small, .day.tonight b { color: #fff; }
.day.past { opacity: 0.5; }
@media (max-width: 520px) {
  .calendar { padding: 14px 10px; }
  .days { gap: 6px; }
  .day { padding: 10px 2px 8px; border-radius: 12px; }
  .day b { font-size: 24px; }
  .day small, .day .dw, .day .dm { font-size: 9px; letter-spacing: 0.04em; }
}

/* ---------- griglia e card ---------- */
.grid { display: grid; gap: 20px; padding: 18px 0 56px; }
@media (min-width: 940px) { .grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } }
.stack { display: grid; gap: 20px; }
.card { position: relative; background: var(--paper); border-radius: 24px; padding: 24px; box-shadow: 0 12px 34px rgba(29, 78, 137, 0.12); animation: rise 0.6s both; }
.card h2 { font: 800 26px/1.1 var(--font); letter-spacing: -0.02em; margin: 0 0 6px; }
.card .sub { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.prize { text-align: center; border: 2px solid #ffe2b0; background: linear-gradient(180deg, #fff8ea, #fff); }
.prize .big { font-size: 46px; line-height: 1; margin-bottom: 6px; }
.prize .eyebrow { color: var(--sun); justify-content: center; }
.prize .text { margin: 0; font: 800 30px/1.1 var(--font); letter-spacing: -0.02em; color: var(--navy); }
.prize-detail { margin: 10px 0 0; color: #284b74; white-space: pre-line; }
.prize .from { margin: 14px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.prize .from img { height: 20px; vertical-align: -4px; margin-left: 4px; }

/* ---------- modulo (check-in) ---------- */
form { display: grid; gap: 14px; }
.row2 { display: grid; gap: 14px; }
@media (min-width: 520px) { .row2 { grid-template-columns: 1fr 1fr; } }
label { display: grid; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
input, textarea, select {
  width: 100%; font: 500 17px/1.3 var(--font); letter-spacing: 0; text-transform: none; color: var(--navy); background: var(--paper-2);
  border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; transition: border-color 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus { border-color: var(--blue-2); background: #fff; }
input[aria-invalid="true"] { border-color: var(--bad); background: #fff6f5; }
.hint { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--faint); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; color: #284b74; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--sun); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.msg { border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 600; }
.msg.err { background: #fff1f0; border: 2px solid #f6c4c1; color: #a3302c; }
.msg.ok { background: #ecfbf3; border: 2px solid #b6ecd0; color: #146b43; }
.done { text-align: center; animation: pop 0.5s both; }
.done .big { font-size: 52px; line-height: 1; }
.done h3 { font: 800 30px/1.1 var(--font); margin: 8px 0 12px; }
.done p { color: var(--muted); margin: 12px 0 0; }
.nick-badge { display: inline-block; padding: 9px 18px; border-radius: 999px; background: var(--navy); color: #fff; font: 800 19px/1 var(--font); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.btn.share { margin-top: 16px; }
.done .share { width: 100%; }

/* ---------- classifica ---------- */
.live { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: #fff1f0; font: 800 11px/1 var(--font); letter-spacing: 0.16em; text-transform: uppercase; color: var(--red); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live.on i { background: var(--red); animation: pulse 1.8s infinite; }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 10px; margin: 6px 0 18px; }
.podium:empty { display: none; }
.step { display: grid; justify-items: center; gap: 6px; text-align: center; min-width: 0; animation: rise 0.5s both; }
.step.p2 { order: 1; }
.step.p1 { order: 2; }
.step.p3 { order: 3; }
.step .medal { font-size: 36px; line-height: 1; }
.step .nick { font: 800 15px/1.15 var(--font); max-width: 100%; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.step .score { font: 800 22px/1 var(--font); }
.step .score small { display: block; font: 800 10px/1.4 var(--font); letter-spacing: 0.14em; color: var(--muted); }
.step .block { width: 100%; border-radius: 14px 14px 6px 6px; display: grid; place-items: center; align-content: center; font: 800 32px/1 var(--font); color: #fff; }
.step.p1 .block { height: 128px; background: var(--navy); }
/* il primo ha il posto 1A: è lui che parte */
.step.p1 .block::after { content: 'POSTO 1A'; display: block; font-size: 11px; letter-spacing: 0.14em; color: var(--sun-2); margin-top: 6px; }
.step.p2 .block { height: 94px; background: var(--blue); }
.step.p3 .block { height: 72px; background: var(--blue-2); }
.step.p1 .medal { font-size: 48px; }
.step.p1 .nick { font-size: 17px; }
.step.me .nick { color: var(--sun); }
@media (min-width: 600px) { .step .nick { font-size: 16px; } .step.p1 .nick { font-size: 19px; } }

.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--paper-2); border: 2px solid transparent; }
.board li.changed { animation: bump 1.6s ease-out; }
.board .pos { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 800 16px/1 var(--font); background: #fff; border: 2px solid var(--line-strong); color: var(--blue); }
.board .who { min-width: 0; }
.board .who b { display: block; font: 700 17px/1.2 var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .who small { color: var(--muted); font-size: 12px; font-weight: 600; }
.board .who small .up { color: var(--ok); }
.board .pts { font: 800 22px/1 var(--font); text-align: right; font-variant-numeric: tabular-nums; }
.board .pts small { display: block; font: 800 10px/1.3 var(--font); color: var(--faint); letter-spacing: 0.14em; text-transform: uppercase; margin-top: 3px; }
.board li.p1 .pos { background: var(--navy); border-color: var(--navy); color: #fff; }
.board li.me { border-color: var(--sun); background: #fff8ea; }
.empty { color: var(--muted); font-size: 15px; padding: 20px 0 6px; text-align: center; }
.empty .big { display: block; font-size: 42px; margin-bottom: 8px; }
.search { margin-bottom: 14px; }

footer { color: var(--muted); font-size: 13px; padding: 22px 0 34px; display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; align-items: center; border-top: 2px solid var(--line); }
footer img { height: 22px; vertical-align: middle; }
footer a { color: var(--blue); }
@media (max-width: 939px) { footer { padding-bottom: 110px; } }

/* coriandoli all'iscrizione */
.confetti { position: fixed; top: -14px; width: 10px; height: 14px; border-radius: 2px; z-index: 50; pointer-events: none; }

/* invito fisso sul telefono */
.sticky-cta { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40; box-shadow: 0 16px 34px rgba(11, 37, 69, 0.35); animation: rise 0.35s both; }
body:not(.past-hero) .sticky-cta { display: none; }
@media (min-width: 940px) { .sticky-cta { display: none; } }

/* ---------- schermo TV (/classifica) ---------- */
.tv { min-height: 100vh; display: flex; flex-direction: column; padding: 3vh 4vw; }
.tv .top { padding: 0 0 2vh; }
.tv .brand img { height: 7vh; }
.tv .brand span { font-size: 1.7vh; }
.tv .live { font-size: 1.6vh; padding: 1vh 1.6vh; }
.tv .live i { width: 1.2vh; height: 1.2vh; }
.tv .head { text-align: center; }
.tv .eyebrow { font-size: 2vh; justify-content: center; }
.tv h1 { font: 800 7vh/1 var(--font); letter-spacing: -0.03em; margin: 0; }
.tv h1 em { font-style: normal; color: var(--sun); }
.tv-body { flex: 1; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 3vw; align-items: center; margin-top: 3vh; }
.tv .podium { margin: 0; gap: 1.4vw; }
.tv .step .medal { font-size: 6vh; }
.tv .step.p1 .medal { font-size: 8vh; }
.tv .step .nick { font-size: 2.4vh; }
.tv .step.p1 .nick { font-size: 2.9vh; }
.tv .step .score { font-size: 3.6vh; }
.tv .step .score small { font-size: 1.4vh; }
.tv .step .block { font-size: 6vh; }
.tv .step.p1 .block { height: 30vh; }
.tv .step.p1 .block::after { font-size: 1.8vh; }
.tv .step.p2 .block { height: 22vh; }
.tv .step.p3 .block { height: 16vh; }
.tv .board { display: block; columns: 2; column-gap: 1.6vw; }
.tv .board li { break-inside: avoid; margin-bottom: 1.1vh; padding: 1.2vh 1.2vw; border-radius: 1.8vh; grid-template-columns: 6vh minmax(0, 1fr) auto; background: #fff; }
.tv .board .pos { width: 5.4vh; height: 5.4vh; font-size: 2.4vh; }
.tv .board .who b { font-size: 2.8vh; }
.tv .board .who small { font-size: 1.5vh; }
.tv .board .pts { font-size: 3.2vh; }
.tv .board .pts small { font-size: 1.2vh; }
.tv .empty { font-size: 3vh; }
.tv .prize-line { text-align: center; margin: 2vh auto 0; padding: 1.4vh 3vh; border-radius: 2vh; background: var(--navy); color: #fff; font: 800 2.6vh/1.2 var(--font); width: fit-content; max-width: 100%; }
@media (max-aspect-ratio: 1/1) { .tv-body { grid-template-columns: 1fr; } }

/* ---------- testi (privacy) ---------- */
.doc { padding: 10px 0 60px; max-width: 760px; }
.doc h1 { font: 800 42px/1.05 var(--font); letter-spacing: -0.02em; margin: 10px 0 22px; }
.doc h2 { font: 800 21px/1.2 var(--font); margin: 28px 0 8px; }
.doc p, .doc li { color: #284b74; }
.ph { background: #ffe1df; color: #a3302c; padding: 0 4px; border-radius: 4px; }

/* ---------- regia ---------- */
.adm-title { font: 800 38px/1.05 var(--font); letter-spacing: -0.02em; margin: 0 0 18px; }
.hero-mini { font-size: 48px; line-height: 1; margin-bottom: 6px; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 6px 0 20px; border-radius: 18px; background: var(--paper); box-shadow: 0 6px 18px rgba(29, 78, 137, 0.1); }
.tabs button { appearance: none; border: 0; background: transparent; color: var(--muted); padding: 10px 16px; border-radius: 14px; font: 800 14px/1 var(--font); cursor: pointer; }
.tabs button.on { background: var(--navy); color: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font: 800 11px/1.3 var(--font); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.r, th.r { text-align: right; }
.tablewrap { overflow-x: auto; }
.pts-input { width: 96px; text-align: right; padding: 9px 12px; font-weight: 800; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.toolbar > * { flex: none; }
.toolbar .grow { flex: 1 1 220px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--paper); border-radius: 18px; padding: 16px 18px; box-shadow: 0 6px 18px rgba(29, 78, 137, 0.1); }
.stat b { display: block; font: 800 30px/1.05 var(--font); overflow-wrap: anywhere; }
.stat span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.evlist { display: grid; gap: 8px; }
.evlist .btn { justify-content: flex-start; font-weight: 600; }
.login { max-width: 440px; margin: 6vh auto; text-align: center; }
.login form { text-align: left; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, #fff 35%); padding: 18px 0 4px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.muted { color: var(--muted); }
.rules-text { white-space: pre-line; margin: 0; color: #284b74; }
.editbox { margin-top: 18px; background: var(--paper-2); box-shadow: none; }
.pass .eyebrow { display: block; }
.where h2 { margin-bottom: 4px; }
.where .addr { margin: 0 0 14px; color: #284b74; font-size: 16px; }
.where-links { display: flex; flex-wrap: wrap; gap: 8px; }
.where-links .btn { flex: 1 1 auto; font-size: 14px; }
footer small { color: var(--faint); }

/* ---------- Natale: neve, lucine, accenti rosso e verde ---------- */
:root { --xmas-red: #d62839; --xmas-green: #1f8a5b; }
.snow { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.flake { position: absolute; top: -20px; color: #fff; text-shadow: 0 0 2px rgba(29, 78, 137, 0.55), 0 0 8px rgba(29, 78, 137, 0.35); user-select: none; animation: fall linear infinite; }
@keyframes fall { to { transform: translate3d(var(--dx, 30px), 110vh, 0) rotate(360deg); } }
/* lucine sulla fascia della carta d'imbarco */
.lights { position: absolute; left: 0; right: 0; top: 52px; height: 18px; pointer-events: none; display: flex; justify-content: space-around; padding: 0 10px; z-index: 2; }
.lights::before { content: ''; position: absolute; left: 0; right: 0; top: 2px; height: 10px; border-bottom: 2px solid #20476f; border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.lights i { position: relative; width: 10px; height: 14px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; margin-top: 8px; animation: twinkle 1.6s ease-in-out infinite; }
.lights i:nth-child(4n+1) { background: #ff3b3b; color: #ff3b3b; }
.lights i:nth-child(4n+2) { background: #ffd23f; color: #ffd23f; animation-delay: 0.4s; }
.lights i:nth-child(4n+3) { background: #3bd16f; color: #3bd16f; animation-delay: 0.8s; }
.lights i:nth-child(4n) { background: #4cc3ff; color: #4cc3ff; animation-delay: 1.2s; }
@keyframes twinkle { 0%, 100% { opacity: 1; box-shadow: 0 0 10px 2px currentColor; } 50% { opacity: 0.45; box-shadow: none; } }
@media (max-width: 760px) { .lights { top: 46px; } .lights i:nth-child(n+13) { display: none; } }
.xmas-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--xmas-red); color: #fff; font: 800 11px/1 var(--font); letter-spacing: 0.14em; text-transform: uppercase; }
.pass-band .xmas-tag { margin-left: auto; margin-right: 14px; }
@media (max-width: 760px) { .pass-band .xmas-tag { margin-right: 0; } }
.pass h1 em { color: var(--xmas-red); }
.stub .seat { position: relative; }
.stub .hat { position: absolute; top: -26px; right: -22px; font-size: 38px; transform: rotate(18deg); }
/* il premio è il regalo: fiocco rosso */
.prize { border-color: #f3c1c6; background: linear-gradient(180deg, #fff3f4, #fff); }
.prize .eyebrow { color: var(--xmas-red); }
.prize::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 14px; margin-left: -7px; background: rgba(214, 40, 57, 0.07); pointer-events: none; }
/* serate speciali sul tabellone */
.day .xmas { font-size: 16px; line-height: 1; margin-top: 2px; }
.how-step:last-child .n { background: var(--xmas-red); }
.calendar { background: linear-gradient(180deg, #0b2545, #0e3a2c); }
.tv .snow { z-index: 0; }

/* ================= Natale «pieno»: sera d'inverno, slitta, abeti, pacco regalo, calendario dell'avvento ================= */
:root { --xmas-red: #c8102e; --xmas-red-2: #e63946; --xmas-green: #146b3a; --xmas-green-2: #1f8a4c; --gold-x: #f2c14e; --night: #0a1a3a; }
body { background: linear-gradient(180deg, #050f26 0, #0b2550 330px, #1d3f78 560px, #dfe9f7 760px, #f6f9fd 1000px) no-repeat, #f6f9fd; }
.sky { height: 820px; }
.cloud { display: none; }
/* stelle */
.sky::before {
  content: ''; position: absolute; inset: 0 0 260px; opacity: 0.9;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 12%, #fff, transparent), radial-gradient(1px 1px at 22% 30%, #fff, transparent),
    radial-gradient(2px 2px at 35% 8%, #fff8d6, transparent), radial-gradient(1px 1px at 48% 22%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 62% 6%, #fff, transparent), radial-gradient(1px 1px at 74% 26%, #fff, transparent),
    radial-gradient(2px 2px at 86% 14%, #fff8d6, transparent), radial-gradient(1px 1px at 93% 34%, #fff, transparent),
    radial-gradient(1px 1px at 5% 40%, #fff, transparent), radial-gradient(1.5px 1.5px at 56% 40%, #fff, transparent);
  animation: stars 4s ease-in-out infinite alternate;
}
@keyframes stars { to { opacity: 0.55; } }
/* colline innevate con gli abeti, in fondo al cielo */
.sky::after {
  content: ''; position: absolute; left: -5%; right: -5%; bottom: 0; height: 300px;
  background:
    radial-gradient(60% 120px at 20% 100%, #ffffff 98%, transparent 100%),
    radial-gradient(55% 140px at 80% 100%, #f1f6fd 98%, transparent 100%),
    radial-gradient(70% 90px at 50% 100%, #e6eef9 98%, transparent 100%);
}
.trees { position: absolute; left: 0; right: 0; bottom: 120px; display: flex; justify-content: space-between; padding: 0 2%; font-size: 46px; z-index: 1; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.25)); }
.trees span:nth-child(even) { font-size: 34px; transform: translateY(14px); }
@media (max-width: 760px) { .trees { display: none; } }
/* la slitta che attraversa il cielo */
.sleigh { position: absolute; top: 70px; left: -240px; font-size: 34px; white-space: nowrap; animation: sleigh 26s linear infinite; filter: drop-shadow(0 0 10px rgba(255, 240, 180, 0.6)); }
@keyframes sleigh { 0% { translate: 0 0; } 50% { translate: calc(50vw + 120px) -30px; } 100% { translate: calc(100vw + 480px) 10px; } }
.flake { color: #fff; text-shadow: 0 0 4px rgba(255, 255, 255, 0.8); }

/* testata sul cielo di notte: logo chiaro */
.top .brand { color: #fff; }
.top .brand span { color: #c9d8f2; border-left-color: rgba(255, 255, 255, 0.3); }
.top .small { color: #ffe9a8; }
.brand .logo-dark { display: none; }
.brand .logo-light { display: block; }
.tv .brand .logo-dark { display: block; }
.tv .brand .logo-light { display: none; }

/* carta d'imbarco: bordo a bastoncino di zucchero e festone */
.pass { border: 0; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45); }
.pass::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  padding: 7px; background: repeating-linear-gradient(45deg, var(--xmas-red) 0 14px, #fff 14px 28px);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.pass-band { background: var(--xmas-green); padding-top: 18px; }
.lights { top: 56px; }
.lights::before { border-bottom: 6px solid #0f5a2f; top: -2px; height: 14px; filter: drop-shadow(0 2px 0 #0a4423); }
.pass h1 em { color: var(--xmas-red); }
.pass .eyebrow { color: var(--xmas-green); }
.meta .hot b { color: var(--xmas-red); }
.stub { background: #fff7f7; }
.stub::before, .stub::after { background: #1d3f78; }
@media (max-width: 760px) { .stub::before, .stub::after { background: #f1f6fd; } }

/* pulsanti di Natale */
.btn.primary { border-color: var(--xmas-red); background: var(--xmas-red); box-shadow: 0 10px 24px rgba(200, 16, 46, 0.35); }
.btn.primary:hover { background: #a50d26; }
.btn.ghost { color: var(--xmas-green); border-color: #b9dcc6; background: #fff; }

/* card con il cappello di neve */
.card, .how-step { border-top: 0; }
.card::after, .how-step::after {
  content: ''; position: absolute; left: 10px; right: 10px; top: -7px; height: 14px; border-radius: 14px; pointer-events: none;
  background: radial-gradient(10px 8px at 10% 100%, #fff 98%, transparent), radial-gradient(14px 9px at 35% 100%, #fff 98%, transparent),
    radial-gradient(12px 8px at 62% 100%, #fff 98%, transparent), radial-gradient(14px 9px at 88% 100%, #fff 98%, transparent), #fff;
  box-shadow: 0 2px 4px rgba(29, 78, 137, 0.12);
}
.how-step .n { background: var(--xmas-green); }
.how-step:nth-child(2) .n { background: var(--gold-x); color: #3d2a00; }
.how-step:last-child .n { background: var(--xmas-red); }

/* calendario dell'avvento: porticine rosse e verdi con il nastro */
.calendar { background: #fff; color: var(--navy); box-shadow: 0 12px 34px rgba(29, 78, 137, 0.14); position: relative; }
.calendar .eyebrow { color: var(--xmas-red); }
.day { position: relative; background: var(--xmas-red); border: 0; border-radius: 12px; overflow: hidden; padding-top: 14px; }
.day:nth-child(even) { background: var(--xmas-green); }
.day::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 8px; margin-left: -4px; background: var(--gold-x); opacity: 0.85; }
.day::after { content: '🎀'; position: absolute; top: -4px; left: 50%; transform: translateX(-50%); font-size: 18px; }
.day > * { position: relative; z-index: 1; }
.day b { color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.day .dw, .day .dm, .day small { color: #fff3d6; }
.day.done { opacity: 1; }
.day.done::after { content: '✅'; font-size: 14px; top: 2px; }
.day.next { outline: 4px solid var(--gold-x); outline-offset: 2px; }
.day.next small { color: #fff; }
.day.tonight { background: var(--gold-x); outline: 4px solid var(--xmas-red); }
.day.tonight b, .day.tonight .dw, .day.tonight .dm, .day.tonight small { color: #3d2a00; text-shadow: none; }

/* il premio è un pacco regalo */
.prize { background: var(--xmas-red); border: 0; color: #fff; overflow: visible; }
.prize::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 22px; margin-left: -11px; background: var(--gold-x); pointer-events: none; }
.prize .bow { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); font-size: 54px; line-height: 1; z-index: 2; }
.prize > * { position: relative; z-index: 1; }
.prize .big { margin-top: 10px; }
.prize .eyebrow, .prize .text, .prize-detail, .prize .from { color: #fff; }
.prize .text { background: rgba(0, 0, 0, 0.12); display: inline-block; padding: 6px 16px; border-radius: 12px; }
.prize .from img { filter: brightness(0) invert(1); }
.prize::after { display: none; }

/* classifica con il primo «sotto l'albero» */
.step.p1 .block { background: var(--xmas-red); }
.step.p2 .block { background: var(--xmas-green); }
.step.p3 .block { background: #2f6fb5; }
.board li.p1 .pos { background: var(--xmas-red); border-color: var(--xmas-red); }
.live { background: #fdecee; color: var(--xmas-red); }
.nick-badge { background: var(--xmas-green); }
.done h3 { color: var(--xmas-red); }

/* invito fisso e piè di pagina */
.sticky-cta { box-shadow: 0 16px 34px rgba(200, 16, 46, 0.4); }
footer { border-top: 3px dashed #f3c1c6; }

/* schermo TV: stesso cielo di notte */
.tv { position: relative; }
.tv .head .eyebrow { color: #ffe9a8; }
.tv h1 { color: #fff; }
.tv h1 em { color: var(--gold-x); }
.tv .brand span { color: #c9d8f2; }
.tv .brand .logo-dark { display: none; }
.tv .brand .logo-light { display: block; }
.tv .empty { color: #fff; }
.tv .prize-line { background: var(--xmas-red); }
.tv .step .nick, .tv .step .score { color: #fff; }
.tv .step .score small { color: #c9d8f2; }
/* regia e privacy: fondo chiaro semplice (lo stile di Natale resta nei colori) */
body.plain { background: linear-gradient(180deg, #fff3f4, #f6f9fd 320px) no-repeat, #f6f9fd; }
/* ritocchi: nastri che non coprono le scritte */
.day::before { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 7px; margin: 0; }
.day::after { top: -2px; font-size: 16px; }
.day { padding-top: 18px; }
.prize .eyebrow { background: rgba(0, 0, 0, 0.22); padding: 5px 12px; border-radius: 999px; }
.prize .text { background: #fff; color: var(--xmas-red); padding: 8px 18px; }
.prize-detail { background: rgba(0, 0, 0, 0.22); padding: 6px 12px; border-radius: 10px; display: inline-block; }
.prize .from { background: rgba(0, 0, 0, 0.22); display: inline-block; padding: 6px 12px; border-radius: 999px; }
/* schermo TV: tutta notte, neve in basso solo come colline */
body.tvpage { background: linear-gradient(180deg, #050f26 0, #0b2550 45%, #1d3f78 100%) fixed; min-height: 100vh; }
body.tvpage .sky { position: fixed; height: 100vh; }
body.tvpage .sky::after { height: 16vh; }
body.tvpage .trees { bottom: 6vh; font-size: 5vh; }
body.tvpage .tv { position: relative; z-index: 1; }
.meta .wide { flex-basis: 100%; }
@media (min-width: 900px) { .meta .wide { flex-basis: auto; } }

/* ---------- codice amico ---------- */
.opt { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--faint); }
input[name=codice] { text-transform: uppercase; letter-spacing: 0.18em; font-weight: 800; }
input[name=codice]::placeholder { letter-spacing: 0.05em; font-weight: 500; text-transform: none; }
.invited { font-weight: 700; color: var(--xmas-green) !important; }
.mycode { margin-top: 18px; padding: 20px 18px; border-radius: 20px; text-align: center; background: #f2fbf5; border: 3px dashed var(--xmas-green); }
.mycode .eyebrow { color: var(--xmas-green); margin: 0 0 8px; }
.mycode .code { display: grid; gap: 4px; width: 100%; padding: 14px 10px; border: 0; border-radius: 16px; background: #fff; cursor: pointer; font: 800 40px/1 var(--font); letter-spacing: 0.22em; color: var(--xmas-green); box-shadow: 0 4px 0 rgba(20, 107, 58, 0.18); }
.mycode .code small { font: 600 12px/1 var(--font); letter-spacing: 0; color: var(--faint); }
.mycode-how { margin: 14px 0 0; color: var(--muted); font-size: 15px; }
.mycode .share { width: 100%; }
.mycode .hint { display: block; margin-top: 10px; }
.mycode .play { width: 100%; margin-top: 10px; background: var(--xmas-green); color: #fff; border-color: var(--xmas-green); }

/* regia: serate che contano scelte dal calendario */
.field { display: grid; gap: 8px; }
.field-title { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.datechips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; }
.datechips li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); font-size: 15px; font-weight: 600; color: var(--navy); text-transform: none; letter-spacing: 0; white-space: nowrap; }
.datechips li .n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 800; }
.datechips li em { font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: var(--ok); padding: 2px 8px; border-radius: 999px; }
.datechips li button { margin-left: auto; flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; }
.datechips li button:hover { background: #fff0ef; color: var(--bad); }
.datechips li.past { background: var(--paper-2); color: var(--muted); }
.datechips li.past .n { background: var(--faint); }
.datechips li.empty { justify-content: center; border-style: dashed; color: var(--muted); font-weight: 500; text-transform: none; }
.dateadd { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dateadd input { flex: 1 1 180px; width: auto; }

/* codice d'ingresso per Mister Buzz (pagina pubblica, dopo il check-in) */
.pinbox { margin-top: 18px; padding: 16px; border-radius: 16px; background: var(--paper-2); border: 1px solid var(--line); text-align: center; }
.pinbox .eyebrow { justify-content: center; }
.pinbox .pin { margin: 4px 0 8px; font: 800 40px/1 var(--font); letter-spacing: 0.12em; color: var(--navy); font-variant-numeric: tabular-nums; }
