/*
 * Defrag on Bootstrap 5.3. Bootstrap supplies reboot, the grid and utilities; this file sets the
 * tokens and Defrag's own components. Mobile first: base rules are for phones, min-width queries add
 * the desktop layout. Status and verification are plain text, never pills or dots.
 */

@font-face {
    font-family: "Inter";
    src: url("/fonts/InterVariable-2bf3d951bf9d6109437ea0874bbf12fb.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ---- Tokens ---------------------------------------------------------------------------------- */

:root {
    --df-bg: #f6f6f3;
    --df-surface: #ffffff;
    --df-sunken: #efefeb;
    --df-ink: #111214;
    --df-text: #2a2c30;
    --df-muted: #5d6168;      /* 5.6:1 on --df-bg */
    --df-faint: #696d73;      /* 4.7:1 on --df-bg; the lightest text colour */
    --df-line: #e3e3de;
    --df-line-strong: #cbcbc5;

    --df-accent: #0f6b52;
    --df-disputed: #a3261b;

    --df-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --df-fs-xs: 0.75rem;
    --df-fs-sm: 0.8125rem;
    --df-fs-md: 0.9375rem;
    --df-fs-lg: 1.125rem;
    --df-fs-h3: 1.0625rem;
    --df-fs-h1: 1.625rem;
    --df-fs-h1-lg: 2.125rem;

    --df-gutter: 1rem;
    --df-radius: 6px;
    --df-radius-sm: 4px;
    --df-bar-h: 3.25rem;

    --bs-body-font-family: var(--df-font);
    --bs-body-color: var(--df-text);
    --bs-body-bg: var(--df-bg);
    --bs-border-color: var(--df-line);
    --bs-link-color-rgb: 17, 18, 20;
    --bs-link-hover-color-rgb: 17, 18, 20;
}

/* ---- Base ------------------------------------------------------------------------------------ */

.df-public {
    font-family: var(--df-font);
    background: var(--df-bg);
    color: var(--df-text);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.df-public main { flex: 1; }

.df-public a {
    color: var(--df-ink);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.df-public :focus-visible {
    outline: 2px solid var(--df-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

.df-num { font-variant-numeric: tabular-nums; }
.df-muted { color: var(--df-muted); }

.df-container {
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 max(var(--df-gutter), env(safe-area-inset-left)) 0 max(var(--df-gutter), env(safe-area-inset-right));
}

.df-skip {
    position: absolute;
    left: 0.5rem;
    top: -3rem;
    z-index: 30;
    background: var(--df-ink);
    color: #fff !important;
    padding: 0.5rem 0.75rem;
    border-radius: var(--df-radius-sm);
}

.df-skip:focus { top: 0.5rem; }

/* ---- App bar: sticky, solid, compact ---------------------------------------------------------- */

.df-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--df-bg);
    border-bottom: 1px solid var(--df-line);
}

.df-bar .df-container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    height: var(--df-bar-h);
}

.df-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--df-ink);
    text-decoration: none;
    font-size: 1.0625rem;
    letter-spacing: 0.01em;
}

.df-public a.df-brand { text-decoration: none; }
.df-brand:hover { color: var(--df-ink); text-decoration: none; }
.df-mark { width: 1.625rem; height: 1.625rem; flex: none; }
.df-wordmark { font-weight: 400; color: var(--df-ink); }
.df-brand-lg .df-mark { width: 2.5rem; height: 2.5rem; }
.df-brand-lg .df-wordmark { font-size: 1.5rem; }

.df-bar-nav {
    display: none;
    gap: 1.25rem;
    margin-left: auto;
    font-size: var(--df-fs-md);
    font-weight: 500;
}

@media (min-width: 768px) {
    .df-bar-nav { display: flex; }
}

.df-public .df-bar-nav a {
    display: flex;
    align-items: center;
    height: var(--df-bar-h);
    color: var(--df-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.df-public .df-bar-nav a:hover,
.df-public .df-bar-nav a[aria-current="page"] { color: var(--df-ink); }
.df-public .df-bar-nav a[aria-current="page"] { border-bottom-color: var(--df-ink); }

/* ---- Bottom tab bar: phones only, the four sections ------------------------------------------ */

.df-tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: var(--df-bg);
    border-top: 1px solid var(--df-line);
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.df-public .df-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1875rem;
    min-height: 3.5rem;
    padding: 0.375rem 0.125rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--df-muted);
    text-decoration: none;
    border-top: 2px solid transparent;
    margin-top: -1px;
}

.df-tabbar svg { width: 1.375rem; height: 1.375rem; flex: none; }
.df-public .df-tabbar a[aria-current="page"] { color: var(--df-ink); border-top-color: var(--df-ink); font-weight: 600; }

/* Room for the tab bar, so it never covers the end of the page. */
.df-public { padding-bottom: calc(3.5rem + env(safe-area-inset-bottom)); }

@media (min-width: 768px) {
    .df-tabbar { display: none; }
    .df-public { padding-bottom: 0; }
}

/* ---- Breadcrumb and page header ----------------------------------------------------------------- */

.df-crumb { margin: 0; padding: 0; list-style: none; display: flex; font-size: var(--df-fs-sm); }

.df-public .df-crumb a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 2.75rem;
    color: var(--df-muted);
    text-decoration: none;
}

.df-public .df-crumb a:hover { color: var(--df-ink); text-decoration: underline; }

.df-page-head { padding: 0.25rem 0 1.25rem; }

.df-page-head h1 {
    font-size: var(--df-fs-h1);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--df-ink);
    margin: 0.25rem 0 0.375rem;
    overflow-wrap: anywhere;
}

.df-page-head .df-sub { font-size: var(--df-fs-md); color: var(--df-muted); margin: 0; }
.df-page-head .df-overview { font-size: var(--df-fs-md); color: var(--df-ink); max-width: 44rem; margin: 1rem 0 0; }
.df-page-head.plain { padding-top: 1.75rem; }

.df-entity-head { display: flex; gap: 0.875rem; align-items: flex-start; }
.df-entity-head > div { min-width: 0; }

@media (min-width: 768px) {
    .df-page-head { padding: 0.5rem 0 1.75rem; }
    .df-page-head.plain { padding-top: 2.5rem; }
    .df-page-head h1 { font-size: var(--df-fs-h1-lg); }
}

/* ---- Pictures: portraits, logos, artwork ---------------------------------------------------------
 * A fixed frame per context, so nothing shifts while loading and nothing is stretched. Portraits fill
 * the frame (cover); logos are shown whole with padding (contain), keeping their transparency.
 * Without an image the frame is the Defrag placeholder: the record's monogram, or a faint mark. */

.df-img {
    position: relative;
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    overflow: hidden;
    border-radius: var(--df-radius);
    border: 1px solid var(--df-line);
    background: var(--df-surface);
}

.df-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.df-img.logo img { object-fit: contain; padding: 12%; }
.df-img.is-empty { background: var(--df-sunken); border-color: var(--df-sunken); }

