:root {
  color-scheme: dark;

  --bg-0: #070a12;
  --bg-1: #0c1222;
  --bg-2: #141e33;

  --glass-col: rgba(255, 255, 255, 0.09);
  --glass-card: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.18);

  --text: #edf1f7;
  --muted: #b1bdcf;
  --muted-2: #8fa0ba;

  --gold-1: #c8a74a;
  --gold-2: #f3dd9a;
  --gold-soft: rgba(200, 167, 74, 0.2);
  --accent: linear-gradient(90deg, var(--gold-1), var(--gold-2));

  --soprano: #f28da0;
  --alto: #f2cc65;
  --tenor: #8cb6ff;
  --bass: #7adf9a;
  --all: #7bd0ff;

  --success: #71d89f;
  --error: #ff8d8d;

  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;

  --shadow-col: 0 24px 80px rgba(0, 0, 0, 0.42);
  --shadow-card: 0 16px 44px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 12% 10%, rgba(32, 60, 120, 0.35), transparent 55%),
    radial-gradient(1200px 900px at 88% 88%, rgba(13, 32, 68, 0.35), transparent 56%),
    linear-gradient(165deg, var(--bg-0), var(--bg-1) 45%, var(--bg-2));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1100px 650px at 50% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
    radial-gradient(1000px 800px at 50% 115%, rgba(0, 0, 0, 0.65), transparent 55%);
  opacity: 0.75;
}

.container {
  position: relative;
  z-index: 2;
  max-width: 1300px;
  margin: 0 auto;
  padding: 30px 22px 70px;
}

.hero {
  margin-bottom: 24px;
  padding: 20px 22px;
  background: var(--glass-col);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-col);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--gold-2);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.3vw, 2.2rem);
  font-weight: 760;
  letter-spacing: .2px;
}

h2, h3 { margin-top: 0; }

.intro,
.panel-text,
.parts-sidebar-text,
.transport-hint,
.hint,
.meta,
.composer,
.metadata-label {
  color: var(--muted);
  line-height: 1.6;
}

.sub-nav {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.sub-nav a {
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 620;
  transition: transform .15s ease, box-shadow .25s ease, border-color .2s ease;
}

.sub-nav a:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px var(--gold-soft);
  border-color: rgba(243, 221, 154, 0.55);
}

.sub-nav a.active {
  background: linear-gradient(90deg, rgba(200, 167, 74, 0.28), rgba(243, 221, 154, 0.22));
  border-color: rgba(243, 221, 154, 0.65);
}

.panel,
.voice-selector,
.legend-panel,
.parts-sidebar,
.transport-panel,
.progress-panel,
.library-item,
.dropzone,
.metadata-preview {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
}

.panel {
  padding: 24px;
  margin-bottom: 20px;
}

.dropzone {
  margin-top: 16px;
  padding: 30px;
  text-align: center;
  border-style: dashed;
  border-width: 2px;
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.04);
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}

.dropzone.dragover {
  border-color: var(--gold-2);
  background: rgba(200, 167, 74, 0.16);
  transform: translateY(-2px);
}

.dropzone-title { margin: 0 0 8px; font-size: 1.12rem; font-weight: 740; }
.dropzone-subtitle { margin: 0 0 16px; color: var(--muted-2); }

.button-like,
.transport-button,
.button-secondary {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.2);
  background: linear-gradient(120deg, rgba(200,167,74,.25), rgba(255,255,255,.08));
  color: var(--text);
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 720;
  transition: transform .14s ease, box-shadow .25s ease, border-color .2s ease;
}

.button-like:hover,
.transport-button:hover,
.button-secondary:hover {
  transform: translateY(-1px);
  border-color: rgba(243,221,154,.8);
  box-shadow: 0 0 18px var(--gold-soft);
}

.button-full { width: 100%; }
.filename { margin-top: 16px; font-weight: 640; }
.message { min-height: 1.5em; margin-top: 10px; color: var(--muted); }
.message.success { color: var(--success); }
.message.error { color: var(--error); }

.controls-panel {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  margin: 18px 0 12px;
}

.voice-selector,
.legend-panel,
.parts-sidebar,
.transport-panel,
.progress-panel {
  padding: 16px;
}

.controls-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .93rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.voice-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.voice-button,
.part-item {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(5, 11, 22, 0.65);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 620;
  transition: transform .15s ease, border-color .15s ease, box-shadow .2s ease;
}

.part-item {
  width: 100%;
  border-radius: 14px;
  text-align: left;
}

.voice-button:hover,
.part-item:hover {
  transform: translateY(-1px);
  border-color: rgba(243, 221, 154, 0.55);
}

