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

:root {
  --bg: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222;
  --accent: #AD0000;
  --accent-dim: rgba(173, 0, 0, 0.15);
  --text: #ffffff;
  --text-muted: #9ca3af;
  --border: #2a2a2a;
  --green-tint: rgba(34, 197, 94, 0.08);
  --red-tint: rgba(239, 68, 68, 0.08);
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius: 6px;
  --transition: 0.18s ease;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { max-width: 100%; display: block; }

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; }
.brand-name {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ── Year Switcher ────────────────────────────────────────── */
.year-switcher {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}
.year-btn {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}
.year-btn.active { background: var(--accent); color: #fff; }

/* ── Tab Nav ──────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  padding: 0 24px;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 10px 20px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }

/* ── Data Notice ──────────────────────────────────────────── */
.data-notice {
  background: rgba(173, 0, 0, 0.12);
  border-bottom: 1px solid rgba(173, 0, 0, 0.25);
  padding: 8px 24px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.data-notice.hidden { display: none; }

/* ── Tab Panels ───────────────────────────────────────────── */
.main-content { padding: 24px; max-width: 1200px; margin: 0 auto; }
.tab-panel { animation: fadeIn 0.2s ease; }
.tab-panel.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
}
.card:hover { background: var(--bg-card-hover); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--accent); }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  color: #fff;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable::after { content: ' ⇅'; opacity: 0.4; font-size: 11px; }
thead th.sort-asc::after { content: ' ↑'; opacity: 1; }
thead th.sort-desc::after { content: ' ↓'; opacity: 1; }
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
tbody tr:hover { background: rgba(255,255,255,0.05); }
tbody tr.win { background: var(--green-tint); }
tbody tr.loss { background: var(--red-tint); }
td { padding: 10px 14px; color: var(--text); }
td.muted { color: var(--text-muted); }

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
}
.modal-title { font-family: var(--font-heading); font-size: 22px; margin-bottom: 12px; }
.modal-body { color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
.modal-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}
.modal-input:focus { border-color: var(--accent); }
.btn-primary {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  letter-spacing: 0.5px;
  transition: opacity var(--transition);
}
.btn-primary:hover { opacity: 0.9; }

/* ── Player Drawer ────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
}
.overlay.hidden { display: none; }
.drawer {
  position: fixed; top: 0; right: 0;
  width: min(480px, 100vw);
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 201;
  overflow-y: auto;
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.drawer.open { transform: translateX(0); }
.drawer.hidden { display: none; }
.drawer-close {
  position: absolute; top: 16px; right: 16px;
  color: var(--text-muted); font-size: 18px; padding: 4px 8px;
}
.drawer-close:hover { color: var(--text); }

/* ── Stat Bar ─────────────────────────────────────────────── */
.stat-bar-wrap { margin-bottom: 16px; }
.stat-bar-label {
  display: flex; justify-content: space-between;
  margin-bottom: 4px; font-size: 12px; color: var(--text-muted);
}
.stat-bar-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.stat-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.5s ease; }

/* ── Error & Loading ──────────────────────────────────────── */
.error-card {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  padding: 20px; text-align: center; color: var(--text-muted);
}
.btn-retry {
  margin-top: 12px; padding: 8px 20px;
  border: 1px solid var(--accent); border-radius: var(--radius);
  color: var(--accent); font-size: 13px; font-weight: 600;
  transition: var(--transition);
}
.btn-retry:hover { background: var(--accent-dim); }
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, #222 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-row { height: 44px; margin-bottom: 2px; }

/* ── Badges ───────────────────────────────────────────────── */
.pos-badge {
  display: inline-block; padding: 2px 8px;
  background: var(--accent-dim); border: 1px solid rgba(173,0,0,0.3);
  border-radius: 4px; font-size: 11px; font-weight: 600;
  color: var(--accent); letter-spacing: 0.5px;
}
.uofl-badge {
  display: inline-block; padding: 2px 8px;
  background: var(--accent); border-radius: 4px;
  font-size: 11px; font-weight: 700; color: #fff; letter-spacing: 0.5px;
}

/* ── Section & Position Headings ──────────────────────────── */
.section-title {
  font-family: var(--font-heading); font-size: 20px; font-weight: 700;
  letter-spacing: 0.5px; margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}
.position-section { margin-bottom: 32px; }
.position-title {
  font-family: var(--font-heading); font-size: 14px; font-weight: 600;
  color: var(--text-muted); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 12px;
}

/* ── Roster position grouping (unit header + per-position subsections) ── */
.position-group { margin-bottom: 40px; }
.position-group-title {
  font-family: var(--font-heading); font-size: 20px; font-weight: 700;
  color: var(--text); margin-bottom: 16px;
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.position-subsection { margin-bottom: 22px; }
.position-subtitle {
  font-family: var(--font-heading); font-size: 13px; font-weight: 600;
  color: var(--text-muted); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 10px;
}
.position-subtitle .count { opacity: 0.6; margin-left: 6px; font-weight: 400; }

/* ── Drawer prev/next navigation ──────────────────────────── */
.drawer-nav { display: flex; align-items: center; gap: 12px; margin: 0 36px 16px 0; }
.drawer-nav-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--transition), color var(--transition);
}
.drawer-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.drawer-nav-pos { font-size: 12px; color: var(--text-muted); letter-spacing: 0.5px; }