.df-img-text {
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    color: var(--df-muted);
    line-height: 1;
    text-align: center;
    padding: 0 0.125rem;
}

.df-img-mark { width: 52%; height: 52%; color: var(--df-line-strong); }

.df-img.sm { width: 2.5rem; height: 2.5rem; }
.df-img.sm .df-img-text { font-size: 0.6875rem; }
.df-img.lg { width: 4.5rem; height: 4.5rem; }
.df-img.lg .df-img-text { font-size: 1.125rem; }

@media (min-width: 768px) {
    .df-img.lg { width: 6rem; height: 6rem; }
    .df-img.lg .df-img-text { font-size: 1.375rem; }
}

/* Competition artwork: banners fill a 16:9 frame; posters and other shapes are shown whole. */
.df-art {
    margin: 0 0 1rem;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--df-radius);
    border: 1px solid var(--df-line);
    background: var(--df-sunken);
}

.df-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.df-art.whole img { object-fit: contain; }

/* ---- Lifecycle status: words, not pills ------------------------------------------------------- */

.df-status { font-size: var(--df-fs-sm); font-weight: 600; color: var(--df-ink); }
.df-status.ongoing { color: var(--df-accent); }
.df-status.completed { color: var(--df-muted); font-weight: 500; }

/* ---- In-page section links (not sticky; the page is short) ------------------------------------ */

.df-tabs {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--df-line);
    margin: 0 calc(-1 * var(--df-gutter)) 1.25rem;
    padding: 0 var(--df-gutter);
}

.df-tabs::-webkit-scrollbar { display: none; }

.df-public .df-tabs a {
    flex: none;
    padding: 0.75rem 0 0.6875rem;
    font-size: var(--df-fs-md);
    font-weight: 500;
    color: var(--df-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.df-public .df-tabs a:hover { color: var(--df-ink); border-bottom-color: var(--df-line-strong); }

@media (min-width: 768px) {
    .df-tabs { margin-left: 0; margin-right: 0; padding: 0; }
}

/* ---- Sections and panels -------------------------------------------------------------------- */

.df-section { margin-bottom: 2rem; scroll-margin-top: calc(var(--df-bar-h) + 0.75rem); }

.df-section > h2,
.df-ranking-hero > h2 {
    font-size: var(--df-fs-h3);
    font-weight: 650;
    color: var(--df-ink);
    margin: 0 0 0.75rem;
}

.df-section > p { max-width: 40rem; }

.df-subhead { font-size: var(--df-fs-md); font-weight: 600; color: var(--df-muted); margin: 1.25rem 0 0.5rem; }

/* A stage of a competition's structure: its name, then its groups, bracket or rounds. */
.df-stage { scroll-margin-top: calc(var(--df-bar-h) + 0.75rem); }
.df-stage > h3.df-subhead { color: var(--df-ink); font-size: var(--df-fs-lg); }
.df-subhead-sm { font-size: var(--df-fs-sm); }

/* Standings: a plain table; narrow screens scroll it sideways rather than squeeze it. */
.df-table-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.df-standings { margin-bottom: 0.75rem; }
.df-standings-meta { font-size: var(--df-fs-sm); color: var(--df-muted); margin: 0 0 0.375rem; }
.df-standings-note { font-size: var(--df-fs-xs); color: var(--df-faint); margin: 0.375rem 0 0; }
.df-standings-table th, .df-standings-table td { padding: 0.4375rem 0.625rem; white-space: nowrap; }
.df-standings-table tbody th { color: var(--df-ink); }
.df-standings-table tr.df-advances > td:first-child { box-shadow: inset 3px 0 0 var(--df-accent); }
.df-standings-table tr.df-cutoff > * { border-top: 2px solid var(--df-accent); }
.df-league-lines { list-style: none; margin: 0.25rem 0 0; padding: 0; font-size: var(--df-fs-sm); }
.df-listed { font-size: var(--df-fs-xs); color: var(--df-faint); }
.df-group { margin-bottom: 1.5rem; scroll-margin-top: calc(var(--df-bar-h) + 0.75rem); }
.df-matchday { font-size: var(--df-fs-xs); font-weight: 600; color: var(--df-faint); text-transform: uppercase; letter-spacing: 0.04em; margin: 0.75rem 0 0.375rem; }

.df-collapsible-round { margin: 0.75rem 0 1rem; }
.df-collapsible-round > summary { cursor: pointer; color: var(--df-muted); font-size: var(--df-fs-sm); font-weight: 600; margin-bottom: 0.5rem; }
.df-collapsible-round > summary::marker { color: var(--df-accent); }
.df-collapsible-round > .df-panel { margin-top: 0.5rem; }
.df-hash-target { animation: df-hash-target 1.8s ease-out; scroll-margin-top: calc(var(--df-bar-h) + 0.75rem); }
@keyframes df-hash-target { 0%, 55% { background: var(--df-sunken); } 100% { background: transparent; } }

.df-panel {
    background: var(--df-surface);
    border: 1px solid var(--df-line);
    border-radius: var(--df-radius);
}

.df-panel-foot {
    padding: 0.625rem 1rem;
    border-top: 1px solid var(--df-line);
    font-size: var(--df-fs-sm);
    color: var(--df-muted);
}

/* ---- Facts ----------------------------------------------------------------------------------- */

.df-facts { margin: 0; }

.df-facts > div {
    display: grid;
    grid-template-columns: 6.75rem 1fr;
    gap: 0.75rem;
    padding: 0.6875rem 1rem;
    border-top: 1px solid var(--df-line);
}

.df-facts > div:first-child { border-top: 0; }
.df-facts dt { font-size: var(--df-fs-sm); font-weight: 500; color: var(--df-muted); padding-top: 0.125rem; }
.df-facts dd { margin: 0; font-size: var(--df-fs-md); color: var(--df-ink); min-width: 0; }

.df-detail { display: block; font-size: var(--df-fs-sm); color: var(--df-muted); margin-top: 0.125rem; }
.df-unknown { color: var(--df-faint); }

/* Source numbers: small, but each a 1.5rem target with a descriptive accessible name. */
.df-refs { white-space: nowrap; font-size: var(--df-fs-xs); color: var(--df-faint); margin-left: 0.125rem; }

.df-public a.df-ref {
    display: inline-block;
    min-width: 1.5rem;
    min-height: 1.5rem;
    line-height: 1.5rem;
    text-align: center;
    color: var(--df-muted);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--df-line-strong);
    vertical-align: baseline;
}

.df-public a.df-ref:hover { color: var(--df-ink); text-decoration-color: currentColor; }

/* Attribution: plain sentence under the item it qualifies. */
.df-attrib { display: block; font-size: var(--df-fs-sm); color: var(--df-muted); margin-top: 0.25rem; }
.df-attrib.disputed { color: var(--df-disputed); }

/* ---- Rows: organizers, directory entries --------------------------------------------------- */

.df-rows { list-style: none; margin: 0; padding: 0; }

.df-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--df-line);
}

