/* ── Reset & Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #fcfcfd;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --purple: #7c3aed;
  --purple-bg: #ede8ff;
  --text: #111827;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --radius: 12px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.nav-logo-icon {
  font-size: 1.25rem;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.nav-page {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-right {
  display: flex;
  align-items: center;
}

.nav-bright {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.nav-bright strong {
  color: var(--accent);
  font-weight: 600;
}

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

/* ── Main ── */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 56px 0 40px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--purple-bg);
  color: var(--purple);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.hero-badge-icon {
  font-size: 0.875rem;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Stats Bar ── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 20px 24px;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

/* ── Controls ── */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.sort-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sort-btn {
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.sort-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sort-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.search-input {
  font-family: var(--font);
  font-size: 0.875rem;
  padding: 9px 14px 9px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  width: 240px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ── Table ── */
.table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.fight-table {
  width: 100%;
  border-collapse: collapse;
}

.fight-table thead {
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
}

.fight-table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
}

.th-rank {
  width: 48px;
  text-align: center;
}

.th-views,
.th-likes,
.th-comments {
  text-align: right;
}

.th-date {
  text-align: right;
}

.fight-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.fight-table tbody tr:last-child {
  border-bottom: none;
}

.fight-table tbody tr:hover {
  background: #f9fafb;
}

.fight-table td {
  padding: 12px 16px;
  font-size: 0.875rem;
  vertical-align: middle;
}

/* Rank */
.td-rank {
  text-align: center;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.td-rank.top-3 {
  color: var(--accent);
  font-size: 0.9375rem;
}

/* Fight cell */
.fight-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fight-thumb {
  width: 96px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f4f6;
  flex-shrink: 0;
}

.fight-info {
  min-width: 0;
}

.fight-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fight-title a {
  transition: color 0.15s;
}

.fight-title a:hover {
  color: var(--accent);
}

.fight-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}

.fight-duration {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.fight-season {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--purple);
  background: var(--purple-bg);
  padding: 2px 8px;
  border-radius: 100px;
}

/* Metric cells */
.td-metric {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.td-metric.views {
  color: var(--text);
}

.td-metric.likes {
  color: var(--text-secondary);
}

.td-metric.comments {
  color: var(--text-secondary);
}

.td-date {
  text-align: right;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Empty state */
.empty-state {
  padding: 64px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 32px 24px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

.footer a {
  color: var(--accent);
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .hero-sub {
    font-size: 0.9375rem;
  }

  .stats-bar {
    grid-template-columns: 1fr;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .sort-buttons {
    justify-content: center;
  }

  .search-input {
    width: 100%;
  }

  .fight-thumb {
    width: 72px;
    height: 40px;
  }

  .th-likes,
  .td-metric.likes,
  .th-comments,
  .td-metric.comments,
  .th-date,
  .td-date {
    display: none;
  }
}

@media (max-width: 480px) {
  .nav-inner {
    padding: 0 16px;
  }

  .main {
    padding: 0 16px 64px;
  }

  .fight-thumb {
    width: 56px;
    height: 32px;
    border-radius: 6px;
  }

  .fight-cell {
    gap: 10px;
  }

  .fight-title {
    font-size: 0.8125rem;
  }
}
