:root { color-scheme: dark; }
* { box-sizing: border-box; }
/* No rubber-band bounce past the top/bottom edges: the banner's horizontal gradient
   can't be continued into that area seamlessly, so don't expose it at all. */
html { overscroll-behavior-y: none; }
body { margin: 0; background: #22252c; color: #e6edf3; font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

.toggle-bar {
  display: inline-flex; align-items: center;
  background: linear-gradient(90deg, #4a3a0f, #8a6a1a);
  color: #f3dba0;
  font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.5rem 1rem; cursor: pointer;
  border: 1px solid #5c4812; border-radius: 999px;
}
.toggle-bar:hover { filter: brightness(1.15); color: #fff; }
.toggle-bar .arrow { display: inline-block; margin-left: 0.5rem; transition: transform 0.3s ease; }
.toggle-bar.open .arrow { transform: rotate(180deg); }

.bracket-panel { height: 0; overflow: hidden; transition: height 0.45s cubic-bezier(0.4, 0, 0.2, 1); }
.bracket-panel-inner { padding-top: 0.4rem; }

/* Bracket heading row; its compact Show/Hide button only appears on narrow screens. */
.bracket-head { display: flex; align-items: center; gap: 0.7rem; margin: 0 0 0.8rem; }
.bracket-head h2.section { margin: 0; }
body:not(.bracket-open) .bracket-head { display: none; }
/* Small pill buttons: the rankings page's compact bracket Show/Hide (narrow screens only)
   and the team page's National/Conference switch. */
.toggle-mini, .scope-toggle {
  display: none; align-items: center; gap: 0.3rem; cursor: pointer;
  background: transparent; color: #e8b84b; border: 1px solid #5c4812; border-radius: 999px;
  padding: 0.15rem 0.6rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.toggle-mini:hover, .scope-toggle:hover { border-color: #c9962c; color: #fff; }
.scope-toggle { display: inline-flex; }
.scope-toggle[hidden] { display: none; }
.scope-toggle:focus-visible { outline: 2px solid #c9962c; outline-offset: 2px; }
.toggle-mini .arrow { display: inline-block; transition: transform 0.3s ease; }
.toggle-mini.open .arrow { transform: rotate(180deg); }
/* Too narrow for the title and the full button side by side: swap to the compact one. */
@media (max-width: 720px) {
  .page-head .toggle-bar { display: none; }
  .toggle-mini { display: inline-flex; }
  body:not(.bracket-open) .bracket-head { display: flex; margin-bottom: 1.8rem; }
  .bracket-head h2.section { letter-spacing: 0.08em; white-space: nowrap; }
}

/* Site header: the same floating, pinned bar on every page. */
.site-nav { position: sticky; top: 0.6rem; z-index: 10; padding: 0.6rem 1.5rem 0; }
.nav-inner {
  max-width: 1200px; height: 52px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-radius: 999px; background: rgba(27, 30, 38, 0.85); backdrop-filter: blur(10px);
  border: 1px solid #3a3f4b; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.site-nav a { color: inherit; text-decoration: none; }
.wordmark { white-space: nowrap; display: inline-flex; align-items: center; gap: 0.5rem; }
.wm-icon { width: 22px; height: 22px; color: #c9962c; flex-shrink: 0; }
.wm-text { font-weight: 800; font-size: 1.1rem; letter-spacing: 0.01em; }
.wm-divider { width: 1px; height: 16px; background: currentColor; opacity: 0.3; }
.wm-net { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.7; }
.nav-links { display: flex; align-items: center; white-space: nowrap; gap: 1.2rem; font-size: 0.85rem; font-weight: 600; color: #9aa3b2; }
.nav-links a:hover, .nav-links a.active { color: #e6edf3; }
/* Rankings link with a hover menu of conference pages. The dropdown starts right at the
   link's bottom edge and pads down to the panel, so the pointer never crosses a gap that
   would close it. */
.nav-menu { position: relative; display: flex; align-items: center; }
.nav-menu > a { padding: 0.4rem 0; }
/* Centered under "Rankings"; nav.js nudges it (--nudge) if centering would run off screen. */
.nav-dropdown {
  position: absolute; top: 100%; left: 50%; z-index: 20; padding-top: 0.75rem; display: none;
  transform: translateX(calc(-50% + var(--nudge, 0px)));
}
.nav-menu:not(.no-menu):hover .nav-dropdown,
.nav-menu:not(.no-menu):focus-within .nav-dropdown,
.nav-menu.open .nav-dropdown { display: block; }
.nav-dropdown-panel {
  min-width: 13rem; max-height: 70vh; overflow-y: auto; padding: 0.4rem;
  display: flex; flex-direction: column; border-radius: 12px; border: 1px solid #3a3f4b;
  background: linear-gradient(160deg, #2c303c, #1b1e26); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.nav-dropdown-panel:empty { display: none; }
.nav-dropdown a { padding: 0.45rem 0.7rem; border-radius: 8px; white-space: nowrap; font-weight: 600; text-align: center; }
.nav-dropdown a:hover, .nav-dropdown a:focus-visible { background: rgba(201, 150, 44, 0.12); color: #e6edf3; outline: none; }
.nav-dropdown a.active { color: #e8b84b; }

/* Conference page title: logo beside the name. */
.conference-title { display: flex; align-items: center; gap: 0.9rem; }
.conference-title-logo { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 0 2px rgba(255,255,255,0.65)) drop-shadow(0 0 5px rgba(255,255,255,0.4)); }
.conference-title-logo[hidden] { display: none; }

/* Team page: the conference logo is a link to the conference page. */
a.conf-logo { border-radius: 8px; transition: transform 0.15s ease; }
a.conf-logo:hover { transform: scale(1.08); }
a.conf-logo:focus-visible { outline: 2px solid #c9962c; outline-offset: 2px; }

.page-title { margin: 0 0 0.2rem; font-size: 1.6rem; font-weight: 900; letter-spacing: 0.01em; }
.page-sub { margin: 0; color: #9aa3b2; font-size: 0.92rem; }
/* Page title + week on the left, bracket toggle on the right; stacks on phones. */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0.4rem 0 1.6rem; }
.page-head .toggle-bar { margin: 0; flex-shrink: 0; }
main { max-width: 1250px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
h2.section { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em; color: #c9962c; margin: 0 0 0.8rem; font-weight: 800; }

/* The bracket keeps its full layout at every width and scales with its own container:
   everything inside is sized in em off a font-size tied to the container width (cqw). */
.bracket-section { position: relative; margin-bottom: 2.5rem; container-type: inline-size; }
.bg-trophy {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  height: 92%;
  width: auto;
  max-width: none;
  opacity: 0.22;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,1) 45%, rgba(0,0,0,0) 78%);
  mask-image: radial-gradient(circle, rgba(0,0,0,1) 45%, rgba(0,0,0,0) 78%);
  transition: opacity 0.1s linear;
}
.bracket {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  font-size: clamp(0.5rem, 1.333cqw, 1rem); /* 1rem at ~1200px wide */
  gap: 0.8em;
  min-height: 28.75em;
}
.col { display: flex; flex-direction: column; gap: 1.1em; justify-content: space-around; height: 100%; min-width: 0; }
.box {
  background: linear-gradient(160deg, #262a35, #1b1e26);
  border: 1px solid #262a35;
  border-left: 0.25em solid #c9962c;
  border-radius: 0.625em;
  padding: 0.9em 1.1em;
  display: flex;
  align-items: center;
  gap: 0.7em;
  min-height: 3.75em;
  min-width: 0;
}
.box img {
  width: 2.125em; height: 2.125em; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.65)) drop-shadow(0 0 5px rgba(255,255,255,0.4));
}
.box .seed { color: #c9962c; font-weight: 800; width: 1.3em; text-align: right; flex-shrink: 0; }
.box .team { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.box .record { margin-left: auto; color: #c3cbe0; font-weight: 600; font-size: 0.85em; flex-shrink: 0; }

.trophy { padding: 0 1em; }
/* Narrow brackets (phones): drop the record, then the name, so seed + logo stay legible. */
@container (max-width: 700px) { .box .record { display: none; } .box { padding: 0.7em 0.8em; } }
@container (max-width: 480px) { .box .team { display: none; } .box { justify-content: center; gap: 0.5em; } .box img { width: 2.6em; height: 2.6em; } }

table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
/* Sticky table headers stop just below the floating nav (top 0.6rem + 0.6rem padding +
   52px bar), so they're never hidden -- or made unclickable -- underneath it. */
/* "Full Rankings" pins just below the floating nav, and the rankings table's column
   headers pin just below it, so both stay visible while scrolling the table. */
:root { --nav-offset: calc(1.2rem + 56px); --sticky-heading: 2.2rem; }
.sticky-heading {
  position: sticky; top: var(--nav-offset); z-index: 4;
  height: var(--sticky-heading); margin: 0; display: flex; align-items: center; gap: 0.7rem;
  background: #22252c;
}
.sticky-heading h2.section { margin: 0; }

/* Customize columns: a dropdown panel under the heading's button. */
.scope-toggle.open .arrow { transform: rotate(180deg); }
.scope-toggle .arrow { display: inline-block; transition: transform 0.3s ease; }
.customize-panel {
  position: absolute; top: calc(100% + 0.3rem); left: 0; z-index: 6;
  width: min(640px, calc(100vw - 2rem)); max-height: 60vh; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.4rem 1rem;
  padding: 1rem 1.1rem; border-radius: 12px; border: 1px solid #3a3f4b;
  background: linear-gradient(160deg, #2c303c, #1b1e26); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.customize-panel[hidden] { display: none; }
.customize-group { border: none; margin: 0; padding: 0; }
.customize-group legend { padding: 0; margin-bottom: 0.3rem; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #c9962c; }
.customize-group label { display: flex; align-items: baseline; gap: 0.4rem; padding: 0.15rem 0; font-size: 0.85rem; cursor: pointer; }
.customize-group input { accent-color: #c9962c; }
.customize-group small { color: #7d8590; font-size: 0.72rem; }
.customize-reset {
  grid-column: 1 / -1; justify-self: start; margin-top: 0.4rem; cursor: pointer;
  background: transparent; border: none; color: #9aa3b2; font: inherit; font-size: 0.8rem; text-decoration: underline;
}
.customize-reset:hover { color: #e6edf3; }
/* Fish metric names keep their casing in the otherwise all-caps header row. */
thead th.brand-head { text-transform: none; letter-spacing: 0.02em; }
/* The rankings table is its own scroll box: it keeps the page's width and scrolls sideways
   to reach added columns, with Rank / movement / Team pinned on the left. Its column headers
   pin to the top of the box, so the box also scrolls vertically -- sized to fill the screen
   below the pinned "Full Rankings" heading, so it feels like scrolling the page. */
.table-scroll {
  overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  max-height: calc(100vh - var(--nav-offset) - var(--sticky-heading) - 0.75rem);
  /* Pinned just below the heading, so scrolling the page further can't slide the box's
     header row underneath it. */
  position: sticky; top: calc(var(--nav-offset) + var(--sticky-heading));
}
.table-scroll table { min-width: 100%; }
/* Thin, site-themed scrollbars on the table box: muted gold handle on a dark track,
   brighter on hover. Chrome and Safari use the ::-webkit-scrollbar rules (5px). Firefox
   only supports the standard keywords, where "thin" is its thinnest -- and Chrome ignores
   ::-webkit-scrollbar once the standard properties are set, so those apply to Firefox only. */
@supports not selector(::-webkit-scrollbar) {
  .table-scroll { scrollbar-width: thin; scrollbar-color: #6b5522 #1b1e26; }
  .table-scroll:hover { scrollbar-color: #c9962c #1b1e26; }
}
.table-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.table-scroll::-webkit-scrollbar-track { background: #1b1e26; border-radius: 3px; }
.table-scroll::-webkit-scrollbar-thumb { background: #6b5522; border-radius: 3px; }
.table-scroll:hover::-webkit-scrollbar-thumb { background: #c9962c; }
.table-scroll::-webkit-scrollbar-corner { background: #1b1e26; }
/* The box is the page's last element: with only its own small gap below it, the page can't
   scroll far enough to push the pinned box up under the heading. */
main:has(> .table-scroll) { padding-bottom: 0.75rem; }
.table-scroll thead th { top: 0; white-space: nowrap; }
.table-scroll tbody tr { --row-bg: #22252c; }
.table-scroll tbody tr:hover { --row-bg: #161b22; }
.table-scroll th:nth-child(-n+3), .table-scroll td:nth-child(-n+3) { position: sticky; z-index: 1; background: var(--row-bg, #22252c); }
/* Offsets are the real widths of the columns to the left, measured after each render
   (app.js pinColumns), since the browser sizes columns to fit their content. */
.table-scroll th:nth-child(1), .table-scroll td:nth-child(1) { left: 0; }
.table-scroll th:nth-child(2), .table-scroll td:nth-child(2) { left: var(--pin-2, 3rem); }
.table-scroll th:nth-child(3), .table-scroll td:nth-child(3) { left: var(--pin-3, 5.6rem); box-shadow: 6px 0 8px -6px rgba(0, 0, 0, 0.6); }
/* Breathing room between the pinned Team column's edge and the first scrolling column. */
.table-scroll th:nth-child(4), .table-scroll td:nth-child(4) { padding-left: 1.5rem; }
/* Header cells sit above body cells; the pinned header corner above everything. */
.table-scroll thead th { z-index: 3; }
.table-scroll thead th:nth-child(-n+3) { z-index: 5; background: #22252c; }
thead th { position: sticky; top: calc(1.2rem + 56px); z-index: 3; /* above row logos' glow filters */ background: #22252c; text-align: left; font-weight: 600; color: #7d8590; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.06em; padding: 0.6rem 0.7rem; border-bottom: 1px solid #21262d; }
thead th.num { text-align: right; }
/* Sortable headers: buttons that look like the plain header text. */
.sort-btn {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 0.25rem;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit;
}
.sort-btn:hover, th.sorted .sort-btn { color: #e6edf3; }
.sort-btn:focus-visible { outline: 2px solid #c9962c; outline-offset: 2px; border-radius: 3px; }
.sort-arrow { font-size: 0.6rem; color: #c9962c; min-width: 0.6rem; }
tbody td { padding: 0.5rem 0.7rem; border-bottom: 1px solid #161b22; white-space: nowrap; }
tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #161b22; }
tbody tr.row-link { cursor: pointer; }
.team-cell { display: flex; align-items: center; gap: 0.55rem; }
.team-cell img {
  width: 24px; height: 24px; object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.65)) drop-shadow(0 0 4px rgba(255,255,255,0.4));
}
.rank { font-weight: 700; color: #e6edf3; }
.trend-col { width: 2.6rem; }
.delta-up { color: #3fb950; font-size: 0.75rem; }
.delta-down { color: #f85149; font-size: 0.75rem; }
.pill { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.74rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.q1 { background: #1a4a2e; color: #6fe79b; }
.q2 { background: #1c3f5e; color: #7cc5ff; }
.q3 { background: #4a3a1a; color: #ffcf6b; }
.q4 { background: #3a2222; color: #ff9a9a; }

/* Team page cards get the same left accent as the bracket boxes: gold for analytics,
   each quad's own pill color (above) for the Quad records. */
#quads .stat-card { border-left: 4px solid #c9962c; }
#quads .quad-1 { border-left-color: #6fe79b; }
#quads .quad-2 { border-left-color: #7cc5ff; }
#quads .quad-3 { border-left-color: #ffcf6b; }
#quads .quad-4 { border-left-color: #ff9a9a; }
.net-val { color: #e8b84b; font-weight: 700; }

.proj-short { display: none; }
.error { color: #f85149; font-weight: 600; padding: 0 1.5rem; }

.team-link { color: inherit; text-decoration: none; border-bottom: 1px dotted transparent; }
.team-link:hover { border-bottom-color: #c9962c; }

.muted { color: #7d8590; font-size: 0.85rem; margin: -0.4rem 0 1rem; }

/* Team page hero: a card fading in from the team's own color (--tc). */
.team-hero {
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  margin: 0.5rem 0 2rem; padding: 1.3rem 1.5rem; border-radius: 18px; border: 1px solid #2e323c;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--tc, #c9962c) 55%, transparent), transparent 60%),
    linear-gradient(160deg, #262a35, #1b1e26);
}
.hero-rank { font-size: 2.6rem; font-weight: 900; color: #c9962c; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.hero-logo { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5)); }
/* The hero lays itself out by its own width (not the window's), so it switches straight
   from one row to "stats on their own row" with no in-between where they wrap at small size. */
.team-hero-wrap { container: hero / inline-size; }
.hero-id { flex: 1 1 0; min-width: 0; } /* long names wrap rather than pushing things to a new row */
.hero-name { margin: 0; font-size: clamp(1.2rem, 3.1cqw, 2.3rem); font-weight: 900; line-height: 1.05; }
.hero-mascot { font-size: 1rem; font-weight: 600; color: #c3cbe0; }
.hero-stats { display: flex; gap: 0.6rem; }
@container hero (max-width: 860px) {
  .hero-stats { width: 100%; }
  .hero-stats .stat-card { flex: 1; min-width: 0; }
  .hero-name { font-size: clamp(1.2rem, 5.4cqw, 2.3rem); }
}
.team-hero .stat-card { background: rgba(0, 0, 0, 0.25); }
/* Pushes itself and the stats to the right on wide screens; on phones it stays at the
   right end of the rank/logo/name row while the stats wrap onto their own row. */
.conf-logo { width: 62px; height: 62px; display: grid; place-items: center; flex-shrink: 0; margin-left: auto; }
/* Same white glow as team logos, so dark conference logos stay readable on the dark card. */
.conf-logo img {
  width: 54px; height: 54px; object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.65)) drop-shadow(0 0 5px rgba(255, 255, 255, 0.4));
}

.analytics-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.8rem; margin-bottom: 2rem;
}
.stat-card {
  background: linear-gradient(160deg, #262a35, #1b1e26);
  border: 1px solid #262a35; border-radius: 10px;
  padding: 0.7rem 0.9rem; display: flex; flex-direction: column; gap: 0.2rem;
}
.stat-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: #7d8590; }
.stat-value { font-size: 1.2rem; font-weight: 700; }

.rank-chart { width: 100%; height: auto; margin-bottom: 2rem; }
.chart-label { font-size: 11px; fill: #7d8590; }

.chart-wrap { position: relative; margin-bottom: 2rem; }
.chart-wrap .rank-chart { margin-bottom: 0; }
.grid-line { stroke: #2e323c; stroke-width: 1; }
.grid-line-v { stroke-dasharray: 2 4; }
.axis-line { stroke: #4a4f5c; stroke-width: 1; }
.chart-point { cursor: pointer; }
.chart-point .hit-area { fill: transparent; }
.chart-point .dot { fill: #c9962c; stroke: #22252c; stroke-width: 1.5; transition: r 0.12s ease; }
.chart-point:hover .dot { fill: #e8b84b; }
.chart-tooltip {
  position: absolute; pointer-events: none; z-index: 2;
  background: linear-gradient(160deg, #2c303c, #1b1e26);
  border: 1px solid #3a3f4b; border-left: 3px solid #c9962c; border-radius: 8px;
  padding: 0.55rem 0.8rem; font-size: 0.82rem; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.chart-tooltip .tt-week { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: #7d8590; }
.chart-tooltip .tt-rank { font-size: 1.15rem; font-weight: 800; color: #c9962c; }
.chart-tooltip .tt-game { margin-top: 0.15rem; }
.chart-tooltip .tt-move { margin-top: 0.15rem; }
.chart-tooltip .delta-up, .chart-tooltip .delta-down { font-size: 0.82rem; font-weight: 700; }
.muted-inline { color: #7d8590; }

.stat-label { display: flex; align-items: center; gap: 0.35rem; }
.stat-unit { font-size: 0.72rem; font-weight: 600; color: #7d8590; }
.stat-rank { font-size: 0.72rem; font-weight: 600; color: #c9962c; }
h2.section.quad-heading { margin-top: 2.2rem; }

.info {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid #4a4f5c; color: #9aa3b2;
  font-size: 0.6rem; font-weight: 700; font-style: italic; font-family: Georgia, serif;
  text-transform: none; letter-spacing: 0; cursor: help;
}
.info:hover, .info:focus { border-color: #c9962c; color: #c9962c; outline: none; }
.info-tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: 240px; z-index: 3; pointer-events: none;
  background: linear-gradient(160deg, #2c303c, #1b1e26);
  border: 1px solid #3a3f4b; border-left: 3px solid #c9962c; border-radius: 8px;
  padding: 0.55rem 0.75rem; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  color: #e6edf3; font: 400 0.78rem/1.4 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: none; letter-spacing: 0; font-style: normal;
  opacity: 0; visibility: hidden; transition: opacity 0.12s ease;
}
.info:hover .info-tip, .info:focus .info-tip { opacity: 1; visibility: visible; }

tbody tr.row-win { background: rgba(63, 185, 80, 0.10); }
tbody tr.row-loss { background: rgba(248, 81, 73, 0.10); }
tbody tr.row-win:hover { background: rgba(63, 185, 80, 0.18); }
tbody tr.row-loss:hover { background: rgba(248, 81, 73, 0.18); }

/* ---- Tablet and phone layouts ---- */

/* Narrow screens: the default columns already need more room than the screen has. */
@media (max-width: 900px) {
  main { padding: 1.2rem 0.9rem 2rem; }
  .table-scroll table { min-width: 860px; }
}


@media (max-width: 640px) {
  .site-nav { padding: 0.5rem 0.6rem 0; }
  .nav-inner { padding: 0 0.9rem; }
  .nav-links { gap: 0.8rem; font-size: 0.8rem; }

  .team-hero { padding: 1rem; gap: 0.6rem 0.65rem; }
  .hero-rank { font-size: 1.6rem; }
  .hero-logo { width: 46px; height: 46px; }
  /* Shrinks with the screen so long names ("Mississippi State") fit beside the logos. */
  .hero-name { font-size: clamp(1.2rem, 5.4vw, 1.6rem); }
  .conf-logo { width: 42px; height: 42px; }
  .conf-logo img { width: 38px; height: 38px; }
  .hero-stats .stat-card { padding: 0.55rem 0.6rem; }

  /* Team page: chart scrolls sideways instead of shrinking its labels; schedule drops Site. */
  .chart-wrap { overflow-x: auto; }
  .chart-wrap .rank-chart { min-width: 560px; }
  .schedule-table td:nth-child(4), .schedule-table th:nth-child(4) { display: none; } /* Site */
  .schedule-table th, .schedule-table td { padding-left: 0.4rem; padding-right: 0.4rem; }
  .schedule-table th, .schedule-table td:nth-child(3) { white-space: normal; } /* Opponent wraps */
  .proj-long { display: none; }
  .proj-short { display: inline; }
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
  .info-tip { width: 200px; }
  /* Right-column cards: open the tooltip toward the left so it stays on screen. */
  .analytics-grid .stat-card:nth-child(2n) .info-tip { transform: translateX(-80%); }
}
@media (max-width: 420px) { .wm-divider, .wm-net { display: none; } }

/* ---- Team page: rank chart + analytics bars side by side ---- */
.team-split { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; margin-bottom: 2rem; }
.team-split > section { min-width: 0; } /* the chart scrolls inside its column instead of widening it */
.team-split .chart-wrap { margin-bottom: 0; }
/* Both column headings are the same height, so the chart and the bars start level. */
.team-split > section > h2.section, .section-head { min-height: 22px; display: flex; align-items: center; margin: 0 0 0.8rem; }
.section-head { gap: 0.7rem; }
.section-head h2.section { margin: 0; }
@media (max-width: 900px) { .team-split { grid-template-columns: 1fr; gap: 1.5rem; } }

/* Percentile bars (Baseball Savant-style): blue = worse than most of FBS, red = better. */
.stat-bar { padding: 0.45rem 0 0.95rem; }
.stat-bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.95rem; }
.stat-bar-label { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 700; color: #c3cbe0; }
.stat-bar-value { font-size: 0.9rem; font-weight: 800; }
.stat-scale {
  position: relative; height: 6px; border-radius: 3px; margin: 0 13px;
  background: linear-gradient(90deg, rgba(44,107,201,0.55), rgba(140,145,160,0.35), rgba(214,53,53,0.55));
}
.stat-tick { position: absolute; top: -3px; bottom: -3px; width: 1px; background: #4a4f5c; }
.stat-pin {
  position: absolute; top: 50%; left: 0; width: 26px; height: 26px; border-radius: 50%;
  transform: translate(-50%, -50%); display: grid; place-items: center;
  border: 3px solid #22252c; box-shadow: 0 0 0 2px var(--pin);
  font-size: 0.62rem; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums;
  transition: left 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) { .stat-pin { transition: none; } }

/* ---- Methodology article (methodology.html) ---- */
.article { max-width: 780px; margin: 0 auto; line-height: 1.7; font-size: 1.02rem; color: #d8dee6; }
.article-head { margin-bottom: 1.2rem; }
.article-hero { margin: 0 auto 1.8rem; text-align: center; }
.article-hero img { display: block; width: 100%; height: auto; border-radius: 10px; }
.article-hero figcaption { margin-top: 0.45rem; font-size: 0.78rem; color: #7d8590; }
.article-hero figcaption a { color: inherit; }
.article-head .page-sub a, .article a { color: #e8b84b; }
.article h2 { font-size: 1.45rem; font-weight: 900; color: #e6edf3; margin: 2.6rem 0 0.8rem; padding-top: 1rem; border-top: 1px solid #343a46; }
.article h3 { font-size: 1.1rem; font-weight: 800; color: #e6edf3; margin: 2rem 0 0.6rem; }
.article p { margin: 0 0 1rem; }
.article ul { margin: 0 0 1.1rem; padding-left: 1.3rem; }
.article li { margin-bottom: 0.55rem; }
.article strong { color: #e6edf3; }
.article blockquote { margin: 1rem 0 1.2rem; padding: 0.4rem 0 0.4rem 1rem; border-left: 3px solid #c9962c; color: #b9c2cf; font-style: italic; }
.article pre { background: #1b1e26; border: 1px solid #343a46; border-radius: 8px; padding: 0.9rem 1rem; overflow-x: auto; font-size: 0.82rem; line-height: 1.5; margin: 0 0 1.2rem; }
.article code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.article .formula { text-align: center; font-size: 1.05rem; }
.article .formula code { background: #1b1e26; border: 1px solid #343a46; border-radius: 6px; padding: 0.35rem 0.8rem; }
/* Charts are drawn on a light background, so they sit on a light card. */
.article-figure { margin: 1.4rem 0 1.6rem; background: #fcfcfb; border-radius: 10px; padding: 0.6rem; }
.article-figure img { display: block; width: 100%; height: auto; }
.article-table-wrap { overflow-x: auto; margin: 0 0 1.4rem; }
.article-table { border-collapse: collapse; width: 100%; font-size: 0.88rem; line-height: 1.4; }
.article-table caption { caption-side: top; text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: #c9962c; font-weight: 800; padding-bottom: 0.5rem; }
/* Not the rankings table: no sticky header, no uppercase. */
.article-table thead th { position: static; text-transform: none; letter-spacing: 0; background: none; }
.article-table thead th.num, .article-table th.num { text-align: right; }
.article-table th { text-align: left; color: #9aa3b2; font-weight: 700; font-size: 0.78rem; border-bottom: 1px solid #3a404c; padding: 0.4rem 0.6rem; vertical-align: bottom; }
.article-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid #2c313b; white-space: nowrap; }
.article-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.article-table tr.chosen td { background: rgba(201, 150, 44, 0.14); color: #f3dba0; font-weight: 700; }
.table-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.4rem; }
@media (max-width: 640px) {
  .article { font-size: 0.98rem; }
  .table-grid { grid-template-columns: 1fr; }
  .article-table { font-size: 0.82rem; }
}

/* environmentBadge flag (flags.js): marks gamma/local so they're never mistaken for prod. */
.env-badge { margin-left: 0.6rem; padding: 0.15rem 0.45rem; border-radius: 4px; background: #8a2be2; color: #fff; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.12em; }

/* Season + week dropdowns (history-select.js, flags weekHistory/seasonHistory): a grey pill at the far right of the
   "Full Rankings" heading, same shape as Customize; the menu shows ~5 weeks, then scrolls. */
.history-select { margin-left: auto; display: inline-flex; gap: 0.4rem; }
.week-select { position: relative; display: inline-flex; }
.week-toggle {
  display: inline-flex; align-items: center; gap: 0.3rem; cursor: pointer; white-space: nowrap;
  background: transparent; color: #c9d1d9; border: 1px solid #4a4f5c; border-radius: 999px;
  padding: 0.15rem 0.6rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.week-toggle:hover { border-color: #9aa3b2; color: #fff; }
.week-toggle:focus-visible { outline: 2px solid #9aa3b2; outline-offset: 2px; }
.week-toggle .arrow { display: inline-block; transition: transform 0.3s ease; }
.week-toggle.open .arrow { transform: rotate(180deg); }
.week-menu {
  position: absolute; top: calc(100% + 0.3rem); right: 0; z-index: 6;
  min-width: 7rem; max-height: 9.2rem; overflow-y: auto; padding: 0.25rem 0;
  border-radius: 10px; border: 1px solid #3a3f4b;
  background: linear-gradient(160deg, #2c303c, #1b1e26); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  scrollbar-width: thin; scrollbar-color: #4a4f5c transparent;
}
.week-menu[hidden] { display: none; }
.week-menu a {
  display: block; padding: 0.3rem 0.8rem; font-size: 0.76rem; white-space: nowrap;
  color: #9aa3b2; text-decoration: none; font-variant-numeric: tabular-nums;
}
.week-menu a:hover, .week-menu a:focus-visible { background: rgba(255, 255, 255, 0.06); color: #fff; outline: none; }
.week-menu a[aria-selected="true"] { color: #fff; font-weight: 700; }

/* Team page: season + week pills on their own row under the hero (right-aligned), and the
   grey "2024 · Final" next to the name when the page isn't the live one. */
.team-history-bar { display: flex; justify-content: flex-end; margin: -1.4rem 0 1.2rem; }
.team-history-bar[hidden] { display: none; }
.team-history-bar .history-select { margin-left: 0; }
.hero-view { margin-left: 0.5rem; font-size: 0.42em; font-weight: 700; color: #9aa3b2; letter-spacing: 0.02em; vertical-align: middle; white-space: nowrap; }

/* Schedule: bowls, playoff rounds and title games show their short name in the Week column. */
/* Week shrinks to its longest name, so the emblem column below is the whole gap. */
.schedule-table th:first-child, .schedule-table .week-cell { width: 1%; white-space: nowrap; }
.game-name { font-size: 0.78rem; color: #c9d1d9; }
/* Thin, headerless column between Week and Opponent: the CFP emblem on playoff games. */
.schedule-table .cfp-col { width: 3.2rem; padding-left: 0; padding-right: 0; text-align: center; }
.cfp-emblem { display: block; height: 1.05rem; width: auto; margin: 0 auto; }