.df-row:first-child { border-top: 0; }
.df-row-main { flex: 1; min-width: 0; }
/* A fixture that did not take place (cancelled, e.g. by a replacement): kept on the record, muted. */
.df-row-void .df-row-title { color: var(--df-muted, #6c757d); text-decoration: line-through; text-decoration-thickness: 1px; }
.df-row-void .df-row-meta { opacity: .8; }
.df-row-title { font-size: var(--df-fs-md); font-weight: 600; color: var(--df-ink); overflow-wrap: anywhere; }
.df-row-meta { font-size: var(--df-fs-sm); color: var(--df-muted); }
.df-row .df-img.sm { margin-top: 0.0625rem; }

a.df-row-link { display: flex; text-decoration: none; color: inherit; }
.df-public a.df-row-link { text-decoration: none; }
a.df-row-link:hover .df-row-title { text-decoration: underline; }

/* Parts of a meta line, separated by a middle dot; parts that are not known are simply absent. */
.df-dots > * + *::before { content: "·"; margin: 0 0.375em; color: var(--df-faint); }

/* Directory and list rows with a picture: the meta line wraps under the name. */
.df-row-side { flex: none; margin-left: auto; padding-left: 0.5rem; text-align: right; }
.df-row .df-attrib + .df-attrib { margin-top: 0.125rem; }
.df-match .df-score { margin: 0 0.5em; color: var(--df-muted); }
.df-row:target { background: var(--df-sunken); }
.df-list-more { display: inline-block; margin-top: 0.625rem; font-size: var(--df-fs-sm); font-weight: 500; }

/* Find in a directory: one field, plain. */
.df-search { display: flex; gap: 0.5rem; margin: 0 0 1rem; max-width: 28rem; }

.df-search input {
    flex: 1;
    min-width: 0;
    height: 2.75rem;
    padding: 0 0.75rem;
    font: inherit;
    font-size: var(--df-fs-md);
    color: var(--df-ink);
    background: var(--df-surface);
    border: 1px solid var(--df-line-strong);
    border-radius: var(--df-radius);
}

.df-search button {
    flex: none;
    height: 2.75rem;
    padding: 0 1rem;
    font: inherit;
    font-size: var(--df-fs-md);
    font-weight: 600;
    color: #fff;
    background: var(--df-ink);
    border: 0;
    border-radius: var(--df-radius);
}

.df-search-note { font-size: var(--df-fs-sm); color: var(--df-muted); margin: -0.5rem 0 1rem; }

/* Sub-headings inside a panel (e.g. a competition within an organization's list). */
.df-panel-group { padding: 0.25rem 1rem 0.75rem; border-top: 1px solid var(--df-line); }
.df-panel-group:first-child { border-top: 0; }
.df-panel-group > .df-row-title { padding-top: 0.625rem; }
.df-panel-group ul { list-style: none; margin: 0.25rem 0 0; padding: 0; }
.df-panel-group li { font-size: var(--df-fs-sm); color: var(--df-muted); padding: 0.125rem 0; }

/* Facts whose value is a list of links or names. */
.df-facts .df-list { list-style: none; margin: 0; padding: 0; }
.df-facts .df-list li + li { margin-top: 0.125rem; }
.df-facts a { overflow-wrap: anywhere; }

/* ---- Prize table ------------------------------------------------------------------------------ */

.df-table { width: 100%; margin: 0; font-size: var(--df-fs-md); border-collapse: collapse; }
.df-table th, .df-table td { padding: 0.5625rem 1rem; border-top: 1px solid var(--df-line); text-align: left; }
.df-table thead th { border-top: 0; font-size: var(--df-fs-sm); font-weight: 500; color: var(--df-muted); }
.df-table td { color: var(--df-ink); }
.df-table .end { text-align: right; }
.df-table .df-each { color: var(--df-muted); font-size: var(--df-fs-sm); }

/* ---- Qualification (fragments/qualification): source → "Qualifies for" → destination ------------
   Two nodes and a labelled arrow on one line, stacked with the arrow pointing down on phones. Green
   marks a confirmed qualifier only; nodes stay neutral. */

.df-qual { margin-bottom: 0.75rem; }
.df-qual-flow { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0.875rem 1rem 0.5rem; }
.df-qual-node {
    display: flex; flex-direction: column; gap: 0.125rem; padding: 0.5rem 0.75rem; background: var(--df-surface);
    border: 1px solid var(--df-line); border-radius: var(--df-radius-sm); min-width: 0;
}
.df-qual-node .df-row-title { overflow-wrap: anywhere; }
.df-qual-to { border-color: var(--df-line-strong); }
.df-qual-edge {
    position: relative; display: flex; align-items: center; justify-content: center; min-height: 2.25rem;
    font-size: var(--df-fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--df-muted);
}
.df-qual-edge::before { content: ""; position: absolute; top: 0; bottom: 0.375rem; left: 50%; border-left: 1.5px solid var(--df-line-strong); }
.df-qual-edge::after {
    content: ""; position: absolute; bottom: 0; left: calc(50% - 0.3125rem); border: 0.3125rem solid transparent;
    border-top: 0.375rem solid var(--df-line-strong); border-bottom: 0;
}
.df-qual-edge span { position: relative; background: var(--df-surface); padding: 0 0.5rem; }
.df-qual-body { padding: 0.25rem 1rem 0.875rem; }
.df-qual-count { font-size: var(--df-fs-sm); font-weight: 600; color: var(--df-ink); margin: 0.5rem 0 0.375rem; }
.df-qualifiers { list-style: none; margin: 0 0 0.625rem; padding: 0; display: grid; grid-template-columns: 1fr; gap: 0.25rem 1.5rem; }
.df-qualifiers li { position: relative; padding-left: 1rem; font-size: var(--df-fs-md); }
.df-qualifiers li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 0.4375rem; height: 0.4375rem; background: var(--df-accent); }
.df-qualifiers li.df-qual-review::before { background: transparent; border: 1.5px solid var(--df-accent); }
.df-advanced { margin: 0.5rem 0 1rem; }

@media (min-width: 576px) {
    .df-qual-flow { flex-direction: row; align-items: center; }
    .df-qual-node { flex: 1 1 0; }
    .df-qual-edge { flex: 0 0 8.5rem; min-height: 0; height: 2.5rem; }
    .df-qual-edge::before { top: 50%; bottom: auto; left: 0.25rem; right: 0.625rem; border-left: 0; border-top: 1.5px solid var(--df-line-strong); }
    .df-qual-edge::after {
        bottom: auto; top: calc(50% - 0.3125rem + 0.75px); left: auto; right: 0.25rem;
        border: 0.3125rem solid transparent; border-left: 0.375rem solid var(--df-line-strong); border-right: 0;
    }
    .df-qualifiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Sources -------------------------------------------------------------------------------- */

.df-sources { list-style: none; margin: 0; padding: 0; }

.df-sources li {
    display: grid;
    grid-template-columns: 1.5rem 1fr;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--df-line);
    font-size: var(--df-fs-md);
    scroll-margin-top: calc(var(--df-bar-h) + 0.75rem);
}

.df-sources li:first-child { border-top: 0; }
.df-sources li:target { background: var(--df-sunken); }
.df-sources .df-n { color: var(--df-faint); font-weight: 600; font-size: var(--df-fs-sm); padding-top: 0.0625rem; }
.df-sources a { font-weight: 500; overflow-wrap: anywhere; }
.df-sources .df-row-meta { margin-top: 0.125rem; }

/* ---- Coverage note ------------------------------------------------------------------------------ */

.df-note {
    border-left: 2px solid var(--df-ink);
    padding: 0.125rem 0 0.125rem 0.875rem;
    font-size: var(--df-fs-md);
    color: var(--df-text);
    max-width: 40rem;
}

/* ---- Home ---------------------------------------------------------------------------------------- */

.df-intro { padding: 1.75rem 0 1.5rem; }

.df-intro h1 {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: var(--df-ink);
    margin: 0 0 0.75rem;
    max-width: 22ch;
}

.df-intro p { font-size: var(--df-fs-lg); color: var(--df-muted); max-width: 36rem; margin: 0; }

@media (min-width: 768px) {
    .df-intro { padding: 3rem 0 2.25rem; }
    .df-intro h1 { font-size: 2.75rem; }
}

/* ---- Rankings -------------------------------------------------------------------------------- */

.df-kicker { margin: 0 0 .4rem; color: var(--df-muted); font-size: var(--df-fs-sm); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.df-ranking-hero { padding: 1.25rem 0 1.5rem; }
.df-ranking-controls { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .75rem 1rem; margin: 0 0 1.25rem; padding: .75rem 0; border-top: 1px solid var(--df-line); border-bottom: 1px solid var(--df-line); }
.df-period-links, .df-year-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .85rem; font-size: var(--df-fs-sm); }
.df-year-links { margin-left: .5rem; color: var(--df-muted); }
.df-period-links a, .df-year-links a { color: var(--df-muted); text-decoration: none; }
.df-period-links a:hover, .df-period-links a.is-selected, .df-year-links a:hover, .df-year-links a.is-selected { color: var(--df-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .35em; }
.df-ranking-method { margin: 0; font-size: var(--df-fs-sm); color: var(--df-muted); }
.df-ranking-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-bottom: 2rem; border: 1px solid var(--df-line); background: var(--df-line); border-radius: var(--df-radius); overflow: hidden; }
.df-ranking-summary > div { display: flex; flex-direction: column; gap: .125rem; padding: .75rem 1rem; background: var(--df-surface); }
.df-ranking-summary strong { color: var(--df-ink); font-size: var(--df-fs-lg); font-variant-numeric: tabular-nums; }
.df-ranking-summary span { color: var(--df-muted); font-size: var(--df-fs-xs); }
.df-ranking-table th, .df-ranking-table td { vertical-align: top; }
.df-ranking-table tbody th { width: 3.5rem; color: var(--df-muted); font-weight: 600; }
.df-ranking-table .df-points { color: var(--df-ink); font-weight: 700; }
.df-contribution-details { margin-top: .25rem; font-size: var(--df-fs-xs); }
.df-contribution-details summary { color: var(--df-muted); cursor: pointer; }
.df-contributions { list-style: none; padding: .35rem 0 0; margin: 0; }
.df-contributions li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .5rem; padding: .25rem 0; color: var(--df-muted); }
.df-contributions li strong { color: var(--df-ink); white-space: nowrap; }
.df-contributions .df-contribution-math { grid-column: 1 / -1; margin-top: -.2rem; font-size: .92em; }
.df-ranking-notes { border-left: 2px solid var(--df-line-strong); max-width: 48rem; padding-left: .875rem; margin: 1.5rem 0 2rem; color: var(--df-muted); font-size: var(--df-fs-sm); }
.df-ranking-notes p { margin: .25rem 0; }
.df-event-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; color: inherit; background: var(--df-surface); border: 1px solid var(--df-line); border-left: 3px solid var(--df-accent); border-radius: var(--df-radius); text-decoration: none; }
.df-event-banner:hover { border-color: var(--df-line-strong); }
main > .df-event-banner:first-child { margin-top: 1.25rem; }
.df-ranking-revision { max-width: 48rem; margin: .75rem 0 0; font-size: var(--df-fs-sm); }
.df-ranking-revision p { margin: .25rem 0; }
.df-ranking-changes { margin: .5rem 0 0; padding-left: 1.1rem; color: var(--df-muted); }
.df-home-about { max-width: 42rem; }

