body,
html {
  margin: 0;
  padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  height: 100%;
  background-color: #f5f5f5;
}

.container {
  display: grid;
  grid-template-columns: clamp(180px, 15vw, 240px) 1fr;
  gap: 5px;
  padding: 5px;
  min-height: 100vh;
  height: 100%;
  box-sizing: border-box;
}

:root {
  --color-bg-main: #ffffff;
  --color-bg-sidebar: #eaeaea;
  --color-border: #d0d0d0;
  --color-text: #111111;
  --color-text-muted: #555555;
  --color-hover: rgba(144, 0, 0, 0.08);
  --color-accent: #900;
}

.left-section {
  background-color: var(--color-bg-sidebar);
  color: var(--color-text);
  border-radius: 12px;
  padding: 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-border);
  position: relative;
}

.nav-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  margin: 12px 4px 6px;
  color: var(--color-text-muted);
  text-align: center;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li a {
  display: block;
  padding: 3px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.75rem;
  transition: background 0.2s ease;
}

.nav-list li a:hover,
.nav-list li a:focus {
  background: var(--color-hover);
  outline: none;
}

.nav-list li a.active {
  border-left: 4px solid var(--color-accent);
  background: rgba(144, 0, 0, 0.08);
  color: #5f0000;
  font-weight: 600;
}

.nav-group + .nav-group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.flyout-heading {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  color: #666;
  margin: 8px 0 4px;
  cursor: default;
  pointer-events: none;
}

.has-flyout {
  position: relative;
}

.flyout {
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 10px;
  width: 300px;
  max-height: 70vh;
  background: #fff;
  color: #111;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding: 10px;
  overflow: auto;
  display: none;
  z-index: 1000;
}

.has-flyout:hover .flyout,
.has-flyout:focus-within .flyout {
  display: block;
}

.flyout-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}

.flyout-list a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.flyout-list a:hover,
.flyout-list a:focus {
  background: #f3f4f6;
  outline: none;
}

.left-section nav::-webkit-scrollbar {
  width: 6px;
}

.left-section nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.left-section nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.right-section {
  background: var(--color-bg-main);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 12px;
}

.page-title h1 {
  margin: 0;
  font-size: 28px;
}

.page-title p {
  margin: 4px 0 0;
  color: #666;
}

.page-intro {
  margin-bottom: 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(to right, #d62e2e, #111827);
  color: #e5e7eb;
}

.page-tagline {
  margin: 0 0 6px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.page-sponsor-note {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.9;
}

.sponsor-label {
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  margin-right: 4px;
}

.tab-holder {
  padding: 0;
}

.stat-button-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  padding: 8px;
  margin: 0;
  background-color: #f3f3f3;
  border-radius: 12px;
}

.stat-button-container .tab {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  text-align: center;
  color: #888;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.stat-button-container .tab:hover {
  color: #333;
  background-color: rgba(255, 255, 255, 0.55);
}

.stat-button-container .tab.active {
  background-color: #900;
  color: #fff;
  box-shadow: 0 4px 12px rgba(144, 0, 0, 0.3);
}

.stat-button-container .tab:active {
  transform: scale(0.98);
}

.stats_holder {
  width: 100%;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
}

.table_container {
  box-sizing: border-box;
  background-color: #ffffff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  overflow-x: auto;
}

.stats_table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  color: #333;
  border: 1px solid #e0e0e0;
  min-width: 560px;
}

.stats_table thead th {
  background-color: #1a1a1a;
  color: #ffffff;
  padding: 12px 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #900;
}

.stats_table thead tr:last-child th {
  background-color: #2d2d2d;
  font-size: 0.72rem;
  border-bottom: 1px solid #444;
}

.stats_table tbody td {
  padding: 9px 8px;
  border-bottom: 1px solid #eee;
  text-align: center;
  vertical-align: middle;
}

.stats_table tbody tr:nth-child(even) {
  background-color: #fcfcfc;
}

.stats_table tbody tr:hover {
  background-color: #fff9e6;
  transition: background-color 0.2s ease;
}

.stats_table tbody td:nth-child(2) {
  text-align: left;
}

.empty-state {
  color: #666;
  font-style: italic;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
}

.player-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.team-link {
  color: #2563eb;
  text-decoration: none;
}

.player-link:hover,
.team-link:hover {
  text-decoration: underline;
}

.player-name-cell {
  min-width: 160px;
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.team-logo {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.overall-elite {
  color: #2e7d32;
  font-weight: 700;
}

.overall-solid {
  color: #a56a00;
  font-weight: 700;
}

.overall-needs-help {
  color: #b91c1c;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .container {
    grid-template-columns: 1fr;
  }

  .right-section,
  .left-section {
    border-radius: 10px;
  }

  .page-title h1 {
    font-size: 22px;
  }

  .stats_table {
    min-width: 520px;
  }
}
