/* ============================================================
   Sky Blue Radio — standalone mini player (/player)
   Self-contained: this page does NOT load styles.css, so every
   value the widget needs lives here.
   ============================================================ */

:root {
  --navy-900: #06173f;
  --navy-800: #0a2a6b;
  --navy-700: #0d3a8f;
  --blue-600: #0a5cc7;
  --sky-400: #3aa6ee;
  --sky-300: #7cc6f5;
  --live: #ff3b5c;
  --ease: cubic-bezier(.22, 1, .36, 1);

  /* Themed surface tokens — overridden by .theme-light below. */
  --pp-page: #06173f;
  --pp-bar: linear-gradient(180deg, #0b2c70 0%, #06173f 100%);
  --pp-edge: rgba(124, 198, 245, .35);
  --pp-text: #fff;
  --pp-text-soft: rgba(255, 255, 255, .78);
  --pp-eyebrow: var(--sky-300);
  --pp-track: rgba(255, 255, 255, .22);
  --pp-thumb: #fff;
  --pp-icon: rgba(255, 255, 255, .7);
}

.theme-light {
  --pp-page: #f4f8fd;
  --pp-bar: linear-gradient(180deg, #ffffff 0%, #eef5fd 100%);
  --pp-edge: #d3e3f6;
  --pp-text: #0e1b33;
  --pp-text-soft: #5b6b86;
  --pp-eyebrow: var(--blue-600);
  --pp-track: rgba(10, 42, 107, .18);
  --pp-thumb: var(--blue-600);
  --pp-icon: #5b6b86;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.pp-html, .pp-body { height: 100%; }
.pp-body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--pp-page);
  display: grid;
  place-items: center;
  padding: 10px;
  overflow: hidden;
}

/* Embedded in someone else's page: let their background show through, so the
   bar reads as a card sitting on their design rather than a navy box. */
.is-framed .pp-body { background: transparent; }

/* The bar itself */
.pp {
  width: 100%;
  max-width: 620px;
  background: var(--pp-bar);
  border: 1px solid var(--pp-edge);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}

/* Play / pause */
.pp-play {
  position: relative; width: 46px; height: 46px; border: 0; cursor: pointer;
  border-radius: 50%; background: linear-gradient(140deg, var(--sky-400), var(--blue-600));
  box-shadow: 0 8px 20px rgba(18, 118, 224, .45); display: grid; place-items: center;
  transition: transform .2s var(--ease), box-shadow .2s;
}
.pp-play:hover { transform: scale(1.06); }
.pp-play:active { transform: scale(.97); }
.pp-play:focus-visible { outline: 3px solid var(--sky-300); outline-offset: 3px; }
.pp-play .ico { width: 22px; height: 22px; fill: #fff; grid-area: 1 / 1; }
.pp-play .ico-pause, .pp-play .pp-spinner { display: none; }
.pp.is-playing .ico-play { display: none; }
.pp.is-playing .ico-pause { display: block; }
.pp.is-loading .ico-play, .pp.is-loading .ico-pause { opacity: 0; }
.pp.is-loading .pp-spinner {
  display: block; grid-area: 1 / 1; width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: pp-spin .7s linear infinite;
}
@keyframes pp-spin { to { transform: rotate(360deg); } }

/* Artwork */
.pp-art {
  position: relative; width: 46px; height: 46px; border-radius: 9px; overflow: hidden;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  border: 1px solid rgba(255, 255, 255, .14); display: grid; place-items: center;
}
.pp-art img { width: 100%; height: 100%; object-fit: cover; display: none; }
.pp-art.has-art img { display: block; }
.pp-art.has-art .pp-art-fallback { display: none; }
.pp-art-fallback { font-family: 'Sora', sans-serif; font-weight: 800; font-size: .72rem; color: var(--sky-300); letter-spacing: .05em; }

/* Metadata */
.pp-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pp-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; color: var(--pp-eyebrow);
  font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .13em;
  margin-bottom: 2px; text-decoration: none; width: fit-content; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pp-eyebrow:hover { text-decoration: underline; }
.pp-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--live); flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(255, 59, 92, .6); animation: pp-pulse 2s infinite;
}
@keyframes pp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 92, .6); }
  70% { box-shadow: 0 0 0 7px rgba(255, 59, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 92, 0); }
}
.pp-title {
  font-family: 'Sora', sans-serif; font-weight: 700; color: var(--pp-text); font-size: .95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pp-artist { color: var(--pp-text-soft); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Equaliser */
.pp-eq { display: flex; align-items: flex-end; gap: 3px; height: 22px; opacity: .35; }
.pp-eq span { width: 3px; height: 30%; background: var(--pp-eyebrow); border-radius: 2px; }
.pp.is-playing .pp-eq { opacity: 1; }
.pp.is-playing .pp-eq span { animation: pp-bars .9s ease-in-out infinite; }
.pp.is-playing .pp-eq span:nth-child(2) { animation-delay: .15s; }
.pp.is-playing .pp-eq span:nth-child(3) { animation-delay: .3s; }
.pp.is-playing .pp-eq span:nth-child(4) { animation-delay: .45s; }
.pp.is-playing .pp-eq span:nth-child(5) { animation-delay: .6s; }
@keyframes pp-bars { 0%, 100% { height: 25%; } 50% { height: 100%; } }

/* Volume */
.pp-volume { display: flex; align-items: center; gap: 8px; }
.pp-mute { background: none; border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; }
.pp-vol-ico { width: 19px; height: 19px; fill: none; stroke: var(--pp-icon); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; }
.pp-mute .ico-off { display: none; }
.pp.is-muted .pp-mute .ico-on { display: none; }
.pp.is-muted .pp-mute .ico-off { display: block; }
.pp-volume input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 84px; height: 4px; border-radius: 4px;
  background: var(--pp-track); cursor: pointer; outline: none;
}
.pp-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--pp-thumb);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.pp-volume input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--pp-thumb); cursor: pointer;
}

/* Error state */
.pp.is-error .pp-title { color: #ffb3c1; }
.theme-light .pp.is-error .pp-title { color: #c22e48; }

/* --- Responsive: shed controls as the frame narrows ---------------------- */
@media (max-width: 460px) {
  .pp-eq { display: none; }
  .pp { grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 12px; }
}
@media (max-width: 360px) {
  .pp-volume { display: none; }
  .pp { grid-template-columns: auto auto minmax(0, 1fr); padding: 10px 12px; }
}
@media (max-width: 260px) {
  .pp-art { display: none; }
  .pp { grid-template-columns: auto minmax(0, 1fr); }
}

/* In a snug iframe/popup there is no room for a floating card — go edge to edge. */
@media (max-height: 105px) {
  .pp-body { padding: 0; }
  .pp { max-width: none; height: 100%; border-radius: 0; border-width: 0 0 0 0; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pp-dot, .pp.is-playing .pp-eq span, .pp.is-loading .pp-spinner { animation: none; }
}
