/* ============================================================================
 * TMS RADIO — SHARED PLAYER PRESENTATION (PR 3)
 * Extracted VERBATIM from site.css (.tms-radio-* block, lines 2915-3317 at
 * commit 8b64b6f) plus the .track-label helper used inside the player card.
 * PR 3: admin/tms-radio/ links this file; the homepage keeps its site.css copy
 * untouched (temporary, documented duplication). PR 4 makes index.html link
 * this file and removes the site.css copy so there is ONE presentation source.
 * Contains NO authority, NO data, NO player logic.
 * ======================================================================== */

.track-label {
  margin: 0;
  color: rgba(255,255,255,.62);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tms-radio-section {
  min-width: 0;
}

.tms-radio-section[hidden],
.tms-radio-mini[hidden] {
  display: none !important;
}

.tms-radio-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}

.tms-radio-head h3 {
  margin: 6px 0 0;
  font-size: clamp(21px, 2.5vw, 30px);
  line-height: 1.12;
  overflow-wrap: break-word;
}

.tms-radio-head p {
  margin: 0;
  color: rgba(255,255,255,.70);
  line-height: 1.45;
}

.tms-radio-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 2px 4px;
  scrollbar-width: thin;
}

.tms-radio-filter {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
  color: rgba(255,255,255,.76);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

.tms-radio-filter.is-active {
  color: #08121d;
  border-color: rgba(249,198,97,.88);
  background: linear-gradient(135deg, #ffe08c, #ffbf47);
  box-shadow: 0 0 18px rgba(249,198,97,.22);
}

.tms-radio-player {
  position: relative;
  margin-top: 12px;
  padding: 16px;
  border-radius: 20px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(34,197,94,.18), transparent 50%),
    radial-gradient(120% 110% at 100% 0%, rgba(239,68,68,.14), transparent 55%),
    linear-gradient(135deg, rgba(8,13,22,.98), rgba(12,18,32,.94));
  border: 1px solid rgba(255,255,255,.13);
  box-shadow:
    0 18px 40px rgba(0,0,0,.30),
    inset 0 1px 0 rgba(255,255,255,.05);
  display: grid;
  grid-template-columns: minmax(260px, clamp(300px, 34vw, 460px)) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  overflow: hidden;
}

.tms-radio-player::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  border: 2px solid rgba(249,198,97,.70);
  box-shadow:
    0 0 0 0 rgba(249,198,97,.32),
    0 0 16px rgba(249,198,97,.32),
    0 0 34px rgba(249,198,97,.16);
  pointer-events: none;
  animation: rpmGoldPulse 2.6s ease-in-out infinite;
}

.tms-radio-art {
  position: relative;
  z-index: 1;
  min-width: 0;
  width: 100%;
  align-self: center;
}

.tms-radio-art img {
  display: block;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1;
  object-fit: contain;
  background: rgba(3, 8, 15, .82);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 16px 34px rgba(0,0,0,.34);
}

