:root {
  color-scheme: dark;
  --bg: #0d0f10;
  --bg-2: #121516;
  --panel: #171a1b;
  --panel-2: #1c2021;
  --line: #2a2f31;
  --text: #f4f7f7;
  --muted: #9aa6a8;
  --green: #1db954;
  --green-2: #1ed760;
  --danger: #ff6b81;
  --radius: 18px;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: linear-gradient(180deg, #0b0d0e 0%, #101314 100%);
  color: var(--text);
  font-size: 15px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.ban-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 9, 10, 0.98);
  z-index: 60;
  padding: 24px;
}

.ban-screen__panel {
  width: min(92vw, 460px);
  text-align: center;
}

.maintenance-screen {
  min-height: calc(100vh - 92px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.maintenance-screen__panel {
  width: min(92vw, 560px);
  text-align: center;
}

.maintenance-illustration {
  font-size: 4rem;
  margin-bottom: 12px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 15, 16, 0.95);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.brandline {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brandline--link:hover .brandmark {
  transform: scale(1.04);
}

.brandmark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.brandmark img {
  width: 100%;
  height: 100%;
  display: block;
}

.brandline h1,
.panel h2,
.hero-panel h2,
.empty-state h3,
.modal__surface h3,
.radio-player-panel h2 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green-2);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.topbar__nav,
.topbar__right,
.table-actions,
.player-controls,
.player-range,
.panel__header,
.modal__actions,
.auth-switch,
.filters {
  display: flex;
  align-items: center;
}

.topbar__nav,
.topbar__right,
.table-actions,
.modal__actions,
.auth-switch {
  gap: 10px;
}

.layout,
.admin-layout,
.radio-layout {
  display: grid;
  gap: 20px;
  padding: 18px;
}

.layout,
.content {
  display: grid;
  gap: 20px;
}

.layout {
  grid-template-columns: minmax(0, 1fr);
}

.content {
  min-width: 0;
}

.content--full {
  width: 100%;
}

.topbar__right {
  align-items: center;
  justify-content: flex-end;
}

.admin-layout,
.radio-layout {
  grid-template-columns: 1fr;
}

.admin-layout {
  gap: 28px;
}

.admin-dashboard {
  display: grid;
  gap: 28px;
}

.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.panel__header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.hero-panel {
  display: grid;
  gap: 18px;
}

.hero-stats,
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 1.3rem;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 0.82rem;
}

.field input,
.field select,
.field textarea,
.table-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101314;
  color: var(--text);
  padding: 9px 11px;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.table-input:focus {
  border-color: rgba(29, 185, 84, 0.7);
}

.field textarea {
  resize: vertical;
  min-height: 108px;
}

.search-field {
  min-width: 240px;
}

.filters {
  gap: 12px;
  flex-wrap: wrap;
}

.filters-panel .filters .field {
  min-width: 160px;
}

.upload-box {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 14px;
  border: 1px dashed rgba(29, 185, 84, 0.45);
  background: rgba(29, 185, 84, 0.06);
  text-align: center;
  margin-bottom: 18px;
}

.upload-box.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.upload-guidance {
  margin-top: 0;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(29, 185, 84, 0.18);
  border-radius: 12px;
  background: rgba(29, 185, 84, 0.05);
}

#upload-preview {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.preview-line,
.userbox {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.eye-button {
  width: 44px;
  height: 44px;
}

.auth-modal-surface {
  width: min(92vw, 360px);
}

.helper-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.link-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: var(--green-2);
  font-weight: 600;
  text-align: left;
}

.link-button:hover {
  color: #8ef0af;
  text-decoration: underline;
}

.link-button:focus-visible {
  outline: 2px solid rgba(30, 215, 96, 0.45);
  outline-offset: 3px;
  border-radius: 6px;
}

.profile-editor {
  margin-top: 6px;
}

.profile-editor__actions {
  display: flex;
  justify-content: flex-end;
}

.discord-field {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #101314;
}

.discord-field__icon {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #5865f2, #7983ff);
  color: #fff;
  font-weight: 800;
}

.discord-field input {
  border: 0;
  border-radius: 0;
}

.lock-banner {
  border: 1px solid rgba(255, 107, 129, 0.3);
  background: rgba(255, 107, 129, 0.08);
  color: #ffc7d1;
  border-radius: 12px;
  padding: 12px;
  font-size: 0.92rem;
  margin-bottom: 12px;
}

#upload-preview audio {
  margin: 6px 0 4px;
  width: min(360px, 100%);
}

