:root{--accent:#00786b;--ink:#102c3a;--paper:#f0f3ef}
*{box-sizing:border-box}
body{margin:0;width:100vw;height:100dvh;overflow:hidden;display:grid;place-items:center;background:#000;color:white;font-family:Arial,Helvetica,sans-serif;cursor:none}
/* Il formato 16:9 comprende header, area immagini e avvisi. Le unita cqw/cqh
   dei figli si riferiscono allo schermo, indipendentemente dalla finestra. */
.screen{position:relative;width:min(100vw,177.77777778dvh);height:min(100dvh,56.25vw);aspect-ratio:16/9;container-type:size;display:flex;flex-direction:column;overflow:hidden;background:var(--ink)}
header{flex:0 0 8%;min-height:0;display:flex;align-items:center;justify-content:space-between;padding:0 3cqw;border-top:.3cqh solid var(--accent);background:var(--header-bg,var(--paper));color:var(--header-text,#102c3a);overflow:hidden}
.identity{display:flex;align-items:center;gap:1cqw;min-width:0}
.identity>div:last-child{min-width:0}
#logo{max-width:10cqw;height:5.8cqh;object-fit:contain;flex-shrink:0}
.emblem{display:grid;place-items:center;width:3.2cqw;height:5.2cqh;flex-shrink:0;font:2.2cqw Georgia,serif;border:.1cqw solid var(--accent);border-radius:0 0 45% 45%;color:var(--accent)}
h1{font-size:1.65cqw;line-height:1.15;margin:0;font-weight:700}
header p{font-size:.95cqw;line-height:1.2;margin:.35cqh 0 0;opacity:.7}
h1,header p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.clock{text-align:right;display:flex;flex-direction:column;gap:.3cqh;flex-shrink:0;margin-left:2cqw}
#time{font-size:2.1cqw;font-variant-numeric:tabular-nums;line-height:1}
#date{font-size:.9cqw;line-height:1.2;text-transform:capitalize}
main{position:relative;flex:1 1 0;min-height:0;min-width:0;overflow:hidden;display:flex;align-items:center;justify-content:center}
#slide{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
#empty{width:100%;height:100%;padding:6cqh 8cqw;background:radial-gradient(ellipse at 100% 90%,#1b5c59 0,transparent 60%),var(--ink)}
.eyebrow{letter-spacing:.25em;color:#93d6bd;font-size:1cqw}
h2{font:normal 4.2cqw/1.08 Georgia,serif;margin:3cqh 0 2cqh}
#empty p{font-size:1.5cqw;color:#becdd0;line-height:1.6}
.line{width:5cqw;height:.25cqh;background:#93d6bd;margin:3cqh 0 2cqh}
.empty-note{font-size:1cqw;color:#becdd0}
.slide-meta{position:absolute;bottom:1cqh;left:2cqw;right:2cqw;display:flex;justify-content:flex-end;gap:1cqw;pointer-events:none;font-size:.8cqw;text-shadow:0 1px 3px #000}
#counter{background:#102c3acc;padding:.4em .7em;border-radius:.2cqw}
#counter{flex-shrink:0}
#counter:empty{display:none}
footer{flex:0 0 6%;min-height:0;display:flex;align-items:stretch;overflow:hidden;background:var(--ticker-bg,var(--paper));color:var(--ticker-text,#102c3a)}
.ticker-label{display:flex;align-items:center;flex-shrink:0;padding:0 2cqw;background:var(--accent);color:white;font-size:1cqw;font-weight:bold;letter-spacing:.12em;z-index:1}
.ticker-window{overflow:hidden;flex:1;min-width:0;display:flex;align-items:center}
#ticker-text{white-space:nowrap;font-size:1.9cqw;padding-left:2cqw;will-change:transform}
#connection{position:absolute;top:8cqh;right:1cqw;margin-top:1cqh;padding:.5em .8em;background:#102c3aeb;color:#e6cb8b;font-size:.85cqw;border-radius:.2cqw}
[hidden]{display:none!important}
