:root {
  --bg: #0a0a0a;
  --panel: #121212;
  --panel-2: #1a1a1a;
  --text: #f5f5f5;
  --muted: #b0b0b0;
  --line: #262626;
  --brand: #f2b705;
  --brand-2: #ff8f1f;
  --danger: #d94e4e;
}

* {
  box-sizing: border-box;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(circle at top right, #20170a 0%, var(--bg) 30%);
  color: var(--text);
}

img {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.88);
  backdrop-filter: blur(5px);
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
}

.auth-card h2 {
  margin: 0;
}

.auth-card input {
  background: #0d0d0d;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font-size: 0.95rem;
}

.error-text {
  color: var(--danger);
  min-height: 1.1rem;
  margin: 0;
  font-size: 0.85rem;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  gap: 1rem;
  padding: 1rem;
  padding-bottom: 1rem;
}

.sidebar,
.content,
.right-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.sidebar,
.right-panel {
  padding: 1rem;
}

.content {
  padding: 1.25rem;
  overflow: hidden;
}

.brand {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  height: 42px;
  padding: 0;
}

.brand img {
  width: auto;
  height: 42px;
  object-fit: contain;
}

.kofi-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.55rem;
  padding: 0.6rem 0.75rem;
  border-radius: 999px;
  border: 0;
  background: var(--brand);
  color: #111;
  font-weight: 700;
  text-decoration: none;
}

.kofi-link:hover {
  background: var(--brand-2);
}

.brand h1 {
  font-size: 1.1rem;
  margin: 0;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  font-size: 0.72rem;
}

.main-nav {
  margin: 1.2rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.nav-item {
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--panel-2);
  border-color: var(--line);
}

.sidebar-block h2 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.account-actions {
  display: grid;
  gap: 0.45rem;
}

.account-link {
  display: block;
  text-decoration: none;
}

