/* Body of Work: Final A look. Light by default, dark via [data-theme="dark"]. */
:root {
  --bg: #FAFAF8; --surface: #FFFFFF; --surface2: #EDEDE8; --border: #E3E3DE; --divider: #EEEEEA;
  --text: #15171C; --text2: #3D424B; --muted: #555B65; --accent: #8A6510; --accent-hover: #6B4E0B;
  --icon: #B8891F; --line-a: #B8891F; --line-b: #2F4B7C; --grid: #E3E3DE;
  --chip-border: #BDBDB6; --input: #FFFFFF; --input-border: #CFCFC8;
  --sel-bg: #15171C; --sel-fg: #FFFFFF; --win: #1F7A4D; --loss: #B0362A; --up: #1F7A4D; --down: #B0362A;
  --gold: #E0B44C; --gold-fg: #15120A;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0F1115; --surface: #14161B; --surface2: #191C22; --border: #262A32; --divider: #1F232A;
  --text: #F2F1EC; --text2: #C9CDD3; --muted: #A3A9B2; --accent: #E0B44C; --accent-hover: #F0C870;
  --icon: #E0B44C; --line-a: #E0B44C; --line-b: #9DB4D9; --grid: #262A32;
  --chip-border: #4A4F59; --input: #191C22; --input-border: #333843;
  --sel-bg: #E0B44C; --sel-fg: #15120A; --win: #7FC8A9; --loss: #E88D7A; --up: #7FC8A9; --down: #E88D7A;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--icon); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; padding: 10px 14px; background: var(--surface); }
.skip:focus { left: 8px; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.wrap { max-width: 1160px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-height: 44px; }
.brand:hover { color: var(--text); }
.brand svg { stroke: var(--icon); }
.brand span { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: 0.04em; text-transform: uppercase; }
.header-right { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.main-nav { display: flex; flex-wrap: wrap; gap: 2px; }
.main-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--muted); text-decoration: none; border-radius: 8px; }
.main-nav a:hover { color: var(--text); background: var(--surface2); }
.main-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); cursor: pointer; }
.icon-btn svg { stroke: currentColor; }
.theme-toggle .moon { display: inline; } .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: none; } [data-theme="dark"] .theme-toggle .sun { display: inline; }

/* Layout */
main.wrap { padding-top: 36px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 28px; }
.eyebrow { margin: 0; color: var(--accent); font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: 0.14em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--display); text-transform: uppercase; margin: 0; }
.h-hero { font-weight: 700; font-size: 64px; line-height: 1; letter-spacing: 0.01em; }
.h-name { font-weight: 700; font-size: 76px; line-height: 0.95; }
.h-section { font-weight: 600; font-size: 28px; letter-spacing: 0.02em; }
.lede { margin: 0; max-width: 640px; color: var(--muted); font-size: 17px; }
.muted { color: var(--muted); }
.text2 { color: var(--text2); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; align-self: flex-start; text-decoration: none; font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.pad { padding: 24px; }
.note { padding: 14px 18px; border: 1px dashed var(--chip-border); border-radius: 12px; color: var(--text2); margin: 0; }
footer.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
footer.site-footer .wrap { padding-top: 20px; padding-bottom: 28px; }

/* Controls */
.controls { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface2); border-radius: 10px; }
.tabs button { min-height: 44px; padding: 0 20px; border: 0; border-radius: 8px; font: inherit; font-weight: 600; background: transparent; color: var(--text2); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--sel-bg); color: var(--sel-fg); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.field select, .field input, .search { min-height: 44px; padding: 0 12px; background: var(--input); color: var(--text); border: 1px solid var(--input-border); border-radius: 8px; font: inherit; font-size: 15px; text-transform: none; letter-spacing: 0; }
.selects { display: flex; flex-wrap: wrap; gap: 12px; }
.pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--chip-border); color: var(--text); text-decoration: none; font-size: 15px; }
.pill:hover { color: var(--text); background: var(--surface2); }
.pill[aria-current="page"] { background: var(--sel-bg); color: var(--sel-fg); border-color: var(--sel-bg); font-weight: 600; }

/* Tables (grid rows inside a scroll box) */
.table-box { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; padding: 14px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 12px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data th:first-child, table.data td:first-child { padding-left: 20px; }
table.data th:last-child, table.data td:last-child { padding-right: 20px; }
table.data .num { text-align: right; white-space: nowrap; }
table.data .nowrap { white-space: nowrap; }
.board td { padding-top: 14px; padding-bottom: 14px; }
.board .score { font-family: var(--display); font-weight: 600; font-size: 24px; }
.board .name a { color: var(--text); font-weight: 600; font-size: 16px; text-decoration: none; }
.board .name a:hover { text-decoration: underline; }
.board .belts { display: block; color: var(--muted); font-size: 13px; }
.rank { font-family: var(--display); font-weight: 700; font-size: 26px; }
.rank-1 { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: var(--gold-fg); font-family: var(--display); font-weight: 700; font-size: 24px; }
.fights { min-width: 1060px; font-size: 14px; }
/* breakdown columns stay hidden until "Show calculation"; Points always shows */
.fights.calc-hidden { min-width: 0; }
.fights.calc-hidden .calc { display: none; }
.calc-note { display: none; }
.fighter-calc-open .calc-note, .fighter-calc-open .calc-only { display: block; }
.calc-only { display: none; }
button.pill { background: transparent; font: inherit; font-size: 15px; cursor: pointer; }
.fights .opp { font-weight: 600; color: var(--text); text-decoration: none; }
.fights a.opp:hover { text-decoration: underline; }
.fights .pts { font-family: var(--display); font-weight: 600; font-size: 20px; }
.fights .zero td { color: var(--muted); }
.res-W { color: var(--win); font-weight: 600; } .res-L { color: var(--loss); font-weight: 600; }
.res-D, .res-NC { color: var(--text2); font-weight: 600; }
.wm-up { color: var(--up); font-weight: 600; } .wm-down { color: var(--down); font-weight: 600; } .wm-even { color: var(--muted); }
.champ { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--gold); color: var(--gold-fg); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--chip-border); font-size: 13px; }
.chip.ring { background: var(--gold); color: var(--gold-fg); border-color: var(--gold); font-weight: 600; }
.chip.none { color: var(--muted); }
.table-foot { display: flex; justify-content: space-between; gap: 16px; padding: 14px 20px; font-weight: 600; border-top: 1px solid var(--border); }
.table-foot .total { font-family: var(--display); font-size: 24px; color: var(--accent); }
details.more { margin-top: 4px; }
details.more summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 600; }

