/* Castcade Spotify shared-room jukebox */
:root {
  --sp-green: #1db954;
  --sp-green-bright: #1ed760;
  --sp-black: #0a0f0c;
  --sp-panel: #111a14;
  --sp-panel-2: #17231b;
}

.sp-shell {
  border: 1px solid rgba(29, 185, 84, 0.45);
  background:
    radial-gradient(circle at 100% 0%, rgba(29, 185, 84, 0.14), transparent 42%),
    linear-gradient(135deg, rgba(14, 24, 18, 0.98), rgba(19, 23, 40, 0.98));
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.32), 0 0 20px rgba(29, 185, 84, 0.08);
}

.sp-shell * {
  min-width: 0;
}

.sp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.sp-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.sp-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #24d664, #0d7d38);
  color: #04110a;
  font-size: 1.1rem;
  box-shadow: 0 0 18px rgba(29, 185, 84, 0.35);
  flex-shrink: 0;
}

.sp-title {
  color: #f5fff8;
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-sub {
  color: #8aa495;
  font-size: 0.72rem;
  font-weight: 650;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sp-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 99px;
  padding: 3px 8px;
  background: rgba(29, 185, 84, 0.12);
  border: 1px solid rgba(29, 185, 84, 0.35);
  color: var(--sp-green-bright);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.sp-pill.off {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.28);
  color: #a9b7c9;
}

.sp-pill.bad {
  background: rgba(255, 107, 129, 0.1);
  border-color: rgba(255, 107, 129, 0.35);
  color: #ff8da0;
}

.sp-now {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sp-art {
  width: 58px;
  height: 58px;
  border-radius: 9px;
  object-fit: cover;
  background: #20362a;
  border: 1px solid rgba(255, 255, 255, 0.13);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sp-green);
  font-size: 1.6rem;
}

.sp-art.sm {
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
  border-radius: 7px;
}

.sp-art.lg {
  width: 72px;
  height: 72px;
  font-size: 2rem;
}

img.sp-art {
  display: block;
  object-fit: cover;
}

.sp-dock-pill .sp-track {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  line-height: 1.15;
}

.sp-track {
  min-width: 0;
  flex: 1;
}

.sp-track-name {
  color: #f7fff9;
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-track-artist {
  color: #9eb6a6;
  font-size: 0.73rem;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-kicker {
  color: var(--sp-green-bright);
  font-size: 0.63rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}

.sp-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.sp-controls.main {
  justify-content: center;
  margin: 8px 0 2px;
}

.sp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e9fff0;
  border-radius: 8px;
  min-height: 29px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1;
  touch-action: manipulation;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.sp-btn:hover {
  background: rgba(29, 185, 84, 0.16);
  border-color: rgba(29, 185, 84, 0.4);
}

.sp-btn:active {
  transform: scale(0.96);
}

.sp-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.sp-btn.primary {
  background: var(--sp-green);
  border-color: var(--sp-green);
  color: #04110a;
  font-weight: 900;
}

.sp-btn.primary:hover {
  background: var(--sp-green-bright);
}

.sp-btn.play {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  background: var(--sp-green);
  border-color: var(--sp-green);
  color: #04110a;
  font-size: 0.95rem;
}

.sp-btn.tiny {
  min-height: 24px;
  padding: 3px 6px;
  font-size: 0.67rem;
}

.sp-btn.danger {
  color: #ff9aaa;
  border-color: rgba(255, 107, 129, 0.3);
}

.sp-btn.active {
  background: rgba(29, 185, 84, 0.2);
  border-color: rgba(29, 185, 84, 0.55);
  color: #d9ffe3;
}

.sp-btn.ghost {
  background: transparent;
}

.sp-progress-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
}

.sp-time {
  color: #8fa89a;
  font-size: 0.63rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 31px;
  text-align: center;
}

.sp-seek {
  --pct: 0%;
  width: 100%;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--sp-green) var(--pct), rgba(255, 255, 255, 0.16) var(--pct));
  outline: none;
  cursor: pointer;
  touch-action: manipulation;
}

.sp-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #eafff0;
  border: 2px solid var(--sp-green);
  box-shadow: 0 0 8px rgba(29, 185, 84, 0.45);
}

.sp-seek::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #eafff0;
  border: 2px solid var(--sp-green);
}

.sp-speaker-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.sp-speaker-row label {
  color: #86a08f;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.sp-select {
  flex: 1;
  min-width: 130px;
  background: rgba(8, 16, 11, 0.8);
  color: #e9fff0;
  border: 1px solid rgba(29, 185, 84, 0.32);
  border-radius: 7px;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  outline: none;
}

.sp-select:focus {
  border-color: var(--sp-green);
}

.sp-note {
  color: #7f9588;
  font-size: 0.66rem;
  line-height: 1.35;
  margin-top: 7px;
}

