:root {
  --bg: #0a0c1f;
  --bg-glow-1: rgba(124, 92, 246, 0.16);
  --bg-glow-2: rgba(45, 30, 110, 0.35);
  --panel: #12142c;
  --panel-alt: #161a38;
  --border: #262a52;
  --border-soft: #1d2044;
  --text: #eef0fb;
  --text-dim: #8b90b8;
  --text-faint: #5c6091;
  --accent: #8b5cf6;
  --accent-soft: rgba(139, 92, 246, 0.16);
  --accent-hover: #a17bfa;
  --green: #22e07a;
  --red: #ef4444;
  --cyan: #22d3ee;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 500px at 12% -8%, var(--bg-glow-1), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, var(--bg-glow-2), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Header ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 28px;
  background: rgba(8, 9, 22, 0.75);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  height: 36px;
  width: auto;
  display: block;
}
.brand-mark {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #5b3dd1);
  color: white;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.45);
}
.brand h1 {
  font-size: 17px;
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.3px;
}

/* ---------- Nav pills (folded into header) ---------- */
.tabs { display: flex; gap: 8px; }
.tab {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.tab:hover { color: var(--text); border-color: var(--accent); }
.tab.active {
  color: #0a0c1f;
  background: var(--text);
  border-color: var(--text);
}

main { padding: 28px; max-width: 1500px; margin: 0 auto; }
.panel.hidden { display: none; }

/* ---------- Panel chrome (matches the "OUTPUT MONITOR" card treatment) ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-label {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--text-dim);
  font-weight: 800;
  text-transform: uppercase;
}
.panel-sub { color: var(--text-faint); font-size: 13px; margin: -4px 0 18px; max-width: 720px; line-height: 1.5; }

.panel-actions { display: flex; align-items: center; gap: 10px; }

input[type="search"], input[type="number"] {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 13px;
  border-radius: 8px;
  font-size: 13px;
}
input[type="search"]:focus, input[type="number"]:focus { outline: none; border-color: var(--accent); }
input[type="search"] { width: 220px; }
input[type="number"] { width: 64px; margin-left: 6px; }
.count-label { font-size: 13px; color: var(--text-dim); display: flex; align-items: center; }

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.btn-accent {
  background: linear-gradient(135deg, var(--accent), #6d3ff0);
  color: white;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.35);
}
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(139, 92, 246, 0.5); }
.btn-accent:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }

.source-chips { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--text-dim);
}

/* ---------- Showbiz News cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.news-card {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.news-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(139, 92, 246, 0.18);
}

.news-card .thumb {
  height: 148px;
  background-size: cover;
  background-position: center;
  background-color: #1a1d40;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.news-card .body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.news-card .source-tag {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.news-card h3 { font-size: 15px; margin: 0; line-height: 1.35; }
.news-card p { font-size: 12.5px; color: var(--text-faint); margin: 0; line-height: 1.5; flex: 1; }
.news-card .timestamp { font-size: 11px; color: var(--text-faint); margin-top: auto; }

/* ---------- Track / chart lists (styled like Global Top 10 / Recently Played rows) ---------- */
.track-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
}
.track-row {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.track-row:hover { border-color: var(--accent); background: var(--accent-soft); }
.track-rank {
  width: 26px;
  flex-shrink: 0;
  text-align: right;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-faint);
}
.track-row img {
  width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
  background: #1a1d40;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.track-meta { min-width: 0; flex: 1; }
.track-meta .title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-meta .artist { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-row .era {
  flex-shrink: 0;
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px;
  background: rgba(34, 224, 122, 0.15); color: var(--green);
}

.status-line { font-size: 12.5px; color: var(--text-faint); margin-bottom: 12px; min-height: 16px; }
.status-line.error { color: var(--red); }

.empty-state {
  grid-column: 1 / -1;
  color: var(--text-faint);
  padding: 40px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  font-size: 13.5px;
}
.empty-state.large { padding: 100px 40px; font-size: 16px; }

@media (max-width: 720px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 14px; }
  .tabs { justify-content: center; flex-wrap: wrap; }
}
