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

:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #e0e0e0;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* === Header / Nav === */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
}

.nav-links a {
  display: block;
  padding: 6px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover {
  background: var(--bg);
  color: var(--text);
}

/* === Footer === */
.site-footer {
  margin-top: 48px;
  padding: 24px 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* === Landing Page === */
.landing {
  text-align: center;
  padding: 48px 0 24px;
}

.landing h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.landing p {
  color: var(--text-muted);
  margin-bottom: 32px;
}

.position-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.position-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.position-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.position-card .abbr {
  font-size: 1.5rem;
  font-weight: 700;
}

.position-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* === Position Page === */
.position-page {
  padding: 32px 0 0;
}

.position-page h1 {
  font-size: 1.6rem;
  margin-bottom: 16px;
}

/* === Scoring Tabs === */
.scoring-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
}

.tab {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

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

.tab.active {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

/* === Tier Rows === */
.tier-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  margin-bottom: 12px;
  align-items: start;
}

.tier-label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 68px;
}

.tier-players {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.player-rank {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.75rem;
  min-width: 18px;
}

.player-name {
  font-weight: 600;
}

.player-team {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* === Tier Colors (green → yellow → orange → red) === */
.tier-color-1  { background: #2e7d32; }
.tier-color-2  { background: #388e3c; }
.tier-color-3  { background: #558b2f; }
.tier-color-4  { background: #9e9d24; }
.tier-color-5  { background: #f9a825; }
.tier-color-6  { background: #ff8f00; }
.tier-color-7  { background: #ef6c00; }
.tier-color-8  { background: #e65100; }
.tier-color-9  { background: #d84315; }
.tier-color-10 { background: #c62828; }
.tier-color-11 { background: #b71c1c; }
.tier-color-12 { background: #880e4f; }

/* === Meta === */
.last-updated {
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* === Responsive === */
@media (max-width: 600px) {
  .nav-bar {
    flex-direction: column;
    height: auto;
    padding: 12px 0;
    gap: 8px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .tier-row {
    grid-template-columns: 1fr;
  }

  .tier-label {
    position: static;
    width: 100%;
  }

  .scoring-tabs {
    flex-wrap: wrap;
  }

  .landing h1 {
    font-size: 1.5rem;
  }
}
