:root {
  --bg: #0e0f13;
  --surface: #15171d;
  --surface-2: #1c1f26;
  --border: rgba(255, 255, 255, 0.07);
  --text: #e8e9ec;
  --muted: #9aa0ab;
  --accent: #e5a00d;
  --accent-soft: rgba(229, 160, 13, 0.14);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--muted); text-decoration: none; }
a:hover { color: var(--accent); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* --- Top bar --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(14, 15, 19, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.brand strong { font-weight: 700; color: var(--accent); }
.brand-mark {
  width: 12px;
  height: 22px;
  border-radius: 3px;
  background: linear-gradient(160deg, var(--accent), #f9be3c);
  display: inline-block;
}
.range-nav { display: flex; gap: 8px; }
.pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  transition: all 0.15s ease;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* --- Summary --- */
.summary {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  margin: 32px 0 8px;
  padding: 24px 32px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-size: 32px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.stat-divider { width: 1px; height: 40px; background: var(--border); }
.summary-note { margin: 0 0 0 auto; color: var(--muted); font-size: 14px; }

/* --- Sections --- */
section { margin-top: 40px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-head h2 { margin: 0; font-size: 20px; font-weight: 650; }
.count {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

/* --- Poster grid --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 22px;
}
.card { transition: transform 0.18s ease; }
.card:hover { transform: translateY(-4px); }
.poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.card:hover .poster img { transform: scale(1.04); }
.poster-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 700;
  color: var(--muted);
  background: linear-gradient(135deg, var(--surface-2), #23262f);
}
.badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(10, 10, 12, 0.78);
  backdrop-filter: blur(6px);
  color: var(--text);
}
.badge-count {
  left: auto;
  right: 8px;
  top: 8px;
  bottom: auto;
  background: var(--accent);
  color: #171204;
}
.card-body { padding: 10px 2px 0; }
.card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-meta {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- States --- */
.error-banner {
  margin-top: 32px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(229, 83, 75, 0.4);
  background: rgba(229, 83, 75, 0.1);
  color: #f2a9a4;
  font-size: 14px;
}
.empty {
  text-align: center;
  padding: 90px 20px;
  color: var(--muted);
}
.empty h2 { color: var(--text); margin: 0 0 8px; font-size: 24px; }
.empty p { margin: 0; }

/* --- Footer --- */
.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 64px;
  padding: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
  .summary { gap: 18px; padding: 18px 20px; }
  .stat-num { font-size: 24px; }
  .summary-note { margin-left: 0; width: 100%; }
  .stat-divider { display: none; }
}
