:root {
  color-scheme: dark;
  --bg: #080b14;
  --panel: rgba(18, 23, 38, .82);
  --panel-solid: #121726;
  --panel-soft: #171d2d;
  --line: rgba(255, 255, 255, .09);
  --text: #f6f7fb;
  --muted: #929bb0;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --success: #42d392;
  --danger: #ff6878;
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 70% -20%, rgba(124, 92, 255, .19), transparent 34%),
    var(--bg);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.ambient {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .13;
  pointer-events: none;
}
.ambient-one { background: var(--accent); top: -160px; left: 15%; }
.ambient-two { background: var(--accent-2); right: -180px; bottom: -180px; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: min(520px, 100%);
  padding: 52px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(24, 29, 48, .96), rgba(13, 17, 29, .96));
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, var(--accent), #a855f7 58%, var(--accent-2));
  box-shadow: 0 14px 42px rgba(124, 92, 255, .34);
  font-size: 28px;
  font-weight: 900;
}
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; font-size: 20px; }

.eyebrow {
  margin: 0 0 10px;
  color: #8e82ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}

h1 { margin: 24px 0 18px; font-size: clamp(42px, 8vw, 68px); line-height: .98; letter-spacing: -.055em; }
h1 span { color: #9b88ff; }
h2, h3, p { margin-top: 0; }
h2 { margin-bottom: 0; font-size: 27px; letter-spacing: -.035em; }
h3 { margin-bottom: 8px; font-size: 23px; letter-spacing: -.025em; }
.auth-copy, .support-copy { color: var(--muted); }
.auth-copy { max-width: 410px; margin-bottom: 30px; font-size: 17px; }
.fine-print { margin: 18px 0 0; color: #737d92; font-size: 12px; }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  color: white;
  text-decoration: none;
  cursor: pointer;
  font-weight: 750;
}
.button-discord { width: 100%; background: #5865f2; }
.button-primary { background: linear-gradient(135deg, var(--accent), #9b5cff); }
.button:hover { filter: brightness(1.08); transform: translateY(-1px); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 22px;
  border-right: 1px solid var(--line);
  background: rgba(10, 13, 23, .82);
  backdrop-filter: blur(22px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 17px; }
.brand span { color: var(--muted); font-size: 11px; }
.nav { display: grid; gap: 6px; }
.nav-item {
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
}
.nav-item:hover, .nav-item.active { color: white; background: rgba(124, 92, 255, .14); }
.nav-item.active { box-shadow: inset 3px 0 #8065ff; }
.sidebar-foot { margin-top: auto; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.avatar.fallback { display: grid; place-items: center; background: var(--panel-soft); font-weight: 800; }
.user-card strong, .user-card a { display: block; max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card a { color: var(--muted); font-size: 12px; text-decoration: none; }

.workspace { min-width: 0; padding: 34px clamp(24px, 4vw, 58px) 70px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.server-select-wrap { display: flex; align-items: center; gap: 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #5b6477; box-shadow: 0 0 0 5px rgba(91, 100, 119, .1); }
.status-dot.online { background: var(--success); box-shadow: 0 0 0 5px rgba(66, 211, 146, .12); }

select, input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: rgba(10, 13, 23, .72);
}
select { padding: 0 36px 0 13px; }
input { width: 100%; padding: 0 14px; }
input:focus, select:focus { border-color: rgba(124, 92, 255, .75); box-shadow: 0 0 0 3px rgba(124, 92, 255, .12); }
label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }

.view { display: none; }
.view.active { display: block; animation: reveal .22s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }

.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(22, 27, 44, .89), rgba(14, 18, 31, .9));
  box-shadow: 0 18px 55px rgba(0, 0, 0, .19);
}
.hero-grid { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 18px; }
.now-playing { min-height: 330px; display: grid; grid-template-columns: minmax(190px, .72fr) 1fr; gap: 28px; padding: 26px; }
.cover { position: relative; min-height: 250px; display: grid; place-items: center; overflow: hidden; border-radius: 18px; background: radial-gradient(circle at 50% 35%, #46349c, #191d35 58%, #0b0e18); }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent, rgba(34, 211, 238, .12)); }
.cover-orbit { width: 170px; height: 170px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; box-shadow: 0 0 0 24px rgba(255,255,255,.025), 0 0 0 52px rgba(255,255,255,.018); }
.cover-mark { position: absolute; z-index: 2; }
.track-details { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.track-details h3 { font-size: clamp(24px, 3vw, 38px); line-height: 1.08; overflow-wrap: anywhere; }
.track-details > p:not(.eyebrow) { color: var(--muted); }
.player-controls { display: flex; align-items: center; gap: 12px; margin: 18px 0 26px; }
.icon-button, .play-button, .text-button {
  border: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}
.icon-button { width: 38px; height: 38px; border-radius: 50%; font-size: 23px; }
.icon-button:hover, .icon-button.active { background: rgba(124, 92, 255, .17); color: #a999ff; }
.play-button { width: 58px; height: 58px; border-radius: 50%; background: white; color: #111521; font-size: 21px; box-shadow: 0 10px 32px rgba(255,255,255,.17); }
.volume-row { display: grid; grid-template-columns: auto 1fr 45px; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
input[type="range"] { min-height: auto; padding: 0; accent-color: var(--accent); }

.quick-add { min-width: 0; overflow: hidden; padding: 28px; }
.quick-add form { min-width: 0; display: grid; gap: 14px; margin-top: 22px; }
.quick-add input, .quick-add select, .quick-add .button { min-width: 0; max-width: 100%; width: 100%; }
.channel-grid { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.quick-add .button { width: 100%; }
.queue-card { margin-top: 18px; padding: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-head h3 { margin-bottom: 0; }
.count { display: inline-grid; place-items: center; min-width: 27px; height: 27px; padding: 0 8px; border-radius: 99px; color: #b9adff; background: rgba(124,92,255,.14); font-size: 12px; vertical-align: 3px; }
.queue-actions { display: flex; gap: 14px; }
.text-button { color: var(--muted); font-weight: 700; }
.text-button:hover { color: white; }
.text-button.danger:hover { color: var(--danger); }

.track-list { display: grid; }
.track-row { min-width: 0; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 13px 4px; border-top: 1px solid var(--line); }
.track-index { color: #687186; text-align: center; }
.track-copy { min-width: 0; }
.track-copy strong, .track-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-copy span { color: var(--muted); font-size: 12px; }
.track-duration { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.row-buttons { display: flex; gap: 4px; }
.row-button { width: 32px; height: 32px; border: 0; border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.04); cursor: pointer; }
.row-button:hover { color: white; background: rgba(124,92,255,.2); }
.empty-state { min-height: 120px; display: grid; place-items: center; color: var(--muted); text-align: center; }

.page-card { min-height: 520px; padding: clamp(24px, 4vw, 40px); }
.page-card > h3 { font-size: 31px; }
.search-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 24px 0 28px; }
.search-form .button { min-width: 120px; }
.result-grid { min-height: 260px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 12px; }
.result-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 15px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.025); }
.result-card strong { display: block; }
.result-card span { color: var(--muted); font-size: 12px; }
.compact-input { width: min(280px, 42vw); }
.server-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 26px; }
.health-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0 8px; }
.health-grid > div { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.025); }
.health-grid span, .health-grid strong { display: block; }
.health-grid span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.health-grid strong { margin-top: 4px; }
.server-card { padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.025); }
.server-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 15px; background: #252c40; font-weight: 900; }
.server-card span { display: block; margin-bottom: 16px; color: var(--muted); font-size: 12px; }
.server-card .button { width: 100%; }
.server-card .installed { color: var(--success); }

.toast { position: fixed; z-index: 30; right: 28px; top: 24px; max-width: 400px; padding: 13px 17px; border: 1px solid var(--line); border-radius: 13px; background: #1a2032; box-shadow: var(--shadow); }
.toast.error { border-color: rgba(255,104,120,.35); color: #ffb1ba; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 82px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .brand > div:last-child, .nav-item, .user-card > div:last-child { font-size: 0; }
  .brand { justify-content: center; padding-inline: 0; }
  .nav-item { height: 46px; text-align: center; }
  .nav-item::first-letter { font-size: 16px; }
  .user-card { justify-content: center; }
  .hero-grid { grid-template-columns: 1fr; }
  .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 20; top: auto; bottom: 0; width: 100%; height: 68px; flex-direction: row; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-width: 1px 0 0; }
  .brand, .sidebar-foot { display: none; }
  .nav { width: 100%; grid-template-columns: repeat(4, 1fr); }
  .nav-item { padding: 6px; font-size: 11px; text-align: center; }
  .workspace { padding: 24px 16px 95px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .server-select-wrap, #guild-select { width: 100%; }
  .now-playing { grid-template-columns: 1fr; }
  .channel-grid { grid-template-columns: 1fr; }
  .cover { min-height: 210px; }
  .result-grid, .server-grid, .health-grid { grid-template-columns: 1fr; }
  .track-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .track-duration { display: none; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .compact-input { width: 100%; }
  .auth-card { padding: 34px 26px; }
}
