.mrs-radio-player,
.mrs-radio-player * {
  box-sizing: border-box;
}

.mrs-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mrs-radio-player {
  width: 100%;
  max-width: var(--mrs-width, 860px);
  margin: 0 auto;
  font-family: system-ui, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--mrs-text, #121212);
}

.mrs-radio-shell {
  position: relative;
  padding: 0;
  border-radius: 26px;
  background: var(--mrs-card-bg, linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06)));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 18px 50px rgba(0,0,0,0.14), inset 0 1px 0 rgba(255,255,255,0.22);
  overflow: hidden;
  isolation: isolate;
}

.mrs-radio-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.20), transparent 35%),
    radial-gradient(circle at bottom left, rgba(255,255,255,0.12), transparent 30%);
  pointer-events: none;
  z-index: -1;
}

.mrs-radio-main {
  display: grid;
  grid-template-columns: minmax(160px, 210px) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 28px);
  align-items: stretch;
  padding: clamp(16px, 2.4vw, 24px);
}

.mrs-radio-art-wrap {
  position: relative;
  width: 100%;
  max-width: 210px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}

.mrs-radio-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
  display: block;
  box-shadow: 0 12px 35px rgba(0,0,0,0.18);
  background: #f4f4f4;
}

.mrs-radio-live-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  color: #fff;
  background: linear-gradient(135deg, var(--mrs-accent, #ff3131), #d80032);
  box-shadow: 0 10px 20px rgba(216,0,50,0.28);
}

.mrs-radio-glow {
  position: absolute;
  inset: auto 12% -12% 12%;
  height: 28px;
  border-radius: 999px;
  filter: blur(18px);
  background: rgba(0,0,0,0.18);
  z-index: -1;
}

.mrs-radio-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.8vw, 18px);
}

.mrs-radio-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 20px);
}

.mrs-radio-meta {
  min-width: 0;
  flex: 1 1 auto;
}

.mrs-radio-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--mrs-subtext, rgba(20,20,20,0.62));
}

.mrs-radio-title {
  margin: 0 0 6px;
  font-size: clamp(22px, 3.2vw, 34px);
  line-height: 1.12;
  font-weight: 800;
  color: var(--mrs-text, #121212);
  word-break: break-word;
}

.mrs-radio-now-line {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--mrs-text, #121212);
}

.mrs-radio-now-line .mrs-now-sep {
  opacity: 0.55;
}

.mrs-radio-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--mrs-subtext, rgba(20,20,20,0.72));
}

.mrs-radio-play {
  flex: 0 0 auto;
  width: clamp(56px, 12vw, 72px);
  height: clamp(56px, 12vw, 72px);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(135deg, var(--mrs-button-start, #121212), var(--mrs-button-end, #2d2d2d));
  box-shadow: 0 16px 28px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease;
}

.mrs-radio-play:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 34px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.18);
}

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

.mrs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding-top: 4px;
}

.mrs-visualizer-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 28px;
  min-width: 120px;
}

.mrs-visualizer-bars span {
  width: 5px;
  height: 22%;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--mrs-text, #111), rgba(17,17,17,0.25));
  opacity: .35;
  transform-origin: bottom;
  transition: opacity 0.2s ease;
}

.mrs-radio-player.is-playing .mrs-visualizer-bars span {
  opacity: 1;
  animation: mrsBar 0.9s ease-in-out infinite;
}

.mrs-radio-player.is-playing .mrs-visualizer-bars span:nth-child(2) { animation-delay: .1s; }
.mrs-radio-player.is-playing .mrs-visualizer-bars span:nth-child(3) { animation-delay: .2s; }
.mrs-radio-player.is-playing .mrs-visualizer-bars span:nth-child(4) { animation-delay: .3s; }
.mrs-radio-player.is-playing .mrs-visualizer-bars span:nth-child(5) { animation-delay: .4s; }
.mrs-radio-player.is-playing .mrs-visualizer-bars span:nth-child(6) { animation-delay: .5s; }

@keyframes mrsBar {
  0%, 100% { transform: scaleY(.3); }
  50% { transform: scaleY(1); }
}

