:root {
  --bg:       #111318;
  --surface:  #1c1f28;
  --surface2: #252933;
  --border:   #2e3342;
  --accent:   #6b8cff;
  --accent2:  #4f6ee0;
  --text:     #e2e6f0;
  --text2:    #8892aa;
  --red:      #e05555;
  --green:    #4caf80;
  --radius:   8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

/* ── HIDDEN ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── LOGIN ──────────────────────────────────────────────────────────────── */
#login-overlay {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.login-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 40px; width: 340px;
}
.login-box h1 { font-size: 22px; margin-bottom: 8px; }
.login-box p  { color: var(--text2); margin-bottom: 28px; }
.login-box label {
  display: block; color: var(--text2); font-size: 12px;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px;
}
.login-box input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); padding: 10px 12px;
  font-size: 14px; outline: none; margin-bottom: 16px;
}
.login-box input:focus { border-color: var(--accent); }
.login-box .btn-primary { width: 100%; }
.login-error { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 20px; }

/* ── LAYOUT ──────────────────────────────────────────────────────────────── */
#app { display: none; flex-direction: column; height: 100dvh; }
#app.visible { display: flex; }

header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 16px; height: 52px; display: flex; align-items: center;
  gap: 10px; flex-shrink: 0;
}
header h1 { font-size: 15px; font-weight: 600; flex: 1; }
#header-user { color: var(--text2); font-size: 13px; }
.btn-logout { background: none; border: none; color: var(--text2); font-size: 13px; padding: 0; cursor: pointer; }

#main {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px;
}

/* ── PLAYER ──────────────────────────────────────────────────────────────── */
#player { flex-shrink: 0; }
.player-bar {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--surface); border-top: 1px solid var(--border);
}
.player-info { flex: 1; min-width: 0; }
#player-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#player-meta  { font-size: 11px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-ctrl { background: none; border: none; color: var(--text); font-size: 20px; padding: 4px 8px; cursor: pointer; }
.btn-ctrl.big { font-size: 24px; }
.btn-ctrl:hover { background: none; }
#player-queue { font-size: 11px; color: var(--text2); white-space: nowrap; }
#player-cover { text-align: center; padding: 6px 16px 10px; background: var(--surface); }
#cover-img { max-width: 230px; width: 100%; border-radius: 8px; }

/* ── BUTTONS ────────────────────────────────────────────────────────────── */
button {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface2); color: var(--text);
  padding: 6px 12px; font-size: 12px; cursor: pointer; transition: background .15s;
}
button:hover { background: var(--border); }
button:disabled { opacity: .5; cursor: default; }
.btn-primary {
  background: var(--accent); border-color: var(--accent2); color: #fff; font-weight: 600;
}
.btn-primary:hover { background: var(--accent2); }

.btn-play {
  width: 100%; padding: 14px; background: var(--accent); color: #fff; border: none;
  border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 8px;
}
.btn-back {
  background: none; border: none; color: var(--text2); font-size: 13px; padding: 0; cursor: pointer;
}
.btn-clear {
  background: none; border: 1px solid var(--border); color: var(--red);
  border-radius: 6px; padding: 6px 12px; font-size: 12px; cursor: pointer;
}
.btn-sel {
  background: none; border: 1px solid var(--border); color: var(--text2);
  border-radius: 6px; padding: 3px 8px; font-size: 11px; cursor: pointer; margin-left: 6px;
}

/* ── GENRE BUTTONS ───────────────────────────────────────────────────────── */
.genre-btn {
  display: block; width: 100%; padding: 16px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 15px; font-weight: 500; text-align: left; cursor: pointer;
}
.genre-btn.classical { border-color: var(--accent); color: var(--accent); }

/* ── SECTIONS ────────────────────────────────────────────────────────────── */
.section { margin-bottom: 20px; }
.section-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text2);
  margin-bottom: 8px; letter-spacing: .06em;
}
.badge {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: 1px 7px; font-size: 11px; color: var(--text2); margin-left: 6px;
}

/* ── NAV BAR ────────────────────────────────────────────────────────────── */
.nav-bar {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.view-title { font-size: 16px; font-weight: 600; }

/* ── INPUTS ─────────────────────────────────────────────────────────────── */
input[type=search], input[type=text] {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 10px 14px; font-size: 14px;
  outline: none; margin-bottom: 8px;
}

/* ── MULTISELECT LIST ───────────────────────────────────────────────────── */
.ms-list {
  border: 1px solid var(--border); border-radius: 8px; overflow-y: auto;
  max-height: 200px; background: var(--surface);
}
.ms-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.ms-item:last-child { border-bottom: none; }
.ms-item.selected { background: var(--surface2); }
.ms-item input[type=checkbox] {
  accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0;
}
.ms-item span { font-size: 14px; }
.ms-empty { padding: 14px; color: var(--text2); font-size: 13px; text-align: center; }

/* ── SHUFFLE ROW ────────────────────────────────────────────────────────── */
.shuffle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; font-size: 15px;
}

/* ── SCROLLBAR ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── GENRE VIEW HEADING ─────────────────────────────────────────────────── */
#view-genre h2 { font-size: 18px; margin-bottom: 20px; }