.hero {
  background: linear-gradient(120deg, rgba(242, 183, 5, 0.23), rgba(255, 143, 31, 0.06));
  border: 1px solid rgba(242, 183, 5, 0.3);
  border-radius: 14px;
  padding: 1.1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.hero h2 {
  margin: 0.25rem 0;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.muted {
  color: var(--muted);
  margin: 0;
}

.cta {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  background: var(--brand);
  color: #111;
  cursor: pointer;
}

.section-title-row {
  margin-top: 1.1rem;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.section-title-row h3 {
  margin: 0;
}

.selection-controls {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  padding: 0.7rem;
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.selection-label {
  margin: 0;
  grid-column: 1 / -1;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.selection-controls select,
.mini-btn {
  background: #0d0d0d;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  font-size: 0.82rem;
}

.mini-btn {
  cursor: pointer;
  background: rgba(242, 183, 5, 0.18);
  border-color: rgba(242, 183, 5, 0.4);
  font-weight: 600;
}

.mini-btn.secondary {
  background: transparent;
  border-color: var(--line);
}

.mini-btn:disabled,
.selection-controls select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#selectionStatus {
  grid-column: 1 / -1;
  font-size: 0.82rem;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.9rem;
}

.album-card {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 0.7rem;
  cursor: pointer;
}

.album-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
}

.album-card h4 {
  margin: 0.55rem 0 0.2rem;
  font-size: 0.95rem;
}

.album-card p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.track-list {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.track-list.compact .track-item {
  grid-template-columns: 1fr auto;
}

.album-break {
  height: 8px;
  background: linear-gradient(
    to bottom,
    rgba(176, 176, 176, 0.35) 0,
    rgba(176, 176, 176, 0.35) 1px,
    transparent 1px,
    transparent 100%
  );
}

.track-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.track-item > span:nth-child(2) {
  min-width: 0;
}

.track-title,
.track-sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-item:last-child {
  border-bottom: 0;
}

.track-item:hover,
.track-item.active {
  background: rgba(242, 183, 5, 0.12);
}

.track-item.in-selection {
  box-shadow: inset 3px 0 0 rgba(242, 183, 5, 0.75);
}

.track-index {
  color: var(--muted);
  font-size: 0.8rem;
}

.track-title {
  font-weight: 600;
}

.track-sub {
  color: var(--muted);
  font-size: 0.82rem;
}

.track-duration {
  font-size: 0.82rem;
  color: var(--muted);
}

.now-card {
  background: var(--panel-2);
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0.85rem;
}

.now-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  margin: 0.5rem 0;
}

.now-card h4 {
  margin: 0 0 0.3rem;
}

.about-card {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
  background: var(--panel-2);
}

.about-card h4 {
  margin: 0 0 0.55rem;
}

.about-card p {
  margin: 0 0 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.about-card .about-subtitle {
  margin: 0.15rem 0 0.45rem;
  color: var(--text);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.support-list {
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.support-list li {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 9px;
  padding: 0.4rem 0.55rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.about-card a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 0 1rem 108px;
}

.site-footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  opacity: 0.85;
}

.player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 96px;
  border-top: 1px solid var(--line);
  background: rgba(12, 12, 12, 0.95);
  backdrop-filter: blur(12px);
  display: grid;
  grid-template-columns: minmax(230px, 1fr) 2fr minmax(140px, 0.7fr);
  align-items: center;
  padding: 0.8rem 1rem;
  gap: 0.85rem;
}

.player-track-meta {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.player-track-meta img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: #252525;
}

.player-track-meta p {
  margin: 0;
}

.controls {
  display: grid;
  gap: 0.45rem;
}

.control-buttons {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}

.control-buttons button {
  border: 0;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: #2a2a2a;
  color: var(--text);
  transition: transform 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
}

.control-buttons button:hover {
  background: #3a3a3a;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.control-buttons .toggle-btn {
  width: auto;
  min-width: 42px;
  padding: 0 0.65rem;
  font-size: 0.78rem;
}

#shuffleBtn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  font-size: 0.95rem;
}

.control-buttons .toggle-btn.active {
  background: rgba(242, 183, 5, 0.22);
  color: var(--brand);
  border: 1px solid rgba(242, 183, 5, 0.45);
}

.control-buttons .play-btn {
  background: var(--brand);
  color: #0e0e0e;
  font-weight: 700;
}

.control-buttons .play-btn:hover {
  background: var(--brand-2);
  box-shadow: 0 0 0 1px rgba(255, 143, 31, 0.55);
}

.seek-wrap {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

input[type='range'] {
  width: 100%;
}

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}

.admin-layout {
  grid-template-columns: 1fr;
  padding-bottom: 1rem;
}

.admin-content {
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
}

.admin-back {
  text-decoration: none;
}

.admin-section {
  margin-top: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: var(--panel-2);
}

.admin-section h3 {
  margin: 0 0 0.7rem;
}

.admin-form {
  display: grid;
  gap: 0.85rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.75rem;
}

.form-grid label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-grid input,
.form-grid select {
  width: 100%;
  background: #0d0d0d;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.catalog-view {
  display: grid;
  gap: 0.75rem;
}

.catalog-album {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
}

.catalog-album h4,
.catalog-album p {
  margin: 0 0 0.4rem;
}

.catalog-album ul {
  margin: 0;
  padding-left: 1rem;
}

.catalog-track-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.35rem;
}

.delete-track-btn {
  border: 1px solid rgba(217, 78, 78, 0.6);
  color: #ffd7d7;
  background: rgba(217, 78, 78, 0.15);
  border-radius: 8px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.delete-track-btn:hover {
  background: rgba(217, 78, 78, 0.24);
}

.trash-track-btn,
.restore-track-btn {
  border: 1px solid rgba(242, 183, 5, 0.5);
  color: #f5e3b0;
  background: rgba(242, 183, 5, 0.15);
  border-radius: 8px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.trash-track-btn:hover,
.restore-track-btn:hover {
  background: rgba(242, 183, 5, 0.24);
}

.trash-wrap,
.active-wrap {
  display: grid;
  gap: 0.6rem;
}

.trash-wrap h4,
.active-wrap h4 {
  margin: 0;
}

.trash-actions {
  display: flex;
  gap: 0.55rem;
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 220px 1fr;
  }

  .right-panel {
    display: none;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 0.7rem;
    padding-bottom: calc(176px + env(safe-area-inset-bottom));
  }

  .sidebar {
    order: 2;
  }

  .content {
    order: 1;
  }

  .player-bar {
    height: auto;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding-bottom: calc(0.8rem + env(safe-area-inset-bottom));
  }

  .volume-wrap {
    justify-content: stretch;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .selection-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .content {
    padding: 0.9rem;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .cta {
    width: 100%;
  }

  .track-item {
    grid-template-columns: 1fr auto;
    gap: 0.55rem;
  }

  .track-index {
    display: none;
  }

  .control-buttons {
    flex-wrap: wrap;
    row-gap: 0.45rem;
  }

  .seek-wrap {
    grid-template-columns: 34px 1fr 34px;
    gap: 0.4rem;
    font-size: 0.75rem;
  }

  .player-track-meta img {
    width: 48px;
    height: 48px;
  }
}

.sidebar .brand {
  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;
}

.sidebar .brand img {
  display: block;
  height: 56px !important;
  width: auto !important;
  max-height: 56px !important;
}
