/* Recotop Dark Theme */

:root {
  --bg-primary: #0f0f1a;
  --bg-card: #1a1b2e;
  --bg-card-hover: #252640;
  --bg-navbar: #0a0a15;
  --accent: #00d4aa;
  --accent-hover: #00f0c0;
  --accent-secondary: #6366f1;
  --text-primary: #e4e4e7;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border: #2d2d44;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --indigo: #6366f1;
}

/* Base */
html {
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  height: 100%;
  margin: 0 auto;
  position: relative;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Links */
a { color: var(--text-primary); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: none; }

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--text-primary); }
.text-accent { color: var(--accent); }

/* Navbar */
.navbar {
  background: var(--bg-navbar);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.navbar-brand {
  color: var(--accent) !important;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}
.navbar-brand:hover { color: var(--accent-hover) !important; }
.navbar-toggler {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  color: var(--text-primary) !important;
  display: none;
}
.navbar-toggler .fa-bars { color: var(--text-primary); }

/* Side navigation */
.sidenav {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 1050;
  top: 0;
  left: 0;
  background-color: var(--bg-navbar);
  border-right: 1px solid var(--border);
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 60px;
  transition: 0.3s ease;
  -webkit-overflow-scrolling: touch;
}
.sidenav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
}
.sidenav a {
  padding: 8px 8px 8px 20px;
  text-decoration: none;
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: 0.2s;
}
.sidenav a:hover {
  color: var(--accent);
  background: var(--bg-card);
}
.sidenav .closebtn {
  position: absolute;
  top: 0;
  right: 20px;
  font-size: 36px;
  color: var(--text-secondary);
}
.sidenav .closebtn:hover { color: var(--accent); background: none; }
.sidenav .sidenav-item {
  padding: 0;
  background: none;
  border: none;
}
.sidenav .sidenav-item a {
  padding: 6px 12px 6px 20px;
  font-size: 14px;
}
.sidenav .sidenav-flag {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: rgba(0, 212, 170, 0.3);
}
.card-body { padding: 1.25rem; }