.voice-button.active,
.part-item.active {
  box-shadow: 0 0 0 1px currentColor inset, 0 0 16px rgba(255,255,255,.08);
}

.voice-button.voice-soprano.active,
.part-item.voice-soprano.active { border-color: var(--soprano); color: var(--soprano); background: rgba(242, 141, 160, 0.16); }
.voice-button.voice-alto.active,
.part-item.voice-alto.active { border-color: var(--alto); color: var(--alto); background: rgba(242, 204, 101, 0.16); }
.voice-button.voice-tenor.active,
.part-item.voice-tenor.active { border-color: var(--tenor); color: var(--tenor); background: rgba(140, 182, 255, 0.16); }
.voice-button.voice-bass.active,
.part-item.voice-bass.active { border-color: var(--bass); color: var(--bass); background: rgba(122, 223, 154, 0.16); }
.part-item.voice-all.active,
.voice-button.active[data-voice="all"] { border-color: var(--all); color: var(--all); background: rgba(123, 208, 255, 0.16); }

.legend-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px,1fr));
  gap: 10px 14px;
}

.legend-item { display: flex; align-items: center; gap: 10px; }
.legend-swatch { width: 14px; height: 14px; border-radius: 999px; display: inline-block; }
.legend-swatch.soprano { background: var(--soprano); }
.legend-swatch.alto { background: var(--alto); }
.legend-swatch.tenor { background: var(--tenor); }
.legend-swatch.bass { background: var(--bass); }

.voice-status { margin: 0 0 14px; color: var(--muted); font-weight: 600; }

.workspace {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
  align-items: start;
}

.parts-list { display: flex; flex-direction: column; gap: 10px; }
.parts-empty {
  color: var(--muted);
  padding: 12px;
  border: 1px dashed rgba(255,255,255,.22);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}

.part-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
}

.part-item-header { display: flex; align-items: center; font-weight: 700; }
.part-item-instrument,
.part-item-meta { margin-top: 5px; color: var(--muted); font-size: .9rem; }
.part-item-instrument-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.part-instrument-select {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  border: 1px solid rgba(243, 221, 154, 0.25);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: .85rem;
  font-family: inherit;
  cursor: pointer;
}
.part-instrument-select:focus {
  outline: none;
  border-color: var(--gold-2);
}
.part-instrument-status {
  color: var(--muted);
  font-size: .78rem;
  white-space: nowrap;
  min-width: 38px;
  text-align: right;
}

.part-group { display: flex; flex-direction: column; gap: 10px; }
.part-group + .part-group { margin-top: 14px; }
.part-group-title {
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.part-group.muted,
.part-item.muted { opacity: .45; filter: grayscale(.25); }

.score-accent-frame {
  border-radius: 18px;
  padding: 3px;
  background: linear-gradient(135deg, rgba(200, 167, 74, .72), rgba(243, 221, 154, .15));
  box-shadow: 0 0 24px rgba(200, 167, 74, 0.2);
  transition: background .2s ease, box-shadow .2s ease;
}
.score-accent-frame.voice-soprano { background: linear-gradient(135deg, rgba(242,141,160,.72), rgba(242,141,160,.12)); }
.score-accent-frame.voice-alto { background: linear-gradient(135deg, rgba(242,204,101,.72), rgba(242,204,101,.12)); }
.score-accent-frame.voice-tenor { background: linear-gradient(135deg, rgba(140,182,255,.72), rgba(140,182,255,.12)); }
.score-accent-frame.voice-bass { background: linear-gradient(135deg, rgba(122,223,154,.72), rgba(122,223,154,.12)); }
.score-accent-frame.voice-all { background: linear-gradient(135deg, rgba(123,208,255,.72), rgba(123,208,255,.12)); }

.score-wrapper {
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
  overflow-x: auto;
  min-height: 240px;
}

.score-container { min-width: 700px; transition: opacity .2s ease, filter .2s ease; }
.score-container.focus-single { opacity: .96; filter: saturate(1.03) contrast(1.01); }
.score-empty { color: #334155; display: grid; place-items: center; min-height: 180px; font-weight: 620; }

.transport-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: end;
  margin: 18px 0 16px;
}
.transport-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.transport-button.is-active {
  border-color: rgba(243,221,154,.85);
  box-shadow: 0 0 18px var(--gold-soft);
  background: rgba(200,167,74,.22);
}

.tempo-panel { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.tempo-slider { width: 100%; accent-color: var(--gold-1); }
.tempo-value,
.progress-label,
.transport-status { font-weight: 700; }

.transport-status-block { min-width: 240px; }
.transport-status { margin: 0 0 6px; }

.progress-panel { margin: 0 0 16px; }
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.18);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2));
  transition: width .12s linear;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.library-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.library-item:hover {
  transform: translateY(-4px);
  border-color: rgba(243, 221, 154, 0.65);
  box-shadow: 0 20px 48px rgba(0,0,0,.34), 0 0 22px var(--gold-soft);
}