/* ── Player headshot (drawer) ─────────────────────────────── */
.player-photo {
  width: 128px; height: 128px;
  object-fit: cover; object-position: top center;
  border-radius: 12px;
  background: linear-gradient(160deg, #2a0d0d, var(--bg));
  border: 1px solid var(--border);
  margin-bottom: 14px; display: block;
}

/* ── Player Cards Grid ────────────────────────────────────── */
.player-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.player-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: 12px; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.player-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); }
.player-card-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.player-card-meta { font-size: 12px; color: var(--text-muted); }

/* ── View Toggle ──────────────────────────────────────────── */
.view-toggle {
  display: flex; gap: 4px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 3px; margin-bottom: 20px; width: fit-content;
}
.view-toggle-btn {
  padding: 5px 16px; border-radius: 4px;
  font-size: 13px; font-weight: 600; color: var(--text-muted); transition: var(--transition);
}
.view-toggle-btn.active { background: var(--accent); color: #fff; }

/* ── Filter Bar ───────────────────────────────────────────── */
.search-input {
  width: 100%;
  max-width: 320px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 13px;
  font-family: var(--font-body);
  font-size: 14px;
  margin-bottom: 20px;
  outline: none;
}
.search-input:focus { border-color: var(--accent); }
.show-more-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
.show-more-bar .filter-btn { padding: 5px 12px; font-size: 12px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn {
  padding: 6px 16px; border: 1px solid var(--border);
  border-radius: 20px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); transition: var(--transition);
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Hero Leader Cards ────────────────────────────────────── */
.leader-heroes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 28px; }
.hero-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-top: 3px solid var(--accent); border-radius: var(--radius);
  padding: 16px; text-align: center;
}
.hero-card-category { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); margin-bottom: 8px; }
.hero-card-name { font-family: var(--font-heading); font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.hero-card-stat { font-family: var(--font-heading); font-size: 28px; font-weight: 700; color: var(--accent); }
.hero-card-sublabel { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; padding: 12px 16px; }
  .brand-name { font-size: 16px; }
  .main-content { padding: 16px; }
  .tab-btn { padding: 10px 12px; font-size: 13px; }
}

/* ── Change API Key button ─────────────────────────────────── */
.change-key-btn {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.change-key-btn:hover { color: var(--text); border-color: var(--accent); }
/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222;
  --accent: #AD0000;
  --accent-dim: rgba(173, 0, 0, 0.15);
  --text: #ffffff;
  --text-muted: #9ca3af;
  --border: #2a2a2a;
  --green-tint: rgba(34, 197, 94, 0.08);
  --red-tint: rgba(239, 68, 68, 0.08);
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius: 6px;
  --transition: 0.18s ease;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { max-width: 100%; display: block; }

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; }
.brand-name {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ── Year Switcher ────────────────────────────────────────── */
.year-switcher {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}
.year-btn {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}
.year-btn.active { background: var(--accent); color: #fff; }

/* ── Tab Nav ──────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  padding: 0 24px;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 10px 20px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }

/* ── Data Notice ──────────────────────────────────────────── */
.data-notice {
  background: rgba(173, 0, 0, 0.12);
  border-bottom: 1px solid rgba(173, 0, 0, 0.25);
  padding: 8px 24px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.data-notice.hidden { display: none; }

/* ── Tab Panels ───────────────────────────────────────────── */
.main-content { padding: 24px; max-width: 1200px; margin: 0 auto; }
.tab-panel { animation: fadeIn 0.2s ease; }
.tab-panel.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
}
.card:hover { background: var(--bg-card-hover); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--accent); }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  color: #fff;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable::after { content: ' ⇅'; opacity: 0.4; font-size: 11px; }
thead th.sort-asc::after { content: ' ↑'; opacity: 1; }
thead th.sort-desc::after { content: ' ↓'; opacity: 1; }
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
tbody tr:hover { background: rgba(255,255,255,0.05); }
tbody tr.win { background: var(--green-tint); }
tbody tr.loss { background: var(--red-tint); }
td { padding: 10px 14px; color: var(--text); }
td.muted { color: var(--text-muted); }

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
}
.modal-title { font-family: var(--font-heading); font-size: 22px; margin-bottom: 12px; }
.modal-body { color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
.modal-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}
.modal-input:focus { border-color: var(--accent); }
.btn-primary {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  letter-spacing: 0.5px;
  transition: opacity var(--transition);
}
.btn-primary:hover { opacity: 0.9; }

