:root {
  color-scheme: dark;
  --radio-bg: #07111f;
  --radio-surface: rgba(22, 34, 56, 0.82);
  --radio-surface-soft: rgba(255, 255, 255, 0.065);
  --radio-border: rgba(255, 255, 255, 0.14);
  --radio-text: #f8fafc;
  --radio-muted: #aab7cc;
  --radio-blue: #69a7ff;
  --radio-red: #ff272f;
  --radio-radius: 38px;
  --radio-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 280px;
  min-height: 100%;
  background: var(--radio-bg);
}

body {
  min-width: 280px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--radio-text);
  background:
    radial-gradient(circle at 12% 3%, rgba(42, 93, 206, 0.62), transparent 34rem),
    radial-gradient(circle at 92% 95%, rgba(112, 37, 214, 0.7), transparent 34rem),
    linear-gradient(135deg, #07111f 0%, #0b1425 52%, #10172a 100%);
}

body.radio-page {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.radio-page .radio-site-header {
  position: relative;
  z-index: 20;
}

.radio-page .navbar,
.radio-page .navbar.scrolled {
  background: rgba(2, 7, 15, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

button,
a {
  font: inherit;
}

.radio-shell {
  min-height: 0;
  display: grid;
  flex: 1 1 auto;
  place-items: center;
  overflow: hidden;
  padding: 104px clamp(18px, 4vw, 44px) 40px;
}

.radio-player {
  position: relative;
  isolation: isolate;
  width: min(100%, 560px);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: visible;
  padding: 0 clamp(24px, 6vw, 48px) 30px;
  border: 1px solid var(--radio-border);
  border-radius: var(--radio-radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), transparent 38%),
    var(--radio-surface);
  box-shadow: var(--radio-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

.radio-player::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(130deg, rgba(76, 141, 255, 0.1), transparent 45%, rgba(117, 51, 210, 0.14));
  pointer-events: none;
}

.radio-player__glow {
  position: absolute;
  z-index: -1;
  right: -120px;
  bottom: -160px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(103, 47, 211, 0.25);
  filter: blur(40px);
  pointer-events: none;
}

.radio-cast {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  padding: 9px;
  visibility: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  opacity: 0;
  background: rgba(255, 255, 255, 0.065);
  cursor: pointer;
  pointer-events: none;
  transition: opacity 180ms ease, background 180ms ease, transform 180ms ease;
  --connected-color: var(--radio-blue);
  --disconnected-color: var(--radio-text);
}

.radio-cast.is-available {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.radio-cast:hover {
  background: rgba(105, 167, 255, 0.13);
  transform: translateY(-1px);
}

.radio-cast:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.radio-player__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: -80px;
}

.radio-player__logo {
  width: 160px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.radio-player__logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.radio-live {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 19px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff3d43, #f5000c);
  box-shadow: 0 10px 24px rgba(255, 20, 31, 0.35);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  white-space: nowrap;
  transition: filter 180ms ease, opacity 180ms ease;
}

.radio-live__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.1);
  animation: radio-pulse 1.6s ease-in-out infinite;
}

.radio-player[data-state="loading"] .radio-live__dot,
.radio-player[data-state="buffering"] .radio-live__dot,
.radio-player[data-state="reconnecting"] .radio-live__dot {
  animation-duration: 650ms;
}

.radio-player[data-state="offline"] .radio-live,
.radio-player[data-state="error"] .radio-live {
  filter: saturate(0.62);
}

.radio-player[data-state="offline"] .radio-live__dot,
.radio-player[data-state="error"] .radio-live__dot {
  opacity: 0.58;
  animation: none;
}

.radio-program {
  width: 100%;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 22px 0 0;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 20px;
  background: var(--radio-surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  text-align: center;
}

.radio-program__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--radio-blue);
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(105, 167, 255, 0.42));
}

.radio-program__copy {
  width: 100%;
  min-width: 0;
}

.radio-program__schedule-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.radio-program__time {
  display: block;
  color: var(--radio-blue);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.radio-program__name {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--radio-text);
  font-size: clamp(0.96rem, 2.8vw, 1.08rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.018em;
  text-overflow: ellipsis;
  text-wrap: balance;
}

.radio-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 26px;
  text-align: center;
}

