:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-alt: #f4f4f5;
  --border: #e4e4e7;
  --text: #09090b;
  --muted: #71717a;
  --accent: #e11d48;
  --accent-fg: #ffffff;
}

html.dark {
  --bg: #09090b;
  --surface: #111114;
  --surface-alt: #18181b;
  --border: #27272a;
  --text: #fafafa;
  --muted: #a1a1aa;
  --accent: #f43f5e;
  --accent-fg: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  padding-bottom: 140px;
}

.mono { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-links { display: flex; gap: 1.25rem; }
.nav-btn {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 0.25rem;
  min-height: 44px;
  white-space: nowrap;
}
.nav-btn.active, .nav-btn:hover { color: var(--text); }

.primary-btn {
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: 0.65rem;
  padding: 0.6rem 1.15rem;
  min-height: 44px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ghost-btn {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 0.55rem 1rem;
  min-height: 44px;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; margin-bottom: 1.5rem; }
.search-form { display: flex; flex: 1 1 320px; gap: 0.5rem; }
.search-form input {
  flex: 1;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.search-submit {
  min-height: 44px;
  padding: 0 1.25rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.category-tabs { display: flex; gap: 0.25rem; padding: 0.25rem; background: var(--surface-alt); border-radius: 0.65rem; }
.tab-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 0.5rem;
  padding: 0.45rem 0.85rem;
  min-height: 36px;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn.active { background: var(--surface); color: var(--text); }

.view { display: none; }
.view.active { display: block; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.section-head h1, .section-head h2 { margin: 0; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.35rem; }
.meta-text { color: var(--muted); font-size: 0.85rem; }

.notice-banner {
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
}
.track-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.track-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-alt); display: block; }
.track-body { padding: 0.85rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.track-title { font-weight: 600; font-size: 0.95rem; line-height: 1.35; margin: 0; }
.track-meta { font-size: 0.8rem; color: var(--muted); }
.track-actions { display: flex; gap: 0.5rem; margin-top: auto; padding-top: 0.5rem; }
.track-actions button { flex: 1; min-height: 40px; font-size: 0.82rem; }

.playlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.playlist-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0.9rem; padding: 1rem; }

.player-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 40;
}
.player-dock.hidden { display: none; }
.player-stage { max-width: 640px; margin: 0.75rem auto 0; aspect-ratio: 16 / 9; display: none; }
.player-stage.video-open { display: block; }
.player-stage iframe { width: 100%; height: 100%; border-radius: 0.75rem; border: 0; }
.player-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.player-meta { display: flex; align-items: center; gap: 0.75rem; min-width: 0; flex: 1; }
.player-meta img { width: 48px; height: 48px; border-radius: 0.5rem; object-fit: cover; }
.player-titles { min-width: 0; }
.player-title { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-channel { font-size: 0.8rem; color: var(--muted); }
.player-controls, .player-mode { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  min-height: 40px;
  padding: 0 0.8rem;
  cursor: pointer;
}

.mobile-nav { display: none; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 50;
  }
  .player-dock { bottom: 48px; }
}
