:root {
  --emory-blue: #012169;
  --emory-blue-light: #1a3a7a;
  --emory-blue-dark: #001447;
  --emory-gold: #f2a900;
  --emory-gold-light: #ffc233;
  --emory-gold-muted: #c48900;
  --bg-primary: #f4f6fa;
  --bg-card: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #5a6278;
  --text-muted: #8b93a8;
  --border: #e2e6ef;
  --sidebar-width: 240px;
  --header-height: 64px;
  --shadow-sm: 0 1px 3px rgba(1, 33, 105, 0.08);
  --shadow-md: 0 4px 12px rgba(1, 33, 105, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
}

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

.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--emory-blue-dark) 0%, var(--emory-blue) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.sidebar-brand {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand h1 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.sidebar-brand .subtitle {
  font-size: 0.75rem;
  color: var(--emory-gold);
  font-weight: 500;
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active {
  background: rgba(242, 169, 0, 0.15);
  color: var(--emory-gold-light);
  border-left: 3px solid var(--emory-gold);
  padding-left: calc(0.75rem - 3px);
}

.nav-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-item .icon {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
}

.nav-beta {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--emory-gold);
  color: var(--emory-blue-dark);
  border-radius: 3px;
  padding: 1px 4px;
  vertical-align: middle;
  margin-left: 3px;
  line-height: 1.4;
}

/* Main content */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--emory-blue);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-title span {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.875rem;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.season-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.season-filter label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.season-filter select {
  appearance: none;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--emory-blue);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23012169' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
}

.content {
  flex: 1;
  padding: 1.75rem 2rem 2.5rem;
}

/* Record banner */
.record-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, var(--emory-blue) 0%, var(--emory-blue-light) 100%);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

.record-banner .record {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--emory-gold);
}

.record-banner .record-detail {
  font-size: 0.85rem;
  opacity: 0.85;
}

.record-banner .divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
}

.record-banner .meta {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.35rem;
  margin-bottom: 1rem;
  width: fit-content;
}

.tab {
  padding: 0.5rem 1.25rem;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius-lg) - 4px);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.tab:hover {
  color: var(--emory-blue);
  background: var(--bg-primary);
}

.tab.active {
  background: var(--emory-blue);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* Table */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  white-space: nowrap;
}

table.stats-wide {
  min-width: 1400px;
}

table.stats-practice {
  min-width: 1800px;
}

/* Advanced stats tab — section divider between offensive (cols 3-11) and defensive (cols 12+) */
table.stats-wide .adv-def-divider {
  border-left: 2px solid rgba(0, 56, 101, 0.35);
}

.team-total-row {
  background: rgba(1, 33, 105, 0.06) !important;
  font-weight: 700;
}

.team-total-row td {
  border-top: 2px solid var(--emory-gold);
}

.team-total-label {
  color: var(--emory-blue);
  font-weight: 800;
}

thead {
  background: var(--emory-blue);
  color: #fff;
}

thead th {
  padding: 0.75rem 0.85rem;
  text-align: right;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--emory-gold);
}

thead th.sticky-left {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--emory-blue);
  text-align: left;
}

thead th.sticky-left-2 {
  position: sticky;
  left: 48px;
  z-index: 2;
  background: var(--emory-blue);
  text-align: left;
}

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

tbody tr:hover {
  background: rgba(1, 33, 105, 0.03);
}

tbody tr:nth-child(even) {
  background: rgba(244, 246, 250, 0.6);
}

tbody tr:nth-child(even):hover {
  background: rgba(1, 33, 105, 0.05);
}

tbody td {
  padding: 0.65rem 0.85rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tbody td.sticky-left {
  position: sticky;
  left: 0;
  z-index: 1;
  background: inherit;
  text-align: center;
  font-weight: 700;
  color: var(--emory-blue);
}

tbody td.sticky-left-2 {
  position: sticky;
  left: 48px;
  z-index: 1;
  background: inherit;
  text-align: left;
  font-weight: 600;
  min-width: 160px;
}

tbody tr:nth-child(even) td.sticky-left,
tbody tr:nth-child(even) td.sticky-left-2 {
  background: #f8f9fc;
}

tbody tr:hover td.sticky-left,
tbody tr:hover td.sticky-left-2 {
  background: rgba(1, 33, 105, 0.03);
}

.player-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--emory-blue);
  color: var(--emory-gold);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
}

