/* ============================================================
   SPEAKEASY RADIO — Stylesheet
   ============================================================ */

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

:root {
  --gold: #c9a84c;
  --gold-dim: #8a6a28;
  --dark: #0a0005;
  --dark-panel: rgba(8, 2, 12, 0.92);
  --text: #e8d8a8;
  --text-dim: #9a8060;
  --border: #3a2810;
  --font: 'Press Start 2P', monospace;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--dark);
  font-family: var(--font);
  color: var(--text);
}

/* ============================================================
   CANVAS SCENE
   ============================================================ */

#bg-gif {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

/* ============================================================
   SCENE SELECTOR
   ============================================================ */

.scene-selector {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 200;
}

.scene-selector-label {
  font-size: 6px;
  color: var(--gold-dim);
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.scene-btn {
  width: 38px;
  height: 38px;
  background: var(--dark-panel);
  border: 2px solid var(--border);
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: pixelated;
}

.scene-btn:hover {
  border-color: var(--gold-dim);
  background: rgba(201, 168, 76, 0.1);
}

.scene-btn.active {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.18);
}

/* ============================================================
   PLAYER BAR
   ============================================================ */

.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 76px;
  background: var(--dark-panel);
  border-top: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 202;
  gap: 16px;
}

/* Art deco border decoration */
.player-bar::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gold-dim);
  opacity: 0.4;
}

/* ── Track Info ── */

.track-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.scene-label {
  font-size: 7px;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.track-title {
  font-size: 9px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 7px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Controls ── */

.player-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ctrl-btn {
  background: none;
  border: 2px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: var(--font);
}

.ctrl-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.ctrl-btn svg {
  width: 14px;
  height: 14px;
}

.ctrl-btn:not(.play-btn) {
  width: 32px;
  height: 32px;
}

.play-btn {
  width: 48px;
  height: 48px;
  border-color: var(--gold-dim);
  color: var(--gold);
}

.play-btn:hover {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.15);
}

.play-btn svg {
  width: 18px;
  height: 18px;
}

.ctrl-btn.active {
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Volume ── */

.player-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.vol-btn {
  width: 32px;
  height: 32px;
}

#volume {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 4px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--gold);
  cursor: pointer;
  image-rendering: pixelated;
}

#volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--gold);
  border: none;
  cursor: pointer;
}

#volume::-webkit-slider-runnable-track {
  background: linear-gradient(to right, var(--gold-dim) 0%, var(--gold-dim) var(--vol-pct, 70%), var(--border) var(--vol-pct, 70%));
}

/* ============================================================
   TRACKLIST
   ============================================================ */

.tracklist-toggle {
  position: fixed;
  bottom: 96px;
  right: 20px;
  width: 38px;
  height: 38px;
  background: var(--dark-panel);
  border: 2px solid var(--border);
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  z-index: 200;
  transition: border-color 0.15s, color 0.15s;
  font-family: var(--font);
}

.tracklist-toggle:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.tracklist-overlay {
  position: fixed;
  bottom: 96px;
  right: 66px;
  width: 280px;
  max-height: 340px;
  background: var(--dark-panel);
  border: 2px solid var(--gold);
  z-index: 300;
  display: none;
  flex-direction: column;
}

.tracklist-overlay.open {
  display: flex;
}

.tracklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 8px;
  color: var(--gold);
  letter-spacing: 2px;
  flex-shrink: 0;
}

.tracklist-header button {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
}

.tracklist {
  overflow-y: auto;
  flex: 1;
}

.tracklist::-webkit-scrollbar {
  width: 4px;
}
.tracklist::-webkit-scrollbar-track {
  background: transparent;
}
.tracklist::-webkit-scrollbar-thumb {
  background: var(--border);
}

.track-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(58, 40, 16, 0.5);
  transition: background 0.1s;
}

.track-item:hover {
  background: rgba(201, 168, 76, 0.08);
}

.track-item.playing {
  background: rgba(201, 168, 76, 0.14);
  border-left: 2px solid var(--gold);
}

.track-item-title {
  font-size: 7px;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-item-artist {
  font-size: 6px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-item.playing .track-item-title {
  color: var(--gold);
}

/* ============================================================
   NO-TRACKS MESSAGE
   ============================================================ */

.no-tracks-msg {
  padding: 20px 14px;
  font-size: 7px;
  color: var(--text-dim);
  line-height: 1.8;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */

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

.loading {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}
