:root {
  --bg: #0f1115;
  --panel: #161923;
  --panel-2: #1d2130;
  --accent: #ff5a5f;
  --accent-2: #6ee7b7;
  --text: #eef0f4;
  --muted: #8a90a2;
  --border: #262b3a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1a1d29 0%, var(--bg) 60%);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 480px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.station-name {
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 6px;
  font-weight: 600;
}

.live-badge {
  color: var(--accent);
  letter-spacing: 1px;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

h1 {
  font-size: 24px;
  margin: 0 0 28px;
  color: var(--text);
}

.vinyl {
  width: 160px;
  height: 160px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel-2) 0 14px, #0a0c11 14px 16px, #1c2030 16px 100%);
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.vinyl.spinning { animation: spin 3.5s linear infinite; }
@keyframes spin { from { transform: rotate(0deg);} to { transform: rotate(360deg); } }

.now-playing {
  text-align: center;
}

.track-title {
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 20px;
  word-break: break-word;
}

.wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 48px;
  margin-bottom: 24px;
}
.wave-bar {
  width: 4px;
  height: 8%;
  min-height: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transition: height 0.08s ease;
}
/* Idle "breathing" animation shown before playback actually starts */
.wave:not(.active) .wave-bar {
  animation: idle-wave 1.8s ease-in-out infinite;
}
.wave:not(.active) .wave-bar:nth-child(2n) { animation-delay: 0.1s; }
.wave:not(.active) .wave-bar:nth-child(3n) { animation-delay: 0.2s; }
.wave:not(.active) .wave-bar:nth-child(4n) { animation-delay: 0.3s; }
.wave:not(.active) .wave-bar:nth-child(5n) { animation-delay: 0.4s; }
@keyframes idle-wave {
  0%, 100% { height: 8%; opacity: 0.35; }
  50% { height: 22%; opacity: 0.6; }
}

.play-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  background: var(--accent);
  color: #1a0a0b;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.play-btn:hover { transform: translateY(-1px); }
.play-btn:active { transform: translateY(0); }

.status-line {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 16px;
}

/* --- Admin page --- */
.admin-card { max-width: 640px; }

.live-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 8px;
}
.live-panel-info { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}
.live-dot.on {
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
.live-error {
  color: var(--accent);
  font-size: 13px;
  margin: 8px 0 0;
  min-height: 1em;
}

/* --- Login page --- */
.login-card { text-align: left; }
.field-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 14px 0 6px;
}
.text-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
}
.text-input:focus { outline: none; border-color: var(--accent-2); }
.login-card .play-btn { margin-top: 22px; }

/* --- Listener count --- */
.listener-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

/* --- Track reorder buttons --- */
.reorder-btns { display: flex; flex-direction: column; gap: 2px; }
.reorder-btns button {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 2px 4px;
}
.reorder-btns button:hover:not(:disabled) { color: var(--accent-2); }
.reorder-btns button:disabled { opacity: 0.25; cursor: default; }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  margin-bottom: 20px;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent-2); background: rgba(110,231,183,0.05); }
.upload-zone input { display: none; }

.track-list { list-style: none; margin: 0; padding: 0; }
.track-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel-2);
  margin-bottom: 8px;
}
.track-item.on-air { outline: 1px solid var(--accent-2); }
.track-item .idx { color: var(--muted); font-size: 12px; width: 20px; }
.track-item .title { flex: 1; font-size: 14px; }
.track-item .dur { color: var(--muted); font-size: 12px; }
.track-item .on-air-badge {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid var(--accent-2);
  padding: 2px 6px;
  border-radius: 6px;
}
.icon-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 8px;
}
.icon-btn:hover { color: var(--accent); background: rgba(255,90,95,0.1); }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.toolbar h2 { font-size: 16px; margin: 0; color: var(--muted); font-weight: 600; }
.small-btn {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.small-btn:hover { border-color: var(--accent-2); }

.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 20px 0;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.toast.show { opacity: 1; }

.whoami { font-size: 12px; opacity: 0.7; margin-top: 6px; }