@media (min-width: 576px) {
    .df-ranking-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .df-ranking-hero { padding: 2.25rem 0 2rem; }
}

.df-feature {
    display: block;
    color: inherit;
    background: var(--df-surface);
    border: 1px solid var(--df-line);
    border-radius: var(--df-radius);
    padding: 1rem;
}

.df-public a.df-feature { text-decoration: none; }
.df-feature:hover { border-color: var(--df-line-strong); }
.df-feature:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

.df-feature-top { display: flex; align-items: center; gap: 0.75rem; }

.df-feature h3 {
    font-size: 1.1875rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--df-ink);
    margin: 0.875rem 0 0.25rem;
}

.df-feature p { font-size: var(--df-fs-md); color: var(--df-muted); margin: 0; max-width: 40rem; }

.df-feature-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    margin: 1rem 0 0;
    padding-top: 0.875rem;
    border-top: 1px solid var(--df-line);
}

.df-feature-facts dt { font-size: var(--df-fs-xs); color: var(--df-muted); font-weight: 500; }
.df-feature-facts dd { margin: 0.125rem 0 0; font-size: var(--df-fs-md); font-weight: 600; color: var(--df-ink); }

@media (min-width: 768px) {
    .df-feature { padding: 1.5rem; }
    .df-feature h3 { font-size: 1.5rem; }
    .df-feature-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---- Prose pages (privacy) ------------------------------------------------------------------- */

.df-prose { max-width: 40rem; padding-bottom: 1rem; }
.df-prose h2 { font-size: var(--df-fs-h3); font-weight: 650; color: var(--df-ink); margin-top: 2rem; }
.df-lede { font-size: var(--df-fs-lg); color: var(--df-muted); }

/* ---- Empty and error states ---------------------------------------------------------------------- */

.df-empty { padding: 3rem 0; max-width: 32rem; }
.df-empty .df-code { font-size: var(--df-fs-sm); color: var(--df-muted); font-weight: 600; margin: 0 0 0.5rem; }
.df-empty h1 { font-size: var(--df-fs-h1); font-weight: 700; color: var(--df-ink); letter-spacing: -0.02em; }

/* ---- Footer -------------------------------------------------------------------------------------- */

.df-footer {
    border-top: 1px solid var(--df-line);
    margin-top: 2.5rem;
    padding: 1.5rem 0 calc(2rem + env(safe-area-inset-bottom));
    font-size: var(--df-fs-sm);
    color: var(--df-muted);
}

.df-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-bottom: 0.75rem; }
.df-footer nav a { display: inline-flex; align-items: center; min-height: 2.25rem; }
.df-public .df-footer a { color: var(--df-text); }
.df-footer p { margin: 0; max-width: 40rem; }

