:root {
  /* Retro Bowl-ish palette */
  --bg: #0b3b6f;
  --card: rgba(7, 35, 67, 0.85);
  --text: #ffffff;
  --muted: #cfe4ff;
  --accent: #d8b25a; /* gold */
  --border: rgba(255, 255, 255, 0.65);
  --border-soft: rgba(255, 255, 255, 0.18);

  --off: rgba(74, 162, 255, 0.22);
  --def: rgba(255, 92, 92, 0.20);
  --off-strong: rgba(74, 162, 255, 0.70);
  --def-strong: rgba(255, 92, 92, 0.65);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: radial-gradient(1200px 800px at 20% 0%, #0f4f93 0%, var(--bg) 55%) fixed;
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  backdrop-filter: blur(8px);
  position: relative;
}

.info-launch {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
}
.info-launch img {
  width: 22px;
  height: 22px;
  display: block;
}
.info-launch-fallback {
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  color: var(--text);
  text-transform: lowercase;
}

.info-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: block;
  z-index: 1000;
  padding: 0;
  overflow-y: auto;
}
.info-modal {
  width: 100%;
  max-height: none;
  overflow: visible;
  border-radius: 0;
  border: 2px solid var(--border);
  border-top: 0;
  border-left: 0;
  border-right: 0;
  background: rgba(7, 35, 67, 0.98);
}
.info-modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.3);
}
.info-modal-head h3 {
  margin: 0;
  font-size: 16px;
}
.info-modal-body {
  padding: 14px 16px 16px;
}
.info-rules {
  margin-top: 0;
}

h1 { margin: 0 0 12px; font-size: 22px; }
h2 { margin: 18px 0 10px; font-size: 16px; color: var(--muted); font-weight: 600; }
h3 { margin: 18px 0 10px; font-size: 14px; color: var(--text); font-weight: 700; }
p, li { color: var(--muted); }

.tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0 16px;
  flex-wrap: wrap;
}
.tab {
  padding: 8px 12px;
  border-radius: 6px;
  border: 2px solid var(--border);
  color: var(--muted);
  background: rgba(0,0,0,0.18);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.tab.active {
  color: var(--text);
  background: rgba(216, 178, 90, 0.22);
}

.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

select, input[type="text"], input[type="number"] {
  width: 220px;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  outline: none;
}

input::placeholder {
  color: rgba(207, 228, 255, 0.88);
}

select option {
  background: #072f57;
  color: var(--text);
}

button {
  padding: 10px 14px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
button:hover { background: rgba(0,0,0,0.28); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  border: 2px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  background: rgba(0,0,0,0.15);
}
.pill.off { border-color: rgba(40,120,255,0.55); }
.pill.def { border-color: rgba(240,90,90,0.55); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: rgba(0,0,0,0.14);
  margin-bottom: 12px;
}
.toolbar.centered {
  justify-content: center;
}
.toolbar.small {
  padding: 8px;
  gap: 8px;
}
.params-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 920px;
}
.params-grid.two {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 760px;
}
.params-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 980px;
}
.params-grid.five > .const-field,
.params-grid.five > div {
  min-width: 0;
}
.toolbar.small .params-grid {
  gap: 6px;
}
/* Constants JSON editor textarea */
.const-json-textarea {
  width: 100%;
  max-width: 980px;
  font-family: monospace;
  font-size: 0.85rem;
  padding: 8px;
  box-sizing: border-box;
  resize: vertical;
  background: var(--bg-inset, #1a1a1a);
  color: inherit;
  border: 1px solid var(--border, #333);
  border-radius: 4px;
}

/* Tooltip styling for constant fields */
.const-field {
  position: relative;
  min-width: 0;
}
.const-field[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: normal;
  max-width: 260px;
  padding: 6px 10px;
  background: #222;
  color: #eee;
  font-size: 0.75rem;
  line-height: 1.35;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  z-index: 20;
  pointer-events: none;
}

/* Constants grid: sharp-edged inputs; fill cell (override global 220px width) */
.params-grid.five input[type="text"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.12);
  padding: 8px 6px;
  font-size: 0.8rem;
}

.params-spacer {
  /* empty grid cell used as a visual gap column */
  pointer-events: none;
}
.toolbar .left {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}
.toolbar .right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.small select, .small input[type="text"], .small input[type="number"] {
  width: 160px;
  padding: 8px 10px;
}
.small .toggle01 {
  width: 160px;
  padding: 8px 10px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  color: var(--text);
  font-weight: 900;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.35);
  text-align: left;
}
.small .toggle01.on {
  background: rgba(74, 162, 255, 0.35);
  border-color: rgba(74, 162, 255, 0.75);
}
.small .toggle01.off {
  background: rgba(255, 92, 92, 0.22);
  border-color: rgba(255, 92, 92, 0.6);
}
.small .toggle01:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.mini { font-size: 12px; color: var(--muted); }
.danger { color: #ffb4b4; font-weight: 800; }
.ok { color: #b6ffcf; font-weight: 800; }
.loading-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 8px 0;
}
.loading-inline-gif {
  width: 26px;
  height: 26px;
  image-rendering: pixelated;
}
.loading-inline-boot {
  margin-top: 4px;
  margin-bottom: 6px;
}
.btn-off { background: rgba(74, 162, 255, 0.28); }
.btn-def { background: rgba(255, 92, 92, 0.26); }
.btn-off:hover { background: rgba(74, 162, 255, 0.38); }
.btn-def:hover { background: rgba(255, 92, 92, 0.36); }

.block {
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.block .hdr {
  padding: 10px 12px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.hdr.off { background: var(--off); }
.hdr.def { background: var(--def); }
.table-wrap { overflow: auto; border-top: 1px solid var(--border-soft); }
.custom-inline-trc {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}

/* Career Add Year roster: force-fit inside card (no horizontal scroll) */
.career-addyear .table-wrap { overflow-x: hidden; }
.career-addyear .players-table { font-size: 11px; }
.career-addyear .players-table td { padding: 4px 4px; }
.career-addyear .players-table td input,
.career-addyear .players-table td select { height: 26px; padding: 4px 4px; font-size: 11px; }

/* Compact column sizes for Add Year roster so it fits the container */
.career-addyear .players-table col.col-side { width: 44px; }
.career-addyear .players-table col.col-pos { width: 56px; }
.career-addyear .players-table col.col-name { width: 120px; }
.career-addyear .players-table col.col-class { width: 52px; }
.career-addyear .players-table col.col-games { width: 44px; }
.career-addyear .players-table col.col-stat { width: 44px; }
.career-addyear .players-table col.col-stars { width: 64px; }
.career-addyear .players-table col.col-drafted { width: 80px; }
.career-addyear .players-table col.col-action { width: 74px; }

/* Career Tables tab */
.snap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: auto;
}
.snap-table-wrap {
  height: 600px;
}
.snap-table th,
.snap-table td {
  border-bottom: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
  padding: 6px 8px;
  white-space: nowrap;
  text-align: left;
}
.snap-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-weight: 900;
}
.snap-table tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.10);
}
.snap-table .num-col,
.snap-table .num-cell {
  text-align: center;
}
.snap-table .snap-ovr-col {
  font-weight: 900;
}
.snap-table td.snap-ovr-99 {
  color: #cc0000;
  font-weight: 900;
  background: #fff2cc !important;
}
.snap-table .snap-sep-right {
  border-right: 2px solid rgba(255, 255, 255, 0.42) !important;
}
.snap-table .snap-sep-both {
  border-left: 2px solid rgba(255, 255, 255, 0.42) !important;
  border-right: 2px solid rgba(255, 255, 255, 0.42) !important;
}
/* Team column: thin right separator (divider between Team and Year) – All Seasons uses snap-sep-right, others use snap-sep-both */
.snap-table th.snap-sep-right.snap-team-col,
.snap-table td.snap-sep-right.snap-team-col,
.snap-table th.snap-sep-both.snap-team-col,
.snap-table td.snap-sep-both.snap-team-col {
  border-right: 1px solid var(--border-soft) !important;
}
/* Match the Team override with Year's left edge so collapsed borders stay thin. */
.snap-table th.snap-sep-right.snap-year-col,
.snap-table td.snap-sep-right.snap-year-col,
.snap-table th.snap-sep-both.snap-year-col,
.snap-table td.snap-sep-both.snap-year-col {
  border-left: 1px solid var(--border-soft) !important;
}

