:root {
  --ap-bar-h: 60px;
  --ap-radius: 12px;
  --ap-bg: #fff;
  --ap-surface: #f5f5f5;
  --ap-surface-2: #eee;
  --ap-surface-3: #ddd;
  --ap-border: rgba(0, 0, 0, .1);
  --ap-border-2: rgba(0, 0, 0, .06);
  --ap-text: #111;
  --ap-text-muted: #888;
  --ap-text-dim: #b5b5b5;
  --ap-accent: #333;
  --ap-accent-light: #555;
  --ap-ease: cubic-bezier(.35, 0, .25, 1);
}

body.radio-player-active { padding-bottom: var(--ap-bar-h); }

#page-radio.radio-player-page {
  min-height: 100vh;
  height: auto !important;
  padding: clamp(8rem, 11vw, 10rem) clamp(1.25rem, 5vw, 5rem) clamp(7rem, 10vw, 9rem);
  color: #fff;
}

#page-radio .radio-video-background { position: fixed !important; }
#page-radio .radio-video-background::after { background: rgba(0, 0, 0, .74); }

.radio-showcase {
  width: min(100rem, 100%);
  margin: 0 auto;
}

/* The original radio template applies spacing to every nested div. Reset it
   inside the new card grid so the transplanted Illuminati geometry is exact. */
#page-radio .radio-showcase div { margin: 0; font-size: inherit; }

.radio-showcase_heading {
  margin: 0 0 clamp(2.75rem, 4vw, 4.5rem) !important;
  color: #fff;
  font-size: clamp(3.5rem, 6vw, 6.25rem) !important;
  font-weight: 400 !important;
  line-height: .92 !important;
  letter-spacing: -.06em !important;
  text-transform: uppercase;
}

.radio-show-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: clamp(20px, 1.75vw, 30px);
  row-gap: clamp(34px, 3vw, 48px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.radio_card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
  transition: transform .3s var(--ap-ease), opacity .3s ease;
}

.radio_card_cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: #191919;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}

.radio_card_cover_inner {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  transition: transform .45s var(--ap-ease);
}

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

.radio_card:hover { transform: translateY(-3px); }
.radio_card:hover .radio_card_cover_inner { transform: scale(1.025); }

.radio_card_body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 126px;
  padding: 16px 2px 0;
  gap: 7px;
}

.radio_card_title {
  margin: 0 !important;
  color: #fff;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  letter-spacing: -.015em !important;
  text-wrap: balance;
}