/* ---- Desktop: facts rail stays in view ------------------------------------------------------- */

@media (min-width: 992px) {
    .df-rail { position: sticky; top: calc(var(--df-bar-h) + 1.5rem); }
}

/* Date ranges and amounts never break across lines. */
.df-row-meta .df-num, .df-feature-facts .df-num, .df-facts .df-num { white-space: nowrap; }

/* Admin preview of a competition page: plain notice above the page. */
.df-preview {
    margin: 1rem 0 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--df-line-strong);
    border-left: 3px solid var(--df-ink);
    background: var(--df-surface);
    font-size: var(--df-fs-md);
}

/* A draft in the admin's preview: said in words, never a badge. */
.df-draft { color: var(--df-ink); font-weight: 600; }

/* Claims: what others reported, set apart from what Defrag documents. */
.df-reported { background: var(--df-sunken); }
.df-reported .df-row-title { font-weight: 500; }
.df-also { max-width: 40rem; }

/* ---- Knockout bracket (fragments/bracket) ------------------------------------------------------
   One fixed-width column per round; positions share the column's height equally, so each match sits
   level with the two that feed it. Connectors are borders. Narrow screens scroll the bracket sideways
   in its own box; nothing is shrunk. */

.df-bracket-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 1rem; padding-bottom: 0.25rem; }
.df-bracket-scroll:focus-visible { outline: 2px solid var(--df-accent); outline-offset: 2px; }
.df-bracket { --df-col: 13.5rem; --df-gap: 1.25rem; display: flex; align-items: stretch; list-style: none; margin: 0; padding: 0; width: max-content; }
.df-round { display: flex; flex-direction: column; width: var(--df-col); flex: 0 0 var(--df-col); margin-right: var(--df-gap); }
.df-round:last-child { margin-right: 0; }
.df-round-name {
    position: sticky; left: 0; font-size: var(--df-fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--df-muted); margin: 0 0 0.5rem; padding-bottom: 0.375rem; border-bottom: 1px solid var(--df-line);
}
/* Equal rows (the tallest card sets them), so a match always sits level with the midpoint of its two feeders. */
.df-round-slots { display: grid; grid-auto-rows: 1fr; flex: 1; list-style: none; margin: 0; padding: 0; }
.df-slot { position: relative; display: flex; align-items: center; padding: 0.375rem 0; }
.df-slot > * { width: 100%; }

/* Connectors: out of every match except the final's and the 3rd place's, joined in pairs, into the next round. */
.df-round:not(.df-round-final):not(.df-round-third) .df-slot::after {
    content: ""; position: absolute; right: calc(var(--df-gap) / -2); top: 50%; width: calc(var(--df-gap) / 2); border-top: 1px solid var(--df-line-strong);
}
.df-round:not(.df-round-final):not(.df-round-third) .df-slot:nth-child(odd)::before {
    content: ""; position: absolute; right: calc(var(--df-gap) / -2); top: 50%; height: 50%; border-right: 1px solid var(--df-line-strong);
}
.df-round:not(.df-round-final):not(.df-round-third) .df-slot:nth-child(even)::before {
    content: ""; position: absolute; right: calc(var(--df-gap) / -2); top: 0; height: 50%; border-right: 1px solid var(--df-line-strong);
}
.df-round:not(:first-child):not(.df-round-third) .df-slot > .df-card { position: relative; }
.df-round:not(:first-child):not(.df-round-third) .df-slot > .df-card::before {
    content: ""; position: absolute; left: calc(var(--df-gap) / -2 - 1px); top: 50%; width: calc(var(--df-gap) / 2); border-top: 1px solid var(--df-line-strong);
}
.df-round-third { padding-left: var(--df-gap); border-left: 1px dashed var(--df-line); }

.df-card {
    display: flex; flex-direction: column; gap: 0.125rem; padding: 0.5rem 0.625rem; min-height: 4.25rem;
    background: var(--df-surface); border: 1px solid var(--df-line); border-radius: var(--df-radius-sm);
    color: var(--df-text); text-decoration: none; font-size: var(--df-fs-sm);
}
a.df-card:hover { border-color: var(--df-line-strong); color: var(--df-text); }
a.df-card:focus-visible { outline: 2px solid var(--df-accent); outline-offset: 2px; }
.df-card-round { font-size: var(--df-fs-xs); color: var(--df-faint); }
.df-card-side { display: flex; justify-content: space-between; gap: 0.5rem; color: var(--df-text); }
.df-card-side.df-won { color: var(--df-ink); font-weight: 600; }
.df-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-card-score { min-width: 1.25rem; text-align: right; }
.df-card-detail { font-size: var(--df-fs-xs); color: var(--df-muted); }
.df-card-unknown { border-style: solid; background: var(--df-bg); }
.df-card-empty { background: transparent; border: 1px dashed var(--df-line-strong); justify-content: center; }
.df-card-empty-text { color: var(--df-muted); font-style: italic; }
.df-implied { font-size: var(--df-fs-xs); color: var(--df-faint); font-style: italic; }
.df-card-add { font-size: var(--df-fs-xs); }
.df-byes { font-size: var(--df-fs-xs); color: var(--df-muted); margin: 0.5rem 0 0; }
.df-byes-label { font-weight: 600; }

/* ---- Double elimination (fragments/double-elimination) ---------------------------------------
   One SVG per stage, laid out on the server (stage/BracketCanvas): fixed-size HTML cards in
   foreignObjects, connectors as paths behind nothing but the gutters and bands they run in. The
   canvas keeps its size and scrolls sideways in its own box on narrow screens. Green is kept for
   confirmed qualification. */

.df-de-scroll { background: var(--df-surface); border: 1px solid var(--df-line); border-radius: var(--df-radius); padding: 0.25rem; }
.df-de-canvas { display: block; overflow: visible; font-family: var(--df-font); }
.df-de-label { font-size: 11px; fill: var(--df-muted); }
.df-de-label-lane { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; fill: var(--df-ink); }
.df-de-label-round { font-size: 11px; font-weight: 600; fill: var(--df-muted); }
.df-de-label-bye { font-size: 11px; fill: var(--df-muted); }