.tms-radio-body {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tms-radio-body h4 {
  margin: 6px 0 6px;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.04;
}

.music-track-meta,
.music-track-description {
  margin: 0;
  color: rgba(255,255,255,.70);
  line-height: 1.45;
}

.music-track-description {
  margin-top: 8px;
  color: rgba(255,255,255,.80);
}

.tms-radio-progress {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.tms-radio-progress-time {
  color: rgba(255,255,255,.64);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.tms-radio-progress-time:last-child {
  text-align: right;
}

.tms-radio-progress-input {
  width: 100%;
  accent-color: #22c55e;
}

.tms-radio-controls,
.tms-radio-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.tms-radio-actions {
  grid-template-columns: minmax(0, 1fr);
}

.tms-radio-control-btn,
.tms-radio-primary-btn,
.tms-radio-cta {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  color: #fff;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  background: rgba(255,255,255,.09);
}

.tms-radio-primary-btn {
  color: #06120d;
  border-color: rgba(34,197,94,.64);
  background: linear-gradient(135deg, #2df07d, #16a34a);
  box-shadow: 0 12px 24px rgba(22,163,74,.22);
}

.tms-radio-control-btn:hover,
.tms-radio-cta:hover {
  background: rgba(255,255,255,.14);
}

.tms-radio-control-btn:disabled,
.tms-radio-primary-btn:disabled {
  opacity: .52;
  cursor: not-allowed;
}

.tms-radio-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: rgba(239,68,68,.38);
  background: linear-gradient(135deg, rgba(239,68,68,.18), rgba(34,197,94,.14));
}

.tms-radio-catalog {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.tms-radio-track-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.tms-radio-track {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.11);
  background: rgba(255,255,255,.055);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.tms-radio-track-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.78);
  font-weight: 900;
  font-size: 13px;
}

.tms-radio-track-copy {
  min-width: 0;
}

.tms-radio-track-copy span,
.tms-radio-track small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tms-radio-track-copy span {
  font-weight: 900;
}

.tms-radio-track small {
  margin-top: 5px;
  color: rgba(255,255,255,.62);
}

.tms-radio-track.is-active {
  border-color: rgba(34,197,94,.58);
  background: rgba(34,197,94,.12);
}

.tms-radio-track.is-active .tms-radio-track-number {
  border-color: rgba(34,197,94,.66);
  background: rgba(34,197,94,.20);
  color: #dfffe9;
}

.tms-radio-category-note {
  position: sticky;
  top: 16px;
  padding: 18px;
  border-radius: 18px;
  border: 2px solid rgba(249,198,97,.68);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(249,198,97,.13), transparent 48%),
    rgba(7,11,18,.50);
  box-shadow:
    0 16px 34px rgba(0,0,0,.24),
    0 0 22px rgba(249,198,97,.12),
    inset 0 1px 0 rgba(255,255,255,.05);
}

.tms-radio-category-note h4 {
  margin: 7px 0 10px;
  font-size: 22px;
  line-height: 1.1;
}

.tms-radio-category-note p:not(.track-label) {
  margin: 0;
  color: rgba(255,255,255,.76);
  line-height: 1.52;
}

.tms-radio-category-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tms-radio-category-stats span {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

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

.tms-radio-mini {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 900;
  width: min(760px, calc(100% - 24px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto auto 40px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(249,198,97,.55);
  background: rgba(7,11,18,.94);
  box-shadow: 0 18px 50px rgba(0,0,0,.45), 0 0 20px rgba(249,198,97,.16);
  backdrop-filter: blur(14px);
}

.tms-radio-mini img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
}

.tms-radio-mini-main {
  min-width: 0;
}

.tms-radio-mini-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.tms-radio-mini-progress {
  height: 5px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
}

.tms-radio-mini-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #facc15);
}

.tms-radio-mini button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-weight: 900;
}

/* mobile rules — verbatim from site.css @media (max-width: 700px) block */
@media (max-width: 700px) {
  .music-player-art img,
  .tms-radio-art img {
    max-width: 100%;
    height: auto;
  }

  .tms-radio-head,
  .tms-radio-player,
  .tms-radio-catalog,
  .tms-radio-track-list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .tms-radio-head h3 {
    font-size: clamp(28px, 9vw, 40px);
    line-height: 1.08;
    overflow-wrap: break-word;
  }

  .tms-radio-filters {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding: 12px 0 6px;
    scroll-snap-type: x proximity;
  }

  .tms-radio-filter {
    max-width: calc(100vw - 56px);
    white-space: normal;
    text-align: center;
    scroll-snap-align: start;
  }

  .tms-radio-player {
    padding: 14px;
    border-radius: 18px;
    gap: 16px;
  }

  .tms-radio-category-note {
    position: static;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 14px;
  }

  .tms-radio-art {
    width: 100%;
    max-width: 100%;
    justify-self: center;
  }

  .tms-radio-body h4 {
    font-size: clamp(30px, 10vw, 44px);
    overflow-wrap: break-word;
  }

  .tms-radio-track {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .tms-radio-track-copy span,
  .tms-radio-track small {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .tms-radio-controls,
  .tms-radio-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* mobile rules — verbatim from site.css @media (max-width: 820px) block (radio rules only) */
@media (max-width: 820px) {
  .tms-music-card,
  .tms-music-hub,
  .music-player,
  .paid-per-mile-player,
  .tms-radio-section,
  .tms-radio-head,
  .tms-radio-player,
  .tms-radio-catalog,
  .tms-radio-track-list,
  .tms-radio-category-note {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }


  .landing-load-form,
  .landing-load-result,
  .otraff-gut-top,
  .otraff-gut-grid,
  .state-grid,
  .bad-load-teaser,
  .tms-music-hub,
  .music-player,
  .paid-per-mile-player,
  .tms-radio-head,
  .tms-radio-player,
  .tms-radio-catalog {
    grid-template-columns: 1fr !important;
  }


  .gut-hero h1,
  .otraff-gut-top h2,
  .otraff-gut-top p,
  .otraff-gut-panel strong,
  .otraff-gut-panel p,
  .landing-load-copy h2,
  .landing-load-result h3,
  .state-section h2,
  .otraff-teaser h2,
  .bad-load-teaser h2,
  .walkthrough-entry h2,
  .tms-music-card h2,
  .tms-radio-head h3,
  .tms-radio-body h4,
  .tms-radio-track-copy span,
  .tms-radio-track small {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
  }
}

/* mobile helpers (from site.css @media blocks) */
@media (max-width: 760px) {
  .tms-radio-track-copy {
    min-width: 0;
  }
}
@media (max-width: 380px) {
  .tms-radio-controls,
  .tms-radio-actions {
    grid-template-columns: 1fr;
  }
}

/* PR 4: intentional empty-catalog state inside the public track list */
.tms-radio-empty { margin: 0; padding: 18px; border-radius: 14px; border: 1px dashed rgba(255,255,255,.22); color: rgba(255,255,255,.8); text-align: center; }
/* PR 7: quiet note when a catalog refresh fails while a loaded queue keeps playing */
.tms-radio-refresh-note { margin: 10px 0 0; font-size: .82rem; color: rgba(255,255,255,.7); }
