:root {
  --bg: #08080b;
  --surface: #101016;
  --surface-2: #17171f;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f2f2f5;
  --dim: #9a9aa8;
  --dimmer: #6c6c7a;
  --accent: #b6ff3f;
  --accent-ink: #0a0a0c;
  --violet: #9d7bff;
  --danger: #ff6b6b;
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

.glow {
  position: fixed;
  inset: -30% 20% 60% -10%;
  background: radial-gradient(closest-side, rgba(182, 255, 63, 0.16), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  background: rgba(8, 8, 11, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  padding: 3px;
  background: var(--accent);
  border-radius: 6px;
  width: 22px;
}

.brand-mark i {
  display: block;
  width: 3px;
  background: var(--accent-ink);
  border-radius: 2px;
}

.brand-mark i:nth-child(1) {
  height: 6px;
}
.brand-mark i:nth-child(2) {
  height: 12px;
}
.brand-mark i:nth-child(3) {
  height: 9px;
}
.brand-mark i:nth-child(4) {
  height: 14px;
}

.brand-name {
  font-size: 16px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.tab.is-active {
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 650;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

main {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 22px 80px;
}

.loading {
  color: var(--dim);
  padding: 60px 0;
  text-align: center;
}

/* ---------- auth / hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 40px;
  align-items: start;
  padding: 30px 0 20px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  border: 1px solid rgba(182, 255, 63, 0.3);
  background: rgba(182, 255, 63, 0.07);
  padding: 5px 10px;
  border-radius: 99px;
  margin-bottom: 18px;
}

h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 16px;
  font-weight: 760;
}

h1 em {
  font-style: normal;
  color: var(--accent);
}

.lede {
  color: var(--dim);
  font-size: 17px;
  max-width: 52ch;
  margin: 0 0 26px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
}

.btn:hover {
  background: #1e1e28;
  border-color: rgba(255, 255, 255, 0.28);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 700;
}

.btn-primary:hover {
  background: #c6ff6b;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--dim);
  font-weight: 500;
}

.btn-ghost:hover {
  color: var(--text);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 13px;
  border-radius: 9px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.card h2,
.card h3 {
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.card p:last-child {
  margin-bottom: 0;
}

.muted {
  color: var(--dim);
}

.small {
  font-size: 13px;
}

.tiny {
  font-size: 12px;
}

/* ---------- notice / banner ---------- */

.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 18px;
  font-size: 14px;
}

.banner-warn {
  border-color: rgba(255, 190, 80, 0.35);
  background: rgba(255, 190, 80, 0.08);
}

.banner-accent {
  border-color: rgba(182, 255, 63, 0.35);
  background: rgba(182, 255, 63, 0.07);
}

.banner-danger {
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.09);
}

/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.rail {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rail-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dimmer);
  padding: 0 4px;
}

.playlist {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 10px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}

.playlist:hover {
  border-color: var(--line-strong);
}

.playlist.is-active {
  border-color: rgba(182, 255, 63, 0.55);
  background: rgba(182, 255, 63, 0.07);
}

.art {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.playlist-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-meta {
  font-size: 11.5px;
  color: var(--dimmer);
  font-family: var(--mono);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.mode {
  text-align: left;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.mode:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.mode.is-active {
  border-color: var(--accent);
  background: rgba(182, 255, 63, 0.08);
  box-shadow: 0 0 0 1px rgba(182, 255, 63, 0.35) inset;
}

.mode-name {
  font-weight: 650;
  font-size: 14px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.mode-blurb {
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.42;
}

/* ---------- queue ---------- */

.queue {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.queue-row {
  display: grid;
  grid-template-columns: 34px 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.queue-row:last-child {
  border-bottom: 0;
}

.queue-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.rank {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dimmer);
  text-align: right;
}

.track-name {
  font-weight: 550;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-sub {
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reason {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dimmer);
  white-space: nowrap;
  text-align: right;
}

.bpm-pill {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(157, 123, 255, 0.16);
  color: #cdbcff;
  border: 1px solid rgba(157, 123, 255, 0.3);
  white-space: nowrap;
}

.queue-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

select,
input[type="text"],
input[type="number"],
textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 8px 10px;
}

textarea {
  width: 100%;
  min-height: 130px;
  font-family: var(--mono);
  font-size: 12.5px;
  resize: vertical;
}

/* ---------- party ---------- */

.party-grid {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.dial {
  text-align: center;
  padding: 8px 0 4px;
}

.dial-value {
  font-family: var(--mono);
  font-size: 62px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 600;
}

.dial-value span {
  font-size: 15px;
  color: var(--dim);
  letter-spacing: 0.06em;
  margin-left: 6px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--violet), var(--accent));
  outline: none;
  margin: 18px 0 8px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text);
  border: 4px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  border: 4px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
  cursor: pointer;
}

.range-ends {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dimmer);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.chip {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--dim);
  border-radius: 99px;
  padding: 5px 11px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.chip:hover {
  color: var(--text);
}

.chip.is-on {
  background: rgba(157, 123, 255, 0.18);
  border-color: rgba(157, 123, 255, 0.6);
  color: #d9ccff;
}

.field {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dimmer);
  margin-bottom: 7px;
}

.meter {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 8px 0 6px;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--accent));
  border-radius: 99px;
}

.lock {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(157, 123, 255, 0.4);
  background: rgba(157, 123, 255, 0.09);
  margin-bottom: 16px;
}

/* ---------- account ---------- */

.stack {
  display: grid;
  gap: 16px;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  font-size: 14px;
}

.kv:last-child {
  border-bottom: 0;
}

.kv span:first-child {
  color: var(--dim);
}

.kv span:last-child {
  font-family: var(--mono);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  color: var(--dim);
}

.pill-on {
  border-color: rgba(182, 255, 63, 0.5);
  background: rgba(182, 255, 63, 0.1);
  color: var(--accent);
}

.pill-off {
  border-color: rgba(255, 107, 107, 0.45);
  color: #ff9d9d;
}

.footer {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 22px 60px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
}

.footer p {
  max-width: 80ch;
}

.footer-dim {
  color: var(--dimmer);
  font-size: 12px;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: #f2f2f5;
  color: #0a0a0c;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  z-index: 50;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  max-width: 90vw;
}

.toast.is-error {
  background: var(--danger);
  color: #fff;
}

.spinner {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .hero,
  .layout,
  .party-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .rail-title {
    display: none;
  }

  .playlist {
    min-width: 220px;
  }

  .queue-row {
    grid-template-columns: 26px 38px minmax(0, 1fr);
  }

  /* The explanation is the product. On a narrow screen it wraps onto its own
     line instead of disappearing. */
  .reason {
    grid-column: 1 / -1;
    text-align: left;
    white-space: normal;
    padding-top: 2px;
  }
}