.badge,
.type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.76rem;
  border: 1px solid rgba(29, 185, 84, 0.22);
  background: rgba(29, 185, 84, 0.08);
  color: #c9f8d8;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge--warning {
  border-color: rgba(255, 170, 54, 0.28);
  background: rgba(255, 170, 54, 0.12);
  color: #ffd59a;
}

.badge--danger {
  border-color: rgba(255, 107, 129, 0.3);
  background: rgba(255, 107, 129, 0.12);
  color: #ffc1cb;
}

.primary-button,
.ghost-button,
.danger-button,
.tab-button,
.primary-icon-button {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.primary-button,
.primary-icon-button {
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #07110a;
  font-weight: 700;
}

.ghost-button,
.tab-button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.account-button--logged-out {
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #07110a;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(29, 185, 84, 0.18);
}

.danger-button {
  background: rgba(255, 107, 129, 0.14);
  color: #ffd0d8;
}

.tab-button.is-active {
  background: rgba(29, 185, 84, 0.14);
  color: #cff8dc;
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.tab-button:hover,
.primary-icon-button:hover {
  transform: translateY(-1px);
}

.table-wrapper {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.songs-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1320px;
  background: #131617;
  table-layout: fixed;
}

.songs-table th,
.songs-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

.songs-table th {
  position: sticky;
  top: 0;
  background: #171b1c;
  color: var(--muted);
  font-size: 0.82rem;
  z-index: 1;
}

.songs-table tr.is-active {
  background: rgba(29, 185, 84, 0.06);
}

.icon-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button.is-favorite,
.table-icon-button.is-favorite {
  color: #ff7fb5;
  border-color: rgba(255, 127, 181, 0.35);
  background: rgba(255, 127, 181, 0.12);
}

.icon-button.is-favorite:hover,
.table-icon-button.is-favorite:hover {
  background: rgba(255, 127, 181, 0.18);
}

.table-icon-button--danger {
  color: #ffb8c3;
  background: rgba(255, 107, 129, 0.08);
}

.songs-table td .type-badge {
  white-space: nowrap;
  max-width: 100%;
}

.songs-table td .tooltip-anchor {
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}

.table-cell-strong {
  font-weight: 600;
}

.table-cell-subtle {
  color: var(--muted);
  font-size: 0.85rem;
}

.table-cell-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  max-width: 100%;
}

.table-link-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}

.tooltip-anchor {
  position: relative;
  display: block;
}

