#liveStage {
  --stage-glow: #c98a3a;
  width: min(var(--home-feature-max-width), calc(100% - (var(--home-feature-gutter) * 2)));
  max-width: var(--home-feature-max-width);
  margin: 0 auto 32px;
  position: relative;
  isolation: isolate;
}

.live-stage-glow {
  position: absolute;
  inset: 8% -4% auto;
  height: 78%;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--stage-glow) 55%, transparent) 0%, transparent 68%),
    radial-gradient(ellipse at 20% 40%, rgba(255, 176, 72, .22), transparent 58%);
  filter: blur(28px);
  opacity: .55;
  pointer-events: none;
  transition: background .6s ease, opacity .4s ease;
}

#liveStage.is-on-air .live-stage-glow {
  opacity: .9;
}

.live-stage-screen {
  position: relative;
  z-index: 1;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  min-height: 180px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 96, 73, .28), transparent 28%),
    radial-gradient(circle at 82% 82%, rgba(104, 84, 255, .32), transparent 34%),
    linear-gradient(135deg, #17132f 0%, #10172b 48%, #0d2630 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .2),
    0 18px 48px rgba(14, 10, 40, .38),
    inset 0 1px 0 rgba(255, 255, 255, .16);
}

.live-stage-screen::before {
  content: "";
  position: absolute;
  inset: -48%;
  z-index: 2;
  pointer-events: none;
  background: conic-gradient(from 220deg, rgba(255, 78, 77, .55), transparent 16%, rgba(106, 91, 255, .42) 37%, transparent 51%, rgba(255, 211, 91, .42) 72%, transparent 86%);
  filter: blur(34px);
  opacity: .72;
  animation: live-welcome-spin 16s linear infinite;
}

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

#liveStage.is-on-air .live-stage-screen::before,
#liveStage.is-on-air .live-stage-screen::after {
  display: none;
}

.live-stage-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0b0a08;
}

#liveStage:not(.is-on-air) .live-stage-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 28%, rgba(255, 214, 150, .1) 50%, transparent 72%);
  animation: stage-wait 1.5s linear infinite;
}

@keyframes stage-wait {
  from { transform: translateX(-35%); }
  to { transform: translateX(35%); }
}

.live-stage-sample {
  display: none;
}

.live-stage-play-btn {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: clamp(18px, 4vw, 42px);
  border: 0;
  background: rgba(7, 9, 26, .16);
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: background .22s ease, transform .22s ease;
}

.live-stage-play-btn::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(76%, 620px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 93, 85, .24) 0%, rgba(100, 78, 255, .14) 34%, transparent 70%);
  filter: blur(10px);
  animation: live-welcome-pulse 3.8s ease-in-out infinite;
}

@keyframes live-welcome-pulse {
  0%, 100% { transform: scale(.82); opacity: .72; }
  50% { transform: scale(1.08); opacity: 1; }
}

.live-stage-play-btn:hover,
.live-stage-play-btn:focus-visible {
  background: rgba(10, 9, 34, .04);
  outline: none;
}

.live-stage-play-btn:hover .live-welcome-card {
  transform: translateY(-4px) scale(1.015);
  border-color: rgba(255, 255, 255, .7);
  box-shadow: 0 22px 60px rgba(5, 4, 26, .42), 0 0 34px rgba(255, 92, 83, .24);
}

.live-stage-play-btn:focus-visible .live-welcome-card {
  outline: 3px solid rgba(255, 220, 108, .9);
  outline-offset: 4px;
}

.live-welcome-card {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: clamp(6px, 1.1vw, 11px);
  width: min(100%, 470px);
  padding: clamp(18px, 3.2vw, 32px) clamp(20px, 4vw, 48px) clamp(20px, 3.5vw, 34px);
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(24, 22, 58, .78), rgba(11, 34, 48, .7));
  box-shadow: 0 18px 52px rgba(5, 4, 26, .3), inset 0 1px 0 rgba(255, 255, 255, .2);
  backdrop-filter: blur(14px);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.live-welcome-topline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, .86);
  font: 900 clamp(.62rem, 1.2vw, .74rem)/1 system-ui, sans-serif;
  letter-spacing: .14em;
}