.snap-table tr.off-row td {
  background: rgba(74, 162, 255, 0.12) !important;
}
.snap-table tr.def-row td {
  background: rgba(255, 92, 92, 0.12) !important;
}
/* Most recent logged season: subtle wash (teams-table-like, no glossy gradient). */
.snap-table tr.snap-row-latest-year td {
  background: rgba(255, 255, 255, 0.14) !important;
}
.snap-table tr.off-row.snap-row-latest-year td {
  background: linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12)), rgba(74, 162, 255, 0.12) !important;
}
.snap-table tr.def-row.snap-row-latest-year td {
  background: linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12)), rgba(255, 92, 92, 0.12) !important;
}
.snap-table tr.off-row.snap-row-latest-year td.snap-ovr-99,
.snap-table tr.def-row.snap-row-latest-year td.snap-ovr-99 {
  background: #fff2ccbb !important;
  color: #cc0000 !important;
}
/* All Players: HOF = induction year; subtle gold tint (no glossy gradient). */
.snap-table tr.off-row.snap-row-hof-inductee-year td {
  background: linear-gradient(rgba(255, 235, 190, 0.22), rgba(255, 235, 190, 0.22)), rgba(74, 162, 255, 0.12) !important;
}
.snap-table tr.def-row.snap-row-hof-inductee-year td {
  background: linear-gradient(rgba(255, 235, 190, 0.22), rgba(255, 235, 190, 0.22)), rgba(255, 92, 92, 0.12) !important;
}
.snap-table tr.off-row.snap-row-hof-inductee-year td.snap-ovr-99,
.snap-table tr.def-row.snap-row-hof-inductee-year td.snap-ovr-99 {
  background: #fff2ccbb !important;
  color: #cc0000 !important;
}
/* Keep 99-overall highlight visible even on tinted OFF/DEF rows. */
.snap-table tr.off-row td.snap-ovr-99,
.snap-table tr.def-row td.snap-ovr-99 {
  background: #fff2ccbb !important;
  color: #cc0000 !important;
}
.snap-table .hof-name {
  color: #d8b25a;
  font-weight: 900;
}
.snap-table .pos-leader {
  font-weight: 900;
}
.snap-table tr.snap-row-clickable td {
  cursor: pointer;
}
.snap-table tr.snap-row-clickable:hover td {
  filter: brightness(0.95);
}