/* ── Player Drawer ────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
}
.overlay.hidden { display: none; }
.drawer {
  position: fixed; top: 0; right: 0;
  width: min(480px, 100vw);
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 201;
  overflow-y: auto;
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.drawer.open { transform: translateX(0); }
.drawer.hidden { display: none; }
.drawer-close {
  position: absolute; top: 16px; right: 16px;
  color: var(--text-muted); font-size: 18px; padding: 4px 8px;
}
.drawer-close:hover { color: var(--text); }

/* ── Stat Bar ─────────────────────────────────────────────── */
.stat-bar-wrap { margin-bottom: 16px; }
.stat-bar-label {
  display: flex; justify-content: space-between;
  margin-bottom: 4px; font-size: 12px; color: var(--text-muted);
}
.stat-bar-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.stat-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.5s ease; }

/* ── Error & Loading ──────────────────────────────────────── */
.error-card {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  padding: 20px; text-align: center; color: var(--text-muted);
}
.btn-retry {
  margin-top: 12px; padding: 8px 20px;
  border: 1px solid var(--accent); border-radius: var(--radius);
  color: var(--accent); font-size: 13px; font-weight: 600;
  transition: var(--transition);
}
.btn-retry:hover { background: var(--accent-dim); }
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, #222 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-row { height: 44px; margin-bottom: 2px; }

/* ── Badges ───────────────────────────────────────────────── */
.pos-badge {
  display: inline-block; padding: 2px 8px;
  background: var(--accent-dim); border: 1px solid rgba(173,0,0,0.3);
  border-radius: 4px; font-size: 11px; font-weight: 600;
  color: var(--accent); letter-spacing: 0.5px;
}
.uofl-badge {
  display: inline-block; padding: 2px 8px;
  background: var(--accent); border-radius: 4px;
  font-size: 11px; font-weight: 700; color: #fff; letter-spacing: 0.5px;
}

/* ── Section & Position Headings ──────────────────────────── */
.section-title {
  font-family: var(--font-heading); font-size: 20px; font-weight: 700;
  letter-spacing: 0.5px; margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}
.position-section { margin-bottom: 32px; }
.position-title {
  font-family: var(--font-heading); font-size: 14px; font-weight: 600;
  color: var(--text-muted); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 12px;
}

/* ── Roster position grouping (unit header + per-position subsections) ── */
.position-group { margin-bottom: 40px; }
.position-group-title {
  font-family: var(--font-heading); font-size: 20px; font-weight: 700;
  color: var(--text); margin-bottom: 16px;
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.position-subsection { margin-bottom: 22px; }
.position-subtitle {
  font-family: var(--font-heading); font-size: 13px; font-weight: 600;
  color: var(--text-muted); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 10px;
}
.position-subtitle .count { opacity: 0.6; margin-left: 6px; font-weight: 400; }

/* ── Drawer prev/next navigation ──────────────────────────── */
.drawer-nav { display: flex; align-items: center; gap: 12px; margin: 0 36px 16px 0; }
.drawer-nav-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--transition), color var(--transition);
}
.drawer-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.drawer-nav-pos { font-size: 12px; color: var(--text-muted); letter-spacing: 0.5px; }

/* ── Player headshot (drawer) ─────────────────────────────── */
.player-photo {
  width: 128px; height: 128px;
  object-fit: cover; object-position: top center;
  border-radius: 12px;
  background: linear-gradient(160deg, #2a0d0d, var(--bg));
  border: 1px solid var(--border);
  margin-bottom: 14px; display: block;
}

/* ── Player Cards Grid ────────────────────────────────────── */
.player-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.player-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: 12px; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.player-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); }
.player-card-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.player-card-meta { font-size: 12px; color: var(--text-muted); }

/* ── View Toggle ──────────────────────────────────────────── */
.view-toggle {
  display: flex; gap: 4px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 3px; margin-bottom: 20px; width: fit-content;
}
.view-toggle-btn {
  padding: 5px 16px; border-radius: 4px;
  font-size: 13px; font-weight: 600; color: var(--text-muted); transition: var(--transition);
}
.view-toggle-btn.active { background: var(--accent); color: #fff; }

/* ── Filter Bar ───────────────────────────────────────────── */
.search-input {
  width: 100%;
  max-width: 320px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 13px;
  font-family: var(--font-body);
  font-size: 14px;
  margin-bottom: 20px;
  outline: none;
}
.search-input:focus { border-color: var(--accent); }
.show-more-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
.show-more-bar .filter-btn { padding: 5px 12px; font-size: 12px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn {
  padding: 6px 16px; border: 1px solid var(--border);
  border-radius: 20px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); transition: var(--transition);
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Hero Leader Cards ────────────────────────────────────── */
.leader-heroes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 28px; }
.hero-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-top: 3px solid var(--accent); border-radius: var(--radius);
  padding: 16px; text-align: center;
}
.hero-card-category { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); margin-bottom: 8px; }
.hero-card-name { font-family: var(--font-heading); font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.hero-card-stat { font-family: var(--font-heading); font-size: 28px; font-weight: 700; color: var(--accent); }
.hero-card-sublabel { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; padding: 12px 16px; }
  .brand-name { font-size: 16px; }
  .main-content { padding: 16px; }
  .tab-btn { padding: 10px 12px; font-size: 13px; }
}

/* ── Change API Key button ─────────────────────────────────── */
.change-key-btn {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.change-key-btn:hover { color: var(--text); border-color: var(--accent); }