.sp-note strong {
  color: #b9dfc6;
}

.sp-empty {
  text-align: center;
  padding: 10px 6px 4px;
  color: #94a3b8;
  font-size: 0.78rem;
  line-height: 1.4;
}

.sp-empty .big {
  font-size: 1.7rem;
  margin-bottom: 4px;
}

.sp-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.sp-bar .sp-now {
  flex: 1;
  min-width: 155px;
}

.sp-bar-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.sp-player-compact {
  padding: 10px 12px;
}

.sp-player-compact .sp-title {
  font-size: 0.82rem;
}

.sp-player-compact .sp-sub {
  font-size: 0.66rem;
}

.sp-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 13px;
  margin-left: 2px;
}

.sp-eq span {
  width: 2px;
  border-radius: 2px;
  background: var(--sp-green-bright);
  height: 5px;
  animation: spEq 1s ease-in-out infinite;
  animation-play-state: paused;
}

.sp-eq.on span {
  animation-play-state: running;
}

.sp-eq span:nth-child(2) { animation-delay: 0.16s; height: 9px; }
.sp-eq span:nth-child(3) { animation-delay: 0.32s; height: 6px; }
.sp-eq span:nth-child(4) { animation-delay: 0.08s; height: 11px; }

@keyframes spEq {
  0%, 100% { transform: scaleY(0.45); opacity: 0.65; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* One-line now playing strip pinned to the TV's top-right corner. */
.sp-tv-line {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 5px 9px;
  background: rgba(8, 16, 11, 0.72);
  border: 1px solid rgba(29, 185, 84, 0.32);
  border-radius: 10px;
  overflow: hidden;
}

.sp-tv-line-art {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
}

.sp-tv-line-art.is-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(29, 185, 84, 0.18);
  font-size: 0.8rem;
}

.sp-tv-line-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.15;
}

.sp-tv-line-text b,
.sp-tv-line-text span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-tv-line-text b {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
}

.sp-tv-line-text span {
  font-size: 0.64rem;
  font-weight: 600;
  color: #94a3b8;
}

.sp-tv-line-state {
  flex-shrink: 0;
  color: var(--sp-green-bright, #1ed760);
  font-size: 0.72rem;
  font-weight: 900;
}

.sp-tv {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 10px 0;
  padding: 10px;
  background: rgba(8, 16, 11, 0.72);
  border: 1px solid rgba(29, 185, 84, 0.32);
  border-radius: 12px;
}

.sp-tv .sp-now {
  gap: 8px;
}

.sp-tv .sp-art {
  width: 46px;
  height: 46px;
  font-size: 1.25rem;
}

.sp-tv .sp-track-name {
  font-size: 0.82rem;
}

.sp-tv .sp-track-artist {
  font-size: 0.68rem;
}

.sp-tv .sp-progress-wrap {
  margin-top: 2px;
}

.sp-tv .sp-note {
  font-size: 0.62rem;
  margin-top: 0;
}

.sp-tv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.sp-tv-label {
  color: var(--sp-green-bright);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 900;
}

.sp-dock {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 950;
  font-family: var(--font-main, system-ui, sans-serif);
}

.sp-dock-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(330px, calc(100vw - 24px));
  padding: 5px 10px 5px 5px;
  border-radius: 99px;
  background: rgba(9, 17, 12, 0.94);
  border: 1px solid rgba(29, 185, 84, 0.5);
  color: #effff3;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45), 0 0 18px rgba(29, 185, 84, 0.14);
  cursor: pointer;
  backdrop-filter: blur(10px);
  text-align: left;
}

.sp-dock-pill .sp-art {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1rem;
}

.sp-dock-pill .sp-track-name {
  font-size: 0.7rem;
  max-width: 185px;
}

.sp-dock-pill .sp-track-artist {
  font-size: 0.61rem;
  margin-top: 1px;
  max-width: 185px;
}

.sp-dock-panel {
  width: min(342px, calc(100vw - 24px));
  margin-bottom: 7px;
  padding: 11px;
  background: rgba(9, 17, 12, 0.98);
  border: 1px solid rgba(29, 185, 84, 0.46);
  border-radius: 14px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(14px);
}

.sp-dock-panel .sp-controls.main {
  margin: 4px 0 0;
}

.sp-dock-panel .sp-progress-wrap {
  margin-top: 4px;
}

.sp-dock-panel .sp-speaker-row {
  margin-top: 5px;
}

.sp-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(3, 8, 5, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.sp-modal-card {
  width: 100%;
  max-width: 760px;
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0f1712;
  border: 1px solid rgba(29, 185, 84, 0.48);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65), 0 0 40px rgba(29, 185, 84, 0.09);
}

