:root {
  color-scheme: dark;
  --bg: #090a0d;
  --panel: #111318;
  --panel-2: #171a20;
  --panel-3: #20242b;
  --text: #f4f6f2;
  --muted: #a8afa8;
  --faint: #747b76;
  --accent: #c8ff5a;
  --accent-ink: #101408;
  --danger: #ff7f83;
  --line: rgba(255,255,255,.08);
  --shadow: 0 20px 60px rgba(0,0,0,.34);
  --radius: 14px;
  --sidebar: 228px;
  --player: 88px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2f2a; border: 3px solid var(--bg); border-radius: 999px; }
.hidden { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 20% 15%, rgba(200,255,90,.10), transparent 30%), var(--bg); }
.login-panel { width: min(560px, 100%); padding: 44px; background: #101217; border-radius: 16px; box-shadow: var(--shadow); }
.login-panel h1 { margin: 34px 0 12px; font-size: clamp(2.4rem, 8vw, 4.9rem); line-height: .92; letter-spacing: -.04em; max-width: 7ch; }
.login-panel > p { color: var(--muted); max-width: 46ch; line-height: 1.6; }
.brand-mark { display: flex; align-items: end; gap: 4px; height: 32px; width: 42px; }
.brand-mark span { width: 8px; background: var(--accent); border-radius: 4px 4px 1px 1px; }
.brand-mark span:nth-child(1) { height: 15px; }
.brand-mark span:nth-child(2) { height: 30px; }
.brand-mark span:nth-child(3) { height: 22px; }
.brand-mark.compact { transform: scale(.72); transform-origin: left center; width: 32px; }
.login-form { margin-top: 34px; }
.login-form label { display:block; font-size: .85rem; color: var(--muted); margin-bottom: 9px; }
.password-row { display: flex; gap: 10px; }
.password-row input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 12px; background: #0b0d11; color: var(--text); padding: 15px 16px; }
.primary-button { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 12px; padding: 13px 18px; font-weight: 780; cursor: pointer; transition: transform .18s ease, filter .18s ease; }
.primary-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.primary-button.large { padding-inline: 22px; }
.form-error { color: var(--danger); min-height: 20px; font-size: .88rem; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto var(--player) 0; width: var(--sidebar); padding: 24px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: #0c0d11; z-index: 20; }
.brand { text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 5px; padding: 3px 8px 24px; }
.brand strong { font-size: 1rem; letter-spacing: -.02em; }
.nav-stack { display: grid; gap: 5px; margin-top: 8px; }
.nav-item, .mobile-nav-item { border: 0; background: transparent; cursor: pointer; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; color: var(--muted); text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.045); color: var(--text); }
.nav-item.active { background: var(--panel-2); color: var(--text); }
.nav-item.active svg { color: var(--accent); }
.sidebar-foot { margin-top: auto; padding: 18px 10px 2px; border-top: 1px solid var(--line); }
.server-state { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .78rem; margin-bottom: 12px; }
.server-state i { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; box-shadow: 0 2px 8px rgba(200,255,90,.3); }
.text-button { border: 0; padding: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: .84rem; }
.text-button:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

.content { min-height: calc(100vh - var(--player)); margin-left: var(--sidebar); padding: 0 42px 140px; }
.topbar { position: sticky; top: 0; z-index: 10; min-height: 86px; display: flex; align-items: center; gap: 16px; padding: calc(14px + env(safe-area-inset-top)) 0 14px; background: linear-gradient(180deg, rgba(9,10,13,.98) 75%, rgba(9,10,13,0)); }
.search-box { height: 50px; max-width: 620px; flex: 1; display: flex; align-items: center; gap: 10px; background: var(--panel-2); border-radius: 14px; padding: 0 14px; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-box input::placeholder { color: #7f8781; }
.search-box kbd { color: var(--faint); border: 1px solid var(--line); background: #0c0e12; border-radius: 6px; padding: 2px 6px; font-size: .72rem; }
.profile-button { margin-left: auto; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-weight: 800; cursor: default; }
.view { display: none; animation: view-in .34s cubic-bezier(.2,.9,.2,1) both; }
.active-view { display: block; }
@keyframes view-in { from { opacity: .01; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.home-intro { min-height: 245px; display: flex; justify-content: space-between; align-items: end; gap: 30px; padding: 35px 0 42px; }
.home-intro h1, .view-heading h1 { margin: 0; font-size: clamp(2.3rem, 5vw, 5rem); line-height: .95; letter-spacing: -.04em; }
.home-intro p, .view-heading p { margin: 15px 0 0; color: var(--muted); line-height: 1.55; max-width: 58ch; }
.content-section { margin-top: 34px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.section-heading h2 { margin: 0; font-size: 1.16rem; letter-spacing: -.02em; }
.view-heading { padding: 34px 0 28px; }
.view-heading h1 { font-size: clamp(2.5rem, 5vw, 4.4rem); }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 14px; }
.album-card { position: relative; border: 0; background: transparent; text-align: left; color: var(--text); cursor: pointer; padding: 0; min-width: 0; }
.album-card .art { aspect-ratio: 1; background: var(--panel-2); border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 26px rgba(0,0,0,.25); }
.album-card img { width:100%; height:100%; object-fit:cover; display:block; transition: transform .28s ease; }
.album-card:hover img { transform: scale(1.025); }
.album-card strong, .album-card small { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.album-card strong { margin-top: 10px; font-size: .92rem; }
.album-card small { margin-top: 4px; color: var(--muted); }

.track-list { display: grid; gap: 3px; }
.track-row { min-height: 68px; display: grid; grid-template-columns: 46px minmax(0,1fr) minmax(100px,.55fr) 64px 84px; gap: 13px; align-items: center; padding: 8px 10px; border-radius: 12px; transition: background .16s ease; }
.track-row:hover { background: rgba(255,255,255,.045); }
.track-row.active { background: rgba(200,255,90,.075); }
.track-cover { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; background: var(--panel-3); }
.track-title, .track-album { min-width: 0; }
.track-title strong, .track-title small, .track-album { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-title strong { display:block; font-size:.93rem; }
.track-title small, .track-album, .track-duration { color: var(--muted); font-size: .78rem; }
.track-album { font-size: .82rem; }
.track-actions { display:flex; justify-content:flex-end; gap:4px; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 50%; display:grid; place-items:center; background: transparent; color: var(--muted); cursor:pointer; }
.icon-button:hover { background: rgba(255,255,255,.07); color:var(--text); }
.icon-button.is-favorite { color: var(--accent); }
.icon-button.is-favorite svg { fill: currentColor; }
.track-play { width: 38px; height: 38px; border-radius: 50%; border:0; display:grid; place-items:center; background:var(--text); color:#090a0d; cursor:pointer; opacity:0; transform:translateX(3px); transition:opacity .15s ease, transform .15s ease; }
.track-row:hover .track-play, .track-row.active .track-play { opacity:1; transform:none; }
.track-play svg { fill: currentColor; stroke: none; width:17px; }
.compact-list .track-row { grid-template-columns: 46px minmax(0,1fr) 64px 84px; }
.compact-list .track-album { display:none; }
.empty-state { min-height: 150px; border: 1px dashed rgba(255,255,255,.12); border-radius: var(--radius); display:grid; align-content:center; justify-items:center; gap:6px; color:var(--muted); text-align:center; padding:26px; }
.empty-state strong { color:var(--text); font-size:.96rem; }
.loading-list { display:grid; gap:7px; }
.loading-list span { display:block; height:68px; border-radius:12px; background: linear-gradient(100deg,#111318 25%,#1b1e24 40%,#111318 55%); background-size:220% 100%; animation: shimmer 1.1s linear infinite; }
@keyframes shimmer { to { background-position-x:-220%; } }

.player { position: fixed; inset: auto 0 0 0; min-height: var(--player); z-index: 50; display:grid; grid-template-columns: minmax(210px,1fr) minmax(330px,1.6fr) minmax(180px,1fr); gap:20px; align-items:center; padding: 10px 18px; background:#111318; box-shadow: 0 -12px 40px rgba(0,0,0,.3); }
.player-track { min-width:0; display:flex; align-items:center; gap:12px; border:0; background:transparent; text-align:left; cursor:pointer; padding:0; }
.player-track img { width:58px; height:58px; object-fit:cover; border-radius:10px; background:var(--panel-3); }
.player-copy { min-width:0; }
.player-copy strong,.player-copy small { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.player-copy strong { font-size:.9rem; }
.player-copy small { color:var(--muted); margin-top:4px; font-size:.76rem; }
.player-center { display:grid; gap:5px; }
.player-controls { display:flex; align-items:center; justify-content:center; gap:8px; }
.play-button { width:42px; height:42px; border:0; border-radius:50%; display:grid; place-items:center; background:var(--text); color:#08090c; cursor:pointer; transition:transform .15s ease; }
.play-button:hover { transform:scale(1.04); }
.play-button svg { width:19px; height:19px; fill:currentColor; stroke:none; }
.timeline { display:grid; grid-template-columns:34px 1fr 34px; gap:8px; align-items:center; color:var(--muted); font-size:.7rem; font-variant-numeric:tabular-nums; }
input[type="range"] { accent-color: var(--accent); }
.timeline input { width:100%; }
.player-actions { display:flex; align-items:center; justify-content:flex-end; gap:7px; }
.volume-icon { color:var(--muted); }
.volume { width:100px; }
.toast { position:fixed; left:50%; bottom:calc(var(--player) + 18px); transform:translate(-50%,16px); opacity:0; pointer-events:none; background:#f3f5ef; color:#11140f; border-radius:10px; padding:10px 14px; font-size:.82rem; font-weight:700; z-index:100; transition:opacity .2s ease, transform .2s ease; box-shadow:0 10px 30px rgba(0,0,0,.3); }
.toast.show { opacity:1; transform:translate(-50%,0); }
.mobile-nav { display:none; }

@media (max-width: 880px) {
  :root { --player: 78px; }
  .sidebar { display:none; }
  .content { margin-left:0; padding:0 18px 170px; }
  .topbar { min-height:74px; }
  .profile-button { display:none; }
  .search-box kbd { display:none; }
  .home-intro { min-height:190px; padding-top:22px; align-items:flex-start; flex-direction:column; justify-content:flex-end; gap:22px; }
  .home-intro .primary-button { display:none; }
  .album-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap:16px 12px; }
  .track-row { grid-template-columns: 46px minmax(0,1fr) 50px 44px; gap:10px; padding-inline:4px; }
  .track-album, .track-duration { display:none; }
  .track-play { opacity:1; transform:none; }
  .track-actions { width:44px; overflow:hidden; }
  .player { left:10px; right:10px; bottom:calc(72px + env(safe-area-inset-bottom)); min-height:66px; border-radius:14px; grid-template-columns: minmax(0,1fr) auto auto; padding:7px 9px; gap:7px; box-shadow:0 12px 38px rgba(0,0,0,.42); }
  .player-track img { width:50px; height:50px; }
  .player-center { display:block; }
  .player-controls .icon-button { display:none; }
  .player-controls { justify-content:flex-end; }
  .timeline { position:absolute; left:12px; right:12px; bottom:0; grid-template-columns:1fr; }
  .timeline span { display:none; }
  .timeline input { height:4px; }
  .player-actions { display:none; }
  .mobile-nav { position:fixed; display:grid; grid-template-columns:repeat(3,1fr); inset:auto 0 0 0; min-height:64px; background:#0d0f13; border-top:1px solid var(--line); z-index:49; padding-bottom:env(safe-area-inset-bottom); }
  .mobile-nav-item { display:grid; place-items:center; align-content:center; gap:3px; color:var(--faint); font-size:.68rem; }
  .mobile-nav-item svg { width:19px; height:19px; }
  .mobile-nav-item.active { color:var(--text); }
  .mobile-nav-item.active svg { color:var(--accent); }
  .toast { bottom:150px; max-width:calc(100vw - 30px); text-align:center; }
  .login-panel { padding:30px 24px; }
  .password-row { flex-direction:column; }
}

@media (max-width: 520px) {
  .home-intro h1, .view-heading h1 { font-size:2.65rem; }
  .album-card strong { font-size:.86rem; }
}

#username { width:100%; border: 1px solid var(--line); border-radius: 12px; background: #0b0d11; color: var(--text); padding: 15px 16px; margin-bottom: 16px; }
.password-label { display:block; font-size: .85rem; color: var(--muted); margin-bottom: 9px; }

.search-tabs { display:flex; gap:8px; margin-bottom: 22px; }
.search-tab { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 8px 16px; font-size: .84rem; cursor: pointer; }
.search-tab:hover { color: var(--text); }
.search-tab.active { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }

.album-header { display:flex; align-items:flex-end; gap: 22px; padding: 20px 0 30px; }
.album-header img { width: 168px; height: 168px; object-fit: cover; border-radius: var(--radius); background: var(--panel-3); box-shadow: var(--shadow); }
.album-header h1 { margin: 0 0 6px; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.03em; }
.album-header p { margin: 0 0 16px; color: var(--muted); }

.admin-create-form { display:flex; flex-wrap:wrap; gap: 10px; align-items:center; margin: 24px 0 6px; }
.admin-create-form input[type="text"], .admin-create-form input[type="password"] { border: 1px solid var(--line); border-radius: 12px; background: #0b0d11; color: var(--text); padding: 12px 14px; min-width: 200px; }
.admin-checkbox { display:flex; align-items:center; gap: 8px; color: var(--muted); font-size: .86rem; }
.user-list { display:grid; gap: 8px; margin-top: 22px; }
.user-row { display:flex; align-items:center; justify-content:space-between; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--panel); }
.user-row.is-inactive { opacity: .55; }
.user-info strong { display:block; }
.user-info small { color: var(--muted); }

@media (max-width: 880px) {
  .album-header { padding-top: 6px; gap: 16px; }
  .album-header img { width: 120px; height: 120px; }
}