.stat-highlight {
  font-weight: 700;
  color: var(--emory-blue);
}

.pct-cell {
  color: var(--text-secondary);
}

.table-footer {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

.table-footer a {
  color: var(--emory-blue-light);
}

.table-footer a {
  color: var(--emory-blue-light);
}

/* Round Analysis */
.round-view-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.35rem;
  margin-bottom: 1rem;
  width: fit-content;
}

.round-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.round-controls label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.round-controls select {
  min-width: 320px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: var(--bg-card);
  color: var(--text-primary);
}

.round-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.round-intro {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.round-tab-bar {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.round-view-tab {
  appearance: none;
  border: none;
  background: none;
  padding: 0.55rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.round-view-tab:hover {
  color: var(--emory-blue);
}

.round-view-tab.active {
  color: var(--emory-blue);
  border-bottom-color: var(--emory-gold);
}

.round-player-picker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.round-player-picker select {
  appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235a6278'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  min-width: 180px;
}

.round-player-picker select:focus {
  outline: none;
  border-color: var(--emory-blue);
}

.round-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.round-bubble {
  appearance: none;
  border: 2px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: var(--shadow-sm);
}

.round-bubble:hover {
  border-color: var(--emory-gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.round-bubble.selected {
  border-color: var(--emory-blue);
  background: linear-gradient(135deg, rgba(1, 33, 105, 0.04) 0%, rgba(242, 169, 0, 0.06) 100%);
  box-shadow: var(--shadow-md);
}

.round-bubble-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.round-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--emory-gold-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.round-clock {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.round-bubble-pts-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.round-bubble-pts {
  font-size: 2rem;
  font-weight: 800;
  color: var(--emory-blue);
  line-height: 1;
  margin-bottom: 0;
}

.round-bubble-pts span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

.round-pts-margin {
  font-size: 1.05rem;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

.round-bubble-meta {
  display: flex;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.round-margin.positive {
  color: #1a7f4b;
  font-weight: 700;
}

.round-margin.negative {
  color: #b42318;
  font-weight: 700;
}

.round-bubble-score {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.round-modal-open {
  overflow: hidden;
}

.round-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(10, 25, 47, 0.55);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.round-modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
}

.round-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.round-modal-header h2 {
  font-size: 1.35rem;
  color: var(--emory-blue);
  margin-bottom: 0.2rem;
}

.round-modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.round-modal-close {
  appearance: none;
  border: none;
  background: var(--bg-primary);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.round-modal-close:hover {
  background: var(--emory-blue);
  color: #fff;
}

.round-modal-half {
  padding: 1.25rem 1.5rem;
}

.round-modal-emory {
  background: linear-gradient(180deg, rgba(0, 56, 101, 0.06) 0%, transparent 100%);
}

.round-modal-opponent {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.03) 0%, transparent 100%);
}

.round-modal-team-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.round-modal-emory .round-modal-team-label {
  color: var(--emory-blue);
}

.round-modal-divider {
  height: 1px;
  background: var(--border);
  margin: 0 1.5rem;
}

.round-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.round-stat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.round-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.round-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.round-stat-delta {
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 0.3rem;
  font-variant-numeric: tabular-nums;
}

.round-stat-delta.round-margin:not(.positive):not(.negative) {
  color: var(--text-muted);
  font-weight: 600;
}

.round-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-md);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.round-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.round-detail-header h2 {
  font-size: 1.25rem;
  color: var(--emory-blue);
  margin-bottom: 0.15rem;
}

.round-detail-span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.round-detail-close {
  appearance: none;
  border: none;
  background: var(--bg-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary);
}

.round-detail-close:hover {
  background: var(--emory-blue);
  color: #fff;
}

.round-detail-score {
  font-size: 0.85rem;
  color: var(--emory-gold-muted);
  font-weight: 600;
  margin-bottom: 1rem;
}

.round-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.round-detail-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.round-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.round-detail-table th,
.round-detail-table td {
  padding: 0.45rem 0.6rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.round-detail-table th:first-child,
.round-detail-table td:first-child {
  text-align: left;
}

.round-detail-table thead {
  background: var(--emory-blue);
  color: #fff;
}

.round-loading,
.round-error {
  color: var(--text-secondary);
  padding: 2rem;
  text-align: center;
}

/* ── Player Comparison Page ───────────────────────────────────────────────── */.pcmp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  padding-top: 0.5rem;
}

.pcmp-bubble {
  appearance: none;
  border: 2px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1rem 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pcmp-bubble:hover {
  border-color: var(--emory-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pcmp-bubble:active {
  transform: translateY(0);
}

.pcmp-bubble-num {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--emory-gold-muted);
  letter-spacing: 0.04em;
}

.pcmp-bubble-name {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.pcmp-last {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--emory-blue);
}

.pcmp-first {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.pcmp-bubble-stats {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.pcmp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 0.35rem 0.2rem;
}

.pcmp-stat-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.pcmp-stat-lbl {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.pcmp-bubble-fg {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.pcmp-bubble-gp {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.pcmp-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
  grid-column: 1 / -1;
}

/* ── Player row hover ──────────────────────────────────────────────────────── */
tr.player-row:hover td {
  background: rgba(0, 56, 101, 0.06);
}

tr.player-row:hover .player-name-cell {
  color: var(--emory-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Player Comparison Modal ──────────────────────────────────────────────── */
.cmp-modal-open {
  overflow: hidden;
}

.cmp-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(10, 25, 47, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.cmp-modal {
  width: min(600px, 100%);
  max-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  overflow: hidden;
}

.cmp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.4rem;
  border-bottom: 2px solid var(--emory-blue);
  background: linear-gradient(135deg, rgba(0, 56, 101, 0.08) 0%, transparent 100%);
  flex-shrink: 0;
}

.cmp-player-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--emory-gold-muted);
  margin-right: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.cmp-player-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--emory-blue);
}

.cmp-close {
  appearance: none;
  border: none;
  background: var(--bg-primary);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.cmp-close:hover {
  background: var(--emory-blue);
  color: #fff;
}

.cmp-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  flex-shrink: 0;
}

.cmp-tab {
  appearance: none;
  border: none;
  background: none;
  padding: 0.7rem 1.2rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.cmp-tab:hover {
  color: var(--emory-blue);
}

.cmp-tab.active {
  color: var(--emory-blue);
  border-bottom-color: var(--emory-blue);
}

.cmp-body {
  padding: 1.25rem 1.4rem;
  overflow-y: auto;
  flex: 1;
}

.cmp-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.cmp-table thead th {
  background: var(--emory-blue);
  color: #fff;
  padding: 0.45rem 0.7rem;
  text-align: right;
  font-weight: 700;
  font-size: 0.78rem;
}

.cmp-table thead th:first-child {
  text-align: left;
}

.cmp-table tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}

.cmp-stat-label {
  padding: 0.4rem 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  width: 36%;
}

.cmp-val {
  padding: 0.4rem 0.7rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.cmp-val.cmp-better {
  color: #1a7f4b;
  font-weight: 700;
}

.cmp-val.cmp-worse {
  color: #b42318;
  font-weight: 700;
}

.cmp-single .cmp-val {
  color: var(--text-primary) !important;
  font-weight: 500;
}

.cmp-subtabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.cmp-subtab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.cmp-subtab:hover {
  border-color: var(--emory-blue);
  color: var(--emory-blue);
}

.cmp-subtab.active {
  background: var(--emory-blue);
  border-color: var(--emory-blue);
  color: #fff;
}

.cmp-teammate-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.cmp-teammate-select-wrap label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.cmp-teammate-select-wrap select {
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  background: var(--bg-card);
  color: var(--text-primary);
  flex: 1;
}

.cmp-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-size: 0.9rem;
}

/* ── Opponents tab ─────────────────────────────────────────────────────────── */
.opp-loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.opp-search-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
}

/* ── Opponent filters ────────────────────────────────────────────────────────── */
.opp-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.opp-select,
.opp-input {
  flex: 1 1 130px;
  min-width: 100px;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.84rem;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
}
.opp-select:focus,
.opp-input:focus {
  border-color: var(--emory-blue);
  box-shadow: 0 0 0 3px rgba(0,51,160,0.1);
}

.opp-clear-btn {
  appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.opp-clear-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Results meta */
.opp-results-info {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0 0.15rem;
}
.opp-results-info strong { color: var(--text-primary); }

/* Results table */
.opp-results-wrap {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.opp-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}
.opp-results-table thead th {
  position: sticky;
  top: 0;
  background: var(--emory-blue);
  color: #fff;
  padding: 0.5rem 0.7rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.opp-results-table thead th:nth-child(n+3) { text-align: right; }

.opp-result-row {
  cursor: pointer;
  border-bottom: 1px solid #eef0f4;
  transition: background 0.1s;
}
.opp-result-row:last-child { border-bottom: none; }
.opp-result-row:hover { background: #eef4fb; }
.opp-result-row td { padding: 0.42rem 0.7rem; vertical-align: middle; }

.opp-res-player { display: flex; flex-direction: column; gap: 1px; }
.opp-res-name   { font-weight: 600; color: var(--text-primary); }
.opp-res-team   { font-size: 0.73rem; color: var(--text-muted); }

.opp-div-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.opp-div-D1    { background: #dbeafe; color: #1e40af; }
.opp-div-D3    { background: #d1fae5; color: #065f46; }
.opp-div-Other { background: #f3f4f6; color: #6b7280; }

.opp-res-stat {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--text-primary);
}
.opp-stat-good { color: #16a34a; font-weight: 600; }

.opp-no-results {
  text-align: center;
  padding: 2.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Opponent comparison view ─────────────────────────────────────────────── */
.opp-comparison-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.opp-back-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 0.32rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-primary);
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.opp-back-btn:hover { background: #f0f4f8; border-color: var(--emory-blue); }
.opp-vs-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--emory-blue);
  flex: 1;
}
.opp-player-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}
.opp-player-meta span {
  background: var(--bg-secondary);
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  border: 1px solid var(--border);
}
.opp-cmp-note {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-style: italic;
}
.opp-cmp-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 62vh;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.opp-full-cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.opp-full-cmp-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  padding: 0.55rem 0.6rem;
  border-bottom: 2px solid var(--border);
  z-index: 1;
}
.opp-full-cmp-table thead th.opp-cmp-stat-col {
  text-align: left;
  min-width: 110px;
}
.opp-cmp-sub {
  font-weight: 400;
  font-size: 0.7rem;
  opacity: 0.75;
}
.opp-full-cmp-table tbody td {
  padding: 0.35rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.opp-full-cmp-table tbody td.cmp-stat-label {
  text-align: left;
  color: var(--text-secondary);
}
.opp-cmp-group-header td {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.6rem;
  border-top: 2px solid var(--emory-gold);
}
.opp-full-cmp-table tbody tr:hover td { background: rgba(0,51,160,0.04); }

/* ── Team search autocomplete ─────────────────────────────────────────────── */
.opp-ac-dropdown {
  position: absolute;
  z-index: 200;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.13), 0 2px 6px rgba(0,0,0,0.07);
  list-style: none;
  margin: 0;
  padding: 4px;
  overflow: hidden;
}
.opp-ac-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.48rem 0.7rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s, color 0.1s;
}
.opp-ac-item::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.1s;
}
.opp-ac-item:hover,
.opp-ac-item.opp-ac-active {
  background: rgba(0,51,160,0.07);
  color: var(--emory-blue);
  font-weight: 600;
}
.opp-ac-item:hover::before,
.opp-ac-item.opp-ac-active::before {
  background: var(--emory-blue);
}

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .sidebar-brand h1,
  .sidebar-brand .subtitle,
  .nav-section-label,
  .nav-item span:not(.icon),
  .sidebar-footer {
    display: none;
  }

  .main {
    margin-left: 60px;
  }

  .header {
    padding: 0 1rem;
  }

  .content {
    padding: 1rem;
  }

  .round-stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .round-modal-overlay {
    padding: 1rem;
  }
}

/* ── Lineup Creator ───────────────────────────────────────────────────────── */
.lu-slots-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.lu-slot {
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  padding: 1rem 0.75rem;
  position: relative;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.lu-slot-empty {
  appearance: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 140px;
}

.lu-slot-empty:hover {
  border-color: var(--emory-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.lu-slot-filled {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 140px;
}

.lu-slot-filled:hover {
  border-color: var(--emory-gold-muted);
}

.lu-slot-pos {
  position: absolute;
  top: 0.45rem;
  left: 0.6rem;
  font-size: 0.65rem;
  font-weight: 900;
  color: var(--emory-gold-muted);
  letter-spacing: 0.04em;
}

.lu-slot-icon {
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--emory-blue);
  opacity: 0.5;
  line-height: 1;
}

.lu-slot-hint {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lu-slot-remove {
  appearance: none;
  border: none;
  background: none;
  position: absolute;
  top: 0.3rem;
  right: 0.4rem;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.lu-slot-remove:hover {
  background: #fee2e2;
  color: #b42318;
}

.lu-slot-name {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: center;
}

.lu-slot-last {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--emory-blue);
}

.lu-slot-first {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.lu-slot-num {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--emory-gold-muted);
  margin-top: 0.2rem;
}

.lu-slot-stats-mini {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.6rem;
  width: 100%;
  justify-content: center;
}

.lu-slot-stats-mini span {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 0.25rem 0.3rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
  flex: 1;
}

.lu-slot-stats-mini small {
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-top: 0.1rem;
}

/* Picker */
.lu-picker {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.25rem;
  overflow: hidden;
  animation: fadeIn 0.15s ease;
}

.lu-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1rem;
  background: var(--emory-blue);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.lu-picker-cancel {
  appearance: none;
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lu-picker-list {
  max-height: 220px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0;
}

.lu-picker-item {
  appearance: none;
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  padding: 0.55rem 0.8rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  transition: background 0.1s;
}

.lu-picker-item:hover {
  background: rgba(0, 56, 101, 0.08);
}

.lu-picker-num {
  font-weight: 800;
  color: var(--emory-gold-muted);
  font-size: 0.72rem;
  min-width: 28px;
}

.lu-picker-name {
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.lu-picker-pts {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Stats area */
.lu-stats-area {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.lu-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}

.lu-tab {
  appearance: none;
  border: none;
  background: none;
  padding: 0.7rem 1.2rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.lu-tab:hover { color: var(--emory-blue); }
.lu-tab.active {
  color: var(--emory-blue);
  border-bottom-color: var(--emory-blue);
}

.lu-stats-content {
  padding: 1.25rem 1.4rem;
}

.lu-stats-note {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.lu-stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.lu-stat-tile {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lu-stat-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--emory-blue);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.lu-stat-lbl {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.lu-expand-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 1rem;
  transition: all 0.15s;
}

.lu-expand-btn:hover {
  border-color: var(--emory-blue);
  color: var(--emory-blue);
}

.lu-full-table-wrap {
  overflow-x: auto;
  margin-top: 0.25rem;
}

.lu-full-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  white-space: nowrap;
}

.lu-full-table thead th {
  background: var(--emory-blue);
  color: #fff;
  padding: 0.45rem 0.7rem;
  text-align: right;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

.lu-full-table tbody td {
  padding: 0.5rem 0.7rem;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.lu-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

/* Advanced stats table in lineup creator */
.lu-adv-table thead th {
  text-align: center;
}

.lu-adv-table thead th.lu-adv-stat-col {
  text-align: left;
  min-width: 100px;
}

.lu-adv-table thead th.lu-adv-player-col {
  min-width: 110px;
}

.lu-adv-table tbody td {
  text-align: center;
}

.lu-adv-table tbody td.lu-adv-stat-label {
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-primary);
  cursor: default;
}

.lu-adv-table tbody tr.lu-adv-def-row td {
  border-top: 2px solid var(--emory-gold);
}

.lu-adv-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  padding: 0 0.25rem;
  font-style: italic;
}

/* ── Aggregated advanced stats layout ──────────────────────────────────── */
.lu-agg-legend {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0;
  align-items: center;
}
.lu-agg-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  cursor: default;
}
.lu-agg-derived  { background: rgba(0,51,160,0.12); color: var(--emory-blue); }
.lu-agg-weighted { background: rgba(218,170,0,0.18); color: #8a6a00; }
.lu-agg-sum      { background: rgba(22,127,75,0.12); color: #16a34a; }

.lu-agg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.lu-agg-half { overflow-x: auto; }
.lu-agg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.lu-agg-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.65rem;
  border-bottom: 2px solid var(--emory-blue);
  text-align: left;
}
.lu-agg-table thead th:last-child { text-align: right; }
.lu-agg-table tbody td {
  padding: 0.32rem 0.65rem;
  border-bottom: 1px solid var(--border);
}
.lu-agg-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.lu-agg-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.lu-agg-group td {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.28rem 0.65rem;
  border-top: 2px solid var(--emory-gold);
}
.lu-agg-table tbody tr:hover td { background: rgba(0,51,160,0.03); }

@media (max-width: 700px) {
  .lu-agg-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .lu-slots-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .lu-slots-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─── Player Profile Modal ──────────────────────────────────────────────────── */

.pp-modal-open {
  overflow: hidden;
}

.pp-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(10, 25, 47, 0.65);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.pp-modal {
  width: min(860px, 100%);
  max-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Header */
.pp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.5rem;
  border-bottom: 2px solid var(--emory-blue);
  background: linear-gradient(135deg, rgba(1, 33, 105, 0.07) 0%, transparent 100%);
  flex-shrink: 0;
}

.pp-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pp-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--emory-gold-muted);
  font-variant-numeric: tabular-nums;
}

.pp-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--emory-blue);
}

.pp-season {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.pp-leads {
  font-size: 0.72rem;
  font-weight: 600;
  color: #1a6b3a;
  background: rgba(1, 100, 50, 0.08);
  border: 1px solid rgba(1, 100, 50, 0.22);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.pp-close {
  appearance: none;
  border: none;
  background: var(--bg-primary);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.pp-close:hover {
  background: #eaecf3;
  color: var(--text-primary);
}

/* Hero stat tiles */
.pp-hero-tiles {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
}

.pp-tile {
  flex: 1;
  min-width: 72px;
  padding: 0.8rem 0.5rem;
  text-align: center;
  border-right: 1px solid var(--border);
}

.pp-tile:last-child {
  border-right: none;
}

.pp-tile-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--emory-blue);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.pp-tile-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Tabs */
.pp-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
  flex-shrink: 0;
  background: var(--bg-primary);
}

.pp-tab {
  appearance: none;
  border: none;
  background: none;
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.pp-tab:hover {
  color: var(--emory-blue);
}

.pp-tab.active {
  color: var(--emory-blue);
  border-bottom-color: var(--emory-gold);
}

/* Tab content area */
.pp-tab-content {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Tables */
.pp-table-wrap {
  overflow-x: auto;
  padding: 1rem 1.25rem;
}

.pp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.pp-table thead th {
  padding: 0.45rem 0.55rem;
  background: var(--bg-primary);
  border-bottom: 2px solid var(--emory-blue);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
}

.pp-table thead th.text-left {
  text-align: left;
}

.pp-table tbody td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  color: var(--text-primary);
  white-space: nowrap;
}

.pp-table tbody td.text-left {
  text-align: left;
}

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

.pp-table tbody tr:hover td {
  background: rgba(1, 33, 105, 0.03);
}

.pp-bold {
  font-weight: 700;
  color: var(--emory-blue) !important;
}

.pp-gs {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--emory-blue);
  color: #fff;
  border-radius: 3px;
  padding: 0 3px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1.4;
}

.pp-career-total td {
  background: rgba(1, 33, 105, 0.05) !important;
  font-weight: 700;
  border-top: 2px solid var(--emory-blue) !important;
}

/* Loading / empty states */
.pp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.pp-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--emory-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pp-empty {
  padding: 2.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.pp-error {
  color: #c0392b;
}

/* Clickable player rows */
#stats-body tr.player-row {
  cursor: pointer;
  transition: background 0.12s;
}

#stats-body tr.player-row:hover td {
  background: rgba(1, 33, 105, 0.04);
}

#stats-body tr.player-row:hover .sticky-left,
#stats-body tr.player-row:hover .sticky-left-2 {
  background: rgba(242, 246, 255, 0.97);
}

/* Sortable column headers */
th.sortable-col {
  cursor: pointer;
  user-select: none;
  outline: none;
}

th.sortable-col:focus,
th.sortable-col:active {
  outline: none;
  background: inherit;
  color: inherit;
}

/* ─── AI Analysis ────────────────────────────────────────────────────────────── */

.ai-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(242, 169, 0, 0.08);
  border: 1px solid rgba(242, 169, 0, 0.35);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 1.25rem 1.5rem 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.ai-disclaimer-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: var(--emory-gold);
  color: var(--emory-blue-dark);
  border-radius: 4px;
  padding: 2px 6px;
  margin-top: 1px;
}

.ai-disclaimer strong {
  color: var(--text-primary);
}

.ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  padding: 1.25rem 1.5rem 2rem;
}

.ai-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ai-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem 0.7rem;
  border-bottom: 2px solid var(--emory-blue);
  background: linear-gradient(135deg, rgba(1, 33, 105, 0.05) 0%, transparent 100%);
  flex-wrap: wrap;
}

.ai-card-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--emory-gold-muted);
}

.ai-card-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--emory-blue);
  flex: 1;
}

.ai-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.ai-card-role {
  width: 100%;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--emory-gold-muted);
  padding-top: 0.1rem;
}

.ai-card-body {
  padding: 0.9rem 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.ai-narrative {
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.ai-badges {
  display: flex;
  gap: 0.5rem;
}

.ai-badge {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.ai-badge-best {
  background: rgba(1, 100, 50, 0.08);
  color: #1a6b3a;
  border: 1px solid rgba(1, 100, 50, 0.2);
}

.ai-badge-worst {
  background: rgba(192, 57, 43, 0.07);
  color: #a93226;
  border: 1px solid rgba(192, 57, 43, 0.2);
}

.ai-badge-icon {
  font-size: 0.6rem;
}

.ai-cats {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ai-cat-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.73rem;
}

.ai-cat-name {
  width: 148px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-weight: 500;
}

.ai-cat-row.ai-cat-best .ai-cat-name {
  color: #1a6b3a;
  font-weight: 700;
}

.ai-cat-row.ai-cat-worst .ai-cat-name {
  color: #a93226;
  font-weight: 700;
}

.ai-cat-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ai-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg-primary);
  border-radius: 999px;
  overflow: hidden;
}

.ai-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.ai-bar-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 26px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ai-sources {
  font-size: 0.67rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  border-top: 1px solid var(--border);
  padding-top: 0.45rem;
  margin-top: 0.1rem;
}

.ai-mpg-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg-primary);
  border-radius: var(--radius);
  font-size: 0.78rem;
}

.ai-mpg-label {
  flex: 1;
  color: var(--text-secondary);
  font-weight: 600;
}

.ai-mpg-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--emory-blue);
}

.ai-mpg-up   { font-size: 0.7rem; color: #1a6b3a; font-weight: 700; }
.ai-mpg-down { font-size: 0.7rem; color: #a93226; font-weight: 700; }

.ai-mpg-actual {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.ai-min-note {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-style: italic;
}

.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.ai-error {
  padding: 2rem 1.5rem;
  color: #a93226;
  font-size: 0.85rem;
}

/* ─── Shooting Analysis ──────────────────────────────────────────────────── */

.sa-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sa-banner {
  justify-content: space-between;
  align-items: center;
}

.sa-player-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.sa-picker-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.sa-picker-select {
  appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  padding: 0.35rem 2rem 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.8)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  min-width: 175px;
}

.sa-picker-select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.7);
}

.sa-picker-select option {
  background: var(--emory-blue);
  color: #fff;
}

.sa-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 1.25rem;
}