/* Track cards (country page) */
.track-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.track-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 212, 170, 0.3);
  box-shadow: 0 0 20px rgba(0, 212, 170, 0.05);
}
.track-position {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.track-trend {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}
.track-album-art {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.track-info { flex: 1; min-width: 0; }
.track-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artist-name {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.9rem;
  margin: 0;
}
.genre-name {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* Trend icon colors */
.trend-new { color: var(--amber); }
.trend-stay { color: var(--indigo); }
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }

/* Home page */
.hero-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}
.hero-title .accent-underline {
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-week {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 4px;
}
.country-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.country-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  min-width: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.country-card:hover {
  border-color: rgba(0, 212, 170, 0.3);
  box-shadow: 0 0 20px rgba(0, 212, 170, 0.05);
}
.country-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.country-flag {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.country-flag-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.country-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.country-card-tracks { list-style: none; padding: 0; margin: 0; }
.country-card-tracks li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}
.country-card-tracks li:first-child { border-top: none; }
.country-card-track-pos {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 20px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.country-card-track-art {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.country-card-track-info {
  flex: 1;
  min-width: 0;
}
.country-card-track-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.country-card-track-artist {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.country-card-track-trend {
  width: 14px;
  text-align: center;
  flex-shrink: 0;
  font-size: 0.7rem;
  line-height: 1;
}
.country-card-link {
  display: block;
  margin-top: 12px;
  text-align: right;
  font-size: 0.85rem;
  color: var(--accent);
}
.country-card-link:hover { color: var(--accent-hover); }

/* Spotlight card */
.spotlight-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid rgba(0, 212, 170, 0.4);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.05), rgba(99, 102, 241, 0.05));
  pointer-events: none;
}
.spotlight-badge {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 14px;
  position: relative;
}
.spotlight-badge i { margin-right: 4px; }
.spotlight-body {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
}
.spotlight-art {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.spotlight-info { flex: 1; min-width: 0; }
.spotlight-track-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotlight-artist-name {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotlight-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.spotlight-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.spotlight-flag {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

/* Leaderboard */
.leaderboard-heading {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 14px;
}
.leaderboard-heading i {
  color: var(--accent);
  margin-right: 6px;
}
.leaderboard-list { display: flex; flex-direction: column; }
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
  border-radius: 8px;
}
a.leaderboard-row {
  padding: 10px 8px;
  margin: 0 -8px;
}
a.leaderboard-row:hover {
  background: var(--bg-card-hover);
  color: inherit;
}
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-rank {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 24px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.leaderboard-rank--first { color: var(--accent); }
.leaderboard-art {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.leaderboard-info { flex: 1; min-width: 0; }
.leaderboard-track-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leaderboard-artist-name {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leaderboard-pill {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(0, 212, 170, 0.12);
  color: var(--accent);
  white-space: nowrap;
}

/* New & Rising strip */
.movers-heading {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 14px;
}
.movers-heading i {
  color: var(--amber);
  margin-right: 6px;
}
.movers-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-top: 6px;
  padding-bottom: 4px;
}
.movers-scroll::-webkit-scrollbar { height: 4px; }
.movers-scroll::-webkit-scrollbar-track { background: transparent; }
.movers-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.mover-item {
  flex: 0 0 auto;
  width: 100px;
  text-align: center;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
}
.mover-item:hover { color: var(--accent); }
.mover-art-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 6px;
}
.mover-art {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}
.mover-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1.2;
}
.mover-badge--new {
  background: var(--amber);
  color: #000;
}
.mover-badge--up {
  background: var(--green);
  color: #000;
}
.mover-track-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mover-artist-name {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Country page header */
.country-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}
.country-header-flag {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.country-header-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}
.country-header-title .text-accent { font-weight: 700; }
.week-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 2px;
}
.limit-links { margin-top: 4px; }
.limit-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.2s;
}
.limit-links a:hover { color: var(--accent); }
.limit-links .sep { color: var(--text-muted); margin: 0 4px; }

/* Sidebar (country/track pages) */
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li { margin-bottom: 2px; }
.sidebar-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: background 0.2s, color 0.2s;
}
.sidebar-list a:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
}
.sidebar-country-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
@media (min-width: 768px) and (max-width: 1100px) {
  .sidebar-country-name { display: none; }
  .sidebar-list a { justify-content: center; padding: 6px 0; }
  .sidebar-list li { margin-bottom: 2px; }
  .sidebar-flag { width: 42px; height: 42px; }
  .sidebar-card { padding: 10px 6px; }
  .col-md-4.order-md-2 { flex: 0 0 76px; max-width: 76px; }
  .col-md-8.order-md-1 { flex: 1; max-width: calc(100% - 76px); }
}
.sidebar-flag {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* Track page */
.track-hero {
  text-align: center;
  padding: 30px 20px;
}
.track-hero-art {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  margin: 0 auto 20px;
  display: block;
}
.track-hero h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.track-hero .artist-name {
  font-size: 1.2rem;
  display: block;
  margin-bottom: 16px;
}

/* Artist hero */
.artist-hero {
  padding: 30px 20px;
}
.artist-hero-header {
  display: flex;
  align-items: center;
  gap: 20px;
}
.artist-hero-art {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  object-fit: cover;
  flex-shrink: 0;
}
.artist-hero-titles {
  min-width: 0;
}
.top-track-highlight {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(0, 212, 170, 0.06);
  border: 1px solid rgba(0, 212, 170, 0.15);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, border-color 0.2s;
}
.top-track-highlight:hover {
  background: rgba(0, 212, 170, 0.12);
  border-color: rgba(0, 212, 170, 0.3);
}
.top-track-art {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.top-track-info {
  flex: 1;
  min-width: 0;
}
.top-track-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-track-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.top-track-position {
  text-align: center;
  flex-shrink: 0;
}
.top-track-pos-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}
.top-track-pos-country {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}
@media (max-width: 480px) {
  .top-track-highlight { gap: 10px; padding: 10px; }
  .top-track-art { width: 48px; height: 48px; }
  .top-track-pos-value { font-size: 1.1rem; }
}
.artist-stats {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.artist-stat {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.artist-stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.artist-stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.3;
}
.artist-stat-label small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* Track hero header wrapper (transparent in default centered layout) */
.track-hero-header { display: contents; }

/* Track hero — has-video variant (compact, side-by-side) */
.track-hero--has-video .track-hero-header {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 16px;
}
.track-hero--has-video .track-hero-art {
  width: 60px;
  height: 60px;
  margin: 0;
  flex-shrink: 0;
}
.track-hero--has-video .track-hero-titles {
  min-width: 0;
}
.track-hero--has-video .track-hero-titles h2 {
  font-size: 1.3rem;
  margin-bottom: 2px;
}
.track-hero--has-video .track-hero-titles .artist-name {
  font-size: 1rem;
  margin-bottom: 0;
}
.track-hero--has-video {
  padding-top: 12px;
}
.track-hero--has-video .track-hero-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

/* Prev/Next track navigation */
.track-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px 16px;
  gap: 16px;
}
.track-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  transition: border-color 0.2s;
  max-width: 220px;
  text-decoration: none;
}
.track-nav-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.track-nav-art {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.track-nav-info {
  min-width: 0;
}
.track-nav-name,
.track-nav-artist {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.track-nav-name { font-weight: 500; font-size: 0.85rem; }
.track-nav-artist { font-size: 0.8rem; color: var(--text-secondary); }
.track-nav-arrow {
  font-size: 1.5rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Calendar icon (track page) */
time.icon {
  font-size: 1em;
  display: block;
  position: relative;
  width: 7em;
  height: 7em;
  background-color: var(--bg-card-hover);
  margin: 1.5em auto;
  border-radius: 0.6em;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  transform-origin: 50% 10%;
}
time.icon * {
  display: block;
  width: 100%;
  font-size: 1em;
  font-weight: bold;
  font-style: normal;
  text-align: center;
}
time.icon strong {
  position: absolute;
  top: 0;
  padding: 0.4em 0;
  color: var(--bg-primary);
  background-color: var(--accent);
  border-bottom: 1px dashed rgba(0, 0, 0, 0.2);
}
time.icon em {
  position: absolute;
  bottom: 0.1em;
  color: var(--text-muted);
}
time.icon span {
  width: 100%;
  font-size: 2.8em;
  letter-spacing: -0.05em;
  padding-top: 1.0em;
  color: var(--text-primary);
}
.calendar-pos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.1em;
  position: absolute;
  bottom: 0.15em;
  left: 0;
  width: 100%;
  font-size: 2.5em;
  color: var(--text-primary);
  line-height: 1;
}
.calendar-pos i {
  font-size: 0.5em;
  width: auto;
  display: inline-block;
  position: relative;
  top: -0.5em;
}
time.icon:hover, time.icon:focus {
  animation: swing 0.6s ease-out;
}
@keyframes swing {
  0%   { transform: rotate(0deg) skewY(0deg); }
  20%  { transform: rotate(12deg) skewY(4deg); }
  60%  { transform: rotate(-9deg) skewY(-3deg); }
  80%  { transform: rotate(6deg) skewY(-2deg); }
  100% { transform: rotate(0deg) skewY(0deg); }
}

/* History tabs (track page) */
.history-tabs {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.history-tab {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-family: inherit;
}
.history-tab:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}
.history-tab--active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}
.history-tab--active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg-primary);
}