.live-welcome-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4f5e;
  box-shadow: 0 0 0 4px rgba(255, 79, 94, .16), 0 0 16px #ff4f5e;
  animation: live-welcome-blink 1.25s ease-in-out infinite;
}

@keyframes live-welcome-blink {
  50% { opacity: .38; transform: scale(.78); }
}

.live-welcome-divider {
  width: 1px;
  height: 13px;
  background: rgba(255, 255, 255, .36);
}

.live-welcome-logo-svg {
  display: block;
  width: min(100%, 430px);
  height: auto;
  margin: 2px auto 0;
  flex: 0 1 auto;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .24));
}

.live-welcome-kicker {
  color: #fff;
  font: 900 clamp(.62rem, 1.25vw, .78rem)/1.1 system-ui, sans-serif;
  letter-spacing: .16em;
  text-align: center;
}

.live-welcome-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 3px;
  color: #fff;
  font: 900 clamp(1.02rem, 2.4vw, 1.42rem)/1.1 system-ui, sans-serif;
  letter-spacing: -.02em;
  text-align: center;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .28);
}

.live-welcome-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ff5b57;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  box-shadow: 0 5px 18px rgba(255, 91, 87, .35);
}

.live-welcome-hint {
  color: rgba(255, 255, 255, .66);
  font: 600 clamp(.7rem, 1.4vw, .86rem)/1.2 system-ui, sans-serif;
  letter-spacing: .02em;
}

.live-welcome-orbit {
  position: absolute;
  z-index: 0;
  width: min(48vw, 340px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 214, 91, .24);
  border-radius: 50%;
  transform: rotate(-26deg) scaleY(.28);
  pointer-events: none;
}

.live-welcome-orbit-one { width: min(62vw, 500px); border-color: rgba(255, 91, 87, .28); transform: rotate(22deg) scaleY(.25); }
.live-welcome-orbit-two { width: min(44vw, 360px); border-color: rgba(105, 91, 255, .38); transform: rotate(-35deg) scaleY(.3); }

.live-welcome-spark {
  position: absolute;
  z-index: 1;
  color: #ffd65b;
  font-size: clamp(1.2rem, 3vw, 2rem);
  text-shadow: 0 0 16px currentColor;
  animation: live-welcome-float 3s ease-in-out infinite;
  pointer-events: none;
}

.live-welcome-spark-one { top: 17%; left: 18%; }
.live-welcome-spark-two { right: 16%; bottom: 18%; color: #ff7373; animation-delay: -1.2s; }

@keyframes live-welcome-float {
  50% { transform: translateY(-8px) rotate(14deg); opacity: .65; }
}

#liveStage.is-on-air .live-stage-play-btn,
.live-stage-play-btn[hidden] {
  display: none;
}

.live-stage-dock {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  display: flex;
  gap: 8px;
}

.live-stage-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 236, 206, .28);
  border-radius: 999px;
  color: #fff8ea;
  background: rgba(18, 14, 10, .52);
  box-shadow: 0 6px 16px rgba(12, 8, 4, .28), inset 0 1px 0 rgba(255, 255, 255, .18);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.live-stage-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.live-stage-btn .ico-on,
.live-stage-btn .ico-compress,
#liveStage.has-sound .live-stage-btn .ico-off,
#liveStage.is-wide .live-stage-btn .ico-expand {
  display: none;
}

#liveStage.has-sound .live-stage-btn .ico-on,
#liveStage.is-wide .live-stage-btn .ico-compress {
  display: block;
}

.live-stage-btn:hover {
  transform: translateY(-1px);
  background: rgba(36, 24, 12, .72);
  border-color: rgba(255, 214, 140, .7);
}

