/* Newsprint: black ink on plain paper, column rules, no rounded corners or shadows. */
:root {
  --paper: #fbfaf6;
  --ink: #161616;
  --muted: #555;
  --rule: #161616;
  --hair: #c9c6bd;
  --loss: #9b1c1c;
  --head: "Old Standard TT", "Times New Roman", Times, serif;
  --body: "PT Serif", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font: 16px/1.45 var(--body); }
.wrap { max-width: 860px; margin: 0 auto; padding-block: 20px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 18px; }

/* Masthead */
header { text-align: center; border-top: 3px double var(--rule); border-bottom: 3px double var(--rule); padding: 10px 0 12px; display: grid; gap: 4px; }
.eyebrow { font: italic .9rem var(--body); color: var(--muted); }
h1 { font: 700 clamp(1.8rem, 5vw, 2.7rem)/1.1 var(--head); margin: 0; text-wrap: balance; }
.sub { margin: 0 auto; color: var(--muted); font-size: .92rem; max-width: 62ch; }

/* The figures, set as a row of boxed columns */
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-bottom: 1px solid var(--rule); }
.strip div { padding: 4px 12px 10px; border-left: 1px solid var(--hair); display: grid; gap: 0; min-width: 0; }
.strip div:first-child { border-left: 0; padding-left: 0; }
.strip b { font: 700 1.6rem var(--head); font-variant-numeric: tabular-nums; }
.strip span { font-size: .85rem; color: var(--muted); }

/* Page links and search */
nav { display: flex; gap: 4px 14px; flex-wrap: wrap; align-items: baseline; font-size: .95rem; }
nav a { color: var(--ink); }
nav a[aria-current="page"] { font-weight: 700; text-decoration: none; }
nav a + a::before { content: "|"; color: var(--hair); margin-right: 14px; display: inline-block; text-decoration: none; }
nav a:focus-visible, input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.search { margin-left: auto; flex: 1 1 180px; max-width: 240px; min-width: 0; }
.search input { width: 100%; font: inherit; padding: 3px 6px; border: 1px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); }

section h2 { font: 700 1.35rem var(--head); margin: 0 0 2px; padding-bottom: 2px; border-bottom: 1px solid var(--rule); }
section > p { margin: 4px 0 10px; color: var(--muted); font-size: .9rem; font-style: italic; max-width: 65ch; }
.l { color: var(--loss); }

/* Top 8: one line per percentage */
.tiers { display: grid; }
.tier { display: grid; grid-template-columns: 3.4em 70px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 5px 0; border-bottom: 1px dotted var(--hair); }
.tier b { font: 700 1.1rem var(--head); text-align: right; font-variant-numeric: tabular-nums; }
.tier > i { align-self: center; height: 7px; border: 1px solid var(--ink); position: relative; }
.tier > i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--ink); }
.tier .names { line-height: 1.5; }
.tier .who { white-space: nowrap; }
.tier.rest .names { color: var(--muted); font-style: italic; }
@media (max-width: 480px) { .tier { grid-template-columns: 3em minmax(0, 1fr); } .tier > i { display: none; } }

/* The Top 8 bracket: a plain table of figures */
.brwrap { overflow-x: auto; }
table.br { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.br th { font: 700 .8rem var(--head); text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.br td { padding: 5px 8px; border-bottom: 1px dotted var(--hair); white-space: nowrap; }
table.br .seed, table.br .num, table.br th:nth-child(n+4) { text-align: right; }
table.br .num { font-weight: 700; }
table.br .vs, table.br .av { color: var(--muted); }
@media (max-width: 560px) { table.br .vs { display: none; } }

/* Rainbow Foil: one boxed column per avatar */
.avgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 24px; align-items: start; }
.av-card { padding: 8px 0 12px; border-top: 1px solid var(--rule); display: grid; gap: 4px; align-content: start; min-width: 0; }
.av-card h3 { margin: 0; font: 700 1.1rem var(--head); display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.av-card h3 small { font: italic .85rem var(--body); color: var(--muted); }
.av-card ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.av-card li { display: grid; grid-template-columns: minmax(0, 1fr) 7.5em; gap: 8px; align-items: center; font-size: .95rem; }
.av-card li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-card details summary { cursor: pointer; font-size: .85rem; color: var(--muted); font-style: italic; }
.av-card details ol { margin-top: 4px; }
.meter { display: grid; grid-template-columns: 1fr 3.2em; align-items: center; gap: 6px; }
.meter i { display: block; height: 7px; border: 1px solid var(--ink); position: relative; }
.meter i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--ink); }
.meter em { font-style: normal; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

footer { color: var(--muted); font-size: .85rem; display: grid; gap: 6px; max-width: 70ch; border-top: 1px solid var(--rule); padding-top: 8px; }
footer p { margin: 0; }