.mrs-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  justify-content: flex-end;
  flex: 1 1 auto;
}

.mrs-share-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mrs-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--mrs-text, #111);
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(17,17,17,0.08);
  text-decoration: none !important;
  transition: transform 0.2s ease, background 0.2s ease;
}

.mrs-share:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.85);
}

.mrs-quality-select {
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid rgba(17,17,17,0.12);
  background: rgba(255,255,255,0.65);
  color: var(--mrs-text, #111);
  font-weight: 600;
  font-size: 13px;
  max-width: 220px;
}

.mrs-theme-toggle,
.mrs-history-toggle {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(17,17,17,0.12);
  background: rgba(255,255,255,0.55);
  color: var(--mrs-text, #111);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.mrs-theme-toggle:hover,
.mrs-history-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.85);
}

.mrs-history-panel {
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(17,17,17,0.06);
}

.mrs-history-heading {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mrs-subtext, rgba(20,20,20,0.62));
}

.mrs-history-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--mrs-text, #111);
  line-height: 1.45;
}

.mrs-history-list li + li {
  margin-top: 4px;
}

.mrs-radio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}

.mrs-volume-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: min(100%, 220px);
  flex: 1 1 200px;
}

.mrs-volume-icon {
  color: var(--mrs-text, #111);
  flex: 0 0 auto;
}

/* Volume: explicit light vs dark (do not rely on --mrs-text for track — it washes out on light cards) */
.mrs-volume-range {
  width: 100%;
  height: 22px;
  appearance: none;
  background: transparent;
  outline: none;
}

.mrs-radio-player.mrs-skin-light .mrs-volume-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  background: linear-gradient(
    90deg,
    #1a1a1f var(--mrs-vol-pct, 85%),
    #aeb2bc var(--mrs-vol-pct, 85%)
  );
}

.mrs-radio-player.mrs-skin-light .mrs-volume-range::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border-radius: 50%;
  background: #121218;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.mrs-radio-player.mrs-skin-light .mrs-volume-range::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #aeb2bc;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.mrs-radio-player.mrs-skin-light .mrs-volume-range::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: #1a1a1f;
}

.mrs-radio-player.mrs-skin-light .mrs-volume-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #121218;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.mrs-radio-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 14px;
  color: var(--mrs-text, #111);
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(17,17,17,0.08);
  transition: transform .25s ease, background .25s ease;
}

.mrs-radio-link:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.75);
}

.mrs-admin-warning {
  padding: 12px 14px;
  border-left: 4px solid #d63638;
  background: #fff;
}

/* Dark skin — !important overrides inline --mrs-text/--mrs-subtext from settings */
.mrs-radio-player.mrs-skin-dark {
  --mrs-text: #f7f8fa !important;
  --mrs-subtext: rgba(247,248,250,0.88) !important;
  color: #f7f8fa;
}

.mrs-radio-player.mrs-skin-dark .mrs-radio-shell {
  background: linear-gradient(150deg, #24242a 0%, #16161a 55%, #121216 100%);
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 22px 60px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.08);
}

.mrs-radio-player.mrs-skin-dark .mrs-radio-shell::before {
  background:
    radial-gradient(circle at 85% 0%, rgba(255,255,255,0.10), transparent 42%),
    radial-gradient(circle at 10% 100%, rgba(255,255,255,0.06), transparent 38%);
}

.mrs-radio-player.mrs-skin-dark .mrs-radio-label {
  color: rgba(247,248,250,0.78) !important;
}

.mrs-radio-player.mrs-skin-dark .mrs-radio-title,
.mrs-radio-player.mrs-skin-dark .mrs-radio-subtitle,
.mrs-radio-player.mrs-skin-dark .mrs-radio-now-line {
  color: #f7f8fa !important;
}

.mrs-radio-player.mrs-skin-dark .mrs-radio-now-line .mrs-now-artist,
.mrs-radio-player.mrs-skin-dark .mrs-radio-now-line .mrs-now-title {
  color: inherit;
}

.mrs-radio-player.mrs-skin-dark .mrs-radio-now-line .mrs-now-sep {
  opacity: 0.85;
  color: rgba(255,255,255,0.75);
}