.df-de-edge { fill: none; stroke-width: 1.5; stroke-linejoin: round; }
.df-de-win { stroke: #8b8d92; }
.df-de-loss { stroke: #a9aba6; stroke-dasharray: 5 4; }
.df-de-qualify { stroke: var(--df-accent); stroke-width: 1.75; }
.df-de-arrow-loss { fill: #a9aba6; }
.df-de-arrow-qualify { fill: var(--df-accent); }
.df-de-stub path { stroke: var(--df-faint); stroke-width: 1.25; stroke-dasharray: 2 2; fill: none; }
.df-de-stub text { font-size: 10px; font-weight: 600; fill: var(--df-faint); text-anchor: middle; }

/* A match card: fixed size, so long names truncate and never move a connector. */
.df-dc {
    box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; gap: 1px; width: 100%; height: 100%;
    margin: 0; padding: 0.25rem 0.5rem; background: var(--df-surface); border: 1px solid var(--df-line-strong); border-radius: var(--df-radius-sm);
    font: inherit; font-size: 12.5px; line-height: 1.25; color: var(--df-text); text-align: left; text-decoration: none; cursor: pointer;
}
.df-dc:hover { border-color: var(--df-ink); color: var(--df-text); }
.df-dc:focus-visible { outline: 2px solid var(--df-accent); outline-offset: 1px; }
.df-dc-draft { border-style: dashed; }
.df-dc-meta { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 10.5px; color: var(--df-faint); }
.df-dc-side { position: relative; display: flex; justify-content: space-between; gap: 0.375rem; }
.df-dc-side.df-won { font-weight: 600; color: var(--df-ink); }
.df-dc-side.df-won::before { content: ""; position: absolute; left: -0.5rem; top: 2px; bottom: 2px; width: 2px; background: var(--df-ink); }
.df-dc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.df-dc-score { flex: 0 0 auto; }

/* Who went through: green only once confirmed; an unconfirmed survivor stays neutral. */
.df-de-end {
    box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 0.125rem 0.5rem;
    border: 1px solid var(--df-line-strong); border-left-width: 3px; border-radius: var(--df-radius-sm); background: var(--df-surface);
    font-size: 12.5px; line-height: 1.25;
}
.df-de-end-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--df-ink); }
.df-de-end-kind { font-size: 10.5px; color: var(--df-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-de-end-confirmed, .df-de-end-source { border-left-color: var(--df-accent); }
.df-de-end-review { border-left-color: var(--df-accent); border-left-style: dashed; }
.df-de-end-survivor { border-style: dashed; border-left-width: 1px; }

/* A competitor's route, shown while its link is the address's target. */
.df-de-route { display: none; pointer-events: none; }
.df-de-route:target { display: inline; }
.df-de-route rect { fill: none; stroke: var(--df-accent); stroke-width: 2; }
.df-de-route path { fill: none; stroke: var(--df-accent); stroke-width: 3; stroke-opacity: 0.55; }

.df-de-key { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; margin: 0.5rem 0 0.25rem; padding: 0; font-size: var(--df-fs-xs); color: var(--df-muted); }
.df-key { display: inline-block; width: 1.5rem; margin-right: 0.375rem; vertical-align: middle; border-top: 1.5px solid #8b8d92; }
.df-key-loss { border-top: 1.5px dashed #a9aba6; }
.df-key-qualify { border-top: 2px solid var(--df-accent); }
.df-key-stub { width: auto; border: 0; font-weight: 600; color: var(--df-faint); }
.df-de-follow { font-size: var(--df-fs-xs); color: var(--df-muted); margin: 0 0 1rem; }
.df-de-follow-label { font-weight: 600; }
.df-de-more { margin: 0.5rem 0 1rem; }
.df-de-more > summary { cursor: pointer; font-size: var(--df-fs-sm); font-weight: 600; color: var(--df-ink); }

/* A match's details over the bracket (the popover attribute; nothing shows where it is not supported). */
[popover].df-pop { display: none; }
[popover].df-pop:popover-open {
    display: block; width: min(28rem, calc(100vw - 2rem)); max-height: calc(100vh - 4rem); overflow: auto; margin: auto; padding: 0;
    border: 1px solid var(--df-line-strong); border-radius: var(--df-radius); background: var(--df-surface); color: var(--df-text);
    box-shadow: 0 8px 28px rgba(17, 18, 20, 0.16);
}
.df-pop::backdrop { background: rgba(17, 18, 20, 0.2); }
.df-pop-place { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 0.5rem 1rem; border-bottom: 1px solid var(--df-line);
    font-size: var(--df-fs-xs); font-weight: 600; color: var(--df-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.df-pop-close { border: 0; background: none; font-size: 1.25rem; line-height: 1; color: var(--df-muted); cursor: pointer; padding: 0 0.25rem; }
.df-de-records th:first-child, .df-de-records td:last-child { white-space: normal; }
.df-de-next { font-size: var(--df-fs-xs); color: var(--df-faint); padding: 0 0.125rem; }

/* Follow controls progressively enhance the server-rendered bracket and its plain anchor list. */
.df-de { min-width: 0; max-width: 100%; }
.df-de-picker { position: relative; margin: .5rem 0; max-width: 24rem; font-size: var(--df-fs-sm); }
.df-de-picker label { display: block; font-weight: 600; margin-bottom: .25rem; }
.df-de-search-row { display: flex; gap: .5rem; }
.df-de-search-row input { min-width: 0; flex: 1; background: var(--df-surface); color: var(--df-text); border: 1px solid var(--df-line-strong); border-radius: var(--df-radius-sm); padding: .4rem .6rem; }
.df-de-search-row button { border: 1px solid var(--df-line-strong); border-radius: var(--df-radius-sm); background: var(--df-surface); color: var(--df-text); padding: 0 .75rem; }
.df-de-options { position: absolute; z-index: 5; top: 100%; left: 0; right: 0; max-height: 16rem; overflow-y: auto; list-style: none; padding: .25rem; margin: 0; background: var(--df-surface); border: 1px solid var(--df-line-strong); border-radius: var(--df-radius-sm); box-shadow: 0 4px 16px #0002; }
.df-de-options li { padding: .4rem .5rem; cursor: pointer; }
.df-de-options li:hover, .df-de-options li.is-active { background: var(--df-bg); outline: 1px solid var(--df-accent); }
[data-follow-status] { margin: .25rem 0; color: var(--df-muted); font-size: var(--df-fs-xs); }
.df-de-route.is-followed { display: inline; }
.df-de-following [data-match]:not(.is-in-route), .df-de-following .df-de-edge:not(.is-in-route) { opacity: .3; }
.df-de-hover-loss { display: none; }
.df-de-hover-loss.is-connected { display: inline; }
.df-de-edge.is-connected { stroke: var(--df-accent); stroke-width: 2.5; }
.df-de-canvas { overflow: hidden; }
.df-dc { padding: 2px 5px; gap: 0; font-size: 11px; line-height: 1.2; }
.df-dc-meta { font-size: 9px; line-height: 11px; }
.df-dc-progression { display: flex; gap: .4rem; font-size: 9px; color: var(--df-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 11px; }
.df-de-drop, .df-dc-name[data-competitor] { cursor: pointer; }
.df-de-drop:hover, .df-dc-name[data-competitor]:hover { text-decoration: underline; }
.df-de-lanes { display: flex; gap: .25rem; margin: .5rem 0; }
.df-de-lanes a { border: 1px solid var(--df-line-strong); padding: .25rem .6rem; border-radius: var(--df-radius-sm); font-size: var(--df-fs-sm); }
.is-pulsed .df-dc { outline: 3px solid var(--df-accent); }

.df-de-enhanced .df-de-route:not(.is-followed) { display: none; }

/* An entrant's identity decision: a small "i" beside the name, a native button opening one explanation per entrant. A
   proposal (not yet reviewed) is dashed. In a bracket card, which is itself a link or a button, the mark is not interactive. */
.df-identity-mark {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 1.0625rem; height: 1.0625rem;
    margin-left: 0.25rem; padding: 0; vertical-align: 0.0625rem; border: 1px solid var(--df-line-strong); border-radius: 50%;
    background: var(--df-surface); color: var(--df-muted); font: 600 0.6875rem/1 Georgia, 'Times New Roman', serif; font-style: italic;
}
button.df-identity-mark { cursor: pointer; position: relative; }
/* A comfortable target on touch screens without changing the mark's size. */
button.df-identity-mark::after { content: ''; position: absolute; inset: -0.5rem; }
button.df-identity-mark:hover { border-color: var(--df-ink); color: var(--df-ink); }
button.df-identity-mark:focus-visible { outline: 2px solid var(--df-accent); outline-offset: 2px; }
.df-identity-proposed { border-style: dashed; }
.df-card-name .df-identity-mark, .df-dc-side .df-identity-mark { width: 0.9375rem; height: 0.9375rem; font-size: 0.625rem; }
.df-dc-side .df-identity-static { margin-right: auto; margin-left: 0; }
.df-identity { margin: 0; padding: 0.75rem 1rem 1rem; font-size: var(--df-fs-sm); }
.df-identity dt { margin-top: 0.625rem; font-size: var(--df-fs-xs); font-weight: 600; color: var(--df-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.df-identity dt:first-child { margin-top: 0; }
.df-identity dd { margin: 0.125rem 0 0; color: var(--df-text); }
.df-identity-sources { margin: 0; padding-left: 1.125rem; }

/* Public tier history (methodology, competition pages): date, then what changed and why. */
.df-tier-history { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.df-tier-history li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--df-line); }
.df-tier-history li:last-child { border-bottom: 1px solid var(--df-line); }
.df-tier-history time { color: var(--df-muted); font-size: var(--df-fs-sm); }
@media (max-width: 560px) { .df-tier-history li { grid-template-columns: 1fr; gap: .15rem; } }

/* ---- Head-to-head ------------------------------------------------------------------------------
 * Two players face each other across the record of their documented meetings. Side A is ink, side B
 * the accent; a draw is the strong line. Whoever is ahead on a line is set in weight, never colour alone. */

.df-h2h, .df-h2h-opponents { --df-h2h-a: var(--df-ink); --df-h2h-b: var(--df-accent); --df-h2h-d: var(--df-line-strong); }

.df-h2h-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    margin: 1.25rem 0 1rem;
    padding: 1.25rem 0.75rem;
    background: var(--df-surface);
    border: 1px solid var(--df-line);
    border-radius: var(--df-radius);
}
.df-h2h-side { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.5rem; min-width: 0; }
.df-h2h-name { font-size: var(--df-fs-lg); font-weight: 650; color: var(--df-ink); line-height: 1.2; overflow-wrap: anywhere; }
.df-h2h-name a { text-decoration: none; }
.df-h2h-name a:hover { text-decoration: underline; }
.df-h2h-side .df-img { border-width: 2px; border-color: var(--df-h2h-a); }
.df-h2h-side.b .df-img { border-color: var(--df-h2h-b); }
.df-h2h-meta { font-size: var(--df-fs-sm); color: var(--df-muted); justify-content: center; }

.df-h2h-tally { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 0.75rem; min-width: 7.5rem; max-width: 15rem; }
.df-h2h-score { display: flex; align-items: baseline; gap: 0.35rem; font-size: 2.75rem; font-weight: 300; line-height: 1; color: var(--df-muted); letter-spacing: -0.02em; }
.df-h2h-score .is-ahead { font-weight: 700; color: var(--df-ink); }
.df-h2h-dash { color: var(--df-line-strong); font-weight: 300; }
.df-h2h-score-none { font-size: 1.5rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--df-line-strong); }
.df-h2h-caption { margin: 0.625rem 0 0; font-size: var(--df-fs-sm); color: var(--df-muted); }
.df-h2h-streak { margin: 0.5rem 0 0; font-size: var(--df-fs-sm); font-weight: 600; color: var(--df-ink); }

.df-h2h-bar, .df-h2h-opp-bar, .df-h2h-split { display: block; width: 100%; overflow: hidden; border-radius: 3px; background: var(--df-sunken); }
.df-h2h-bar { height: 6px; margin-top: 0.75rem; }
.df-h2h-bar .a, .df-h2h-opp-bar .a, .df-h2h-split .a { fill: var(--df-h2h-a); }
.df-h2h-bar .d, .df-h2h-opp-bar .d { fill: var(--df-h2h-d); }
.df-h2h-bar .b, .df-h2h-opp-bar .b, .df-h2h-split .b { fill: var(--df-h2h-b); }

@media (min-width: 768px) {
    .df-h2h-hero { gap: 2rem; padding: 2rem 1.5rem; }
    .df-h2h-name { font-size: 1.375rem; }
    .df-h2h-tally { min-width: 12rem; padding-top: 1.25rem; }
    .df-h2h-score { font-size: 4rem; gap: 0.6rem; }
}
@media (max-width: 767px) {
    .df-h2h-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .df-h2h-tally { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; min-width: 0; max-width: none; padding-top: 0.25rem; }
    .df-h2h-meta { display: flex; flex-direction: column; gap: 0.125rem; }
    .df-h2h-meta > * + *::before { content: none; }
}

.df-h2h-tools { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.df-h2h-picker { display: flex; gap: 0.5rem; flex: 1 1 18rem; max-width: 28rem; }
.df-h2h-picker .form-select { min-width: 0; }
.df-h2h-swap { display: inline-flex; gap: 0.375rem; align-items: center; font-size: var(--df-fs-sm); font-weight: 500; }

/* The comparison: a's value, the measure with a split bar under it, b's value. */
.df-h2h-compare { width: 100%; border-collapse: collapse; }
.df-h2h-compare td, .df-h2h-compare th { padding: 0.75rem 1rem; border-top: 1px solid var(--df-line); vertical-align: middle; }
.df-h2h-compare tbody tr:first-child td, .df-h2h-compare tbody tr:first-child th { border-top: 0; }
.df-h2h-compare th { text-align: center; font-size: var(--df-fs-sm); font-weight: 500; color: var(--df-muted); width: 44%; }
.df-h2h-compare td { width: 28%; font-size: var(--df-fs-lg); color: var(--df-muted); }
.df-h2h-compare .va { text-align: left; }
.df-h2h-compare .vb { text-align: right; }
.df-h2h-compare .is-ahead { color: var(--df-ink); font-weight: 700; }
.df-h2h-split { height: 4px; margin: 0.4rem auto 0; max-width: 14rem; }
@media (max-width: 560px) {
    .df-h2h-compare td { font-size: var(--df-fs-md); padding: 0.625rem 0.625rem; }
    .df-h2h-compare th { padding: 0.625rem 0.25rem; }
}

/* Meetings: newest first, the winner's name in weight; a left rule in the winner's colour. */
.df-h2h-meetings { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.625rem; }
.df-h2h-meeting { background: var(--df-surface); border: 1px solid var(--df-line); border-left: 3px solid var(--df-h2h-d); border-radius: var(--df-radius); padding: 0.875rem 1rem; }
.df-h2h-meeting.won-a { border-left-color: var(--df-h2h-a); }
.df-h2h-meeting.won-b { border-left-color: var(--df-h2h-b); }
.df-h2h-when { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; font-size: var(--df-fs-sm); }
.df-h2h-when a { font-weight: 500; }
.df-h2h-line { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0.75rem; align-items: baseline; margin-top: 0.5rem; }
.df-h2h-who { color: var(--df-muted); overflow-wrap: anywhere; }
.df-h2h-who.b { text-align: right; }
.df-h2h-meeting.won-a .df-h2h-who.a, .df-h2h-meeting.won-b .df-h2h-who.b { color: var(--df-ink); font-weight: 650; }
.df-h2h-result { font-size: 1.375rem; font-weight: 600; color: var(--df-ink); text-align: center; letter-spacing: -0.01em; }
.df-h2h-detail { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; justify-content: center; margin-top: 0.25rem; font-size: var(--df-fs-sm); color: var(--df-muted); }
.df-h2h-detail:empty { display: none; }

.df-h2h-shared .is-ahead { font-weight: 650; }
.df-h2h-shared td.end:not(.is-ahead) { color: var(--df-muted); }

/* Opponents met: on the player's page and the chooser. */
.df-h2h-opponents { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.df-h2h-opponents a { display: block; padding: 0.75rem 0.875rem; background: var(--df-surface); border: 1px solid var(--df-line); border-radius: var(--df-radius); text-decoration: none; }
.df-h2h-opponents a:hover { border-color: var(--df-line-strong); }
.df-h2h-opp-name { display: block; font-weight: 600; color: var(--df-ink); }
.df-h2h-opp-record { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 0.125rem; font-size: var(--df-fs-sm); color: var(--df-muted); }
.df-h2h-opp-bar { height: 4px; margin-top: 0.5rem; }

/* Sourced squad snapshots. All anchors come from the shared formation catalogue. */
.df-squad-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr)); gap: 1.5rem; }
/* A competition page lists every entrant's squad compactly; the pitch is on each squad's page. */
.df-squad-grid-compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 0 1.5rem; }
.df-squad-summary { padding: 1rem 0; border-top: 1px solid var(--df-line); min-width: 0; }
.df-squad-summary h3 { font-size: var(--df-fs-h3); }
.df-squad-pitch { width: 100%; max-width: 42rem; margin: 1rem auto; }
.df-squad-svg { display: block; width: 100%; height: auto; }
.df-pitch-field { fill: var(--df-sunken); stroke: var(--df-line-strong); stroke-width: 2; }
.df-pitch-line { fill: none; stroke: var(--df-line-strong); stroke-width: 2; }
.df-squad-card { fill: var(--df-surface); stroke: var(--df-line-strong); stroke-width: 2; }
.df-squad-svg text { text-anchor: middle; font-family: var(--df-font); }
.df-squad-position { fill: var(--df-muted); font-size: 22px; }
.df-squad-name { fill: var(--df-ink); font-size: 22px; font-weight: 600; }
.df-squad-type { fill: var(--df-muted); font-size: 18px; }
.df-squad-list { display: none; padding-left: 1.5rem; }
.df-squad-list li { padding: .5rem 0; border-bottom: 1px solid var(--df-line); }
.df-squad-summary p { margin-bottom: .25rem; }
.df-squad-details { margin: .5rem 0; }
.df-squad-details summary { cursor: pointer; color: var(--df-muted); }
.df-squad-details .df-squad-list { display: block; padding-left: 0; list-style: none; margin: .25rem 0 0; font-size: var(--df-fs-sm); }
.df-squad-details .df-squad-list li { padding: .25rem 0; }
.df-squad-history { padding: 1rem 0; border-top: 1px solid var(--df-line); }
@media (max-width: 479.98px) {
    .df-squad-svg { display: none; }
    .df-squad-list { display: block; }
}

/* ---- Affiliation timeline (Timeline.java) --------------------------------------------------- */
/* Drawn only as precisely as recorded: a shaded band where a boundary is known to the month or year, an outlined band
   for an estimate, a dotted stub where it is not known. Lanes are SVG (positions are attributes; no inline styles).
   The rows under the chart remain the record. */

.df-timeline { --df-tl-label: 9rem; margin: 0 0 1.25rem; }
.df-tl-lane { display: grid; grid-template-columns: var(--df-tl-label) minmax(0, 1fr); align-items: center; column-gap: 0.75rem; min-height: 1.75rem; }
.df-tl-axis { min-height: 1.25rem; font-size: var(--df-fs-xs); color: var(--df-faint); }
.df-tl-years { display: flex; }
.df-tl-year { flex: 1 1 0; min-width: 0; padding-left: 0.25rem; border-left: 1px solid var(--df-line); white-space: nowrap; }
.df-tl-label { font-size: var(--df-fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-tl-track { display: block; width: 100%; height: 0.875rem; overflow: visible; }
.df-tl-track line, .df-tl-track rect { vector-effect: non-scaling-stroke; }
.df-tl-gridline { stroke: var(--df-line); stroke-width: 1; }
.df-tl-span { fill: var(--df-accent); }
.df-tl-window { fill: color-mix(in srgb, var(--df-accent) 35%, var(--df-surface)); }
.df-tl-estimate { fill: var(--df-surface); stroke: var(--df-accent); stroke-width: 1; stroke-dasharray: 3 2; }
.df-tl-unestablished { fill: color-mix(in srgb, var(--df-accent) 12%, var(--df-surface)); stroke: var(--df-accent); stroke-width: 1; stroke-dasharray: 1 2; }
.df-tl-start-unknown, .df-tl-end-unknown { fill: none; stroke: var(--df-muted); stroke-width: 1.5; stroke-dasharray: 1 3; }
.df-tl-move { stroke: var(--df-ink); stroke-width: 2; }
.df-tl-key { font-size: var(--df-fs-xs); color: var(--df-muted); margin: 0.5rem 0 0; }

@media (max-width: 575.98px) {
    .df-tl-lane { grid-template-columns: minmax(0, 1fr); row-gap: 0.25rem; padding-bottom: 0.375rem; }
    .df-tl-axis .df-tl-label { display: none; }
}

/* A longer list's remainder, behind a plain link-like summary. */
.df-more { margin-top: 0.5rem; }
.df-more > summary { cursor: pointer; font-size: var(--df-fs-sm); color: var(--df-text); text-decoration: underline; text-underline-offset: 2px; }
