:root {
  --accent: #22C3E6;
  --accent-ink: #04222D;
  --bg: #0A1622;
  --panel: #0F2436;
  --panel-2: #0A1B2A;
  --line: #1B3550;
  --line-2: #2A4A68;
  --text: #E6F4FA;
  --text-2: #D6E9F2;
  --muted: #8FB3C7;
  --muted-2: #6E93A8;
  --sel: #173652;
  --ded: #D9B3F0;
  --ded-bg: #2A1E3A;
  --ded-line: #5A3F7A;
  --live: #E0405E;
  --live-soft: #FF8FA3;
  --ok: #3DDC97;
  --warn: #E0B84A;
  --mod: #FFC977;
  --radius: 16px;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Sora', 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--accent); }
.nascosto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Elementi comuni ---------- */
.logo { display: flex; align-items: center; gap: 12px; }
.logo-ic {
  width: 38px; height: 38px; border-radius: 12px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo-nome { font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: -0.02em; }
.logo-nome b { color: var(--accent); font-weight: 700; }

.btn {
  height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-2);
  background: transparent; color: var(--text); font-weight: 600; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.btn:hover { background: #12304a; }
.btn.primario { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primario:hover { filter: brightness(1.08); }
.btn.piccolo { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.pericolo { border-color: #6B2A38; color: var(--live-soft); }
.btn.pericolo:hover { background: #3A1420; }
.btn-ic {
  width: 44px; height: 44px; border-radius: 10px; border: none; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0;
}
.btn-ic:hover { background: #12304a; color: var(--text); }

.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label, .etichetta { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.input, .textarea, select.input {
  height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2);
  color: var(--text); padding: 0 12px; outline: none; width: 100%;
}
.textarea { height: auto; min-height: 64px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus, .textarea:focus { border-color: var(--accent); }
.errore { color: var(--live-soft); font-size: 14px; min-height: 20px; }
.ok-msg { color: var(--ok); font-size: 14px; }

.badge {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px;
  display: inline-block; line-height: 16px; vertical-align: middle;
}
.badge.admin { background: #3A1420; color: var(--live-soft); }
.badge.dj { background: #0E3A48; color: var(--accent); }
.badge.mod { background: #3A2A10; color: var(--mod); }
.badge.ospite { background: #1A2C3D; color: var(--muted); }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 15px; color: #fff; text-transform: uppercase;
}
.avatar.piccolo { width: 30px; height: 30px; font-size: 13px; }

.pannello {
  border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line);
  min-height: 0; display: flex; flex-direction: column;
}
.pannello-titolo {
  font-family: var(--display); font-weight: 600; font-size: 17px; display: flex; align-items: center; gap: 8px;
}
.sezione-titolo { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- Schermata d'ingresso ---------- */
#ingresso {
  min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 32px 16px;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(34,195,230,.10), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, rgba(217,179,240,.07), transparent 60%),
    var(--bg);
}
.ingresso-box {
  width: 100%; max-width: 940px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: var(--panel);
}
.ingresso-radio {
  padding: 40px; background: linear-gradient(160deg, #0F2B40 0%, #0A1B2A 100%);
  display: flex; flex-direction: column; gap: 28px; border-right: 1px solid var(--line);
}
.ingresso-radio h1 { font-family: var(--display); font-size: 34px; line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
.ingresso-radio p { margin: 0; color: var(--muted); line-height: 1.55; }
.mini-player {
  margin-top: auto; padding: 16px; border-radius: 14px; background: rgba(10,22,34,.6); border: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
}
.ingresso-form { padding: 36px 40px; display: flex; flex-direction: column; gap: 18px; }
.schede { display: flex; gap: 6px; padding: 4px; background: var(--panel-2); border-radius: 12px; border: 1px solid var(--line); }
.scheda {
  flex: 1; height: 40px; border: none; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600;
}
.scheda[aria-selected="true"] { background: var(--sel); color: var(--text); }
.ingresso-form form { display: flex; flex-direction: column; gap: 14px; }
.spunta { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-2); line-height: 1.4; }
.spunta input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); flex-shrink: 0; }
.link-btn { background: none; border: none; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; }

/* ---------- App ---------- */
#app { height: 100%; display: flex; flex-direction: column; }
.testata {
  height: 68px; flex-shrink: 0; padding: 0 24px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); gap: 16px;
}
.io-chip {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 6px; border-radius: 12px;
  border: 1px solid var(--line-2); background: transparent; color: var(--text); font-weight: 600;
}
.io-chip:hover { background: #12304a; }

.player {
  margin: 16px 24px 0; padding: 14px 22px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line);
  display: flex; align-items: center; gap: 22px; flex-shrink: 0;
}
.play-btn {
  width: 62px; height: 62px; border-radius: 50%; border: none; background: var(--accent); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: transform .15s;
}
.play-btn:hover { transform: scale(1.05); }
.play-btn.piccolo { width: 48px; height: 48px; }
.player-info { display: flex; flex-direction: column; gap: 4px; flex-grow: 1; min-width: 0; }
.player-riga { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.in-onda {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; padding: 3px 10px; border-radius: 99px;
  background: #3A1420; color: var(--live-soft);
}
.player-titolo {
  font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-artista { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-sep { width: 1px; height: 56px; background: var(--line); flex-shrink: 0; }
.eq { display: flex; align-items: flex-end; gap: 4px; height: 36px; flex-shrink: 0; }
.eq span { width: 5px; border-radius: 3px; background: var(--accent); height: 30%; }
.suona .eq span { animation: eq 1s ease-in-out infinite; }
.eq span:nth-child(2) { animation-delay: -.4s !important; }
.eq span:nth-child(3) { animation-delay: -.7s !important; }
.eq span:nth-child(4) { animation-delay: -.2s !important; }
.eq span:nth-child(5) { animation-delay: -.55s !important; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.volume { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.volume input { width: 110px; accent-color: var(--accent); }
.ascoltatori { font-size: 13px; color: var(--muted); }

.griglia {
  flex-grow: 1; min-height: 0; margin: 16px 24px 20px; display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 270px; gap: 16px;
}

/* Dediche */
.dediche { padding: 18px; gap: 12px; overflow: hidden; }
.dedica-form {
  padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line-2);
  display: flex; flex-direction: column; gap: 10px; flex-shrink: 0;
}
.dedica-form .input { height: 40px; background: var(--panel); }
.dedica-form .textarea { min-height: 56px; background: var(--panel); }
.btn-dedica { height: 44px; border: none; border-radius: 10px; background: var(--ded); color: var(--ded-bg); font-weight: 700; }
.lista-dediche { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; min-height: 0; padding-right: 2px; }
.dedica {
  padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 5px;
}
.dedica.onda { background: var(--ded-bg); border-color: var(--ded-line); }
.dedica.rifiutata { opacity: .5; }
.dedica-testa { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.dedica-chi { font-weight: 700; color: var(--ded); overflow-wrap: anywhere; }
.dedica-msg { font-size: 14px; line-height: 1.45; color: var(--text-2); overflow-wrap: anywhere; }
.dedica-canzone { font-size: 13px; color: #B9A3C9; }
.stato { font-weight: 700; white-space: nowrap; }
.stato.attesa { color: var(--warn); }
.stato.onda { color: var(--accent); }
.stato.letta { color: var(--ok); }
.stato.rifiutata { color: var(--muted); }
.dedica-azioni { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.dedica-azioni button {
  height: 30px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--ded-line); background: transparent;
  color: var(--ded); font-size: 12px; font-weight: 600;
}
.dedica-azioni button.pieno { background: var(--ded); color: var(--ded-bg); border-color: var(--ded); }

/* Chat */
.chat-testa {
  height: 58px; flex-shrink: 0; padding: 0 20px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); gap: 12px;
}
.chat-benvenuto { flex: 1; min-width: 0; text-align: right; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.messaggi {
  flex-grow: 1; overflow-y: auto; padding: 14px 20px; display: flex; flex-direction: column; gap: 2px; min-height: 0;
  font-size: var(--dim-chat, 15px);
}
/* Righe in stile IRC:  ora  nick: messaggio  */
.msg { display: block; position: relative; padding: 3px 36px 3px 6px; border-radius: 6px; line-height: 1.5; overflow-wrap: anywhere; }
.msg:hover { background: rgba(255,255,255,.03); }
.msg-ora { color: var(--muted-2); font-size: .8em; margin-right: .5em; font-variant-numeric: tabular-nums; }
.msg-nick {
  font-weight: 700; background: none; border: none; padding: 0; color: inherit; font-size: 1em; line-height: inherit;
  display: inline-flex; align-items: center; gap: .35em; vertical-align: top;
}
.msg-nick:hover { text-decoration: underline; }
.msg-nick .avatar {
  width: calc(var(--dim-chat, 15px) * 1.3); height: calc(var(--dim-chat, 15px) * 1.3);
  font-size: calc(var(--dim-chat, 15px) * .62) !important; flex-shrink: 0;
}
.msg-sep { color: var(--muted); margin-right: .4em; font-weight: 700; }
.msg-testo { color: var(--text-2); white-space: pre-wrap; }
.msg.staff { background: rgba(34,195,230,.07); }
.msg.staff .msg-testo { color: var(--text); }
.msg.menzione { background: rgba(34,195,230,.14); box-shadow: inset 3px 0 0 var(--accent); }
.msg-canc {
  position: absolute; right: 4px; top: 2px; width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--muted); display: none; align-items: center; justify-content: center;
}
.msg:hover .msg-canc, .msg:focus-within .msg-canc { display: flex; }
.msg-sistema {
  align-self: center; font-size: .87em; margin: 6px 0; color: var(--muted); padding: 6px 14px; border-radius: 99px; background: var(--panel-2);
  text-align: center; max-width: 90%; overflow-wrap: anywhere;
}
.msg-sistema.brano { color: var(--accent); }
.scrivi { padding: 12px 20px 18px; flex-shrink: 0; position: relative; }
.scrivi-box {
  min-height: 56px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 6px; padding: 0 6px 0 16px;
}
.scrivi-box:focus-within { border-color: var(--accent); }
.scrivi-box input { flex-grow: 1; height: 50px; background: transparent; border: none; outline: none; color: var(--text); min-width: 0; }
.invia {
  width: 44px; height: 44px; border-radius: 10px; border: none; background: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.emoji-pop {
  position: absolute; bottom: 78px; right: 20px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 10px; display: grid; grid-template-columns: repeat(8, 38px); gap: 4px; z-index: 20; box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.emoji-pop button { width: 38px; height: 38px; border: none; background: transparent; border-radius: 8px; font-size: 20px; }
.emoji-pop button:hover { background: var(--sel); }
.nuovi {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 86px; height: 34px; padding: 0 14px; border-radius: 99px;
  border: none; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px; z-index: 5;
}
.stato-conn { padding: 8px 20px; background: #3A2A10; color: var(--mod); font-size: 13px; text-align: center; }

/* Colonna destra */
.colonna-destra { padding: 18px; gap: 12px; overflow: hidden; }
.lista-online { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-height: 0; flex-grow: 1; }
.gruppo { font-size: 12px; color: var(--muted-2); margin: 10px 0 4px; }
.utente {
  display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 8px; border-radius: 10px;
  background: none; border: none; color: var(--text); text-align: left; width: 100%;
}
.utente:hover { background: #12304a; }
.utente-nick { font-weight: 500; flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.punto { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.ultimi {
  padding: 12px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); display: flex;
  flex-direction: column; gap: 10px; flex-shrink: 0; min-height: 0;
}
.ultimi.con-tv { max-height: none; }
.box-schede { display: flex; gap: 6px; }
.box-scheda {
  flex: 1; height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  font-weight: 600; font-size: 13px; white-space: nowrap;
}
.box-scheda[aria-selected="true"] { background: var(--sel); color: var(--text); border-color: var(--accent); }
.box-schede:not(:has(.box-scheda:not(.nascosto) ~ .box-scheda:not(.nascosto))) .box-scheda { pointer-events: none; border-color: transparent; background: none; text-align: left; padding: 0; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--muted); }
.lista-ultimi { display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.ultimo { display: flex; align-items: center; gap: 10px; font-size: 14px; min-width: 0; }
.ultimo-cover {
  width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--sel);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 16px;
}
.ultimo-testi { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.ultimo-titolo { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.ultimo-info { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ultimo-dj { font-size: 13px; flex-shrink: 0; }
.box-tv { display: flex; flex-direction: column; gap: 6px; }
.box-tv iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }
.tv-barra { display: flex; align-items: center; gap: 6px; }
.tv-barra .vuoto { font-size: 11.5px; line-height: 1.35; flex: 1; }
.tv-barra .btn-ic { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 17px; flex-shrink: 0; }
.tv-pop iframe { flex: 1; width: 100%; border: 0; background: #000; }
.tv-pop { min-height: 220px; }
.vuoto { font-size: 14px; color: var(--muted-2); line-height: 1.5; }

/* Navigazione mobile */
.nav-mobile { display: none; }

/* Finestre */
.velo {
  position: fixed; inset: 0; background: rgba(4,12,20,.72); display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 50;
}
.finestra {
  width: 100%; max-width: 460px; max-height: calc(100% - 32px); overflow-y: auto; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 14px;
}
.finestra.larga { max-width: 860px; }
.finestra h2 { margin: 0; font-family: var(--display); font-size: 20px; }
.finestra-azioni { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.regole { white-space: pre-line; line-height: 1.6; color: var(--text-2); margin: 0; }
.menu-voci { display: flex; flex-direction: column; gap: 6px; }
.menu-voci .btn { justify-content: flex-start; }
.riga { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.riga > * { flex: 1; min-width: 140px; }

.tabella { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabella th { text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
.tabella td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabella select { height: 34px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-2); padding: 0 8px; }
.tabella-wrap { overflow-x: auto; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #3A1420; color: #FFD4DC;
  border: 1px solid #6B2A38; padding: 12px 18px; border-radius: 12px; z-index: 80; max-width: calc(100% - 32px);
  box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 14px;
}
.toast.ok { background: #0F3326; color: #BFF5DD; border-color: #1F6B4C; }

/* ---------- Tablet ---------- */
@media (max-width: 1180px) {
  .griglia { grid-template-columns: 290px minmax(0, 1fr); }
  .colonna-destra { display: none; }
  .volume { display: none; }
}

/* ---------- Telefono ---------- */
@media (max-width: 820px) {
  body { font-size: 15px; }
  .ingresso-box { grid-template-columns: 1fr; }
  .ingresso-radio { padding: 24px; gap: 16px; border-right: none; border-bottom: 1px solid var(--line); }
  .ingresso-radio h1 { font-size: 26px; }
  .ingresso-form { padding: 24px; }
  #ingresso { padding: 16px; align-items: flex-start; }

  .testata { height: 58px; padding: 0 16px; }
  .logo-nome { font-size: 18px; }
  .logo-ic { width: 32px; height: 32px; border-radius: 10px; }
  .io-chip .io-nome { display: none; }
  .player { margin: 0 16px; padding: 12px; gap: 12px; border-radius: 16px; }
  .play-btn { width: 50px; height: 50px; }
  .player-titolo { font-size: 16px; }
  .player-artista { font-size: 13px; }
  .player-sep, .player-dopo { display: none; }

  .griglia { grid-template-columns: minmax(0, 1fr); margin: 12px 16px 0; gap: 0; }
  .chat-benvenuto { display: none; }
  .griglia > .pannello { display: none; }
  .griglia > .pannello.attivo { display: flex; }
  .colonna-destra.attivo { display: flex; }
  .chat-testa { height: 50px; padding: 0 14px; }
  .messaggi { padding: 12px 14px; }
  .scrivi { padding: 10px 12px 12px; }
  .emoji-pop { right: 12px; grid-template-columns: repeat(6, 38px); }

  .nav-mobile {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: 64px; flex-shrink: 0;
    border-top: 1px solid var(--line); margin-top: 12px; background: var(--bg);
  }
  .nav-mobile button {
    background: none; border: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; font-size: 12px; color: var(--muted); position: relative;
  }
  .nav-mobile button[aria-current="true"] { color: var(--accent); }
  .pallino {
    position: absolute; top: 9px; left: calc(50% + 8px); min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
    background: var(--live); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px;
  }
}

/* ---------- Player: copertina, programma e DJ in regia ---------- */
.player-cover {
  width: 62px; height: 62px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line);
  flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.player-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.player-cover .eq { height: 28px; }
.player-programma { font-size: 14px; color: var(--text-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.in-onda.nonstop { background: #0E3A48; color: var(--accent); }
.player-dj { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); max-width: 260px; flex-shrink: 0; }
.player-dj img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--sel); flex-shrink: 0; }
.dj-iniziale {
  width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; text-transform: uppercase;
}
.player-dj img, .dj-iniziale { box-shadow: 0 0 0 2px var(--live); }
.dj-etichetta { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--live-soft); }
.pallino-live { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulsa-priv 1.4s ease-in-out infinite; }
.player-dj-nome { font-family: var(--display); font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Colonna palinsesto ---------- */
.palinsesto { padding: 18px; gap: 12px; overflow: hidden; }
.ora-card {
  flex-shrink: 0; border-radius: 16px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.ora-card.live { border-color: var(--accent); }
.ora-foto { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--sel); }
.ora-corpo { padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.ora-etichetta { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ora-titolo { font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.ora-sotto { font-size: 14px; color: var(--muted); line-height: 1.45; }
.giorni { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; flex-shrink: 0; }
.giorno {
  height: 38px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-weight: 600; font-size: 13px; padding: 0;
}
.giorno[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.giorno.oggi:not([aria-selected="true"]) { color: var(--text); border-color: var(--line-2); }
.lista-pal { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; padding-right: 2px; }
.slot {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--panel-2);
  border: 1px solid var(--line);
}
.slot.ora { border-color: var(--accent); background: #0E2E40; }
.slot img, .slot .slot-iniz {
  width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--sel);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted);
}
.slot-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.slot-orario { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.slot-nome { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-dj { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Pulsanti "scrivi al DJ" nella barra in alto ---------- */
.azioni-dj { display: flex; gap: 8px; flex: 1; justify-content: center; min-width: 0; }
.azioni-dj button {
  height: 42px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted);
  font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding: 0 16px;
}
.azioni-dj button.attivo { border-color: var(--accent); background: #0E2E40; color: var(--text); }
.azioni-dj button.attivo:hover { background: #12384F; }
.azioni-dj button[aria-disabled="true"] { opacity: .55; }
/* Registratore del vocale */
.registra { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0; }
.btn-rec {
  width: 84px; height: 84px; border-radius: 50%; border: none; background: var(--live); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.btn-rec.ferma { background: #3A1420; color: var(--live-soft); border: 2px solid var(--live); }
.rec-tempo { font-family: var(--display); font-size: 22px; font-weight: 600; }
.chiamata-frame { width: 100%; height: 520px; border: 0; border-radius: 12px; background: #060b17; }

/* ---------- Dentro il Playout (solo chat) ---------- */
body.embed .testata, body.embed .player, body.embed #pan-palinsesto, body.embed #pan-utenti,
body.embed .azioni-dj, body.embed .nav-mobile { display: none !important; }
body.embed .griglia { grid-template-columns: minmax(0, 1fr); margin: 0; }
body.embed #pan-chat { display: flex; border-radius: 0; border: none; }
body.embed .chat-testa { display: none; }
body.embed .messaggi { padding: 12px; }
body.embed .scrivi { padding: 8px 10px 10px; }
body.embed .chat-benvenuto { display: none; }
body.embed .emoji-pop { grid-template-columns: repeat(6, 38px); right: 10px; }

@media (max-width: 1180px) {
  .player-dj { display: none !important; }
  .az-testo { display: none; }
  .azioni-dj button { padding: 0 13px; font-size: 16px; }
}
@media (max-width: 820px) {
  .player-cover { width: 50px; height: 50px; border-radius: 12px; }
  .player-cover .eq { display: flex; }
  .azioni-dj { gap: 4px; }
  .azioni-dj button { width: 40px; height: 40px; padding: 0; justify-content: center; font-size: 17px; }
  .az-testo { display: none; }
  .testata .logo-nome { display: none; }
  .testata { gap: 8px; }
  .nav-mobile { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Foto profilo */
img.avatar.foto { object-fit: cover; background: var(--sel); padding: 0; }
.avatar.grande { width: 72px; height: 72px; font-size: 26px; }

/* Pulsanti staff: PLAY DIRETTA (DJ e admin) e REGIA (admin) */
.staff-btn { display: flex; gap: 8px; align-items: center; }
.btn-diretta, .btn-regia {
  height: 42px; padding: 0 16px; border-radius: 10px; font-weight: 800; font-size: 13px; letter-spacing: .06em;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; text-decoration: none; cursor: pointer;
}
.btn-diretta, .btn-regia { background: transparent; border: 1px solid var(--line-2); color: var(--text); }
.btn-diretta:hover, .btn-regia:hover { background: #12304a; }
.pallino-rec { width: 9px; height: 9px; border-radius: 50%; background: #fff; }
@keyframes pulsa { 0% { box-shadow: 0 0 0 0 rgba(224,64,94,.55); } 70% { box-shadow: 0 0 0 10px rgba(224,64,94,0); } 100% { box-shadow: 0 0 0 0 rgba(224,64,94,0); } }

/* Player: altezza fissa, titolo e cantante su una riga sola */
.player { height: 94px; }
.player-info { overflow: hidden; }
.player-riga { flex-wrap: nowrap; overflow: hidden; }
.player-titolo { line-height: 1.3; }
@media (max-width: 1180px) {
  .sd-testo { display: none; }
  .btn-diretta, .btn-regia { padding: 0 12px; }
}
@media (max-width: 820px) {
  .player { height: 76px; }
  .player-titolo { font-size: 15px; }
  .player-programma { font-size: 12px; }
  .btn-diretta, .btn-regia { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .staff-btn { gap: 4px; }
}

/* ---------- Messaggi privati ---------- */
.privati-barra { display: flex; gap: 6px; min-width: 0; flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; }
.privati-barra::-webkit-scrollbar { display: none; }
.privati-barra:not(:has(.priv-chip:not(.nascosto))) { display: none; }
.priv-chip {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px 0 4px; flex-shrink: 0;
  border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font-weight: 600; font-size: 14px;
}
.priv-chip:hover { background: #12304a; }
.priv-chip .avatar { width: 28px; height: 28px; font-size: 12px; }
.priv-chip-nome { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.priv-chip.nuovo { border-color: var(--live); background: #2A1420; }
.priv-conta {
  position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  background: var(--live); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.priv-chip.squilla { animation: squilla .6s ease 2; }
@keyframes squilla {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-6deg) scale(1.06); }
  40% { transform: rotate(6deg) scale(1.06); }
  60% { transform: rotate(-3deg); }
  80% { transform: rotate(3deg); }
}

#privati-strato { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.priv {
  position: fixed; width: 340px; height: 430px; max-height: calc(100% - 32px); pointer-events: auto;
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.5); overflow: hidden;
  /* si allarga tirando l'angolo in basso a destra */
  resize: both; min-width: 280px; min-height: 300px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
}
.priv::after {
  content: ''; position: absolute; right: 3px; bottom: 3px; width: 12px; height: 12px; pointer-events: none;
  background: linear-gradient(135deg, transparent 0 45%, var(--muted-2) 45% 52%, transparent 52% 65%, var(--muted-2) 65% 72%, transparent 72%);
}
.priv.davanti { border-color: var(--accent); }
.priv.lampeggia { animation: lampeggia .4s ease 3; }
@keyframes lampeggia { 50% { border-color: var(--live); box-shadow: 0 0 0 3px rgba(224,64,94,.35), 0 18px 50px rgba(0,0,0,.5); } }
.priv.trascino { opacity: .92; user-select: none; }
.priv-testa {
  display: flex; align-items: center; gap: 9px; padding: 9px 8px 9px 12px; background: var(--panel-2);
  border-bottom: 1px solid var(--line); cursor: move; touch-action: none; user-select: none;
}
.priv-testa .avatar { width: 28px; height: 28px; font-size: 12px; }
.priv-nome { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.priv-stato { font-size: 12px; color: var(--muted-2); white-space: nowrap; }
.priv-testa .btn-ic { width: 32px; height: 32px; border-radius: 8px; }
.priv-msg { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.priv-riga { line-height: 1.5; overflow-wrap: anywhere; padding: 1px 2px; }
.priv-ora { color: var(--muted-2); font-size: .75em; margin-right: .45em; font-variant-numeric: tabular-nums; }
.priv-nick { font-weight: 700; margin-right: .4em; }
.priv-testo { color: var(--text-2); white-space: pre-wrap; }
.priv-sis { align-self: center; font-size: 12px; color: var(--muted); text-align: center; }
.priv-scrivi { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.priv-scrivi input {
  flex: 1; min-width: 0; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2);
  padding: 0 12px; color: var(--text);
}
.priv-scrivi input:disabled { opacity: .6; }
.priv-scrivi button[type="submit"] { width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); border: none; }
.priv-scrivi .priv-btn-emoji { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.priv-emoji {
  position: absolute; left: 8px; right: 8px; bottom: 58px; display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 2px; padding: 8px; max-height: 190px; overflow-y: auto; background: var(--panel-2); border: 1px solid var(--line-2);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45); z-index: 2;
}
.priv-emoji button { height: 36px; border: none; background: transparent; border-radius: 8px; font-size: 20px; }
.priv-emoji button:hover { background: var(--sel); }

/* Avviso privato sul nick nella lista utenti */
.utente.con-privato { box-shadow: inset 3px 0 0 var(--accent); }
.utente.ha-privato { background: #2A1420; box-shadow: inset 3px 0 0 var(--live); }
.utente-priv {
  margin-left: auto; padding: 2px 8px; border-radius: 99px; background: #0E3A48; color: var(--accent); font-size: 12px; font-weight: 700;
  white-space: nowrap; border: 1px solid var(--accent);
}
.utente-priv:hover { background: #12485A; }
.utente-priv.nuovo { background: var(--live); color: #fff; border-color: var(--live); animation: pulsa-priv 1.4s ease-in-out infinite; }
.utente.con-privato .punto { display: none; }
/* La barra in alto dei privati ridotti serve solo dove la lista utenti non si vede
   (tablet e dentro il Playout); sul computer il segnale è sul nick, al telefono su "Utenti" */
@media (min-width: 1181px) { body:not(.embed) .privati-barra { display: none !important; } }
@media (max-width: 820px) { body:not(.embed) .privati-barra { display: none !important; } }
@keyframes pulsa-priv { 50% { opacity: .55; } }

body.embed .privati-barra { padding: 6px 8px; border-bottom: 1px solid var(--line); flex: none; }

@media (max-width: 820px) {
  .priv-chip { padding: 0; width: 38px; justify-content: center; }
  .priv-chip-nome { display: none; }
  .priv-chip .avatar { width: 32px; height: 32px; }
  /* al telefono il privato si apre come pannello dal basso, a tutta larghezza */
  .priv { left: 8px !important; right: 8px !important; top: auto !important; bottom: 8px !important; width: auto !important; height: min(70%, 480px) !important; resize: none; }
  .priv::after, .priv-allarga { display: none; }
  .priv-testa { cursor: default; }
}

/* A− / A+ grandezza scritte */
.dim-testo { display: flex; gap: 4px; flex-shrink: 0; }
.dim-testo button {
  height: 32px; min-width: 38px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent;
  color: var(--text); font-weight: 700; font-size: 14px;
}
.dim-testo button:hover:not(:disabled) { background: #12304a; }
#btn-a-meno { font-size: 12px; }
#btn-a-piu { font-size: 16px; }
.embed-strisce { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.embed-strisce .privati-barra { flex: 1; border: none; padding: 0; }
.embed-strisce .dim-testo { margin-left: auto; }
/* anche i privati seguono la grandezza scelta */
.priv-msg { font-size: var(--dim-chat, 15px); }
.priv-ora { font-size: .75em; }
.priv-sis { font-size: .8em; }

/* pulsante 📺 LIVE nel player quando c'è la diretta video */
.btn-tv {
  height: 40px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--live); background: #2A1420; color: #fff;
  font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; letter-spacing: .05em;
}
.btn-tv:hover { background: #3A1420; }
.btn-tv-testo { color: var(--live-soft); }
@media (max-width: 820px) { .btn-tv { padding: 0; width: 40px; height: 40px; justify-content: center; font-size: 17px; } .btn-tv-testo { display: none; } }

/* Colore della scritta (staff) */
.btn-colore { width: 36px; }
.pallino-colore { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); display: block; }
.pallino-colore.nessuno { background: conic-gradient(#FF6B6B, #FFE066, #69DB7C, #4DABF7, #9775FA, #F783AC, #FF6B6B) !important; border-color: transparent; }
.pop-colori {
  position: fixed; z-index: 90; display: grid; grid-template-columns: repeat(5, 36px); gap: 6px; padding: 10px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.pop-colori .colore { width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.pop-colori .colore.normale { border-color: var(--line-2); color: var(--text); font-weight: 700; }
.pop-colori .colore.scelto { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.priv-scrivi .priv-btn-colore { width: 36px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.stato-tv { font-size: 13px; line-height: 1.5; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); margin-top: -6px; }