.live-stage-btn:focus-visible {
  outline: 2px solid #f6be6d;
  outline-offset: 3px;
}

.live-stage-btn:active {
  transform: translateY(1px);
}

@media (max-width: 700px) {
  #liveStage {
    width: calc(100% - (var(--home-feature-gutter) * 2));
    margin-bottom: 24px;
  }

  .live-stage-screen {
    border-radius: 16px;
    min-height: 150px;
  }

  .live-stage-dock {
    right: 10px;
    bottom: 10px;
    gap: 6px;
  }

  .live-stage-btn {
    width: 38px;
    height: 38px;
  }
}

#liveStage:fullscreen,
#liveStage:-webkit-full-screen,
#liveStage.is-expanded {
  width: 100vw;
  max-width: none;
  height: 100vh;
  margin: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: #090807;
}

#liveStage.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
}

#liveStage:fullscreen .live-stage-screen,
#liveStage:-webkit-full-screen .live-stage-screen,
#liveStage.is-expanded .live-stage-screen {
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  border-radius: 0;
  box-shadow: none;
}

#liveStage:fullscreen .live-stage-glow,
#liveStage:-webkit-full-screen .live-stage-glow,
#liveStage.is-expanded .live-stage-glow {
  display: none;
}

.live-stage-status {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  max-width: min(86%, 520px);
  margin: 0;
  padding: 9px 15px;
  border: 1px solid rgba(255, 236, 206, .22);
  border-radius: 999px;
  color: #fff8ea;
  background: rgba(10, 8, 6, .82);
  font: 700 .86rem/1.25 system-ui, sans-serif;
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.live-stage-status[data-kind="error"] { color: #ffd0c4; }
.live-stage-status[hidden] { display: none; }

/* Nell'embed iniziale resta visibile solo l'azione principale. */
.is-live-embed #liveStage:not(.is-on-air) .live-stage-dock {
  opacity: 0;
  pointer-events: none;
}

.is-live-embed #liveStage:not(.is-on-air) .live-stage-play-btn {
  display: flex !important;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.is-live-embed #liveStage.is-on-air .live-stage-play-btn {
  display: none !important;
}

.is-live-embed #liveStage {
  width: 100%;
  max-width: none;
  margin: 0;
}

.is-live-embed #liveStage .live-stage-screen {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  box-shadow: none;
}

.is-live-embed .main-live-section,
.is-live-embed #mainLivePlayer,
.is-live-embed #liveStage {
  height: 100vh;
  min-height: 100vh;
}

/* ── Live TV WOW layer ──
   Il player resta sempre 16:9 e diventa il fulcro della pagina. */
#liveStage {
  width: min(1480px, calc(100% - 28px));
  max-width: 1480px;
  margin: 0 auto clamp(30px, 4vw, 52px);
}

#liveStage .live-stage-glow {
  inset: 5% -3% auto;
  height: 86%;
  background:
    radial-gradient(ellipse at 14% 32%, rgba(255, 70, 111, .5), transparent 42%),
    radial-gradient(ellipse at 86% 68%, rgba(53, 222, 255, .46), transparent 46%),
    radial-gradient(ellipse at 50% 90%, rgba(120, 78, 255, .34), transparent 58%);
  filter: blur(42px);
  opacity: .68;
}

#liveStage.is-on-air .live-stage-glow {
  opacity: 1;
  animation: live-tv-breathe 5s ease-in-out infinite;
}

@keyframes live-tv-breathe {
  0%, 100% { transform: scale(.98); filter: blur(42px); }
  50% { transform: scale(1.035); filter: blur(48px); }
}

