/* Nightwave dashboard */
:root {
  --night: #07051A; --night2: #0E0A24; --panel: #161033; --panel2: #1E1745; --line: rgba(196, 181, 253, .14); --line2: rgba(196, 181, 253, .26);
  --violet: #8B5CF6; --cyan: #22D3EE; --magenta: #EC4899; --green: #34D399; --amber: #FBBF24; --red: #F43F5E;
  --text: #F5F3FF; --muted: #A9A1CF; --grad: linear-gradient(90deg, #22D3EE, #8B5CF6 55%, #EC4899);
  --r: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Poppins, system-ui, sans-serif; color: var(--text); background: radial-gradient(1000px 500px at 85% -10%, #251A55 0%, transparent 60%), var(--night); min-height: 100vh; overflow-x: hidden; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: clamp(24px, 3vw, 32px); }
h2 { font-size: 18px; }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.eyebrow { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px clamp(12px, 3vw, 28px); background: rgba(7, 5, 26, .8); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { border-radius: 50%; }
.top-links { display: flex; gap: 4px; }
.top-links a { text-decoration: none; padding: 7px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 14px; }
.top-links a.on, .top-links a:hover { background: rgba(139, 92, 246, .16); color: var(--text); }
.me { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; }
.me-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

/* buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer; text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 9px 16px; border-radius: 11px; background: var(--grad); color: #fff; transition: transform .12s, filter .12s; white-space: nowrap; }
.btn:hover { filter: brightness(1.1); } .btn:active { transform: scale(.97); } .btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: rgba(139, 92, 246, .12); border: 1px solid var(--line2); }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.danger { color: #FDA4AF; border-color: rgba(244, 63, 94, .45); }
.btn.round { width: 46px; height: 46px; padding: 0; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line2); font-size: 18px; }
.btn.round.big { width: 62px; height: 62px; font-size: 24px; background: var(--grad); border: 0; box-shadow: 0 8px 26px rgba(139, 92, 246, .45); }
.btn.round.lit, .btn.chip.lit { background: rgba(139, 92, 246, .35); border-color: var(--violet); }
.btn.icon { width: 32px; height: 32px; padding: 0; border-radius: 9px; background: transparent; border: 1px solid var(--line); font-size: 14px; }
.btn.icon:hover { background: rgba(139, 92, 246, .2); }
.btn.icon.danger:hover { background: rgba(244, 63, 94, .2); }
.btn.chip { background: var(--panel2); border: 1px solid var(--line2); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500; }
input[type=text], input[type=search], input[type=number], select { background: var(--night2); border: 1px solid var(--line2); border-radius: 11px; padding: 9px 12px; min-width: 0; max-width: 100%; }
input:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.num { width: 90px; } .num.wide { width: 170px; }
select { cursor: pointer; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* layout */
.app { padding: clamp(14px, 3vw, 28px); max-width: 1400px; margin: 0 auto; }
.loading, .empty { padding: 28px; text-align: center; color: var(--muted); }
.empty { background: rgba(22, 16, 51, .6); border: 1px dashed var(--line2); border-radius: var(--r); margin-bottom: 14px; }
.page { display: flex; flex-direction: column; gap: 16px; }
.page-head { margin-bottom: 4px; } .page-head p { color: var(--muted); margin: 6px 0 0; }
.list-title { margin: 26px 0 12px; font-size: 16px; color: var(--muted); }
.panel { background: linear-gradient(180deg, rgba(30, 23, 69, .78), rgba(22, 16, 51, .78)); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(14px, 2vw, 22px); min-width: 0; }
.panel-head { margin-bottom: 14px; } .panel-head p { color: var(--muted); margin: 6px 0 0; font-size: 14px; line-height: 1.5; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* servers */
.servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.server { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 20px 14px; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); transition: transform .15s, border-color .15s; min-width: 0; }
.server:hover { transform: translateY(-2px); border-color: var(--violet); }
.server-icon { width: 64px; height: 64px; border-radius: 18px; object-fit: cover; }
.server-name { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-sub { font-size: 13px; color: var(--muted); }
.ph { display: grid; place-items: center; background: linear-gradient(135deg, #22D3EE55, #8B5CF6aa, #EC489977); font-size: 22px; }

/* server page */
.guild { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.guild > * { min-width: 0; }
.side { position: sticky; top: 70px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 12px; }
.back:hover { color: var(--text); }
.guild-head { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; min-width: 0; }
.guild-head > div { display: flex; flex-direction: column; min-width: 0; }
.guild-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-head small { color: var(--muted); font-size: 12px; }
.guild-icon { width: 44px; height: 44px; border-radius: 13px; flex: none; object-fit: cover; }
.tabs { display: flex; flex-direction: column; gap: 2px; }
.tab { display: flex; gap: 10px; align-items: center; padding: 9px 11px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px; white-space: nowrap; }
.tab:hover { background: rgba(139, 92, 246, .12); color: var(--text); }
.tab.on { background: rgba(139, 92, 246, .24); color: var(--text); box-shadow: inset 3px 0 0 var(--violet); }
.content { min-width: 0; }

/* player */
.player-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.np-status { font-size: 13px; padding: 8px 12px; border-radius: 10px; margin-bottom: 14px; background: rgba(251, 191, 36, .12); color: #FDE68A; }
.np-status.good { background: rgba(52, 211, 153, .12); color: #A7F3D0; }
.np-main { display: flex; gap: 18px; align-items: center; min-width: 0; }
.np-art { flex: none; }
.np-art .art, .np-art .ph { width: 132px; height: 132px; border-radius: 16px; object-fit: cover; box-shadow: 0 12px 34px rgba(0, 0, 0, .45); font-size: 44px; }
.np-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.np-title { font-size: 20px; font-weight: 700; text-decoration: none; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
a.np-title[href]:hover { text-decoration: underline; }
.np-author { color: var(--muted); } .np-req { font-size: 13px; color: var(--muted); }
.np-progress { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin: 20px 0 14px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { position: relative; height: 8px; border-radius: 99px; background: rgba(196, 181, 253, .16); cursor: pointer; }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: var(--grad); }
.bar-knob { position: absolute; top: 50%; left: 0; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(139, 92, 246, .35); }
.controls { display: flex; justify-content: center; align-items: center; gap: 14px; margin-bottom: 16px; }
.controls2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: center; }
.vol-wrap { display: flex; align-items: center; gap: 8px; }
.vol { width: 150px; accent-color: var(--violet); }
.vol-text { font-size: 13px; color: var(--muted); width: 42px; font-variant-numeric: tabular-nums; }
.chip-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; }
.chip-toggle input { accent-color: var(--magenta); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-dials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center; }
.search { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.search input { flex: 1 1 200px; }
.results { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.result, .q-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: rgba(7, 5, 26, .35); min-width: 0; }
.thumb { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; flex: none; font-size: 16px; }
.t-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.t-info b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-info small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-play { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.pl-play select { flex: 1 1 180px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--violet); width: 16px; height: 16px; }
.queue { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 640px; overflow-y: auto; }
.q-num { width: 24px; text-align: right; color: var(--muted); font-size: 13px; flex: none; font-variant-numeric: tabular-nums; }
.q-actions { display: flex; gap: 4px; flex: none; }
.q-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.empty-row { color: var(--muted); padding: 14px; text-align: center; font-size: 14px; }
.panel > p { color: var(--muted); font-size: 14px; margin: 0 0 10px; }

/* settings rows */
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-text b { font-weight: 600; font-size: 15px; }
.row-text small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.toggle { cursor: pointer; }
.switch { position: relative; flex: none; width: 46px; height: 26px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: rgba(196, 181, 253, .2); transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: var(--violet); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--cyan); outline-offset: 2px; }
.save-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.save-bar.left { justify-content: flex-start; }
.status { display: inline-block; padding: 7px 12px; border-radius: 10px; background: rgba(196, 181, 253, .12); font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.status.good { background: rgba(52, 211, 153, .14); color: #A7F3D0; }

/* DJ mode */
.dj-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.dj-list { display: flex; flex-direction: column; gap: 12px; }
.dj-entry { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: rgba(7, 5, 26, .3); }
.dj-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.dj-head b { flex: 1 1 140px; }
.dj-all { display: flex; align-items: center; gap: 8px; } .dj-all small { color: var(--muted); }
.dj-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; }
.dj-perm { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 0; }
.tri { display: inline-flex; border: 1px solid var(--line2); border-radius: 9px; overflow: hidden; flex: none; }
.tri-b { width: 32px; height: 28px; border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.tri-b + .tri-b { border-left: 1px solid var(--line); }
.tri-b.on.allow { background: rgba(52, 211, 153, .3); color: #fff; }
.tri-b.on.none { background: rgba(196, 181, 253, .2); color: #fff; }
.tri-b.on.deny { background: rgba(244, 63, 94, .35); color: #fff; }

/* voice channels, songs, log */
.vc-list { display: flex; flex-direction: column; gap: 4px; }
.vc { padding: 6px 4px 6px 26px; } .vc.cat { padding-left: 4px; font-weight: 600; margin-top: 8px; }
.songs { margin: 6px 0 10px; padding-left: 22px; }
.songs li { padding: 4px 0; } .songs li > span { margin-right: 8px; word-break: break-word; }
.songs .btn.icon { width: 26px; height: 26px; vertical-align: middle; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.log li { display: grid; grid-template-columns: 170px 150px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.log time { color: var(--muted); font-size: 13px; }
.log b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* playlists */
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 14px; }
.pl { display: flex; flex-direction: column; gap: 6px; text-decoration: none; padding: 12px; border-radius: 14px; background: rgba(7, 5, 26, .35); border: 1px solid var(--line); min-width: 0; }
.pl:hover { border-color: var(--violet); }
.pl b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl small { color: var(--muted); font-size: 12px; }
.pl-cover { width: 100%; aspect-ratio: 1; border-radius: 10px; object-fit: cover; font-size: 34px; }
.pl-cover.big { width: 150px; height: 150px; flex: none; }
.pl-top { display: flex; gap: 20px; align-items: center; margin: 6px 0 16px; flex-wrap: wrap; }
.pl-top h1 { margin: 4px 0; word-break: break-word; }
.pl-top p { margin: 0 0 12px; }
.pl-edit { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }

/* toasts and modal */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { padding: 11px 16px; border-radius: 12px; background: #1E1745; border: 1px solid var(--line2); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); font-size: 14px; transition: opacity .4s, transform .4s; }
.toast.ok { border-left: 4px solid var(--green); } .toast.bad { border-left: 4px solid var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); }
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(4, 3, 14, .7); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { position: relative; width: min(640px, 100%); max-height: 85vh; overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; padding: 24px; }
.modal-x { position: absolute; top: 12px; right: 12px; background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--muted); }
.lyrics { white-space: pre-wrap; font-family: inherit; line-height: 1.7; margin: 14px 0 0; }

/* tablets and phones */
@media (max-width: 1100px) { .player-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .guild { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .side { position: static; padding: 12px; }
  .tabs { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: thin; }
  .tab { flex: none; background: rgba(139, 92, 246, .08); }
  .tab.on { box-shadow: inset 0 -3px 0 var(--violet); }
  .log li { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 560px) {
  .top { gap: 8px; }
  .brand span, .me-name { display: none; }
  .top-links a { padding: 6px 8px; font-size: 13px; }
  .me .btn { padding: 5px 9px; }
  .np-main { flex-direction: column; text-align: center; }
  .np-art .art, .np-art .ph { width: 160px; height: 160px; }
  .controls { gap: 10px; }
  .vol { width: 120px; }
  .row { flex-wrap: wrap; }
  .row.toggle { flex-wrap: nowrap; }
  .q-actions .btn.icon { width: 28px; height: 28px; }
  .thumb { width: 38px; height: 38px; }
  .servers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-cover.big { width: 110px; height: 110px; }
}