.mrs-radio-player.mrs-skin-dark .mrs-radio-subtitle {
  opacity: 0.92;
}

.mrs-radio-player.mrs-skin-dark .mrs-visualizer-bars span {
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.28)) !important;
  opacity: 0.55;
}

.mrs-radio-player.mrs-skin-dark.is-playing .mrs-visualizer-bars span {
  opacity: 1;
}

.mrs-radio-player.mrs-skin-dark .mrs-share,
.mrs-radio-player.mrs-skin-dark .mrs-quality-select,
.mrs-radio-player.mrs-skin-dark .mrs-theme-toggle,
.mrs-radio-player.mrs-skin-dark .mrs-history-toggle,
.mrs-radio-player.mrs-skin-dark .mrs-radio-link {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.28);
  color: #ffffff !important;
  box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}

.mrs-radio-player.mrs-skin-dark .mrs-share:hover,
.mrs-radio-player.mrs-skin-dark .mrs-quality-select:hover,
.mrs-radio-player.mrs-skin-dark .mrs-theme-toggle:hover,
.mrs-radio-player.mrs-skin-dark .mrs-history-toggle:hover,
.mrs-radio-player.mrs-skin-dark .mrs-radio-link:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.42);
  color: #ffffff !important;
}

.mrs-radio-player.mrs-skin-dark .mrs-share svg {
  color: inherit;
}

.mrs-radio-player.mrs-skin-dark .mrs-quality-select {
  color-scheme: dark;
}

.mrs-radio-player.mrs-skin-dark .mrs-history-panel {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
}

.mrs-radio-player.mrs-skin-dark .mrs-history-heading {
  color: rgba(247,248,250,0.82) !important;
}

.mrs-radio-player.mrs-skin-dark .mrs-history-list {
  color: #f7f8fa !important;
}

.mrs-radio-player.mrs-skin-dark .mrs-volume-icon {
  color: #f0f1f4 !important;
}

/* Dark: bright “filled” vs opaque dark trough (translucent white read as one solid bar on dark cards) */
.mrs-radio-player.mrs-skin-dark .mrs-volume-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  background: linear-gradient(
    90deg,
    #f5f6f8 var(--mrs-vol-pct, 85%),
    #2e3038 var(--mrs-vol-pct, 85%)
  ) !important;
}

.mrs-radio-player.mrs-skin-dark .mrs-volume-range::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  border: 2px solid rgba(26, 26, 31, 0.95);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.mrs-radio-player.mrs-skin-dark .mrs-volume-range::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #2e3038;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mrs-radio-player.mrs-skin-dark .mrs-volume-range::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: #f5f6f8;
}

.mrs-radio-player.mrs-skin-dark .mrs-volume-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(26, 26, 31, 0.95);
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.mrs-radio-player.mrs-skin-dark .mrs-radio-play {
  color: #111 !important;
  background: linear-gradient(145deg, #f3f4f6, #d7d9df) !important;
  box-shadow: 0 14px 28px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.65);
}

.mrs-radio-player.mrs-skin-dark .mrs-radio-play:hover {
  box-shadow: 0 18px 34px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.75);
}

/* Responsive */
@media (max-width: 900px) {
  .mrs-radio-main {
    grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
    gap: 18px;
  }
}

@media (max-width: 720px) {
  .mrs-radio-main {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .mrs-radio-art-wrap {
    max-width: 200px;
  }

  .mrs-radio-top {
    flex-direction: column;
    align-items: center;
  }

  .mrs-radio-meta {
    text-align: center;
  }

  .mrs-toolbar {
    justify-content: center;
  }

  .mrs-toolbar-actions {
    justify-content: center;
  }

  .mrs-radio-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .mrs-volume-box {
    width: 100%;
    flex: 1 1 auto;
  }

  .mrs-radio-link {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .mrs-radio-shell {
    border-radius: 20px;
  }

  .mrs-toolbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .mrs-share-group {
    justify-content: center;
  }

  .mrs-quality-select {
    max-width: none;
    width: 100%;
  }

  .mrs-theme-toggle,
  .mrs-history-toggle {
    width: 100%;
  }
}
