:root {
  --accento: #ff2d95;
  --fondo: #0b0618;
  --fondo2: #170d33;
  --testo: #f6f2ff;
  --tenue: #a99cc9;
  --verde: #2ee59d;
  --rosso: #ff4d5e;
  --oro: #ffc83d;
  --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --titolo: "Avenir Next Condensed", "Arial Narrow", "Avenir Next", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--testo);
  background:
    radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accento) 35%, transparent), transparent 70%),
    radial-gradient(900px 500px at 100% 110%, #3b1fa855, transparent 70%),
    var(--fondo);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
.logo {
  font-family: var(--titolo);
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: .9;
}
.logo b { color: var(--accento); }
.piede {
  font-size: 12px;
  color: var(--tenue);
  text-align: center;
  padding: 10px;
}
.piede a { color: inherit; }
#spia {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--verde); box-shadow: 0 0 8px var(--verde); vertical-align: middle;
}
#spia.off { background: var(--rosso); box-shadow: 0 0 8px var(--rosso); }

/* avviso connessione persa (regia e telefoni) */
.avviso-rete { position: fixed; left: 50%; top: 14px; transform: translate(-50%, -150%); z-index: 50; background: var(--rosso); color: #fff; padding: 12px 20px; border-radius: 14px; box-shadow: 0 10px 40px #0008; display: flex; flex-direction: column; gap: 2px; text-align: center; font-size: 14px; max-width: 92vw; transition: transform .3s; }
.avviso-rete b { font-size: 16px; }
body.scollegato .avviso-rete { transform: translate(-50%, 0); }

/* ---------- veste natalizia (attivabile dalla regia) ---------- */
html.natale {
  --fondo: #08140f;
  --fondo2: #10261b;
  --tenue: #a8c4b5;
  --oro: #ffd54a;
}
html.natale body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #e8253c55, transparent 70%),
    radial-gradient(900px 500px at 100% 110%, #1f9d5555, transparent 70%),
    var(--fondo);
  background-attachment: fixed;
}
/* fila di lucine in alto */
html.natale body::before {
  content: ""; position: fixed; left: 0; right: 0; top: 0; height: 30px; z-index: 40; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='30'%3E%3Cpath d='M0 4Q20 16 40 4T80 4T120 4T160 4' fill='none' stroke='%23264a37' stroke-width='2'/%3E%3Cg%3E%3Cellipse cx='20' cy='17' rx='5' ry='7' fill='%23e8253c'/%3E%3Cellipse cx='60' cy='17' rx='5' ry='7' fill='%23ffd54a'/%3E%3Cellipse cx='100' cy='17' rx='5' ry='7' fill='%232ee59d'/%3E%3Cellipse cx='140' cy='17' rx='5' ry='7' fill='%234da3ff'/%3E%3C/g%3E%3C/svg%3E") repeat-x;
  filter: drop-shadow(0 0 6px #ffd54a88);
  animation: lucine 1.6s steps(2) infinite;
}
@keyframes lucine { 50% { filter: drop-shadow(0 0 2px #ffd54a44) brightness(.6); } }
html.natale body > header, html.festa body > header,
html.natale body > .barra, html.festa body > .barra { padding-top: 30px; } /* lascia spazio alle lucine (telefono) */
/* dietro ai contenuti: non coprono mai testi, pulsanti, logo o immagini */
#effetti { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
#effetti i { position: absolute; top: -20px; animation-timing-function: linear, ease-in-out; animation-iteration-count: infinite; }
#effetti .fiocco { border-radius: 50%; background: #fff; box-shadow: 0 0 6px #ffffffaa; animation-name: cade, ondeggia; }
#effetti .coriandolo { animation-name: cade, ondeggia; } /* cadono dritti ondeggiando appena, senza girare */
#effetti .filante { top: -130px; animation-name: cadeLenta, ondeggia; }
#effetti .filante svg { display: block; filter: drop-shadow(0 2px 4px #0006); }
@keyframes cade { to { transform: translateY(110vh); top: 100%; } }
@keyframes cadeLenta { to { top: 110%; } }
@keyframes ondeggia { 50% { margin-left: 24px; } }
@keyframes gira3d { 0% { rotate: 0deg; scale: 1 1; } 50% { rotate: 180deg; scale: 1 .2; } 100% { rotate: 360deg; scale: 1 1; } }
@keyframes dondola { 0%, 100% { rotate: -14deg; } 50% { rotate: 14deg; } }
@media (prefers-reduced-motion: reduce) { #effetti { display: none; } html.natale body::before, html.festa body::before { animation: none; } }

/* ---------- veste "Festa" (compleanni, carnevale, fine anno…) ---------- */
html.festa body {
  background:
    radial-gradient(900px 500px at 10% -10%, color-mix(in srgb, var(--accento) 45%, transparent), transparent 70%),
    radial-gradient(800px 500px at 95% 0%, #ffd54a40, transparent 70%),
    radial-gradient(900px 600px at 50% 115%, #4da3ff40, transparent 70%),
    var(--fondo);
  background-attachment: fixed;
}
/* bandierine in alto */
html.festa body::before {
  content: ""; position: fixed; left: 0; right: 0; top: 0; height: 30px; z-index: 40; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='30'%3E%3Cpath d='M0 3Q50 10 100 3T200 3' fill='none' stroke='%23ffffff66' stroke-width='2'/%3E%3Cpath d='M6 5L26 6L16 26Z' fill='%23ff2d95'/%3E%3Cpath d='M56 7L76 7L66 27Z' fill='%23ffd54a'/%3E%3Cpath d='M106 5L126 5L116 25Z' fill='%232ee59d'/%3E%3Cpath d='M156 7L176 6L166 27Z' fill='%234da3ff'/%3E%3C/svg%3E") repeat-x;
  transform-origin: 50% 0; animation: bandiere 3s ease-in-out infinite;
}
@keyframes bandiere { 50% { transform: skewX(4deg) scaleY(.92); } }