.sa-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.sa-card-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.sa-card-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}

.sa-chart-wrap {
  position: relative;
  height: 280px;
}
.sa-chart-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  pointer-events: none;
}
.sa-chart-msg[hidden] { display: none; }

.sa-adv-no-data {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  background: #fef9e7;
  border: 1px solid #f0c040;
  border-radius: 8px;
  color: #7a5c00;
  font-size: 0.82rem;
  line-height: 1.5;
}
.sa-adv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.sa-adv-wrap {
  height: 300px;
}

.sa-error {
  color: #c0392b;
  font-size: 0.875rem;
  padding: 0.75rem 1.25rem;
  background: #fdf0ee;
  border-radius: var(--radius);
  border: 1px solid #f5c6c0;
}

/* ── Password gate ─────────────────────────────────────────────────────────── */
#pw-gate {
  position: fixed;
  inset: 0;
  background: var(--emory-blue-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
#pw-gate[hidden] { display: none; }

.pw-box {
  background: #fff;
  border-radius: 14px;
  padding: 2.5rem 2.25rem 2rem;
  width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.pw-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--emory-blue);
  letter-spacing: -0.02em;
}

.pw-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1rem;
}

#pw-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

#pw-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
#pw-input:focus { border-color: var(--emory-blue); }

#pw-form button {
  width: 100%;
  padding: 0.65rem;
  background: var(--emory-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
#pw-form button:hover { background: var(--emory-blue-light); }

#pw-error {
  font-size: 0.78rem;
  color: #c0392b;
  margin-top: 0.25rem;
}
#pw-error[hidden] { display: none; }