/* Fighter page */
.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.hero .sub { margin: 0; color: var(--muted); font-size: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat { padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.stat .value { font-family: var(--display); font-weight: 700; font-size: 48px; line-height: 1.05; }
.stat .value.accent { color: var(--accent); }
.stat .note2 { color: var(--text2); font-size: 14px; }
svg.chart { display: block; width: 100%; height: auto; }
svg.chart .grid line { stroke: var(--grid); }
svg.chart .axis text { fill: var(--muted); font-size: 12px; font-family: var(--body); }
svg.chart .mark { fill: var(--text); font-size: 12px; font-family: var(--body); }
svg.chart .line-a { fill: none; stroke: var(--line-a); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .line-b { fill: none; stroke: var(--line-b); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .dot-a { fill: var(--line-a); } svg.chart .dot-b { fill: var(--line-b); }
svg.chart .end { fill: var(--text); font-size: 13px; font-weight: 600; font-family: var(--body); }

/* Fighters index */
.search-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.search { min-width: min(420px, 100%); }
.fighter-list td a { color: var(--text); font-weight: 600; text-decoration: none; }
.fighter-list td a:hover { text-decoration: underline; }

/* Head-to-head */
.pickers { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: end; }
.pickers .vs-small { font-family: var(--display); font-weight: 700; font-size: 22px; padding-bottom: 8px; color: var(--muted); }
.h2h-hero { display: grid; grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr); gap: 16px; align-items: center; }
.h2h-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.h2h-side.a { align-items: flex-end; text-align: right; }
.h2h-side.a .chips { justify-content: flex-end; }
.h2h-side h2 { font-weight: 700; font-size: 56px; line-height: 0.95; }
.h2h-side h2 a { color: var(--text); text-decoration: none; }
.h2h-side h2 a:hover { text-decoration: underline; }
.vs { justify-self: center; display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--gold); color: var(--gold-fg); font-family: var(--display); font-weight: 700; font-size: 28px; }
.cmp-row { display: grid; grid-template-columns: minmax(0, 1fr) 240px minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--divider); }
.cmp-row:last-child { border-bottom: 0; }
.cmp-row .va { display: flex; justify-content: flex-end; align-items: baseline; gap: 10px; }
.cmp-row .vb { display: flex; justify-content: flex-start; align-items: baseline; gap: 10px; }
.cmp-row .big { font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1.1; }
.cmp-row .big.lead { color: var(--accent); }
.cmp-row .mid { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cmp-row .mid b { font-weight: 600; }
.cmp-row .sub { color: var(--text2); font-size: 14px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.met-card { padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.met-card .pts { font-family: var(--display); font-weight: 700; font-size: 48px; line-height: 1; }
.met-card .pts small { font-size: 20px; color: var(--muted); font-weight: 600; }
.best-list .head { display: flex; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.best-list .item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--divider); font-size: 14px; }
.best-list .item:last-child { border-bottom: 0; }
.best-list .item .p { font-family: var(--display); font-weight: 600; font-size: 22px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; }
.legend .a { background: var(--line-a); } .legend .b { background: var(--line-b); }

/* Methodology */
.prose { max-width: 760px; }
.prose p, .prose li { color: var(--text2); }
.prose h2 { margin-top: 12px; }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; background: var(--surface2); padding: 14px 16px; border-radius: 10px; overflow-x: auto; color: var(--text); }

/* Phone */
@media (max-width: 720px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  main.wrap { padding-top: 24px; gap: 22px; }
  .brand span { font-size: 22px; }
  .h-hero { font-size: 44px; }
  .h-name { font-size: 52px; }
  .lede { font-size: 15px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 32px; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; padding: 0 8px; }
  .selects { width: 100%; }
  .selects .field { flex: 1; min-width: 140px; }
  .board .col-best, .board .col-div { display: none; }
  .h2h-hero { grid-template-columns: 1fr; }
  .h2h-side.a { align-items: flex-start; text-align: left; }
  .h2h-side.a .chips { justify-content: flex-start; }
  .h2h-side h2 { font-size: 40px; }
  .vs { width: 44px; height: 44px; font-size: 20px; justify-self: start; }
  .cmp-row { grid-template-columns: 1fr 1fr; padding: 12px 16px; }
  .cmp-row .mid { grid-column: 1 / -1; order: -1; align-items: flex-start; text-align: left; }
  .cmp-row .va { justify-content: flex-start; }
  .cmp-row .big { font-size: 26px; }
  .two { grid-template-columns: 1fr; }
  .pickers { grid-template-columns: 1fr; }
  .pickers .vs-small { padding: 0; }
}