/* Tables (dark) */
.table { color: var(--text-primary); background: transparent; }
.table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  border-top: none;
}
.table td {
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
.table-xs td, .table-xs th {
  padding-top: .2rem !important;
  padding-bottom: .2rem !important;
}
.table a { color: var(--accent); }
.table a:hover { color: var(--accent-hover); }
.table-responsive-wrap { overflow-x: auto; max-width: 100%; }

/* Video container */
.video-container {
  overflow: hidden;
  position: relative;
  width: 100%;
  border-radius: 12px 12px 0 0;
}
.video-container::after {
  padding-top: 56.25%;
  display: block;
  content: '';
}
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Genre/Artist track grid */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.related-card {
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  transition: background 0.2s;
}
.related-card:hover { background: var(--bg-card-hover); }
.related-card-art {
  width: 100%;
  max-width: 120px;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  margin: 0 auto 8px;
}
.related-card-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.related-card-artist {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Genre/Artist track list */
.related-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
}
.related-list-item:last-child { border-bottom: none; }
.related-list-item:hover { background: var(--bg-card-hover); }
.related-list-art {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.related-list-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.related-list-info .related-card-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.related-list-info .related-card-artist {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* iTunes link */
.itunes-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
  padding: 8px 0;
  transition: color 0.2s;
}
.itunes-link:hover { color: var(--accent-hover); }

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s;
  text-decoration: none;
}
.back-link i { font-size: 1.1rem; color: var(--accent); }
.back-link:hover { color: var(--accent); }
.back-link .back-flag {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer a {
  color: var(--text-secondary);
  margin: 0 8px;
}
.site-footer a:hover { color: var(--accent); }

/* Navbar right (search icon + hamburger) */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.navbar-search-icon {
  color: var(--text-secondary) !important;
  font-size: 1.1rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.navbar-search-icon:hover {
  color: var(--accent) !important;
  background: var(--bg-card);
}

/* Settings dropdown */
.navbar-settings {
  position: relative;
}
.navbar-settings-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.navbar-settings-btn:hover {
  color: var(--accent);
  background: var(--bg-card);
}
.settings-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 180px;
  z-index: 1060;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.settings-dropdown.open { display: block; }
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.settings-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* Search page */
.search-input-wrap {
  position: relative;
}
.search-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus {
  border-color: var(--accent);
}
.search-input::placeholder {
  color: var(--text-muted);
}
.search-group-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.search-country-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.search-country-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: border-color 0.2s, background 0.2s;
  white-space: nowrap;
}
.search-country-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-card-hover);
}
.search-country-flag {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}
.search-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.2s;
  color: var(--text-primary);
}
.search-result-row:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.search-result-row--clickable {
  cursor: pointer;
}
.search-result-art {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.search-result-info {
  flex: 1;
  min-width: 0;
}
.search-result-name {
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-artist {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-genre {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.search-empty,
.search-loading {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 20px 0;
}

/* Song page — collapsible country history */
.song-country-history {
  overflow: visible;
  margin-bottom: 20px;
}
.song-country-history:last-child {
  margin-bottom: 0;
}
.song-history-toggle-row {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 0;
}
.song-show-more-btn {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  padding: 4px 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.song-show-more-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Archive — global page */
.archive-country-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  min-width: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}
.archive-country-card:hover {
  border-color: rgba(0, 212, 170, 0.3);
  box-shadow: 0 0 20px rgba(0, 212, 170, 0.05);
  color: inherit;
}
.archive-date-range {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Archive — year tabs */
.archive-year-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.archive-year-tab {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.archive-year-tab:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.archive-year-tab--active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}
.archive-year-tab--active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg-primary);
}

/* Archive — month grid layout */
.archive-months-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.archive-month {
  min-width: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}
.archive-month--empty {
  opacity: 0.35;
}
.archive-month-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Archive — week list */
.archive-weeks {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.archive-week {
  display: block;
  padding: 5px 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-radius: 6px;
}
a.archive-week--has-chart {
  background: none;
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
a.archive-week--has-chart:hover {
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent);
}
a.archive-week--has-chart i {
  margin-right: 4px;
  font-size: 0.75rem;
}
.archive-week-num {
  display: inline-block;
  min-width: 4.2em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 2px;
}

/* Archive responsive */
@media (max-width: 768px) {
  .archive-months-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .archive-year-tab { padding: 5px 12px; font-size: 0.8rem; }
  .archive-month { padding: 10px; }
}
@media (max-width: 480px) {
  .archive-months-grid { grid-template-columns: 1fr; gap: 8px; }
  .archive-country-card { padding: 14px; }
  .archive-month { padding: 10px; }
  .archive-week { font-size: 0.8rem; padding: 4px 8px; }
}

/* World Map */
.world-map-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-primary);
}
.world-map-wrap svg {
  width: 100%;
  height: auto;
  display: block;
  transform-origin: 0 0;
}
.world-map-wrap--dragging svg {
  cursor: grabbing;
}
.world-map-wrap--zoomed svg {
  cursor: grab;
}
.world-map-wrap svg path {
  fill: var(--bg-card-hover);
  stroke: var(--bg-primary);
  stroke-width: 0.5;
  transition: fill 0.2s;
}
.world-map-wrap svg path.map-active,
.world-map-wrap svg g.map-active path {
  fill: rgba(0, 212, 170, 0.25);
  cursor: pointer;
}
.world-map-wrap svg path.map-active:hover,
.world-map-wrap svg g.map-active:hover path {
  fill: rgba(0, 212, 170, 0.5);
}
.world-map-wrap svg path.map-selected,
.world-map-wrap svg g.map-selected path {
  fill: rgba(0, 212, 170, 0.6);
}
.world-map-wrap--compact {
  max-height: 260px;
}
.world-map-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 10;
}
.world-map-tooltip img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}
.map-heading {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 14px;
}
.map-heading i {
  color: var(--accent);
  margin-right: 6px;
}
.map-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.map-heading-row .map-heading {
  margin-bottom: 0;
}
.map-heading-row a {
  font-size: 0.85rem;
  color: var(--accent);
}
.map-heading-row a:hover {
  color: var(--accent-hover);
}
.map-popup {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  width: 240px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 20;
  display: none;
}
.map-popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.map-popup-flag {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.map-popup-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}
.map-popup-leader {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.map-popup-art {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.map-popup-track-info {
  flex: 1;
  min-width: 0;
}
.map-popup-rank {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.map-popup-track {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-popup-artist {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-popup-link {
  display: block;
  text-align: center;
  padding: 6px 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}
.map-popup-link:hover {
  background: var(--accent);
  color: var(--bg-primary);
}
.map-detail {
  display: none;
  margin-top: 10px;
}
.map-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.map-detail-flag {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.map-detail-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}
.map-detail-title .text-accent { font-weight: 700; }
.map-detail-date {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.map-detail-tracks {
  list-style: none;
  padding: 0;
  margin: 0;
}
.map-detail-tracks li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.map-detail-tracks li:first-child { border-top: none; }
.map-detail-pos {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.map-detail-art {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.map-detail-info {
  flex: 1;
  min-width: 0;
}
.map-detail-track-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-detail-artist {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-detail-footer {
  margin-top: 12px;
  text-align: right;
}
.map-detail-footer a {
  font-size: 0.85rem;
  color: var(--accent);
}
.map-detail-footer a:hover { color: var(--accent-hover); }
.map-detail-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 20px 0;
  font-size: 0.9rem;
}
.map-zoom-controls {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
}
.map-zoom-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  padding: 0;
  line-height: 1;
  font-family: inherit;
}
.map-zoom-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.map-zoom-btn--reset {
  font-size: 0.7rem;
  font-weight: 600;
}
.map-attribution {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 10px;
  text-align: right;
}
.map-attribution a {
  color: var(--text-secondary);
}
@media (max-width: 768px) {
  .world-map-wrap--compact { max-height: 200px; }
}
@media (max-width: 480px) {
  .world-map-wrap--compact { max-height: 160px; }
}

/* NEW badge (country chart) */
.badge-new {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  z-index: 1;
  background: var(--amber);
  color: #000;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Track stats (track page hero) */
.track-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.track-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.track-stat i {
  color: var(--accent);
  font-size: 0.8rem;
}

/* Share button */
.share-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  font-family: inherit;
  font-weight: 500;
}
.share-btn:hover {
  color: var(--accent);
  background: var(--bg-card-hover);
}

/* Share toast */
.share-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 2000;
}
.share-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* "This week last year" link */
.last-year-link {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.last-year-link a {
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: color 0.2s;
}
.last-year-link a:hover {
  color: var(--accent);
}
.last-year-link i {
  margin-right: 4px;
  font-size: 0.75rem;
}
.last-year-disabled {
  color: var(--border);
  font-size: 0.82rem;
  cursor: default;
}
.last-year-disabled i {
  margin-right: 4px;
  font-size: 0.75rem;
}
.year-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--bg-primary);
  letter-spacing: 0.03em;
}

/* #1 for X weeks badge */
.badge-number-one {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--amber), #f97316);
  color: #000;
  vertical-align: middle;
  margin-left: 6px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-number-one i {
  font-size: 0.6rem;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, color 0.2s, border-color 0.2s, transform 0.3s;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(10px);
}
.back-to-top--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Utilities */
.m-b-10 { margin-bottom: 10px; }
.m-b-0 { margin-bottom: 0px; }
.m-l-10 { margin-left: 10px; }
.m-t-10 { margin-top: 10px; }
.p-0 { padding: 0px; }
.p-l-10 { padding-left: 10px; }
.p-b-10 { padding-bottom: 10px; }
.p-15 { padding: 15px; }
.hide { display: none; }
.show { display: block; }

/* Responsive — Tablet & below */
@media (max-width: 991px) {
  .navbar-toggler { display: block; }
  .related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .search-country-item { font-size: 0.85rem; padding: 5px 12px; }
}

/* Responsive — Mobile */
@media (max-width: 768px) {
  h1 { font-size: 1.5rem !important; }
  .container {
    width: 100%;
    max-width: none;
    padding: 0 10px;
  }

  /* Navbar */
  .navbar { padding: 0.6rem 0.8rem; }

  /* Hero */
  .hero-title { font-size: 1.4rem; }

  /* Spotlight */
  .spotlight-body { gap: 14px; }
  .spotlight-art { width: 90px; height: 90px; }
  .spotlight-track-name { font-size: 1.1rem; }
  .spotlight-artist-name { font-size: 0.9rem; }
  .spotlight-flag { width: 22px; height: 22px; }

  /* Leaderboard */
  .leaderboard-art { width: 38px; height: 38px; }

  /* Home country grid */
  .country-grid { grid-template-columns: 1fr; gap: 12px; }
  .country-card { padding: 16px; }
  .country-flag { width: 32px; height: 32px; }
  .country-name { font-size: 1rem; }

  /* Country page header */
  .country-header { padding: 16px; gap: 12px; }
  .country-header-flag { width: 44px; height: 44px; }
  .country-header-title { font-size: 1.2rem; }

  /* Track cards */
  .track-position { font-size: 1.2rem; min-width: 32px; }
  .track-album-art { width: 48px; height: 48px; border-radius: 6px; }
  .track-card { padding: 10px 12px; gap: 10px; }
  .track-name { font-size: 0.9rem; }
  .artist-name { font-size: 0.82rem; }
  .genre-name { font-size: 0.78rem; }

  /* Related grid */
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .related-card-art { width: 70px; height: 70px; }
  .related-list-art { width: 40px; height: 40px; }

  /* Artist hero */
  .artist-hero { padding: 20px 16px; }
  .artist-hero-art { width: 90px; height: 90px; }
  .artist-hero-header { gap: 16px; }
  .artist-stats { gap: 8px; margin-top: 16px; padding-top: 16px; }
  .artist-stat { padding: 10px 4px; }
  .artist-stat-value { font-size: 1.2rem; }

  /* Track hero */
  .track-hero { padding: 20px 16px; }
  .track-hero h2 { font-size: 1.2rem; }
  .track-hero .artist-name { font-size: 1rem; }
  .track-hero-art { width: 160px; height: 160px; }
  .track-hero--has-video .track-hero-art { width: 50px; height: 50px; }
  .track-hero--has-video .track-hero-titles h2 { font-size: 1.1rem; }

  /* Track nav */
  .track-nav { padding: 0 12px 12px; gap: 8px; }
  .track-nav-btn { padding: 6px 8px; gap: 8px; }
  .track-nav-art { width: 36px; height: 36px; }
  .track-nav-name, .track-nav-artist { max-width: 90px; }

  /* Cards */
  .card-body { padding: 1rem; }
  .card { border-radius: 10px; }

  /* Search page */
  .search-result-art { width: 40px; height: 40px; }
  .search-country-grid { gap: 6px; }
  .search-country-item { font-size: 0.82rem; padding: 5px 10px; }

  /* Sidebar hidden on mobile (empty col) */
  .sidebar-col-mobile-hide { display: none !important; }

  /* Show more button */
  .song-show-more-btn { padding: 8px 16px; font-size: 0.85rem; }

  /* Tables: horizontal scroll on mobile */
  .table-responsive-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .table { font-size: 0.85rem; }
  .table th { font-size: 0.7rem; }

  /* Calendar icon */
  time.icon { font-size: 0.9em; width: 6.5em; height: 6.5em; }

  /* Footer */
  .site-footer { margin-top: 24px; padding: 16px 0; }
}

/* Responsive — Small phone */
@media (max-width: 480px) {
  .container { padding: 0 6px; }

  /* Hero */
  .hero-title { font-size: 1.2rem; }

  /* Spotlight */
  .spotlight-card { padding: 14px; }
  .spotlight-body { flex-direction: column; text-align: center; gap: 12px; }
  .spotlight-art { width: 100px; height: 100px; }
  .spotlight-track-name { font-size: 1rem; white-space: normal; }
  .spotlight-flags { justify-content: center; }
  .spotlight-count { font-size: 0.8rem; }

  /* Movers */
  .mover-art { width: 64px; height: 64px; }
  .mover-item { width: 84px; }
  .movers-scroll { gap: 10px; }

  /* Country cards */
  .country-card { padding: 14px; }
  .country-card-header { gap: 10px; margin-bottom: 12px; }
  .country-flag { width: 28px; height: 28px; }
  .country-name { font-size: 0.9rem; }
  .country-card-track-art { width: 28px; height: 28px; }
  .country-card-track-name { font-size: 0.8rem; }
  .country-card-track-artist { font-size: 0.75rem; }
  .country-card-link { font-size: 0.8rem; }

  /* Country page header */
  .country-header { padding: 12px; gap: 10px; flex-wrap: wrap; }
  .country-header-flag { width: 36px; height: 36px; }
  .country-header-title { font-size: 1.05rem; }
  .week-info { font-size: 0.8rem; }
  .limit-links a { font-size: 0.78rem; }

  /* Track cards */
  .track-card { padding: 8px 10px; gap: 8px; }
  .track-position { font-size: 1rem; min-width: 28px; }
  .track-album-art { width: 40px; height: 40px; }
  .track-trend { width: 14px; }
  .track-name { font-size: 0.85rem; }

  /* Artist hero */
  .artist-hero-art { width: 70px; height: 70px; }
  .artist-hero-header { gap: 12px; }
  .artist-stats { flex-wrap: wrap; gap: 6px; }
  .artist-stat { flex: 1 1 calc(50% - 6px); min-width: 0; padding: 8px 4px; }
  .artist-stat-value { font-size: 1.1rem; }
  .artist-stat-label { font-size: 0.72rem; }

  /* Track hero */
  .track-hero-art { width: 130px; height: 130px; }
  .track-hero h2 { font-size: 1.05rem; }
  .track-hero .artist-name { font-size: 0.9rem; margin-bottom: 10px; }
  .track-hero--has-video .track-hero-art { width: 44px; height: 44px; }
  .track-hero--has-video .track-hero-header { gap: 12px; }
  .track-hero--has-video .track-hero-titles h2 { font-size: 1rem; }
  .track-hero--has-video .track-hero-titles .artist-name { font-size: 0.85rem; }

  /* Track nav: keep side by side */
  .track-nav { padding: 0 12px 14px; gap: 8px; justify-content: space-between; }
  .track-nav-btn { padding: 10px 12px; gap: 8px; max-width: none; }
  .track-nav-art { display: none !important; }
  .track-nav-name, .track-nav-artist { max-width: 100px; font-size: 0.82rem; }
  .track-nav-arrow { font-size: 1.4rem; }

  /* Related grid */
  .related-card-art { width: 60px; height: 60px; }
  .related-card-name { font-size: 0.78rem; }
  .related-card-artist { font-size: 0.72rem; }
  .related-list-art { width: 36px; height: 36px; }

  /* Cards */
  .card-body { padding: 0.75rem; }
  .card { border-radius: 8px; }

  /* Tables */
  .table { font-size: 0.8rem; }

  /* Calendar */
  time.icon { font-size: 0.8em; width: 6em; height: 6em; }

  /* Sidebar card */
  .sidebar-card { padding: 12px; }
}

@media screen and (max-height: 450px) {
  .sidenav { padding-top: 15px; }
  .sidenav a { font-size: 12px; }
}