.radio_card_artist {
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.radio_card_add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 5px;
  margin: auto 0 0;
  padding: 9px 0 !important;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 0;
  color: #fff !important;
  background: transparent !important;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

.radio_card_add svg { width: 14px; height: 14px; }
.radio_card_add:hover { color: #111 !important; border-color: #fff; background: #fff !important; }
.radio_card_add.is-added { color: #fff !important; border-color: #fff; }

.radio-show-status {
  grid-column: 1 / -1;
  padding: 2rem 0;
  color: #fff;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.soundcloud_audio_engine {
  position: fixed !important;
  left: -10px !important;
  bottom: -10px !important;
  width: 1px !important;
  height: 1px !important;
  border: 0 !important;
  opacity: .001 !important;
  pointer-events: none !important;
}

.audio_player {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5500;
  display: flex;
  align-items: stretch;
  height: var(--ap-bar-h);
  border-top: 1px solid var(--ap-border);
  color: var(--ap-text);
  background: var(--ap-bg);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, .04);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

.ap_bar_cover {
  position: relative;
  flex: 0 0 var(--ap-bar-h);
  width: var(--ap-bar-h);
  height: var(--ap-bar-h);
  overflow: hidden;
  border-right: 1px solid var(--ap-border-2);
  background: var(--ap-surface-2);
}

.ap_bar_cover_img { display: block; width: 100%; height: 100%; object-fit: cover; }

.ap_bar_info {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0 12px;
  gap: 4px;
  overflow: hidden;
}

.ap_bar_title,
.ap_bar_artist { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ap_bar_title { color: var(--ap-text); font-size: 12px; font-weight: 500; line-height: 1.25; }
.ap_bar_artist { color: var(--ap-text-muted); font-size: 10px; line-height: 1.25; letter-spacing: .06em; text-transform: uppercase; }

.ap_bar_progress_wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 8px;
  cursor: pointer;
  touch-action: none;
}

.ap_bar_progress_track { position: relative; width: 100%; height: 2px; overflow: hidden; border-radius: 1px; background: var(--ap-surface-3); }
.ap_bar_progress_fill { position: absolute; inset: 0; width: 0; border-radius: 1px; background: var(--ap-accent); }

.ap_bar_time {
  display: none;
  align-self: center;
  flex-shrink: 0;
  padding: 0 8px;
  color: var(--ap-text-dim);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.ap_bar_controls { display: flex; flex-shrink: 0; align-items: center; padding: 0 6px 0 0; gap: 2px; }

.ap_btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px !important;
  height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50%;
  color: var(--ap-text) !important;
  background: transparent !important;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  touch-action: manipulation;
}

.ap_btn:hover { background: var(--ap-surface) !important; }
.ap_btn svg { width: 18px; height: 18px; fill: currentColor; }
.ap_btn-play { width: 40px !important; height: 40px !important; color: #fff !important; background: var(--ap-accent) !important; }
.ap_btn-play:hover { background: var(--ap-accent-light) !important; }
.ap_btn-list svg, .ap_btn-vol svg { width: 15px; height: 15px; }
.ap_btn-prev svg, .ap_btn-next svg { width: 17px; height: 17px; }

.ap_playlist {
  position: fixed;
  right: 0;
  bottom: var(--ap-bar-h);
  z-index: 5400;
  display: flex;
  flex-direction: column;
  width: 360px;
  max-width: 100%;
  max-height: 50vh;
  overflow: hidden;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius) var(--ap-radius) 0 0;
  color: var(--ap-text);
  background: var(--ap-bg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s var(--ap-ease);
  pointer-events: none;
}

.ap_playlist.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ap_playlist_header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--ap-border); background: var(--ap-surface); }
.ap_playlist_label, .ap_playlist_link { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.ap_playlist_label { color: var(--ap-text-muted); }
.ap_playlist_count { margin-left: 4px; color: var(--ap-text-dim); font-size: 10px; }
.ap_playlist_link { color: var(--ap-accent) !important; }
.ap_playlist_body { flex: 1; overflow-y: auto; }
.ap_playlist_empty { padding: 32px 16px; color: var(--ap-text-dim); font-size: 13px; text-align: center; }

.ap_playlist_item { display: flex; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--ap-border-2); gap: 10px; font-size: 12px; cursor: pointer; }
.ap_playlist_item:hover { background: var(--ap-surface); }
.ap_playlist_item.is_current { background: var(--ap-surface-2); }
.ap_playlist_item_cover { position: relative; flex: 0 0 36px; width: 36px; height: 36px; overflow: hidden; border-radius: 2px; background: var(--ap-surface-2) center/cover no-repeat; }
.ap_playlist_item_meta { flex: 1; min-width: 0; }
.ap_playlist_item_title, .ap_playlist_item_artist { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ap_playlist_item_title { color: var(--ap-text); font-size: 12px; }
.ap_playlist_item_artist { color: var(--ap-text-muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.ap_playlist_item_remove { display: inline-flex !important; align-items: center; justify-content: center; flex: 0 0 24px; width: 24px !important; height: 24px !important; padding: 0 !important; border: 0 !important; border-radius: 50%; color: var(--ap-text-dim) !important; background: transparent !important; }
.ap_playlist_item_remove:hover { color: var(--ap-text) !important; background: var(--ap-surface) !important; }
.ap_playlist_item_remove svg { width: 12px; height: 12px; fill: currentColor; }

.ap_vol_popup {
  position: fixed;
  right: 60px;
  bottom: calc(var(--ap-bar-h) + 8px);
  z-index: 5400;
  display: flex;
  align-items: center;
  width: 180px;
  padding: 10px 12px;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  color: var(--ap-text-muted);
  background: var(--ap-bg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s var(--ap-ease);
  pointer-events: none;
  gap: 8px;
}

.ap_vol_popup.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ap_vol_popup svg { flex-shrink: 0; width: 16px; height: 16px; fill: currentColor; }
.ap_vol_slider { flex: 1; height: 3px; margin: 0; padding: 0; border: 0; border-radius: 2px; outline: none; background: var(--ap-surface-3); cursor: pointer; appearance: none !important; }
.ap_vol_slider::-webkit-slider-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ap-accent); cursor: pointer; appearance: none; }
.ap_vol_slider::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--ap-accent); cursor: pointer; }

.ap_error_hint { position: fixed; bottom: calc(var(--ap-bar-h) + 12px); left: 50%; z-index: 5600; padding: 10px 14px; border-radius: 8px; color: #fff; background: #000; box-shadow: 0 4px 18px rgba(0,0,0,.2); font-size: 12px; transform: translateX(-50%); }

@media (max-width: 640px) {
  .ap_bar_cover { display: none; }
  .ap_bar_info { padding-left: 10px; }
  .ap_bar_controls { gap: 0; }
  .ap_btn { min-width: 40px; }
  .ap_playlist { width: 100%; }
  .ap_vol_popup { right: 48px; }
  #page-radio.radio-player-page { padding-right: 1rem; padding-left: 1rem; }
}

@media (max-width: 860px) {
  body.radio-player-active { padding-bottom: calc(var(--ap-bar-h) + env(safe-area-inset-bottom)); }
  .audio_player { bottom: env(safe-area-inset-bottom); }
  .audio_player::after { content: ""; position: absolute; top: 100%; right: 0; left: 0; height: env(safe-area-inset-bottom); background: var(--ap-bg); }
  .ap_playlist { bottom: calc(var(--ap-bar-h) + env(safe-area-inset-bottom)); }
  .ap_vol_popup { bottom: calc(var(--ap-bar-h) + env(safe-area-inset-bottom) + 8px); }
}

@media (max-width: 1599px) {
  .radio-show-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1199px) {
  .radio-show-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
  .radio-show-grid { grid-template-columns: repeat(2, 1fr); }
  .radio_card_body { min-height: 132px; }
}

@media (max-width: 519px) {
  .radio-show-grid { grid-template-columns: 1fr; row-gap: 38px; }
  .radio_card_body { min-height: 118px; }
}

@media (prefers-reduced-motion: reduce) {
  .radio-background-video { display: none; }
  .radio_card_cover_inner, .ap_playlist, .ap_vol_popup { transition: none; }
}