.snap-filter-trigger {
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
}
.snap-filter-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 5;
  min-width: 210px;
  max-width: 320px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(7, 35, 67, 0.98);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.snap-filter-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.snap-filter-row button {
  flex: 1;
  padding: 5px 7px;
  font-size: 11px;
  border-width: 1px;
}
.snap-filter-values {
  max-height: 180px;
  overflow: auto;
  border-top: 1px solid var(--border-soft);
  padding-top: 6px;
}
.snap-filter-value {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  margin: 3px 0;
}

.players-table {
  table-layout: fixed;
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}
.players-table td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.players-table td input, .players-table td select {
  width: 100%;
  min-width: 0;
  padding: 6px 6px;
  height: 28px;
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
  background: rgba(170, 214, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.65);
  color: var(--text);
}
.players-table td input:disabled,
.players-table td select:disabled {
  background: rgba(140, 160, 180, 0.18);
  color: rgba(207, 228, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.35);
  cursor: not-allowed;
}
.players-table td input[readonly] {
  cursor: default;
}
.players-table td.name input { text-align: left; }
.players-table td input::placeholder {
  color: rgba(207, 228, 255, 0.9);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.players-table td select {
  font-weight: 800;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.35);
}
.players-table td.stars select {
  font-size: 10px;
  letter-spacing: 0;
  color: #ddc80a;
  font-weight: 900;
}
.players-table td.drafted select {
  font-size: 11px;
  letter-spacing: 0;
}

/* Fixed column sizes so OFF/DEF rows align identically; Name gets the leftover width.
   Keep these small enough so the whole row fits without horizontal scrolling. */
.players-table col.col-side { width: 56px; }
.players-table col.col-pos { width: 70px; }     /* Position dropdown */
.players-table col.col-class { width: 70px; }   /* FR/SO/JR/SR */
.players-table col.col-games { width: 54px; }
.players-table col.col-stat { width: 60px; }    /* compact numeric stats */
.players-table col.col-stars { width: 90px; }
.players-table col.col-drafted { width: 100px; }
.players-table col.col-action { width: 78px; }
.players-table col.col-name { width: 150px; }
.players-table td button { padding: 6px 8px; font-size: 11px; }

.trc-grid {
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.trc-grid table {
  table-layout: fixed;
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
}
.trc-grid th, .trc-grid td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
  text-align: center;
}
.trc-grid th:last-child, .trc-grid td:last-child { border-right: 0; }
.trc-grid thead th {
  background: rgba(0,0,0,0.25);
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}
.trc-grid .left { text-align: left; }
.trc-grid .title { background: rgba(74, 162, 255, 0.22); color: var(--text); font-weight: 900; }
.trc-grid .title.def { background: rgba(255, 92, 92, 0.20); }
.trc-grid .subhdr { background: rgba(0,0,0,0.18); color: var(--muted); }

.trc-layout {
  display: grid;
  grid-template-columns: 1fr 140px 190px;
  gap: 10px;
  align-items: start;
}
@media (max-width: 1100px) { .trc-layout { grid-template-columns: 1fr; } }

/* Excel-style TRC sheet (matches screenshots/TRC_TABLE.png) */
.trc-excel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

/* TRC: offense/defense season comparison tables flanking summary (Career/League) */
.trc-comparison-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(260px, 1.15fr) minmax(200px, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}
.trc-summary-center {
  min-width: 0;
  display: flex;
  justify-content: center;
  align-self: end;
}
.trc-summary-center .trc-summary {
  margin-bottom: 0;
  width: 100%;
  max-width: 760px;
}
@media (max-width: 1100px) {
  .trc-comparison-row {
    grid-template-columns: 1fr;
  }
}

.trc-comp-panel {
  min-width: 0;
}
.trc-comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}
.trc-comp-table td {
  border: 1px solid #000;
  padding: 4px 6px;
  text-align: center;
  vertical-align: bottom;
}
.trc-comp-table .trc-comp-label {
  text-align: right;
  font-weight: 700;
  width: 30%;
}
.trc-comp-table .trc-comp-val,
.trc-comp-table .trc-comp-rank {
  color: #000;
}
.trc-comp-off .trc-comp-label {
  background: #1f5e8f;
  color: #fff;
  border-right: 2px solid #000;
}
.trc-comp-off .trc-comp-val {
  background: #d9e8f7;
  font-weight: 700;
}
.trc-comp-off .trc-comp-rank {
  background: #d9e8f7;
  font-style: italic;
}
.trc-comp-off .trc-comp-delta {
  background: #e8dfd0;
  font-weight: 700;
}

.trc-comp-def-wrap {
  font-family: ui-monospace, "Cascadia Code", "Courier New", Courier, monospace;
}
.trc-comp-def .trc-comp-label {
  background: #6b1515;
  color: #fff;
  font-weight: 700;
  border-right: 2px solid #000;
}
.trc-comp-def .trc-comp-val {
  background: #f7d6d6;
  font-weight: 700;
}
.trc-comp-def .trc-comp-rank {
  background: #f7d6d6;
  font-style: italic;
}
.trc-comp-def .trc-comp-delta {
  background: #f0e4e4;
  font-weight: 700;
}

.trc-comp-section-divider td {
  border-top: 3px solid #000;
}

.trc-comp-good {
  color: #228b22 !important;
}
.trc-comp-bad {
  color: #e02020 !important;
}
.trc-comp-delta-neutral {
  color: #000;
}