#liveStage .live-stage-screen {
  box-sizing: border-box;
  border: 2px solid rgba(145, 237, 255, .55);
  border-radius: clamp(16px, 2vw, 28px);
  box-shadow:
    0 0 0 1px rgba(255, 90, 123, .42),
    0 0 0 5px rgba(101, 220, 255, .08),
    0 28px 72px rgba(0, 0, 0, .48),
    0 0 46px rgba(72, 215, 255, .24),
    inset 0 1px 0 rgba(255, 255, 255, .24);
}

#liveStage .live-stage-screen::before {
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .13), transparent 18%, transparent 70%, rgba(102, 231, 255, .1)),
    linear-gradient(180deg, rgba(255, 255, 255, .07), transparent 24%);
  filter: none;
  opacity: 1;
  mix-blend-mode: screen;
  animation: none;
}

#liveStage.is-on-air .live-stage-screen::before {
  display: block;
}

#liveStage .live-stage-video {
  border-radius: inherit;
}

#liveStage .live-stage-dock {
  right: clamp(12px, 2vw, 26px);
  bottom: clamp(12px, 2vw, 24px);
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(129, 231, 255, .22);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(8, 16, 42, .78), rgba(24, 16, 54, .64));
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .14);
  backdrop-filter: blur(16px) saturate(145%);
}

#liveStage .live-stage-btn {
  width: 46px;
  height: 46px;
  border-color: rgba(161, 237, 255, .3);
  background: linear-gradient(145deg, rgba(51, 80, 148, .54), rgba(19, 37, 76, .68));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 5px 14px rgba(0, 0, 0, .2);
}

#liveStage .live-stage-btn:hover,
#liveStage .live-stage-btn:focus-visible {
  border-color: #8cecff;
  background: linear-gradient(145deg, #ff5775, #8c5dff);
  box-shadow: 0 0 0 3px rgba(105, 225, 255, .18), 0 8px 22px rgba(255, 79, 122, .3);
}

#liveStage .live-stage-status {
  border-color: rgba(135, 231, 255, .34);
  background: rgba(7, 15, 39, .84);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28), 0 0 22px rgba(68, 213, 255, .12);
  backdrop-filter: blur(14px);
}

#liveStage .live-stage-play-btn {
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(12, 18, 53, .28), rgba(27, 9, 48, .12));
}

#liveStage .live-stage-play-btn:hover {
  background: linear-gradient(120deg, rgba(12, 18, 53, .08), rgba(27, 9, 48, .03));
}

#liveStage .live-welcome-card {
  border-color: rgba(145, 235, 255, .42);
  background: linear-gradient(145deg, rgba(16, 25, 67, .84), rgba(43, 13, 65, .7));
  box-shadow: 0 24px 70px rgba(4, 4, 30, .48), 0 0 42px rgba(64, 214, 255, .18), inset 0 1px 0 rgba(255, 255, 255, .22);
}

#liveStage .live-welcome-kicker { color: #8feaff; }
#liveStage .live-welcome-title { text-shadow: 0 3px 22px rgba(0, 0, 0, .42), 0 0 18px rgba(91, 224, 255, .22); }
#liveStage .live-welcome-arrow { background: linear-gradient(135deg, #ff5275, #8c5dff); }

@media (max-width: 700px) {
  #liveStage {
    width: calc(100% - 24px);
    margin-bottom: 30px;
  }

  #liveStage .live-stage-screen {
    border-radius: 16px;
  }

  #liveStage .live-stage-dock {
    right: 8px;
    bottom: 8px;
    gap: 6px;
    padding: 6px;
    border-radius: 14px;
  }

  #liveStage .live-stage-btn {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 380px) {
  #liveStage {
    width: calc(100% - 18px);
  }

  #liveStage .live-stage-dock {
    gap: 4px;
    padding: 5px;
  }

  #liveStage .live-stage-btn {
    width: 38px;
    height: 38px;
  }
}

/* Nell'embed il player conserva la piena larghezza della viewport. */
.is-live-embed #liveStage {
  width: 100%;
  max-width: none;
  margin: 0;
}
