:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #1c2128;
  --text-muted: #57606a;
  --accent: #0d6b4f;
  --accent-soft: #e6f4ef;
  --success: #1a7f37;
  --failure: #cf222e;
  --pending: #9a6700;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #161b22;
    --border: #30363d;
    --text: #e6edf3;
    --text-muted: #9198a1;
    --accent: #3fb28f;
    --accent-soft: #10261f;
    --success: #3fb950;
    --failure: #f85149;
    --pending: #d29922;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

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

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

a:hover {
  text-decoration: underline;
}

code {
  background: var(--accent-soft);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-emoji {
  font-size: 2rem;
  line-height: 1;
}

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

.tagline {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.header-links {
  display: flex;
  gap: 18px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Main layout */

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1rem;
  font-weight: 600;
}

.stat-value a {
  color: inherit;
}

.error-banner {
  background: var(--accent-soft);
  border: 1px solid var(--failure);
  color: var(--failure);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

/* Tabs */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.panel-hint {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0 0 14px;
}

/* Lists */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}

.list-item .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rank {
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
}

.list-item .item-main {
  flex: 1;
  min-width: 0;
}

.list-item .item-title {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item .item-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.badge-success {
  background: var(--accent-soft);
  color: var(--success);
}

.badge-failure {
  background: rgba(207, 34, 46, 0.12);
  color: var(--failure);
}

.badge-pending {
  background: rgba(154, 103, 0, 0.12);
  color: var(--pending);
}

.badge-neutral {
  background: var(--accent-soft);
  color: var(--text-muted);
}

.download-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.download-links a {
  background: var(--accent);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.download-links a:hover {
  text-decoration: none;
  opacity: 0.9;
}

.empty-state,
.error-row {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 20px;
  text-align: center;
}

/* Skeletons */

.skeleton,
.skeleton-row {
  background: linear-gradient(90deg, var(--border) 25%, var(--accent-soft) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
  color: transparent !important;
}

.skeleton-row {
  height: 52px;
  list-style: none;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Footer */

.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}