/* PRC/TRC career cards (matches screenshots/prctrc.png) */
.prc-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 680px;
  margin: 0 auto;
}
@media (max-width: 1100px) {
  .prc-board { grid-template-columns: 1fr; }
}
.prc-col-title {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 6px 0 8px;
}
.prc-stack {
  display: grid;
  gap: 10px;
}
.prc-card {
  border-collapse: collapse;
  width: 100%;
  min-width: 280px;
  font-size: 12px;
  table-layout: fixed;
}
.prc-card th,
.prc-card td {
  border: 1px solid rgba(0,0,0,0.28);
  padding: 3px 4px;
  text-align: center;
  white-space: nowrap;
}
.prc-card col.c-side { width: 54px; }
.prc-card col.c-season { width: 46px; }
.prc-card col.c-rk { width: 46px; }

.prc-card.off th.pos,
.prc-card.off th.player,
.prc-card.off td.lbl,
.prc-card.off th.rks { background: #1f5e8f; color: #fff; }
.prc-card.def th.pos,
.prc-card.def th.player,
.prc-card.def td.lbl,
.prc-card.def th.rks { background: #8b1a1a; color: #fff; }

.prc-card th.pos {
  font-size: 27px;
  font-weight: 900;
}
.prc-card th.player {
  text-align: left;
  font-weight: 900;
  font-size: 17px;
  padding-left: 10px;
}
.prc-card th.cls-h { background: #ffe599; color: #000; font-weight: 900; font-size: 18px; }
.prc-card th.cls-h.capt { color: #b8860b; }
.prc-card th.rks { font-weight: 900; }

.prc-card.off td { background: #d9e8f7; color: #000; }
.prc-card.def td { background: #f7d6d6; color: #000; }

/* Class cells should match value-cell fill; only text changes when captain */
.prc-card.off th.cls-h { background: #d9e8f7; color: #000; }
.prc-card.def th.cls-h { background: #f7d6d6; color: #000; }
/* Ensure captain/drafted text colors win over the per-side base color */
.prc-card.off th.cls-h.capt,
.prc-card.def th.cls-h.capt { color: #b8860b !important; }

.prc-card td.lbl {
  text-align: right;
  font-weight: 900;
}
.prc-card.off td.rk { background: #d9e8f7; font-weight: 900; }
.prc-card.def td.rk { background: #f7d6d6; font-weight: 900; }

.prc-card td.pts { font-weight: 900; font-size: 15px; }
.prc-card td.pts.aa { color: #0b5494; font-weight: 900; }
.prc-card td.ovr { font-weight: 900; font-size: 18px; }
.prc-card td.ovr.ovr99 { color: #cc0000; font-weight: 900; background: #fff2cc !important; }

.prc-card.off td.aw { background: #d9e8f7; font-weight: 900; }
.prc-card.def td.aw { background: #f7d6d6; font-weight: 900; }
.prc-card td.aw.mvp { background: #e06666 !important; color: #000; font-weight: 900; }
.prc-card td.aw.poy { background: #f6b26b !important; color: #000; font-weight: 900; }
.prc-card td.aw.roy { background: #93c47d !important; color: #000; font-weight: 900; }
.prc-card td.aw.mip { background: #6fa8dc !important; color: #000; font-weight: 900; }
.prc-card td.lbl.awards { vertical-align: middle; }

/* Make the year row borders more noticeable */
.prc-card tr.year-row td {
  border-top: 2px solid rgba(0,0,0,0.65);
  border-bottom: 2px solid rgba(0,0,0,0.65);
}

/* Bold bottom border for key stat rows */
.prc-card tr.strong-bottom td {
  border-bottom: 2px solid rgba(0,0,0,0.55);
}

/* Most recent season column: darker fill + bold left/right borders */
.prc-card.off td.recent,
.prc-card.off th.cls-h.recent { background: #c7dcf2; }
.prc-card.def td.recent,
.prc-card.def th.cls-h.recent { background: #f2caca; }
.prc-card td.recent,
.prc-card th.recent {
  border-left: 2px solid rgba(0,0,0,0.55);
  border-right: 2px solid rgba(0,0,0,0.55);
}

/* Rks spacer cells under drafted label should match header color */
.prc-card.off td.rk.spacer { background: #1f5e8f; color: #fff; }
.prc-card.def td.rk.spacer { background: #8b1a1a; color: #fff; }

/* Career year selector (centered with prev/next arrows) */
.year-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.year-nav button {
  width: 34px;
  height: 32px;
  padding: 0;
  font-weight: 900;
}
.year-nav select {
  min-width: 120px;
  text-align: center;
  font-weight: 900;
  font-size: 20px;
}

/* Footer filler under Awards */
.prc-card tr.footer td { height: 14px; }
.prc-card.off td.footer-fill { background: #1f5e8f; }
.prc-card.def td.footer-fill { background: #8b1a1a; }
.prc-card.off td.footer-pad { background: #d9e8f7; }
.prc-card.def td.footer-pad { background: #f7d6d6; }

/* Career Square (full-career breakdown per player) */
.csq-container { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.csq-wrap { position: relative; display: inline-block; }
.csq-close {
  position: absolute; top: 1px; right: 1px; z-index: 2;
  width: 18px; height: 18px; border: none; border-radius: 3px;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 13px; line-height: 18px;
  text-align: center; cursor: pointer; padding: 0; display: none;
}
.csq-wrap:hover .csq-close { display: block; }

.csq-card {
  border-collapse: collapse; font-size: 11px; table-layout: fixed;
}
.csq-card th, .csq-card td {
  border: 1px solid rgba(0,0,0,0.28); padding: 1px 3px;
  text-align: center; white-space: nowrap; overflow: hidden;
}
.csq-card col.csq-col-lbl { width: 90px; }
.csq-card col.csq-col-v   { width: 48px; }
.csq-card col.csq-col-r   { width: 24px; }
.csq-card col.csq-col-cv  { width: 68px; }
.csq-card col.csq-col-cr  { width: 24px; }

/* Header */
.csq-card.off th.csq-pos,
.csq-card.off th.csq-name,
.csq-card.off td.csq-lbl  { background: #1f5e8f; color: #fff; }
.csq-card.def th.csq-pos,
.csq-card.def th.csq-name,
.csq-card.def td.csq-lbl  { background: #8b1a1a; color: #fff; }

.csq-card th.csq-pos { font-size: 24px; font-weight: 900; }
.csq-card th.csq-name {
  text-align: left; font-weight: 900; font-size: 14px; padding-left: 8px;
}
.csq-card .csq-hof { color: #ffd700; }
.csq-card .csq-info {
  font-size: 10px; font-weight: 700; margin-left: 10px; opacity: 0.85;
}
.csq-card th.csq-grade {
  font-weight: 900; font-size: 14px;
}
.csq-card.off th.csq-grade { background: #d9e8f7; color: #000; }
.csq-card.def th.csq-grade { background: #f7d6d6; color: #000; }
.csq-card th.csq-grade.csq-capt { color: #b8860b; }
.csq-card th.csq-career-hdr { font-size: 13px; }

/* Body base fills */
.csq-card.off td { background: #d9e8f7; color: #000; }
.csq-card.def td { background: #f7d6d6; color: #000; }

.csq-card td.csq-lbl { text-align: right; font-weight: 900; font-size: 10px; }
.csq-card td.csq-v, .csq-card td.csq-cv { font-weight: 900; text-align: right; }
.csq-card td.csq-r, .csq-card td.csq-cr {
  font-weight: 700; font-size: 9px; text-align: right; opacity: 0.7;
  border-left: none;
}
.csq-card td.csq-v, .csq-card td.csq-cv { border-right: none; }
.csq-card td.csq-text { font-weight: 700; text-align: center; font-size: 10px; }

/* Stat-specific */
.csq-card td.csq-pts { font-weight: 900; font-size: 13px; }
.csq-card td.csq-aa { color: #0b5494; }
.csq-card td.csq-ovr { font-weight: 900; font-size: 16px; }
.csq-card td.csq-ovr.csq-ovr99 { color: #cc0000; background: #fff2cc !important; }

/* Highlighted column */
.csq-card.off td.csq-hi,
.csq-card.off th.csq-grade.csq-hi { background: #c7dcf2; }
.csq-card.def td.csq-hi,
.csq-card.def th.csq-grade.csq-hi { background: #f2caca; }
.csq-card td.csq-v.csq-hi { border-left: 2px solid rgba(0,0,0,0.45); }
.csq-card td.csq-r.csq-hi { border-right: 2px solid rgba(0,0,0,0.45); }
.csq-card td.csq-text.csq-hi,
.csq-card th.csq-hi {
  border-left: 2px solid rgba(0,0,0,0.45);
  border-right: 2px solid rgba(0,0,0,0.45);
}

/* OVR row borders */
.csq-card tr.csq-ovr-row td {
  border-top: 2px solid rgba(0,0,0,0.55);
  border-bottom: 2px solid rgba(0,0,0,0.55);
}
.csq-card tr.csq-strong-bottom td { border-bottom: 2px solid rgba(0,0,0,0.45); }

/* Awards */
.csq-card td.csq-aw { font-weight: 900; font-size: 10px; }
.csq-card td.csq-aw-mvp { background: #e06666 !important; color: #000; }
.csq-card td.csq-aw-poy { background: #f6b26b !important; color: #000; }
.csq-card td.csq-aw-roy { background: #93c47d !important; color: #000; }
.csq-card td.csq-aw-mip { background: #6fa8dc !important; color: #000; }
.csq-card td.csq-bowl { background: #ffe599 !important; color: #000; font-weight: 900; font-size: 9px; }

/* Stars row */
.csq-card td.csq-stars { font-size: 10px; letter-spacing: -0.5px; }

/* Coordinators / text rows */
.csq-card td.csq-coord { font-size: 9px; font-weight: 700; }

/* Footer */
.csq-card tr.csq-footer td { height: 10px; }
.csq-card.off td.csq-footer-fill { background: #1f5e8f; }
.csq-card.def td.csq-footer-fill { background: #8b1a1a; }

@media (max-width: 1100px) { .trc-excel { grid-template-columns: 1fr; } }

.trc-sheet-wrap {
  /* border: 2px solid var(--border); */
  border-radius: 6px;
  overflow: auto;
  background: transparent;
}
.trc-sheet {
  border-collapse: collapse;
  font-size: clamp(10px, 0.82vw, 12px);
  min-width: 860px;
  width: 100%;
}
.trc-sheet th, .trc-sheet td {
  border: 1px solid rgba(0,0,0,0.18);
  padding: 4px 6px;
  text-align: center;
  white-space: nowrap;
}
.trc-sheet .left { text-align: left; }

/* column widths (approx from Excel) */
.trc-sheet col.c-pos { width: 56px; }
.trc-sheet col.c-ovr { width: 46px; }
.trc-sheet col.c-gps { width: 52px; }
.trc-sheet col.c-cord { width: 54px; }
.trc-sheet col.c-name { width: 170px; }
.trc-sheet col.c-aw { width: 58px; }
.trc-sheet col.c-grade { width: 58px; }
.trc-sheet col.c-num { width: 60px; }
.trc-sheet col.c-numwide { width: 72px; }
.trc-sheet col.c-gms { width: 44px; }
.trc-sheet col.c-stars { width: 52px; }

/* header bars */
.trc-sheet .hdr-off th {
  background: #1f5e8f; /* Excel blue */
  color: #ffffff;
  font-weight: 900;
}
.trc-sheet .hdr-def th {
  background: #8b1a1a; /* Excel red */
  color: #ffffff;
  font-weight: 900;
}

/* row fills */
.trc-sheet tr.row-off td { background: #cfe2f3; }
.trc-sheet tr.row-def td { background: #f4cccc; }

/* emphasis */
/* OVR cells: deeper background (match PRC current-year cells) */
.trc-sheet tr.row-off td.ovr { background: #c7dcf2; color: #000; font-weight: 700; }
.trc-sheet tr.row-def td.ovr { background: #f2caca; color: #000; font-weight: 700; }
/* Higher specificity than tr.row-off td.ovr so 99 overall shows red like PRC */
.trc-sheet tr.row-off td.ovr.ovr99,
.trc-sheet tr.row-def td.ovr.ovr99 {
  color: #cc0000 !important;
  font-weight: 900;
  background: #fff2cc !important;
}
.trc-sheet td.ovr.ovr99 { color: #cc0000; font-weight: 900; background: #fff2cc !important; }
.trc-sheet td.aa { color: #0099ff; font-weight: 900; }
.trc-sheet td.name { font-weight: 900; }
.trc-sheet td.name.name-captain { color: #b8860b; font-weight: 900; }

/* Class styling */
.trc-sheet td.cls { font-weight: 900; }
.trc-sheet td.cls.class-fr { color: #1a7f37; font-weight: 900; }
.trc-sheet td.cls.cls-leaving { color: #cc0000; font-weight: 900; }

/* Stars should be gold anywhere they appear */
.trc-sheet td.stars { color: #ddc80a; font-weight: 900; }

/* Bold position codes */
.trc-sheet tr.row-off td:first-child,
.trc-sheet tr.row-def td:first-child { font-weight: 900; }

/* award fills (Excel-like) */
.trc-sheet td.aw.mvp { background: #e06666 !important; color: #000; font-weight: 900; }
.trc-sheet td.aw.poy { background: #f6b26b !important; color: #000; font-weight: 900; }
.trc-sheet td.aw.roy { background: #93c47d !important; color: #000; font-weight: 900; }
.trc-sheet td.aw.mip { background: #6fa8dc !important; color: #000; font-weight: 900; }

/* totals + banners */
/* Aggregation rows: keep these readable (no full-row tint).
   Only the "Total Offense/Defense" label cell keeps the header color. */
.trc-sheet tr.row-off-total td { background: #ffffff; color: #000; font-weight: 900; }
.trc-sheet tr.row-def-total td { background: #ffffff; color: #000; font-weight: 900; }
.trc-sheet td.total-label {
  background: #1f5e8f !important;
  color: #fff !important;
  font-weight: 900;
  text-align: center;
}
.trc-sheet td.total-label.def { background: #8b1a1a !important; color: #fff !important; }

/* Ensure row-level aggregation styling never overrides the header label text color. */
.trc-sheet tr.row-off-total td.total-label { color: #fff !important; }
.trc-sheet tr.row-def-total td.total-label.def { color: #fff !important; }
.trc-sheet tr.row-off-banner td { background: #ffffff; color: #000; font-weight: 900; }
.trc-sheet tr.row-off-banner td.banner {
  background: #ffd966 !important;
  color: #000;
  text-align: center;
}

/* Improve readability: stronger inner gridlines + less washed-out fills */
.trc-sheet th, .trc-sheet td {
  border: 1px solid rgba(0,0,0,0.28);
}
.trc-sheet tr.row-off td { background: #d9e8f7; color: #000; }
.trc-sheet tr.row-def td { background: #f7d6d6; color: #000; }
.trc-sheet tr.row-off td.aa,
.trc-sheet tr.row-def td.aa { color: #0b5394 !important; font-weight: 900; }
.trc-sheet .hdr-off th { border-color: rgba(0,0,0,0.35); }
.trc-sheet .hdr-def th { border-color: rgba(0,0,0,0.35); }

/* Bold horizontal rule under OFF/DEF header rows across full table width */
.trc-sheet tr.hdr-off > th,
.trc-sheet tr.hdr-def > th {
  border-bottom: 2px solid rgba(0,0,0,0.7) !important;
}

/* Bold separator above aggregate rows (Total Offense / Total Defense) */
.trc-sheet tr.row-off-total > td,
.trc-sheet tr.row-def-total > td {
  border-top: 2px solid rgba(0,0,0,0.7) !important;
}
/* Keep full-width aggregate separator even on "blank" cells */
.trc-sheet tr.row-off-total > td.blank,
.trc-sheet tr.row-def-total > td.blank {
  border-top-color: rgba(0,0,0,0.7) !important;
}

/* Strong vertical separators around OVR (col 2), Class (col 7), and Gms (col 13).
   Scope to real header/player rows only; aggregate rows use colspans and can misalign nth-child. */
.trc-sheet tr.hdr-off > *:nth-child(2),
.trc-sheet tr.hdr-off > *:nth-child(7),
.trc-sheet tr.hdr-off > *:nth-child(13),
.trc-sheet tr.hdr-def > *:nth-child(2),
.trc-sheet tr.hdr-def > *:nth-child(7),
.trc-sheet tr.hdr-def > *:nth-child(13),
.trc-sheet tr.row-off > *:nth-child(2),
.trc-sheet tr.row-off > *:nth-child(7),
.trc-sheet tr.row-off > *:nth-child(13),
.trc-sheet tr.row-def > *:nth-child(2),
.trc-sheet tr.row-def > *:nth-child(7),
.trc-sheet tr.row-def > *:nth-child(13) {
  border-left: 2px solid rgba(0,0,0,0.7) !important;
  border-right: 2px solid rgba(0,0,0,0.7) !important;
}

/* Blank cells should blend into the page background */
.trc-sheet td.blank {
  background: transparent !important;
  border-color: transparent !important;
}

/* Metric cells in the Total Offense/Defense rows should be tinted like their sections */
.trc-sheet td.metric.off { background: #d9e8f7 !important; color: #000; }
.trc-sheet td.metric.def { background: #f7d6d6 !important; color: #000; }

@media (max-width: 1180px) {
  .trc-sheet th, .trc-sheet td {
    padding: 3px 4px;
  }
  .trc-sheet col.c-name { width: 140px; }
  .trc-sheet col.c-num { width: 52px; }
  .trc-sheet col.c-numwide { width: 62px; }
}

.ovr-stack.excel .hdr { background: #1f5e8f; color: #fff; }
.statbox.excel .hdr { font-size: 11px; letter-spacing: 0.02em; }

/* Summary blocks under the sheet (requested: OFF / TEAM / DEF left-to-right) */
.trc-summary {
  display: grid;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto 14px;
}
.trc-summary-title {
  text-align: center;
  font-weight: 900;
  font-size: 12px;
  color: var(--text);
  letter-spacing: 0.02em;
}
.trc-summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.trc-summary-row.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 520px;
  margin: 0 auto;
}
.trc-summary-row.one {
  display: flex;
  justify-content: center;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}
.trc-summary-row.one .trc-sum-cell {
  min-width: 220px;
}
.trc-summary-row.overalls {
  grid-template-columns: repeat(3, max-content);
  justify-content: center;
  align-items: center; /* vertically center side cells against larger TEAM value */
  max-width: 680px;
  margin: 0 auto;
}
.trc-summary-row.overalls .trc-sum-cell {
  min-width: 0;
  width: auto; /* keep boxes snug around their values */
}
.trc-summary-row.overalls .trc-sum-cell .val {
  padding: 10px 14px; /* tighter/square-ish box around OVERALL values */
}
.trc-summary-row.overalls .trc-sum-cell.ovr99 {
  background: #fff2cc !important;
}
.trc-summary-row.overalls .trc-sum-cell.ovr99 .val {
  color: #cc0000 !important;
}
.trc-summary-row.points {
  grid-template-columns: repeat(3, max-content);
  justify-content: center;
  align-items: center; /* keep OFF/DEF vertically centered to bigger TEAM middle box */
  max-width: 680px;
  margin: 0 auto;
}
.trc-summary-row.points .trc-sum-cell {
  min-width: 0;
  width: auto; /* snug around value for GPOINTS and RANK rows */
}
.trc-summary-row.points .trc-sum-cell .val {
  padding: 8px 12px;
}
.rank-total-suffix {
  font-size: 0.52em;
  font-weight: 700;
  opacity: 0.9;
}
.trc-summary-row.ranks .trc-sum-cell.small .val { font-size: 16px; }

.trc-sum-cell {
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0,0,0,0.12);
  text-align: center;
}
.trc-sum-cell .val {
  padding: 14px 8px;
  font-weight: 900;
  font-size: 40px;
  line-height: 1;
}
.trc-summary-row .trc-sum-cell.all .val {
  font-size: 52px; /* ~30% larger than OFF/DEF value cells */
}
.trc-sum-cell.off .lbl,
.trc-sum-cell.off { background: rgba(74,162,255,0.18); }
.trc-sum-cell.def .lbl,
.trc-sum-cell.def { background: rgba(255,92,92,0.16); }
.trc-sum-cell.all .lbl,
.trc-sum-cell.all { background: rgba(0,0,0,0.22); }

/* smaller "points" boxes */
.trc-sum-cell.small .val {
  font-size: 30px;
  padding: 10px 8px;
}
.trc-summary-row .trc-sum-cell.all.small .val {
  font-size: 39px; /* keep middle TEAM value ~30% larger on small rows too */
}

.ovr-stack {
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.ovr-stack .hdr {
  background: rgba(0,0,0,0.25);
  padding: 8px 8px;
  text-align: center;
  font-weight: 900;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-soft);
}
.ovr-stack .box {
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 900;
  border-bottom: 1px solid var(--border-soft);
}
.ovr-stack .box.off { background: rgba(74,162,255,0.20); }
.ovr-stack .box.all { background: rgba(0,0,0,0.28); }
.ovr-stack .box.def { background: rgba(255,92,92,0.20); border-bottom: 0; }

.side-stats { display: grid; gap: 10px; }
.statbox {
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0,0,0,0.12);
}
.statbox .hdr {
  padding: 8px 8px;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
  border-bottom: 1px solid var(--border-soft);
}
.statbox.off .hdr { background: rgba(74,162,255,0.22); }
.statbox.def .hdr { background: rgba(255,92,92,0.20); }
.statbox .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.statbox .row > div {
  padding: 8px 8px;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  text-align: center;
  font-weight: 900;
}
.statbox .row > div:nth-child(2n) { border-right: 0; }

.player-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 1200px) { .player-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .player-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pc {
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.pc .top {
  padding: 10px 10px;
  font-weight: 900;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.pc.off .top { background: var(--off-strong); }
.pc.def .top { background: var(--def-strong); }
.pc .body { padding: 10px 10px; font-size: 12px; color: var(--muted); }
.pc .kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}
.pc .kv div strong { color: var(--text); }

/* Analytics tab (Career / League) */
.analytics-wrap {
  margin-bottom: 14px;
}
.analytics-year-slider {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: rgba(7, 35, 67, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.analytics-year-slider-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 10px;
}
.analytics-year-slider-title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.analytics-year-slider-readout {
  font-size: 13px;
  font-weight: 900;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.analytics-year-slider-track-wrap {
  position: relative;
  height: 36px;
  margin: 0 4px;
}
.analytics-year-slider-input {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 8px;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.analytics-year-slider-start {
  z-index: 1;
}
.analytics-year-slider-end {
  z-index: 2;
}
.analytics-year-slider-input::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(255, 255, 255, 0.06));
  border: 1px solid var(--border-soft);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}
.analytics-year-slider-input::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(255, 255, 255, 0.06));
  border: 1px solid var(--border-soft);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}
.analytics-year-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 18px;
  height: 20px;
  margin-top: -7px;
  border-radius: 4px;
  border: 2px solid rgba(0, 0, 0, 0.45);
  background: var(--accent);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: grab;
}
.analytics-year-slider-input::-moz-range-thumb {
  pointer-events: auto;
  width: 18px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid rgba(0, 0, 0, 0.45);
  background: var(--accent);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: grab;
}
.analytics-year-slider-input:active::-webkit-slider-thumb {
  cursor: grabbing;
}
.analytics-year-slider-input:active::-moz-range-thumb {
  cursor: grabbing;
}
.analytics-chart {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin-bottom: 14px;
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.12);
}
.analytics-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 280px;
}
.analytics-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 4;
  min-width: 140px;
  max-width: 220px;
  padding: 8px 10px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: rgba(7, 35, 67, 0.98);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  font-size: 11px;
  color: var(--text);
}
.analytics-tooltip-year {
  font-weight: 900;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--accent);
}
.analytics-tooltip-user {
  font-weight: 800;
  margin-bottom: 2px;
  color: var(--muted);
}
.analytics-tooltip-stat {
  color: var(--muted);
  margin-bottom: 2px;
}
.analytics-tooltip-val {
  font-weight: 900;
  font-size: 16px;
}
.analytics-tooltip-player {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-soft);
  font-weight: 800;
  font-size: 11px;
  color: var(--muted);
}
.analytics-user-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
}
.analytics-user-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}
.analytics-user-item input {
  width: auto;
  accent-color: #4aa2ff;
  cursor: pointer;
}
.analytics-clusters {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.analytics-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.analytics-row > .analytics-cluster {
  flex: 1;
  min-width: 0;
}
.analytics-cluster-center {
  text-align: center;
}
.analytics-cluster-center .analytics-cluster-btns {
  justify-content: center;
}
.analytics-cluster-right {
  text-align: right;
}
.analytics-cluster-right .analytics-cluster-btns {
  justify-content: flex-end;
}
.analytics-cluster-label {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}
.analytics-cluster-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.analytics-cluster-main-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  width: 100%;
}
.analytics-cluster-main-row .analytics-cluster-btns {
  flex: 1 1 auto;
  min-width: 0;
}
.analytics-rank-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 14px 18px;
  margin-left: auto;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.analytics-rank-badges--visible {
  opacity: 1;
  transform: translateY(0);
}
.analytics-rank-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 52px;
}
.analytics-rank-badge-cat {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 2px;
}
.analytics-rank-badge-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  opacity: 0.85;
  margin-bottom: 2px;
}
.analytics-rank-badge-val {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.1;
}
.analytics-rank-badge-team .analytics-rank-badge-val {
  color: rgba(224, 232, 240, 0.95);
}
.analytics-rank-badge-off .analytics-rank-badge-val {
  color: #7fd0ff;
}
.analytics-rank-badge-def .analytics-rank-badge-val {
  color: #ff8c8c;
}
.analytics-btn {
  padding: 8px 12px;
  border-radius: 6px;
  border: 2px solid var(--border);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.18);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.analytics-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.28);
}
.analytics-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.analytics-btn.active {
  color: var(--text);
  border-width: 2px;
}
.analytics-btn-team.active {
  background: rgba(224, 232, 240, 0.35);
  border-color: rgba(224, 232, 240, 0.85);
}
.analytics-btn-off.active {
  background: rgba(74, 162, 255, 0.35);
  border-color: rgba(74, 162, 255, 0.85);
}
.analytics-btn-def.active {
  background: rgba(255, 92, 92, 0.3);
  border-color: rgba(255, 92, 92, 0.75);
}
.analytics-btn-award.active {
  background: rgba(216, 178, 90, 0.22);
  border-color: rgba(216, 178, 90, 0.65);
}

