@font-face {
  font-family: 'StrangerThings';
  src: url('../font/Stranger_Things_Outlined.woff') format('woff2'),
    url('../font/Stranger_Things_Outlined.woff2') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  /* importante: niente scroll */
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #120000 0%, #000 70%);
  font-family: 'StrangerThings', serif;
}

.container {
  text-align: center;
  animation: flicker 4s infinite;
}

h1 {
  text-transform: uppercase;
  font-weight: 900;

  /* Dimensione con fallback per vecchi iOS */
  font-size: 3rem;
  font-size: clamp(2.5rem, 10vw, 6rem);

  /* Le lettere in Stranger Things sono spesso molto vicine o si toccano */
  letter-spacing: -0.03em;

  /* 2. RIEMPIMENTO NERO */
  color: #b30000;

  /* 4. SOLUZIONE PER IOS (CRUCIALE) */
  /* paint-order dice a Safari: "Disegna il bordo rosso SOTTO, poi mettici il nero SOPRA".
     Senza questo, il testo nero sembrerebbe sottilissimo o invisibile. */
  paint-order: stroke fill;
  
  /* Shadow */
  text-shadow:
    0 0 12px rgba(255, 0, 0, 0.6),
    0 0 30px rgba(120, 0, 0, 0.5);

  /* 5. EFFETTO GLOW (NEON) */
  /* Usiamo più livelli di ombra per creare profondità */
  /* Alone diffuso scuro */

  /* Ottimizzazione rendering iOS */
  transform: translateZ(0);
}


.countdown {
  font-size: clamp(2rem, 5vw, 4rem);

  color: #b30000;
  letter-spacing: 6px;
  transform: translateZ(0);
  text-shadow:
    0 0 12px rgba(255, 0, 0, 0.6),
    0 0 30px rgba(120, 0, 0, 0.5);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  min-width: 22ch;
  text-align: center;
}

.countdown {
  display: flex;
  gap: 1.2ch;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.unit {
  display: grid;
  grid-template-columns: 3ch 1ch;
  align-items: baseline;
  min-width: 4ch;
}

.unit span {
  text-align: right;
}

.unit small {
  font-size: 0.8em;
  opacity: 0.8;
}


@keyframes flicker {

  0%,
  19%,
  22%,
  62%,
  64%,
  70%,
  100% {
    opacity: 1;
  }

  20%,
  63%,
  65% {
    opacity: 0.75;
  }
}

footer {
  position: fixed;
  bottom: 10px;
  width: 100%;
  text-align: center;
  font-family: system-ui, sans-serif;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.05em;
  pointer-events: none;
}