.library-item h3 { margin: 0 0 8px; font-size: 1.2rem; }
.library-item .tag {
  display: inline-block;
  background: rgba(255,255,255,.08);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: .84rem;
  border: 1px solid rgba(255,255,255,.16);
}

.metadata-preview {
  border-left: 4px solid var(--gold-1);
  padding: 16px;
  margin-top: 18px;
  border-radius: 0 12px 12px 0;
}
.metadata-preview h4 {
  margin: 0 0 12px;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gold-2);
}

.metadata-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: .95rem;
}

.score-view-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.hidden { display: none !important; }

/* ── Studio uitbreidingen ─────────────────────────────────────────────── */
.upload-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 6px 0 10px;
}
.filename.subtle { color: var(--muted-2); font-weight: 540; }

/* ── Library overzicht ─────────────────────────────────────────────────── */
.library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.library-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.library-switcher-label {
  color: var(--muted);
  font-weight: 600;
  font-size: .95rem;
}
.library-select {
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  border: 1px solid rgba(243, 221, 154, 0.35);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: .95rem;
  font-family: inherit;
  min-width: 180px;
  cursor: pointer;
}
.library-select:focus {
  outline: none;
  border-color: var(--gold-2);
  box-shadow: 0 0 0 2px var(--gold-soft);
}
.library-switcher .button-secondary[disabled] {
  opacity: .45;
  cursor: not-allowed;
}
.save-section-library {
  margin: 12px 0;
}

/* Move-modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--bg, #1a1310);
  border: 1px solid rgba(243, 221, 154, 0.4);
  border-radius: 12px;
  padding: 22px;
  min-width: 320px;
  max-width: 90vw;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.modal-card h3 { margin: 0 0 8px; }
.modal-subtitle {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .95rem;
}
.modal-card .library-select {
  width: 100%;
  margin-top: 6px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.library-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.library-card:hover {
  transform: translateY(-3px);
  border-color: rgba(243, 221, 154, 0.55);
  box-shadow: 0 18px 44px rgba(0,0,0,.34), 0 0 18px var(--gold-soft);
}
.library-card-head h3 { margin: 0 0 4px; font-size: 1.15rem; }
.library-card-composer { margin: 0; color: var(--muted); }
.library-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.library-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}
.library-card-actions .button-like,
.library-card-actions .button-secondary {
  padding: 8px 12px;
  font-size: .9rem;
}

.tag {
  display: inline-block;
  background: rgba(255,255,255,.08);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: .82rem;
  border: 1px solid rgba(255,255,255,.16);
}
.tag-success { color: var(--success); border-color: rgba(113,216,159,.45); background: rgba(113,216,159,.10); }
.tag-muted { color: var(--muted-2); }

.button-secondary {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18);
}
.button-secondary.danger {
  color: var(--error);
  border-color: rgba(255, 141, 141, 0.45);
  background: rgba(255, 141, 141, 0.08);
}

/* ── Oefen-pagina ─────────────────────────────────────────────────────── */
.practice-header-panel .score-meta h2 { margin-bottom: 4px; }
.score-composer { margin: 0 0 6px; color: var(--muted); }
.score-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }

.practice-controls {
  display: grid;
  grid-template-columns: auto 220px 220px 1fr;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}
.control-block { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.slider { width: 100%; accent-color: var(--gold-1); }

.part-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.part-toggle {
  appearance: none;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(0,0,0,.25);
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-weight: 720;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.part-toggle:hover { transform: translateY(-1px); border-color: rgba(243,221,154,.55); }
.part-toggle.active { border-color: var(--gold-2); background: rgba(200,167,74,.25); }
.part-item.soloed { border-color: var(--gold-2); box-shadow: 0 0 0 1px var(--gold-2) inset; }
.part-item.muted { opacity: .42; }

@media (max-width: 1100px) {
  .practice-controls { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .practice-controls { grid-template-columns: 1fr; }
}

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

@media (max-width: 900px) {
  .transport-panel { grid-template-columns: 1fr; align-items: start; }
  .transport-status-block { min-width: 0; }
}

@media (max-width: 860px) {
  .controls-panel { grid-template-columns: 1fr; }
  .legend-items { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .container { padding: 20px 14px 56px; }
  .panel { padding: 16px; }
  .legend-items { grid-template-columns: 1fr; }
  .voice-buttons { flex-direction: column; }
  .voice-button { width: 100%; text-align: left; }
}
