/* ===========================================================
   site-wide persistent player: footer bar + "Tracks" modal.
   Footer stays plain/hard-edged to match the rest of the site.
   The Tracks modal is a deliberate departure: old-internet
   skeuomorphic chrome (beveled plastic, hard drop shadow, LCD
   screen in a techy monospace) layered on the site's palette.
   =========================================================== */

:root {
  --sp-chrome: var(--soft-blossom, #EEB3C4);
  --sp-chrome-dark: #c98298;
  --sp-chrome-light: #fbe3ea;
  --sp-screen-bg: #16231a;
  --sp-screen-fg: #8ef29a;
}

#sp-root { all: initial; }
#sp-root * { box-sizing: border-box; font-family: "Inter", sans-serif; }

/* reserve room for the fixed footer so it never covers page content */
body { padding-bottom: 56px; }
@media (max-width: 700px) {
  body { padding-bottom: 48px; }
}

/* ---------------------------- footer bar ---------------------------- */

.sp-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 10px;
  background: #E8E8D3;
  outline: 1px solid #000;
  outline-offset: -1px;
  color: #000;
  text-transform: lowercase;
}

.sp-footer-art {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  outline: 1px solid #000;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

.sp-footer-info {
  flex: 0 1 160px;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
}
.sp-footer-title {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-footer-artist {
  font-size: 0.7rem;
  opacity: 0.65;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-oscilloscope {
  flex: 0 0 auto;
  background: #0c0c0c;
  outline: 1px solid #000;
  image-rendering: pixelated;
  display: block;
}

.sp-footer-controls {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
}
.sp-footer-controls button {
  width: 26px;
  height: 26px;
  background: #fff;
  outline: 1px solid #000;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
}
.sp-footer-controls button:hover { background: var(--eggshell, #E8E8D3); }

.sp-scrubber-wrap {
  flex: 1 1 auto;
  min-width: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sp-time {
  font-size: 0.65rem;
  opacity: 0.6;
  min-width: 28px;
  text-align: center;
}

.sp-footer input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  background: #000;
  outline: none;
  cursor: pointer;
}
.sp-scrubber-wrap input[type="range"] { flex: 1 1 auto; }
.sp-volume-row { flex: 0 0 70px; display: flex; align-items: center; gap: 4px; }
.sp-volume-row input[type="range"] { width: 60px; }
.sp-vol-icon { font-size: 0.75rem; }

.sp-footer input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 9px;
  height: 9px;
  background: #000;
  border: 1px solid #000;
}

@media (max-width: 700px) {
  .sp-footer-artist, .sp-volume-row, .sp-time { display: none; }
  .sp-footer { height: 48px; gap: 6px; }
  .sp-oscilloscope { display: none; }
}

/* ---------------------------- Tracks window ---------------------------- */

.sp-tracks-window {
  position: fixed;
  top: 14vh;
  left: 50%;
  transform: translateX(-50%);
  width: 360px;
  max-width: 92vw;
  z-index: 600;
  background: var(--sp-chrome);
  border: 2px solid #000;
  border-radius: 0; /* outer box: hard corners, always */
  box-shadow: 5px 5px 0 #362304;
  font-family: "Inter", sans-serif;
  user-select: none;
}
.sp-tracks-window.hidden { display: none; }

.sp-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: repeating-linear-gradient(
    to bottom,
    var(--sp-chrome-light) 0px, var(--sp-chrome-light) 1px,
    var(--sp-chrome) 1px, var(--sp-chrome) 3px
  );
  border-bottom: 2px solid #000;
  cursor: grab;
}
.sp-titlebar:active { cursor: grabbing; }

.sp-tb-icon {
  flex: 0 0 auto;
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.75;
}
.sp-tb-rule {
  flex: 1 1 auto;
  height: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}
.sp-tb-title {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 0 4px;
  text-transform: lowercase;
}
.sp-tb-close {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  border: 1px solid #000;
  background: #fff;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.9), inset -1px -1px 0 rgba(0, 0, 0, 0.35);
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0;
}
.sp-tb-close:hover { background: var(--pink-carn, #F37EB5); }
.sp-tb-close:active { box-shadow: inset -1px -1px 0 rgba(255, 255, 255, 0.9), inset 1px 1px 0 rgba(0, 0, 0, 0.35); }

.sp-body {
  padding: 12px;
}

.sp-screen-row {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: var(--sp-chrome-dark);
  border-radius: 6px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.35), inset -1px -1px 2px rgba(0, 0, 0, 0.3);
}

.sp-art {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 5px;
  border: 1px solid #000;
  background-size: cover;
  background-position: center;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
}

.sp-screen {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--sp-screen-bg);
  border-radius: 4px;
  border: 1px solid #000;
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.6), inset 0 0 12px rgba(0, 0, 0, 0.5);
  padding: 6px 8px;
  color: var(--sp-screen-fg);
  font-family: "VT323", monospace;
  text-shadow: 0 0 4px rgba(142, 242, 154, 0.65);
  overflow: hidden;
}
.sp-screen-title {
  font-size: 1.15rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-screen-artist {
  font-size: 0.95rem;
  line-height: 1.15;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-screen-time {
  margin-top: 4px;
  font-size: 0.85rem;
  opacity: 0.75;
  letter-spacing: 0.03em;
}

.sp-controls-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
}
.sp-ctrl-btn {
  width: 42px;
  height: 30px;
  background: #fff;
  border: 1px solid #000;
  border-radius: 5px;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.9), inset -1px -1px 0 rgba(0, 0, 0, 0.3), 1px 1px 0 rgba(0, 0, 0, 0.25);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sp-ctrl-btn:hover { background: var(--eggshell, #E8E8D3); }
.sp-ctrl-btn:active {
  box-shadow: inset -1px -1px 0 rgba(255, 255, 255, 0.9), inset 1px 1px 0 rgba(0, 0, 0, 0.3);
  transform: translate(1px, 1px);
}
.sp-ctrl-btn.sp-play { width: 54px; }

.sp-uprule {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 6px;
}
.sp-uprule::before, .sp-uprule::after {
  content: '';
  flex: 1 1 auto;
  height: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}
.sp-uprule span {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: lowercase;
  opacity: 0.75;
}

.sp-tracklist-wrap {
  position: relative;
  background: #fff;
  border: 1px solid #000;
  border-radius: 5px;
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.25);
  max-height: 220px;
  overflow: hidden;
}

.sp-tracklist {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 12px;
}

/* faux physical scrollbar thumb, textured like an old scroll-thumb grip */
.sp-tracklist::-webkit-scrollbar { width: 12px; }
.sp-tracklist::-webkit-scrollbar-track { background: var(--sp-chrome-light); }
.sp-tracklist::-webkit-scrollbar-thumb {
  background: var(--sp-chrome);
  border: 1px solid #000;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(0,0,0,0.12) 0, rgba(0,0,0,0.12) 2px,
    transparent 2px, transparent 4px
  );
}

.sp-track-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.sp-track-row:hover { background: var(--sp-chrome-light); }
.sp-track-row.playing .sp-track-name {
  text-decoration: underline;
  font-weight: 700;
}
.sp-track-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-track-dur { flex: 0 0 auto; opacity: 0.55; font-variant-numeric: tabular-nums; }

.sp-empty-state {
  padding: 18px 10px;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.6;
}

@media (max-width: 700px) {
  .sp-tracks-window { width: 300px; top: 10vh; }
}
