:root {
  --bg: #0a0a0f;
  --bg2: #101018;
  --surface: #16161f;
  --surface2: #1c1c2a;
  --border: #2a2a3a;
  --gold: #d4a843;
  --gold-dim: #a07830;
  --green: #00ff88;
  --green-dim: #004422;
  --red: #ff2255;
  --text: #eee;
  --text-dim: #8888aa;
  --radius: 12px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 16px;
  background-image: radial-gradient(ellipse at 50% 0%, #14142a 0%, var(--bg) 70%);
}

.app {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ─── LED RACK ─── */
.led-rack {
  background: linear-gradient(180deg, #0c0c14, #08080e);
  border: 1px solid #1a1a2a;
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: 0 0 40px rgba(0, 255, 136, 0.03), inset 0 1px 0 rgba(255,255,255,0.03);
}

.led-screen {
  font-family: 'Orbitron', monospace;
  color: var(--green);
}

.led-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  letter-spacing: 1px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--green-dim);
  margin-bottom: 10px;
}

.led-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.status-label {
  font-weight: 700;
  font-size: 0.75rem;
}

.led-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
}

.led-info strong {
  color: var(--green);
}

.led-sep {
  opacity: 0.3;
}

.led-marquee {
  overflow: hidden;
  margin: 12px 0 14px;
}

.led-marquee p {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
  white-space: nowrap;
  animation: scroll-text 12s linear infinite;
}

@keyframes scroll-text {
  0% { transform: translateX(100%); }
  10% { transform: translateX(0); }
  90% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ─── VU METER ─── */
.vu-meter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vu-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vu-label {
  font-size: 0.65rem;
  font-weight: 700;
  width: 12px;
  text-align: right;
  opacity: 0.5;
}

.vu-bars {
  display: flex;
  gap: 2px;
  flex: 1;
}

.vu-dot {
  height: 6px;
  flex: 1;
  background: #002211;
  border-radius: 1px;
  transition: all 0.05s;
}

.vu-dot.on-green {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.vu-dot.on-red {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

/* ─── CONSOLE ─── */
.console {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 800px) {
  .console { grid-template-columns: 1fr; }
}

.deck, .setlist {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}

/* ─── DECK ─── */
.deck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.deck-header h2 {
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  letter-spacing: 4px;
  color: var(--text-dim);
}

.playing-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-dim);
  transition: all 0.3s;
}

.playing-dot.active {
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
  animation: pulse-dot 1s ease-in-out infinite;
}

.now-playing {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.np-label {
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 4px;
}

.np-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── SEEK ─── */
.seek-wrap {
  margin-bottom: 22px;
  position: relative;
}

.seek-wrap input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(to right, var(--gold) var(--val, 0%), #1a1a2a var(--val, 0%));
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: background 0.1s;
}

.seek-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff, var(--gold));
  box-shadow: 0 0 16px rgba(212, 168, 67, 0.4), 0 0 4px rgba(212, 168, 67, 0.6);
  cursor: pointer;
  transition: transform 0.12s;
  border: 2px solid rgba(255,255,255,0.15);
}

.seek-wrap input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.seek-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
}

.seek-wrap input[type="range"]::-moz-range-track {
  height: 6px;
  background: #1a1a2a;
  border-radius: 3px;
  border: none;
}

.seek-wrap input[type="range"]::-moz-range-progress {
  height: 6px;
  background: var(--gold);
  border-radius: 3px;
}

.seek-wrap input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff, var(--gold));
  border: 2px solid rgba(255,255,255,0.15);
  cursor: pointer;
}

/* ─── TRANSPORT ─── */
.transport {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.t-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

.t-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.3);
}

.t-btn:active {
  transform: translateY(0);
}

.t-play {
  background: linear-gradient(135deg, #1a8a5a, #0d6b3f);
  box-shadow: 0 2px 12px rgba(0, 255, 136, 0.15);
  color: #fff;
}

.t-play:hover {
  box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
}

.t-pause {
  background: linear-gradient(135deg, #b8860b, #8a6508);
  color: #fff;
}

.t-stop {
  background: linear-gradient(135deg, #cc2244, #991133);
  color: #fff;
}

.t-next {
  background: linear-gradient(135deg, #3a4a6a, #2a3850);
  color: #fff;
}

/* ─── FADER ─── */
.fader-wrap {
  text-align: center;
  padding: 0 8px;
}

.fader-wrap label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 3px;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-weight: 600;
}

.fader-track {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fader-track::before,
.fader-track::after {
  content: '';
  width: 2px;
  height: 8px;
  background: var(--text-dim);
  border-radius: 1px;
  flex-shrink: 0;
}

.fader-track::before { background: var(--gold); }

.fader-wrap input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  background: linear-gradient(to right, var(--gold) var(--val, 0%), #1a1a2a var(--val, 0%));
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.fader-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 35%, #e8e8e8, #999);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.5);
  cursor: pointer;
  transition: box-shadow 0.15s;
  border: none;
}

.fader-wrap input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.6), 0 0 16px rgba(212, 168, 67, 0.15), inset 0 1px 0 rgba(255,255,255,0.5);
}

.fader-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
}

.fader-wrap input[type="range"]::-moz-range-track {
  height: 4px;
  background: #1a1a2a;
  border-radius: 2px;
  border: none;
}

.fader-wrap input[type="range"]::-moz-range-progress {
  height: 4px;
  background: var(--gold);
  border-radius: 2px;
}

.fader-wrap input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 35%, #e8e8e8, #999);
  border: none;
  cursor: pointer;
}

/* ─── SETLIST ─── */
.setlist h2 {
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  letter-spacing: 4px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 16px;
  background: var(--bg2);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--gold);
  background: rgba(212, 168, 67, 0.05);
}

.upload-inner p {
  font-weight: 600;
  margin: 4px 0;
}

.upload-inner small {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.upload-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 4px;
}

.playlist-wrap {
  max-height: 360px;
  overflow-y: auto;
}

.playlist-wrap::-webkit-scrollbar {
  width: 4px;
}

.playlist-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.playlist-wrap::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.playlist-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 32px 0;
}

.song-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--bg2);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.song-item:hover {
  border-color: var(--border);
  background: var(--surface2);
}

.song-item.active {
  border-color: var(--gold);
  background: rgba(212, 168, 67, 0.06);
}

.song-info {
  flex: 1;
  min-width: 0;
}

.song-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-info p {
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.song-actions button {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.song-actions button:hover {
  transform: scale(1.1);
}

.btn-play-item {
  background: var(--green-dim);
  color: var(--green);
}

.btn-play-item:hover {
  background: #005533;
}

.btn-rename-item {
  background: rgba(212, 168, 67, 0.12);
  color: var(--gold);
}

.btn-rename-item:hover {
  background: rgba(212, 168, 67, 0.3);
}

.btn-del-item {
  background: rgba(255, 34, 85, 0.15);
  color: var(--red);
}

.btn-del-item:hover {
  background: rgba(255, 34, 85, 0.3);
}

.rename-input {
  background: var(--bg);
  border: 1px solid var(--gold);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 2px 6px;
  width: 100%;
  outline: none;
}

/* ─── HIDDEN AUDIO ─── */
#main-audio-player {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