.radio-schedule-button {
  width: min(100%, 270px);
  min-height: 50px;
  display: grid;
  grid-template-columns: 20px 1fr 20px;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  color: var(--radio-text);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 650;
  letter-spacing: 0.025em;
  text-align: center;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.radio-schedule-button:hover {
  border-color: rgba(105, 167, 255, 0.42);
  background: rgba(105, 167, 255, 0.1);
  transform: translateY(-1px);
}

.radio-schedule-button:focus-visible,
.radio-schedule__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.radio-schedule-button svg {
  width: 20px;
  height: 20px;
  color: var(--radio-blue);
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.radio-schedule-button__arrow {
  width: 18px !important;
  height: 18px !important;
  justify-self: end;
  color: var(--radio-muted) !important;
}

.radio-play {
  position: relative;
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 50%;
  color: #4d5570;
  background:
    radial-gradient(circle, #fff 0 44%, transparent 45%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.07));
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    0 0 34px rgba(88, 112, 255, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.radio-play:hover {
  transform: translateY(-2px) scale(1.025);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.38), 0 0 42px rgba(88, 112, 255, 0.42);
}

.radio-play:active {
  transform: scale(0.98);
}

.radio-play:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 6px;
}

.radio-play__icon {
  position: absolute;
  width: 46px;
  height: 46px;
  fill: currentColor;
  transition: opacity 140ms ease, transform 180ms ease;
}

.radio-play__icon--play {
  transform: translateX(0.5px);
}

.radio-play__icon--pause,
.radio-play__spinner {
  opacity: 0;
  transform: scale(0.75);
}

.radio-schedule {
  position: fixed;
  z-index: 200;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  display: none;
  align-items: stretch;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: var(--radio-text);
  background: transparent;
  box-shadow: none;
}

.radio-schedule[open] {
  display: flex;
}

.radio-schedule::backdrop {
  background: rgba(2, 7, 15, 0);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color 380ms ease;
}

.radio-schedule.is-open::backdrop {
  background: rgba(2, 7, 15, 0.72);
}

.radio-schedule__panel {
  position: relative;
  width: 40vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--radio-border);
  background: #111d32;
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.42);
  transform: translateX(105%);
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.radio-schedule.is-open .radio-schedule__panel {
  transform: translateX(0);
}

.radio-schedule__header {
  position: relative;
  z-index: 2;
  min-height: 72px;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0 72px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
}

.radio-schedule__handle {
  display: none;
}

.radio-schedule__eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--radio-blue);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.radio-schedule h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 650;
}

.radio-schedule__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  color: var(--radio-text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.radio-schedule__close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.radio-schedule__content {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 24px 24px;
  overscroll-behavior: contain;
  scrollbar-color: rgba(105, 167, 255, 0.5) transparent;
}

.radio-schedule__day {
  padding-top: 18px;
}

.radio-schedule__day h3 {
  margin: 0 0 10px;
  color: var(--radio-blue);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.radio-schedule__day ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.radio-schedule__day li {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  align-items: baseline;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
}

.radio-schedule__day time {
  color: var(--radio-muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.radio-schedule__day li span {
  font-size: 0.84rem;
  font-weight: 550;
  line-height: 1.3;
}

.radio-schedule__empty {
  margin: 0;
  padding: 28px 0 8px;
  color: var(--radio-muted);
  text-align: center;
}

@media (max-width: 768px) {
  .radio-schedule {
    align-items: flex-end;
    justify-content: center;
  }

  .radio-schedule__panel {
    width: 100%;
    height: 85vh;
    height: 85svh;
    border: 1px solid var(--radio-border);
    border-bottom: 0;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.42);
    transform: translateY(105%);
  }

  .radio-schedule.is-open .radio-schedule__panel {
    transform: translateY(0);
  }

  .radio-schedule__header {
    padding-top: 10px;
  }

  .radio-schedule__eyebrow {
    margin-bottom: 0;
    font-size: 1.05rem;
  }

  .radio-schedule h2 {
    display: none;
  }

  .radio-schedule__handle {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 40px;
    height: 4px;
    display: block;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    transform: translateX(-50%);
  }
}

.radio-player[data-state="playing"] .radio-play__icon--play,
.radio-player[data-state="casting"] .radio-play__icon--play,
.radio-player[data-state="loading"] .radio-play__icon--play,
.radio-player[data-state="buffering"] .radio-play__icon--play,
.radio-player[data-state="reconnecting"] .radio-play__icon--play {
  opacity: 0;
  transform: scale(0.75);
}

.radio-player[data-state="playing"] .radio-play__icon--pause,
.radio-player[data-state="casting"] .radio-play__icon--pause {
  opacity: 1;
  transform: scale(1);
}

.radio-player[data-state="loading"] .radio-play__spinner,
.radio-player[data-state="buffering"] .radio-play__spinner,
.radio-player[data-state="reconnecting"] .radio-play__spinner {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(77, 85, 112, 0.24);
  border-top-color: currentColor;
  border-radius: 50%;
  opacity: 1;
  transform: scale(1);
  animation: radio-spin 850ms linear infinite;
}

@keyframes radio-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.78); }
}

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