.tooltip-anchor[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  min-width: max-content;
  max-width: min(320px, 60vw);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(29, 185, 84, 0.18);
  background: rgba(11, 13, 14, 0.96);
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 8;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

.tooltip-anchor[data-tooltip]:hover::after,
.tooltip-anchor[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.metric-column,
.metric-chip {
  display: none;
}

body.show-favorites-metric .metric-favorites {
  display: table-cell;
}

body.show-plays-metric .metric-plays {
  display: table-cell;
}

body.show-favorites-metric .metric-chip.metric-favorites,
body.show-plays-metric .metric-chip.metric-plays {
  display: inline-flex;
}

.songs-table th:nth-child(1),
.songs-table td:nth-child(1),
.songs-table th:nth-child(2),
.songs-table td:nth-child(2) {
  width: 56px;
}

.songs-table th:nth-child(3),
.songs-table td:nth-child(3) {
  width: 230px;
}

.songs-table th:nth-child(4),
.songs-table td:nth-child(4) {
  width: 160px;
}

.songs-table th:nth-child(5),
.songs-table td:nth-child(5) {
  width: 78px;
}

.songs-table th:nth-child(6),
.songs-table td:nth-child(6),
.songs-table th:nth-child(8),
.songs-table td:nth-child(8),
.songs-table th:nth-child(10),
.songs-table td:nth-child(10),
.songs-table th:nth-child(11),
.songs-table td:nth-child(11) {
  width: 72px;
}

.songs-table th:nth-child(7),
.songs-table td:nth-child(7) {
  width: 82px;
}

.songs-table th:nth-child(9),
.songs-table td:nth-child(9) {
  width: 108px;
}

.songs-table th:nth-child(12),
.songs-table td:nth-child(12) {
  width: 126px;
}

.table-actions {
  flex-wrap: nowrap;
}

.admin-search-field {
  min-width: 320px;
}

.table-panel {
  min-height: calc(100vh - 330px);
}

.table-wrapper {
  max-width: 100%;
}

.mobile-song-list {
  display: none;
}

.pagination {
  display: flex;
  margin-top: 14px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.song-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #131617;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.song-card.is-active {
  background: rgba(29, 185, 84, 0.08);
}

.song-card__header,
.song-card__footer,
.song-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.song-card__header p,
.song-card__meta span {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.song-card__meta {
  flex-wrap: wrap;
}

.song-card__meta--stats {
  justify-content: flex-start;
  gap: 14px;
}

.song-card .type-badge {
  max-width: 140px;
}

.account-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#profile-status {
  margin-bottom: 14px;
}

#profile-name {
  word-break: break-word;
}

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

.profile-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.profile-details {
  margin-top: 12px;
}

.profile-bio-card p,
.profile-discord-card p {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.radio-controls-grid {
  align-items: end;
}

#radio-upcoming {
  margin-top: 16px;
}

.player-bar {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 72px;
  border: 1px solid var(--line);
  background: rgba(17, 20, 21, 0.98);
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow);
}

.player-close-button {
  position: absolute;
  top: -14px;
  right: -10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #171a1b;
}

.player-nav-button {
  width: 42px;
  height: 42px;
}

.player-bar__label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.player-controls {
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.primary-icon-button {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
}

.player-range {
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.player-volume {
  display: grid;
  gap: 4px;
  min-width: 120px;
}

.player-volume span {
  color: var(--muted);
  font-size: 0.8rem;
}

.floating-player-button {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 24px;
  z-index: 35;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #07110a;
  padding: 12px 16px;
  font-weight: 700;
}

.player-range--wide {
  margin: 18px 0;
}

input[type="range"] {
  flex: 1;
  accent-color: var(--green);
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress__bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-2));
}

.loading-state,
.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.65);
  z-index: 30;
}

.modal__surface {
  width: min(92vw, 440px);
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #171a1b;
}

.modal__actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.toast-stack {
  position: fixed;
  top: 88px;
  right: 20px;
  display: grid;
  gap: 10px;
  z-index: 40;
}

.toast {
  position: relative;
  min-width: 260px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #16191a;
  box-shadow: var(--shadow);
}

.toast--success {
  border-color: rgba(29, 185, 84, 0.25);
}

.toast--error {
  border-color: rgba(255, 107, 129, 0.25);
}

.toast__title,
.toast__copy {
  margin: 0;
}

.toast__copy {
  margin-top: 4px;
  color: var(--muted);
}

.toast__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.site-footer {
  padding: 24px 20px 120px;
  text-align: center;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

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

@media (max-width: 1100px) {
  .topbar__right {
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .topbar,
  .player-bar,
  .panel__header,
  .player-controls,
  .preview-line,
  .userbox {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-stats,
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-meta-grid,
  .account-summary-grid {
    grid-template-columns: 1fr;
  }

  .layout,
  .admin-layout,
  .radio-layout {
    padding: 16px;
  }

  .player-bar {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .floating-player-button {
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
  }

  .songs-table,
  .songs-table thead,
  .table-wrapper {
    display: none;
  }

  .mobile-song-list {
    display: grid;
    gap: 12px;
  }

  .pagination {
    display: flex;
    justify-content: center;
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .filters .search-field,
  .filters .field,
  .filters .ghost-button {
    min-width: 0;
    width: 100%;
  }

  .admin-search-field {
    min-width: 0;
    width: 100%;
  }
}
