:root {
  color-scheme: dark;
  --paper: #f9f2f7;
  --muted: #beb2c8;
  --pink: #ff9db7;
  --cyan: #92e8f3;
  --line: #ffe1ff2e;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font: 16px/1.5 system-ui, sans-serif;
  background: #090812;
  color: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; min-height: 100svh; isolation: isolate; position: relative; }
.backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, #090812 0%, #090812e0 18%, #090812a0 48%, #09081220 100%),
    linear-gradient(0deg, #090812 0%, #09081242 23%, transparent 58%, #0908128f 100%),
    radial-gradient(ellipse at 86% 38%, #532345, #0b0c1b 65%);
  background-image:
    linear-gradient(90deg, #090812 0%, #090812e0 18%, #090812a0 48%, #09081220 100%),
    linear-gradient(0deg, #090812 0%, #09081242 23%, transparent 58%, #0908128f 100%),
    url("vice-city-notte.webp"),
    radial-gradient(ellipse at 86% 38%, #532345, #0b0c1b 65%);
  background-size: cover;
  background-position: 64% center;
}
.top, main, footer { margin-inline: auto; width: min(1120px, calc(100% - 96px)); }
.top, footer { display: flex; align-items: center; gap: 12px; }
.top { min-height: 79px; border-bottom: 1px solid var(--line); }
.top p, footer p, .edition, .clock-heading, .progress-label, .dispatch h2, .digits small {
  text-transform: uppercase;
  font-family: var(--mono);
  letter-spacing: 0.13em;
}
.top p { font-size: 0.72rem; color: var(--cyan); }
.signal { display: flex; align-items: flex-end; gap: 3px; height: 15px; color: var(--cyan); }
.signal i { width: 3px; height: 5px; background: currentColor; }
.signal i:nth-child(2) { height: 8px; }
.signal i:nth-child(3) { height: 11px; }
.signal i:nth-child(4) { height: 14px; opacity: 0.4; }
button {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #100e20b8;
  padding: 8px 13px;
  min-height: 42px;
  color: var(--paper);
  font: 600 0.75rem/1.2 system-ui, sans-serif;
  cursor: pointer;
  margin-left: auto;
}
button:hover { border-color: var(--cyan); }
button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.sound-icon { margin-right: 5px; color: var(--cyan); }
main { padding-top: clamp(38px, 7vh, 87px); }
.edition { margin: 0 0 10px; font-size: 0.77rem; color: var(--pink); }
h1 {
  font: 900 clamp(4.05rem, 11vw, 9.5rem)/0.82 "Arial Black", "Segoe UI", sans-serif;
  letter-spacing: -0.082em;
  margin: 0;
  text-shadow: 0 6px 38px #05040ddd;
}
h1 span {
  display: block;
  color: var(--pink);
  font-size: 0.34em;
  line-height: 1.12;
  letter-spacing: 0.03em;
  margin-top: 0.32em;
}
.tagline { color: var(--muted); margin: 19px 0 25px; font-size: clamp(0.94rem, 2vw, 1.1rem); }
.countdown {
  width: min(690px, 100%);
  background: linear-gradient(125deg, #171327ef, #0c0a19d8);
  border: 1px solid var(--line);
  border-top: 2px solid #ffabca9c;
  padding: clamp(13px, 2.8vw, 27px);
  box-shadow: 0 16px 70px #0005;
}
.clock-heading, .progress-label { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
.clock-heading h2, .clock-heading time, .progress-label { font: inherit; margin: 0; font-size: 0.69rem; }
.clock-heading h2 { color: var(--paper); }
.clock-heading time, .progress-label { color: var(--muted); }
.digits {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr) 12px minmax(0, 1fr) 12px minmax(0, 1fr);
  align-items: start;
  gap: clamp(2px, 1vw, 12px);
  margin: 15px 0 16px;
  text-align: center;
  font: 700 clamp(1.7rem, 5.6vw, 4.8rem)/1.07 var(--mono);
  font-variant-numeric: tabular-nums;
}
.digits div { min-width: 0; background: #0b0917; padding: 9px 2px 9px; border: 1px solid #ffe1ff1f; }
.digits div:last-child span { color: var(--pink); }
.digits small { display: block; color: var(--muted); font-weight: 400; font-size: clamp(0.54rem, 1.50vw, 0.69rem); margin-top: 7px; }
.digits b { padding-top: 8px; color: #b093bc; font-size: 0.46em; line-height: 2.18; }
progress { display: block; appearance: none; width: 100%; height: 5px; margin-top: 7px; border: 0; background: #29233b; }
progress::-webkit-progress-bar { background: #29233b; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #77e4f1, #ff8eac); }
progress::-moz-progress-bar { background: linear-gradient(90deg, #77e4f1, #ff8eac); }
.dispatch { display: flex; align-items: flex-start; gap: 14px; margin: 25px 0 23px; }
.dispatch h2 { font-size: 0.66rem; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.dispatch p { font-size: clamp(1rem, 3vw, 1.3rem); margin: 0; }
.status-light { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
footer { min-height: 65px; padding: 10px 0 max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
footer p { margin: 0; font-size: 0.65rem; color: var(--muted); }
body[data-phase="imminente"] .status-light, body[data-phase="finale"] .status-light { background: var(--pink); box-shadow: 0 0 15px var(--pink); }
body[data-phase="finale"] .status-light { animation: signal 2s ease-in-out infinite alternate; }
body[data-phase="aperta"] .countdown { border-top-color: var(--cyan); }
body[data-phase="aperta"] .dispatch p { color: var(--cyan); font-weight: 750; }
@keyframes signal { to { opacity: 0.48; } }
@media (max-width: 700px) {
  .top, main, footer { width: calc(100% - 36px); }
  .top { min-height: 65px; }
  main { padding-top: 38px; }
  .backdrop { background-position: 77% center; }
  .digits { grid-template-columns: minmax(0, 1fr) 6px minmax(0, 1fr) 6px minmax(0, 1fr) 6px minmax(0, 1fr); }
  .clock-heading h2, .clock-heading time { font-size: 0.61rem; }
}
@media (max-width: 370px) {
  h1 { font-size: 3.45rem; }
  .top { gap: 8px; }
  .top p { font-size: 0.62rem; }
  button { padding: 8px; }
  .sound-icon { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
