:root {
  --bg: #0b0b0d;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.1);
  --text: #f5f5f7;
  --text-dim: rgba(245, 245, 247, 0.6);
  --accent: #fa586a;
  --accent-2: #ff9f43;
}

* { box-sizing: border-box; }

/* Datei-Inputs bewusst nicht mit display:none/hidden verstecken -
   Chrome verweigert dann input.click() (kein Rendering-Box). */
.file-input-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100%;
}

.bg-blur {
  position: fixed;
  inset: -10%;
  background-size: cover;
  background-position: center;
  filter: blur(60px) saturate(1.4) brightness(0.55);
  transform: scale(1.15);
  transition: background-image 0.6s ease;
  z-index: -2;
}

.bg-scrim {
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 100% at 50% 0%, rgba(11, 11, 13, 0.2) 0%, rgba(11, 11, 13, 0.85) 60%, #0b0b0d 100%);
  z-index: -1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  position: sticky;
  top: 0;
  backdrop-filter: blur(20px);
  background: rgba(11, 11, 13, 0.4);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(250, 88, 106, 0.7);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a0a0d;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 28px 80px;
}

.player-hero {
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 48px 0 40px;
  flex-wrap: wrap;
}

.cover-wrap {
  width: 280px;
  height: 280px;
  flex-shrink: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
  position: relative;
  background: linear-gradient(160deg, #1c1c1f, #0f0f11);
}

.cover-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}

.track-info {
  flex: 1;
  min-width: 280px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 700;
}

.track-title {
  font-size: 34px;
  font-weight: 800;
  margin: 0 0 6px;
  line-height: 1.15;
}

.track-artist {
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 28px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.time {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  width: 38px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  outline: none;
  flex: 1;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.seek {
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--progress, 0%), rgba(255, 255, 255, 0.18) var(--progress, 0%));
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.ctrl-btn:hover { background: rgba(255, 255, 255, 0.16); }
.ctrl-btn:active { transform: scale(0.94); }

.ctrl-play {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a0a0d;
}

.download-btn {
  margin-left: auto;
  text-decoration: none;
}

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  width: 120px;
}

.volume { width: 90px; }

.library {
  margin-top: 20px;
}

.library-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.library-head h2 {
  font-size: 20px;
  margin: 0;
}

.library-count {
  color: var(--text-dim);
  font-size: 13px;
}

.library-empty {
  color: var(--text-dim);
  padding: 30px 0;
  font-size: 14px;
}

.track-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--card-border);
}

.track-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.12s ease;
}

.track-row:last-child { border-bottom: none; }
.track-row:hover { background: rgba(255, 255, 255, 0.06); }
.track-row.active { background: rgba(250, 88, 106, 0.12); }

.track-index {
  width: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.track-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: linear-gradient(160deg, #232327, #101012);
  flex-shrink: 0;
}

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

.track-meta .name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.track-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }

/* Upload modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

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

.modal {
  width: 100%;
  max-width: 480px;
  background: #17171a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-head h3 { margin: 0; font-size: 18px; }

.dropzones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 20px 10px;
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  min-height: 130px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(250, 88, 106, 0.08);
}

.dropzone.has-file {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

#coverPreview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.field-row input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.field-row input:focus { border-color: var(--accent); }

.upload-status {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.upload-status.error { color: var(--accent); }
.upload-status.success { color: #4ade80; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 640px) {
  .player-hero { flex-direction: column; text-align: center; gap: 24px; }
  .controls-row { justify-content: center; }
  .download-btn { margin-left: 0; }
  .cover-wrap { width: 220px; height: 220px; }
  .dropzones { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}
