/* RC88 · Riquadro della radio dentro la Home.
   Stile autonomo: nessuna regola globale, nessun effetto sulle altre sezioni.
   Il riquadro copre la pagina e ospita il lettore della diretta in un iframe
   che riempie lo spazio disponibile, senza mostrare l'indirizzo di origine. */

.radio-panel {
  --radio-ink: #f6f4ef;
  --radio-ink-soft: rgba(246, 244, 239, .7);
  --radio-night: #0b1220;
  --radio-night-soft: #16202f;
  --radio-gold: #f6bf4d;
  --radio-red: #e2453f;
  --radio-teal: #35c8c0;
  --radio-violet: #a86bff;
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 3vw, 26px);
  background: rgba(6, 10, 17, .74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.radio-panel[hidden] {
  display: none !important;
}

.radio-panel-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.radio-panel-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(980px, 100%);
  max-height: calc(100dvh - 16px);
  overflow: hidden;
  padding: clamp(14px, 3vw, 22px);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(246, 191, 77, .18) 0%, transparent 62%),
    linear-gradient(180deg, var(--radio-night-soft) 0%, var(--radio-night) 74%);
  box-shadow: 0 32px 90px rgba(0, 0, 0, .6);
  color: var(--radio-ink);
}

.radio-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.radio-panel-heading {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.radio-panel-eyebrow {
  margin: 0;
  color: var(--radio-gold);
  font: 900 .68rem/1 system-ui, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.radio-panel-title {
  margin: 0;
  color: var(--radio-ink);
  font: 900 clamp(1.15rem, 3.4vw, 1.5rem)/1.12 Georgia, serif;
}

.radio-panel-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--radio-ink);
  font: 400 24px/1 system-ui, sans-serif;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}

.radio-panel-close:hover {
  background: rgba(255, 255, 255, .18);
  transform: translateY(-1px);
}

.radio-panel-close:focus-visible {
  outline: 3px solid rgba(246, 191, 77, .65);
  outline-offset: 3px;
}

/* ── Il lettore: un iframe che riempie il riquadro ───────────────────────
   L'indirizzo di origine non compare mai: l'iframe non ha barre e il
   contenuto si adatta alla larghezza del telefono o del computer. */
.radio-frame-shell {
  position: relative;
  display: grid;
  padding: 6px;
  border-radius: 22px;
}

.radio-frame-box {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 18px;
  background: #0b1220;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.radio-frame {
  display: block;
  width: 100%;
  height: clamp(300px, 68dvh, 720px);
  border: 0;
  background: #0b1220;
  color-scheme: dark;
}

.radio-frame-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  background: linear-gradient(180deg, #16202f 0%, #0b1220 100%);
  color: var(--radio-ink-soft);
  font: 800 .82rem/1.35 system-ui, sans-serif;
  text-align: center;
  transition: opacity .3s ease;
}

.radio-frame-loading[hidden] {
  display: none !important;
}

.radio-frame-spinner {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(246, 191, 77, .25);
  border-top-color: var(--radio-gold);
  border-right-color: var(--radio-teal);
  animation: radio-spin 1s linear infinite;
}

@keyframes radio-spin {
  to { transform: rotate(360deg); }
}

/* ── Animazioni colorate ────────────────────────────────────────────────
   Tutto ciò che si muove è soltanto decorativo (aria-hidden) e non aggiunge
   nessuna scritta: sfere luminose dietro il riquadro, un alone arcobaleno
   attorno al lettore e barre sonore colorate sotto. Si muovono mentre il
   riquadro è aperto e restano ferme con «riduci movimento». */

.radio-panel-aura {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.radio-blob {
  position: absolute;
  width: min(70vw, 460px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(54px);
  opacity: .5;
  will-change: transform;
}

.radio-blob-a {
  top: -18%;
  left: -12%;
  background: radial-gradient(circle at 50% 50%, #f6bf4d 0%, rgba(246, 191, 77, 0) 70%);
  animation: radio-drift-a 17s ease-in-out infinite;
}

.radio-blob-b {
  right: -14%;
  bottom: -22%;
  background: radial-gradient(circle at 50% 50%, #e2453f 0%, rgba(226, 69, 63, 0) 70%);
  animation: radio-drift-b 21s ease-in-out infinite;
}

.radio-blob-c {
  top: 26%;
  right: 4%;
  width: min(52vw, 340px);
  background: radial-gradient(circle at 50% 50%, #35c8c0 0%, rgba(53, 200, 192, 0) 72%);
  animation: radio-drift-c 24s ease-in-out infinite;
}

@keyframes radio-drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(26px, 34px, 0) scale(1.14); }
}

@keyframes radio-drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.06); }
  50% { transform: translate3d(-30px, -26px, 0) scale(.94); }
}

