/* Pagina TV: il video del brano in onda a schermo intero, con la grafica sopra */
:root { --accent: #e2001a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: #fff; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; overflow: hidden; }
#screen { position: fixed; inset: 0; background: #000; }
.layer { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; display: flex; align-items: center; justify-content: center; }
.layer.on { opacity: 1; }
.layer video { width: 100%; height: 100%; object-fit: contain; background: #000; }
/* brano senza video: copertina grande su sfondo sfocato */
.layer .still { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(40px) brightness(.45); transform: scale(1.15); }
.layer .still-cover { position: relative; width: min(46vh, 46vw); aspect-ratio: 1; border-radius: 1.2vh; box-shadow: 0 2vh 6vh rgba(0,0,0,.6); background-size: cover; background-position: center; }
/* sottopancia: titolo e artista */
.lower { position: absolute; left: 4vw; bottom: 7vh; display: flex; align-items: center; gap: 1.6vh; padding: 1.4vh 2.4vh 1.4vh 1.4vh; background: rgba(0,0,0,.62); border-left: .6vh solid var(--accent);
  border-radius: .8vh; transform: translateX(-120%); transition: transform .7s cubic-bezier(.2,.8,.2,1); backdrop-filter: blur(6px); max-width: 70vw; }
.lower.show { transform: none; }
.lower-cover { width: 9vh; height: 9vh; border-radius: .6vh; background-size: cover; background-position: center; flex: none; }
.lower-text { display: flex; flex-direction: column; min-width: 0; }
.lower-title { font-size: 3.6vh; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lower-artist { font-size: 2.6vh; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* prossimo brano */
.next { position: absolute; right: 4vw; bottom: 7vh; padding: 1vh 1.8vh; background: rgba(0,0,0,.62); border-radius: .8vh; font-size: 2.2vh; opacity: 0; transition: opacity .6s; max-width: 40vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next.show { opacity: 1; }
.next b { color: var(--accent); margin-right: .8vh; }
/* logo del canale in alto a destra */
.bug { position: absolute; right: 3vw; top: 3vh; font-weight: 800; font-size: 2.6vh; letter-spacing: .05em; padding: .6vh 1.4vh; border-radius: .6vh; background: rgba(0,0,0,.35); text-shadow: 0 0 1vh rgba(0,0,0,.6); }
.bug::before { content: ''; display: inline-block; width: 1.2vh; height: 1.2vh; border-radius: 50%; background: var(--accent); margin-right: 1vh; vertical-align: middle; }
/* logo immagine del canale: angolo, altezza e opacita' dal pannello Grafica della regia */
/* sempre presente ma trasparente quando e' spento: cosi' compare e sparisce in dissolvenza */
.logo { position: absolute; height: var(--logo-h, 12vh); max-width: 30vw; object-fit: contain; opacity: 0; transition: opacity var(--logo-f, .5s) ease;
  filter: drop-shadow(0 calc(var(--logo-s, .3) * .8vh) calc(var(--logo-s, .3) * 2.4vh) rgba(0,0,0, calc(.25 + var(--logo-s, .3) * .6))); pointer-events: none; }
.logo.noshadow { filter: none; }
.logo.show { opacity: var(--logo-o, .85); }
.logo.tr { right: 3vw; top: 3vh; } .logo.tl { left: 3vw; top: 3vh; }
.logo.br { right: 3vw; bottom: 3vh; } .logo.bl { left: 3vw; bottom: 3vh; }
body.crawling .logo.br, body.crawling .logo.bl { bottom: 7vh; }
body.logo-tl .clock { left: auto; right: 3vw; }
/* messaggi degli ascoltatori approvati in regia (spunta "In TV"): uno alla volta, a destra */
.msgbox { position: absolute; right: 3vw; top: 22vh; width: min(34vw, 60vh); padding: 1.6vh 2vh; background: rgba(0,0,0,.66); border-left: .6vh solid var(--msg-c, var(--accent)); border-radius: .8vh;
  backdrop-filter: blur(6px); transform: translateX(130%); transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.msgbox.show { transform: none; }
.msg-head { display: flex; align-items: center; gap: 1vh; margin-bottom: .8vh; min-width: 0; }
.msg-ch { font-size: 1.6vh; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: .3vh .9vh; border-radius: .5vh; background: var(--msg-c, var(--accent)); color: #fff; flex: none; }
.msg-author { font-size: 2.2vh; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-text { font-size: 2.5vh; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
/* posizione dei messaggi scelta in regia: a sinistra, oppure al posto del sottopancia dei brani */
.msgbox.at-left { right: auto; left: 3vw; transform: translateX(-130%); }
.msgbox.at-lower { right: auto; top: auto; left: 4vw; bottom: 7vh; width: min(52vw, 90vh); transform: translateX(-130%); }
body.crawling .msgbox.at-lower { bottom: 9vh; }
.msgbox.at-left.show, .msgbox.at-lower.show { transform: none; }
.msgbox.at-lower .msg-text { -webkit-line-clamp: 3; }
/* orologio in alto a sinistra */
.clock { position: absolute; left: 3vw; top: 3vh; font-weight: 700; font-size: 2.6vh; padding: .6vh 1.4vh; border-radius: .6vh; background: rgba(0,0,0,.35); font-variant-numeric: tabular-nums; display: none; }
.clock.show { display: block; }
/* testo scorrevole in basso */
.crawl { position: absolute; left: 0; right: 0; bottom: 0; height: 4.6vh; background: var(--accent); color: #fff; overflow: hidden; display: none; align-items: center; font-weight: 600; font-size: 2.4vh; }
.crawl.show { display: flex; }
.crawl span { white-space: nowrap; padding-left: 100%; animation: crawl linear infinite; animation-duration: var(--crawl-time, 30s); }
@keyframes crawl { from { transform: translateX(0); } to { transform: translateX(-100%); } }
body.crawling .lower, body.crawling .next { bottom: 9vh; }
/* dentro la regia (monitor PROGRAMMA): senza comandi */
body.embed .controls { display: none; }
.off { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-size: 4vh; color: #666; }
.off.show { display: flex; }
/* comandi: compaiono muovendo il mouse */
.controls { position: fixed; left: 50%; top: 2vh; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: rgba(20,20,26,.85); border-radius: 10px;
  transition: opacity .4s; font-size: 13px; z-index: 5; }
.controls.hide { opacity: 0; pointer-events: none; }
.controls button, .controls select { background: #2a2a33; color: #fff; border: 1px solid #3a3a44; border-radius: 7px; padding: 6px 10px; font: inherit; cursor: pointer; }
.muted { color: #9ca3af; }
body.idle { cursor: none; }
/* foto delle immagini sincronizzate: piu' grande dello schermo, si muove piano */
.layer .photo { position: absolute; inset: -6%; background-size: cover; background-position: center; will-change: transform; }