.sp-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sp-modal-title {
  color: #f2fff6;
  font-size: 1.05rem;
  font-weight: 900;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sp-modal-sub {
  color: #8fa89a;
  font-size: 0.73rem;
  margin-top: 3px;
}

.sp-close {
  border: 0;
  background: rgba(255, 255, 255, 0.07);
  color: #dfeee4;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.sp-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 18px 0;
  flex-wrap: wrap;
}

.sp-tab {
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.04);
  color: #b9cbbf;
  border-radius: 99px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 750;
  cursor: pointer;
}

.sp-tab.active {
  background: rgba(29, 185, 84, 0.18);
  border-color: rgba(29, 185, 84, 0.55);
  color: #d9ffe3;
}

.sp-searchbar {
  display: flex;
  gap: 7px;
  padding: 11px 18px 6px;
}

.sp-input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: #effff3;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.86rem;
  outline: none;
  user-select: text;
}

.sp-input::placeholder { color: #718578; }

.sp-input:focus {
  border-color: rgba(29, 185, 84, 0.6);
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.09);
}

.sp-results {
  padding: 4px 18px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 120px;
}

.sp-section-title {
  color: #8fa89a;
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 13px 0 6px;
}

.sp-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: background 0.14s, border-color 0.14s;
}

.sp-row:hover {
  background: rgba(29, 185, 84, 0.07);
  border-color: rgba(29, 185, 84, 0.16);
}

.sp-row-main {
  min-width: 0;
  flex: 1;
}

.sp-row-name {
  color: #f1fff4;
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-row-sub {
  color: #8da396;
  font-size: 0.68rem;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.sp-badge {
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  padding: 1px 4px;
  font-size: 0.55rem;
  font-weight: 850;
  color: #aabbb0;
  vertical-align: middle;
}

.sp-loading {
  padding: 24px 8px;
  text-align: center;
  color: #91a697;
  font-size: 0.82rem;
}

.sp-spinner {
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(29, 185, 84, 0.25);
  border-top-color: var(--sp-green-bright);
  border-radius: 50%;
  animation: spSpin 0.8s linear infinite;
  vertical-align: -3px;
  margin-right: 6px;
}

@keyframes spSpin { to { transform: rotate(360deg); } }

.sp-error {
  margin: 8px 0;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(255, 107, 129, 0.09);
  border: 1px solid rgba(255, 107, 129, 0.28);
  color: #ffb2bf;
  font-size: 0.75rem;
  line-height: 1.35;
  user-select: text;
}

.sp-success {
  border-color: rgba(29, 185, 84, 0.42);
  background: rgba(29, 185, 84, 0.08);
  color: #bdf8cd;
}

.sp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 18px 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: #708675;
  font-size: 0.64rem;
}

.sp-footer a {
  color: #a9e9bb;
}

.sp-copy {
  user-select: text;
}

@media (max-width: 600px) {
  .sp-shell { padding: 11px; }
  .sp-title { font-size: 0.87rem; }
  .sp-sub { font-size: 0.66rem; }
  .sp-art { width: 47px; height: 47px; }
  .sp-art.sm { width: 37px; height: 37px; }
  .sp-player-compact { padding: 9px 10px; }
  .sp-player-compact .sp-bar { gap: 6px; }
  .sp-player-compact .sp-now { min-width: 125px; }
  .sp-player-compact .sp-btn { font-size: 0.68rem; padding: 4px 6px; }
  .sp-speaker-row { gap: 5px; }
  .sp-select { min-width: 105px; font-size: 0.68rem; }
  .sp-modal { padding: 7px; align-items: stretch; }
  .sp-modal-card { max-height: 94vh; border-radius: 14px; }
  .sp-modal-head { padding: 12px 13px 8px; }
  .sp-tabs { padding: 8px 13px 0; }
  .sp-searchbar { padding: 9px 13px 5px; }
  .sp-results { padding: 3px 13px 13px; }
  .sp-row { padding: 6px 4px; }
  .sp-row-name { font-size: 0.78rem; }
  .sp-row-sub { font-size: 0.64rem; }
  .sp-row-actions .sp-btn { min-height: 25px; padding: 3px 6px; font-size: 0.64rem; }
  .sp-footer { padding: 8px 13px 11px; font-size: 0.59rem; }
  .sp-dock { left: 8px; bottom: 8px; }
  .sp-dock-pill { max-width: calc(100vw - 16px); }
  .sp-dock-pill .sp-track-name { max-width: 150px; }
  .sp-dock-panel { width: min(330px, calc(100vw - 16px)); }
}

@media (max-width: 360px) {
  .sp-player-compact .sp-now { min-width: 100%; }
  .sp-player-compact .sp-bar-controls { width: 100%; justify-content: flex-start; }
  .sp-head-actions { width: auto; margin-left: auto; }
  .sp-head-actions .sp-btn { flex: 0 0 auto; }
}