@keyframes radio-drift-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(.96); }
  50% { transform: translate3d(-22px, 30px, 0) scale(1.1); }
}

/* Alone arcobaleno attorno al lettore. */
.radio-halo {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: conic-gradient(from 0deg, #f6bf4d, #e2453f, #a86bff, #35c8c0, #f6bf4d);
  filter: blur(11px);
  opacity: .55;
  animation: radio-halo-turn 9s linear infinite;
  animation-play-state: paused;
}

.radio-panel[data-playing="1"] .radio-halo {
  animation-play-state: running;
  opacity: .85;
}

@keyframes radio-halo-turn {
  to { transform: rotate(360deg); }
}

/* Barre sonore: sette colori, ognuna con il suo ritmo. */
.radio-eq {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 30px;
  margin-top: -2px;
}

.radio-eq span {
  width: 6px;
  height: 34%;
  border-radius: 999px;
  transform-origin: bottom center;
  background: linear-gradient(180deg, #ffe9a8, #f6bf4d);
  animation: radio-eq 1.05s ease-in-out infinite;
  animation-play-state: paused;
}

.radio-eq span:nth-child(2) {
  background: linear-gradient(180deg, #ffb9a8, #e2453f);
  animation-duration: .82s;
  animation-delay: -.3s;
}

.radio-eq span:nth-child(3) {
  background: linear-gradient(180deg, #b7f5ef, #35c8c0);
  animation-duration: 1.24s;
  animation-delay: -.6s;
}

.radio-eq span:nth-child(4) {
  background: linear-gradient(180deg, #d7bcff, #a86bff);
  animation-duration: .96s;
  animation-delay: -.15s;
}

.radio-eq span:nth-child(5) {
  background: linear-gradient(180deg, #b7f5ef, #35c8c0);
  animation-duration: 1.15s;
  animation-delay: -.45s;
}

.radio-eq span:nth-child(6) {
  background: linear-gradient(180deg, #ffb9a8, #e2453f);
  animation-duration: .88s;
  animation-delay: -.72s;
}

.radio-eq span:nth-child(7) {
  background: linear-gradient(180deg, #ffe9a8, #f6bf4d);
  animation-duration: 1.08s;
  animation-delay: -.35s;
}

.radio-panel[data-playing="1"] .radio-eq span {
  animation-play-state: running;
}

@keyframes radio-eq {
  0%, 100% { height: 22%; }
  50% { height: 100%; }
}

/* Il titolo prende un riflesso di colori, senza cambiare una sola parola. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .radio-panel-title {
    background: linear-gradient(100deg, #fff6dc 0%, #f6bf4d 32%, #ffb0a8 58%, #9df0e6 84%, #fff6dc 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: radio-title-shine 9s linear infinite;
  }
}

@keyframes radio-title-shine {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .radio-blob,
  .radio-halo,
  .radio-eq span,
  .radio-frame-spinner,
  .radio-panel-title {
    animation: none !important;
  }

  .radio-eq span { height: 46%; }
  .radio-halo { opacity: .5; }
}

.radio-panel-status {
  margin: 0;
  min-height: 18px;
  color: var(--radio-ink-soft);
  font: 700 .78rem/1.4 system-ui, sans-serif;
}

.radio-panel-status[data-kind="error"] {
  color: #ffb0a8;
}

.radio-panel-status[data-kind="success"] {
  color: #a7e8c1;
}

/* Il pulsante nel riquadro «Come trovarci in TV» è un comando vero: si
   comporta come i pulsanti e non come un collegamento. */
.canale222-radio-cta {
  cursor: pointer;
  font-family: system-ui, sans-serif;
}

/* Con il riquadro aperto la pagina sotto non deve scorrere. */
html.is-radio-open,
html.is-radio-open body {
  overflow: hidden;
}

@media (max-width: 560px) {
  .radio-panel {
    padding: 8px;
  }

  .radio-panel-card {
    max-height: calc(100dvh - 12px);
    border-radius: 20px;
  }

  .radio-frame-shell {
    padding: 4px;
    border-radius: 18px;
  }

  .radio-frame {
    height: clamp(320px, calc(100dvh - 190px), 700px);
  }

  .radio-eq {
    height: 26px;
  }
}