@media (max-width: 520px) {
  :root {
    --radio-radius: 30px;
  }

  .radio-shell {
    place-items: center;
    padding: 72px 12px 28px;
  }

  .radio-player {
    min-height: 420px;
    padding: 0 20px 22px;
  }

  .radio-player__header {
    gap: 12px;
    margin-top: -58px;
  }

  .radio-player__logo {
    width: 116px;
    border-radius: 25px;
  }

  .radio-live {
    min-height: 34px;
    padding-inline: 16px;
    font-size: 0.7rem;
  }

  .radio-program {
    min-height: 65px;
    margin-top: 16px;
    padding: 10px 16px;
    border-radius: 18px;
  }

  .radio-program__icon {
    width: 17px;
    height: 17px;
  }

  .radio-program__name {
    font-size: 0.94rem;
  }

  .radio-control {
    margin-top: 20px;
  }

  .radio-schedule-button {
    width: min(100%, 220px);
    grid-template-columns: 18px 1fr 18px;
    gap: 8px;
    min-height: 44px;
    margin-top: 10px;
    padding-inline: 14px;
    border-radius: 16px;
    font-size: 0.81rem;
  }

  .radio-schedule-button svg {
    width: 18px;
    height: 18px;
  }

  .radio-play {
    width: 112px;
    height: 112px;
  }

  .radio-play__icon,
  .radio-player[data-state="loading"] .radio-play__spinner,
  .radio-player[data-state="buffering"] .radio-play__spinner,
  .radio-player[data-state="reconnecting"] .radio-play__spinner {
    width: 40px;
    height: 40px;
  }

  .radio-schedule__header {
    padding-right: 64px;
    padding-left: 64px;
  }

  .radio-schedule__content {
    padding: 6px 18px 20px;
  }

  .radio-schedule__day li {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    padding-inline: 10px;
  }

}

@media (max-height: 680px) {
  .radio-shell {
    place-items: start center;
  }

  .radio-player {
    min-height: 0;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (min-width: 600px) {
  .radio-shell {
    padding: 68px 12px 12px;
  }

  .radio-player {
    width: min(100%, 760px);
    min-height: 238px;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    grid-template-areas:
      "header control"
      "header program"
      "header schedule";
    gap: 8px 28px;
    padding: 14px 28px;
    border-radius: 30px;
  }

  .radio-player__header {
    grid-area: header;
    align-self: start;
    gap: 14px;
    margin-top: -70px;
  }

  .radio-player__logo {
    width: 112px;
    border-radius: 24px;
  }

  .radio-live {
    min-height: 33px;
    padding-inline: 15px;
    font-size: 0.69rem;
  }

  .radio-program {
    grid-area: program;
    min-height: 64px;
    margin: 0;
    padding: 10px 16px;
    border-radius: 20px;
  }

  .radio-program__name {
    font-size: 0.94rem;
  }

  .radio-control {
    grid-area: control;
    margin: 0;
  }

  .radio-schedule-button {
    grid-area: schedule;
    justify-self: center;
    min-height: 42px;
    margin: 0;
  }

  .radio-play {
    width: 88px;
    height: 88px;
  }

  .radio-play__icon,
  .radio-player[data-state="loading"] .radio-play__spinner,
  .radio-player[data-state="buffering"] .radio-play__spinner,
  .radio-player[data-state="reconnecting"] .radio-play__spinner {
    width: 33px;
    height: 33px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .radio-player {
    background: #152139;
  }
}
