/* FIP Stats — shares the DPF draw page chrome (draw.css) for visual
   consistency. This file only adds FIP-specific bits: source attribution,
   pair-stats accordion, podium, breakdown, modal, danes section. */

/* body.draw-page already handles outer padding (max-width:480px mobile,
   1200px desktop, bottom safe-area). Don't double up. */
.fs-wrap{padding:0;}

/* Hero — overrides .draw-header where needed. The chrome (padding, card
   background, h1 size, .tournament-meta layout) comes from draw.css. */
.fs-hero h1{
    display:inline-flex;align-items:center;gap:10px;flex-wrap:wrap;
}
.fs-hero__title-logo{height:14px;width:auto;opacity:0.8;}
.draw-title-link:hover .fs-hero__title-logo{opacity:1;}
.fs-fip-logo-inline{height:12px;width:auto;vertical-align:-1px;opacity:0.75;}
.fs-fip-logo-inline:hover{opacity:1;}
.fs-source-link{
    color:inherit;text-decoration:none;border-bottom:1px dotted var(--card-border);
    display:inline-flex;align-items:center;gap:4px;
}
.fs-source-link:hover{color:var(--accent);border-color:var(--accent);}
.fs-hero__meta{
    font-family:var(--font-mono),monospace;font-size:11px;color:var(--text-muted);
    display:flex;gap:14px;flex-wrap:wrap;margin-top:10px;
}
.fs-hero__updated{opacity:0.85;}

/* Old hero classes — kept only as no-op overrides in case any cached
   templates render them; the new template uses .draw-header structure. */
.fs-hero__eyebrow,.fs-hero__title,.fs-hero__sub,.fs-gender-toggle{display:none;}

/* KPI row */
.fs-kpis{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin:14px 0 22px;}
.fs-kpi{
    background:var(--card);border:1px solid var(--card-border);
    border-radius:var(--radius);padding:12px 14px;
    display:flex;flex-direction:column;gap:2px;min-width:0;
}
.fs-kpi__value{font-family:var(--font-mono),monospace;font-size:22px;font-weight:700;color:var(--text);line-height:1.1;}
.fs-kpi__value--accent{color:var(--accent);}
.fs-kpi__label{font-size:10.5px;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.08em;font-weight:600;}

/* Section heading */
.fs-section{margin:22px 0 14px;}
.fs-section__head{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:10px;}
.fs-section__title{font-size:15px;font-weight:700;letter-spacing:0.01em;margin:0;}
.fs-section__count{font-family:var(--font-mono),monospace;font-size:11px;color:var(--text-muted);}
.fs-sort{font-size:11px;color:var(--text-muted);font-family:var(--font-mono),monospace;}

/* Pair card */
.fs-pairs{display:flex;flex-direction:column;gap:6px;}
.fs-pair{
    background:var(--card);border:1px solid var(--card-border);
    border-radius:var(--radius);overflow:hidden;
    transition:border-color 0.15s;
}
.fs-pair[open]{border-color:rgba(34,197,94,0.4);}
.fs-pair__summary{
    display:grid;grid-template-columns:42px 1fr 18px;gap:12px;
    align-items:center;padding:11px 14px;cursor:pointer;list-style:none;
}
.fs-pair__meta-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:3px;flex-wrap:wrap;}
.fs-pair__meta-row .fs-pair__circuit{margin-top:0;}
.fs-pair__meta-row .fs-team-pts{text-align:right;margin-left:auto;}
.fs-pair__meta-row .fs-team-pts small{display:inline;margin-left:4px;}
.fs-pair__summary::-webkit-details-marker{display:none;}
.fs-seed{
    font-family:var(--font-mono),monospace;font-size:13px;font-weight:700;
    background:var(--accent-dim);color:var(--accent);
    border-radius:8px;padding:5px 0;text-align:center;
}
.fs-players{display:flex;flex-direction:column;gap:3px;min-width:0;}
.fs-player-line{display:flex;align-items:baseline;gap:8px;min-width:0;}
.fs-player-name{font-size:13.5px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.fs-player-name a{color:inherit;text-decoration:none;}
.fs-player-name a:hover{color:var(--accent);}
.fs-player-rank{font-family:var(--font-mono),monospace;font-size:11px;color:var(--text-muted);font-weight:700;}
.fs-player-pts{font-family:var(--font-mono),monospace;font-size:11px;color:var(--accent);font-weight:700;}
.fs-player-country{font-family:var(--font-mono),monospace;font-size:10px;color:var(--text-muted);}
.fs-player-flag{display:inline-block;width:16px;height:12px;object-fit:cover;border-radius:2px;vertical-align:-1px;flex-shrink:0;}
.fs-player-move{font-family:var(--font-mono),monospace;font-size:10px;font-weight:700;}
.fs-player-move--up{color:#6dd49a;}
.fs-player-move--down{color:#d46d8a;}
.fs-team-pts{font-family:var(--font-mono),monospace;font-size:13px;font-weight:700;color:var(--accent);text-align:right;line-height:1.1;}
.fs-team-pts small{display:block;font-size:9px;font-weight:400;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.08em;margin-top:1px;}
.fs-caret{color:var(--text-muted);font-size:11px;transition:transform 0.15s;}
.fs-pair[open] .fs-caret{transform:rotate(180deg);color:var(--accent);}

/* Pair details */
.fs-details{
    border-top:1px solid var(--card-border);
    background:rgba(0,0,0,0.18);
    padding:14px 16px;
    display:grid;grid-template-columns:1fr;gap:14px 24px;
    grid-template-areas:
        "p1head"
        "p1podium"
        "p1counted"
        "p2head"
        "p2podium"
        "p2counted";
}
@media (min-width:760px){
    .fs-details{
        grid-template-columns:1fr 1fr;
        grid-template-areas:
            "p1head    p2head"
            "p1podium  p2podium"
            "p1counted p2counted";
    }
}
.fs-cell--p1head{grid-area:p1head;}
.fs-cell--p2head{grid-area:p2head;}
.fs-cell--p1podium{grid-area:p1podium;}
.fs-cell--p2podium{grid-area:p2podium;}
.fs-cell--p1counted{grid-area:p1counted;}
.fs-cell--p2counted{grid-area:p2counted;}
.fs-cell:empty{display:none;}
@media (min-width:760px){.fs-cell:empty{display:block;}}

.fs-pdetail__head{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px;margin-bottom:8px;}
.fs-pdetail__name{font-size:13.5px;font-weight:700;color:var(--text);margin-right:auto;}
.fs-pdetail__pts{font-family:var(--font-mono),monospace;font-size:12px;font-weight:700;color:var(--accent);}
.fs-pdetail__move{font-family:var(--font-mono),monospace;font-size:11px;font-weight:700;}
.fs-subhead{
    font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:0.10em;
    color:var(--text-muted);margin:14px 0 6px;
    display:flex;align-items:center;gap:8px;
}
.fs-subhead::after{content:'';flex:1;height:1px;background:var(--card-border);}
.fs-subhead:first-child{margin-top:0;}

.fs-podium{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px;}
.fs-podium li{
    display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:baseline;
    font-size:12px;color:var(--text);
    padding:5px 8px;border-radius:6px;background:rgba(212,176,109,0.05);
}
.fs-podium__title{display:inline;line-height:1.6;}
.fs-podium__title .fs-bd-row__cat{vertical-align:1px;}
.fs-podium__sep{color:var(--text-muted);opacity:0.55;margin:0 1px;}
.fs-podium li.fs-podium--final{background:rgba(176,138,212,0.05);}
.fs-podium__icon{font-size:13px;}
.fs-podium__detail{font-family:var(--font-mono),monospace;font-size:10.5px;color:var(--text-muted);}

/* Tournament breakdown — card list, not table */
.fs-breakdown{display:flex;flex-direction:column;gap:0;}
.fs-bd-row{
    display:grid;grid-template-columns:1fr auto;gap:6px 12px;align-items:baseline;
    padding:8px 4px;border-bottom:1px solid var(--card-border);
}
.fs-bd-row:last-child{border-bottom:none;}
.fs-bd-row__main{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;min-width:0;}
.fs-bd-row__name{font-size:12.5px;font-weight:600;color:var(--text);}
.fs-bd-row__cat{
    font-family:var(--font-mono),monospace;font-size:9.5px;font-weight:700;letter-spacing:0.06em;
    background:var(--card-border);color:var(--text-muted);
    padding:2px 6px;border-radius:4px;text-transform:uppercase;
    border:1px solid transparent;white-space:nowrap;
}
/* Official FIP tier palette (sampled from FIP Points Table 2026) */
.fs-cat--fip-platinum{background:rgba(108,171,202,0.16);color:#8fc8e0;border-color:rgba(108,171,202,0.45);}
.fs-cat--fip-gold{background:rgba(188,153,49,0.16);color:#e1b850;border-color:rgba(188,153,49,0.45);}
.fs-cat--fip-silver{background:rgba(178,178,178,0.16);color:#d4d4d4;border-color:rgba(178,178,178,0.40);}
.fs-cat--fip-bronze{background:rgba(154,91,48,0.18);color:#d18752;border-color:rgba(154,91,48,0.50);}
.fs-cat--fip-finals{background:rgba(127,55,150,0.20);color:#c599e0;border-color:rgba(127,55,150,0.50);}
.fs-cat--fip-championship{background:rgba(30,47,90,0.30);color:#8aa3d4;border-color:rgba(30,47,90,0.70);}
.fs-cat--premier-padel-major,
.fs-cat--premier-padel-p1,
.fs-cat--premier-padel-p2,
.fs-cat--premier-padel-finals{background:rgba(168,123,81,0.18);color:#cf9a6b;border-color:rgba(168,123,81,0.50);}
/* Padel Federation Tour (legacy) */
.fs-cat--pft-tour-22,
.fs-cat--pft-tour-24,
.fs-cat--pft-tour-26,
.fs-cat--pft-tour-30{background:rgba(74,157,110,0.14);color:#6dd49a;border-color:rgba(74,157,110,0.40);}
.fs-bd-row__pts{font-family:var(--font-mono),monospace;font-size:14px;font-weight:700;color:var(--accent);text-align:right;}
.fs-bd-row__pts--zero{color:var(--text-muted);}
.fs-bd-row__sub{
    grid-column:1 / -1;
    font-family:var(--font-mono),monospace;font-size:10.5px;color:var(--text-muted);
    display:flex;flex-wrap:wrap;gap:10px;
}
.fs-bd-row__sub span{white-space:nowrap;}
.fs-bd-row__sub span+span::before{content:'·';margin-right:10px;color:var(--card-border);}

.fs-empty{color:var(--text-muted);font-size:12.5px;padding:24px 8px;text-align:center;}

/* Danes mini-section (collapsible) */
.fs-danes{
    margin:14px 0 22px;
    background:linear-gradient(180deg,rgba(196,30,58,0.06),rgba(255,255,255,0.01));
    border:1px solid rgba(196,30,58,0.22);
    border-radius:var(--radius);overflow:hidden;
}
.fs-danes__summary{
    display:flex;align-items:center;gap:10px;
    padding:12px 16px;cursor:pointer;list-style:none;
    font-size:14px;
}
.fs-danes__summary::-webkit-details-marker{display:none;}
.fs-danes__title{font-weight:700;color:var(--text);flex:1;}
.fs-danes[open] .fs-caret{transform:rotate(180deg);color:#f87171;}
.fs-danes__list{display:flex;flex-direction:column;gap:4px;padding:0 16px 14px;border-top:1px solid rgba(196,30,58,0.18);padding-top:10px;}
.fs-danes__row{
    display:grid;grid-template-columns:34px 1fr auto;gap:10px;align-items:baseline;
    padding:6px 4px;font-size:12.5px;
}
.fs-danes__seed{font-family:var(--font-mono),monospace;font-weight:700;color:var(--accent);text-align:center;}
.fs-danes__partners{color:var(--text);font-weight:600;}
.fs-danes__section{font-family:var(--font-mono),monospace;font-size:10.5px;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;}

/* Danish player highlight (red name only) */
.fs-player-line--dk .fs-player-name,
.fs-player-line--dk .fs-player-name a{color:#fca5a5;}

/* Pair circuit counters */
.fs-pair__circuit{display:flex;gap:6px;margin-top:2px;}
.fs-circuit{
    font-family:var(--font-mono),monospace;font-size:10px;font-weight:700;
    padding:2px 6px;border-radius:4px;
}
.fs-circuit--titles{background:rgba(212,176,109,0.10);color:#d4b06d;}
.fs-circuit--finals{background:rgba(176,138,212,0.10);color:#b08ad4;}

/* Compact breakdown rows (single-line) */
.fs-bd-row{grid-template-columns:1fr auto;}
.fs-bd-row__main{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px;}
.fs-bd-row__sep{color:var(--text-muted);opacity:0.55;}
.fs-bd-row__meta{font-family:var(--font-mono),monospace;font-size:10.5px;color:var(--text-muted);}
.fs-bd-row__sub{display:none;}
.fs-bd-row--hidden{display:none;}
.fs-bd-row--hidden.fs-bd-row--shown{display:grid;}

.fs-bd-toggle{
    margin-top:8px;width:100%;
    background:transparent;border:1px dashed var(--card-border);color:var(--text-muted);
    font-family:var(--font-mono),monospace;font-size:11px;font-weight:600;
    padding:7px 10px;border-radius:8px;cursor:pointer;transition:all .15s;
}
.fs-bd-toggle:hover{border-color:var(--accent);color:var(--accent);}
.fs-bd-toggle.open{border-style:solid;}

/* ─── Collapsed pair-stats sections ─── */
.fs-section--collapsible{
    background:var(--card);border:1px solid var(--card-border);
    border-radius:var(--radius);padding:0;margin:14px 0;overflow:hidden;
}
.fs-section--collapsible > .fs-section__head{
    cursor:pointer;list-style:none;padding:14px 16px;margin:0;
    align-items:center;
}
.fs-section--collapsible > .fs-section__head::-webkit-details-marker{display:none;}
.fs-section--collapsible[open] > .fs-section__head{border-bottom:1px solid var(--card-border);}
.fs-section--collapsible > .fs-section__head .fs-caret{margin-left:auto;transition:transform 0.18s;color:var(--text-muted);}
.fs-section--collapsible[open] > .fs-section__head .fs-caret{transform:rotate(180deg);}
.fs-section--collapsible > .fs-pairs{padding:12px 16px 16px;}

/* ─── Draw / Order of Play ───
   Visual treatment mirrors the DPF .bracket-match vocabulary: compact dark
   cards, mono seeds, small uppercase round labels. Structural layout
   (vertical rounds with court grouping) is FIP-specific because the data
   shape isn't a clean elimination tree. */
.fd-wrap{margin:18px 0 22px;}
.fd-wrap__title{font-size:14px;font-weight:700;margin:0 0 4px;letter-spacing:0.01em;text-transform:uppercase;color:var(--text);}
.fd-wrap__updated{font-family:var(--font-mono),monospace;font-size:10.5px;color:var(--text-muted);margin:0 0 12px;}

.fd-section{
    background:transparent;border:none;
    margin:0 0 12px;overflow:visible;
}
.fd-section__summary{
    cursor:pointer;list-style:none;display:flex;align-items:center;
    gap:10px;padding:8px 0 12px;
    border-bottom:1px solid var(--card-border);
}
.fd-section__summary::-webkit-details-marker{display:none;}
.fd-section[open] .fd-section__summary{border-bottom-color:transparent;}
.fd-section__title{
    font-size:10px;font-weight:700;text-transform:uppercase;
    letter-spacing:0.5px;color:var(--text-muted);
    font-family:var(--font-mono),monospace;
}
.fd-section__badge{
    font-family:var(--font-mono),monospace;font-size:10px;font-weight:700;
    padding:2px 7px;border-radius:999px;background:var(--accent-dim);color:var(--accent);
    letter-spacing:0.04em;
}
.fd-section__summary .fs-section__count{margin-left:auto;font-family:var(--font-mono),monospace;font-size:10.5px;color:var(--text-muted);}
.fd-section__summary .fs-caret{color:var(--text-muted);transition:transform 0.18s;}
.fd-section[open] .fd-section__summary .fs-caret{transform:rotate(180deg);}
.fd-section__pdf{padding:10px 0 0;font-size:12px;}
.fd-section__pdf a{color:var(--text-muted);text-decoration:none;border-bottom:1px dotted var(--card-border);}
.fd-section__pdf a:hover{color:var(--accent);border-color:var(--accent);}
.fd-empty{padding:14px 4px 8px;color:var(--text-muted);font-size:13px;margin:0;}
.fd-empty a{color:var(--accent);text-decoration:none;border-bottom:1px dotted var(--accent);}

/* Player search — mirrors the .dpf-search component on the rankings page
   so the input feels identical across the app and iOS Safari doesn't auto-
   zoom on focus (font-size:16px). */
.fd-search{margin:0 0 12px;position:relative;}
.fd-search-wrap{position:relative;}
.fd-search-icon{
    position:absolute;left:12px;top:50%;transform:translateY(-50%);
    color:var(--text-muted);pointer-events:none;
}
.fd-search-input{
    width:100%;box-sizing:border-box;
    background:var(--card);border:1px solid var(--card-border);color:var(--text);
    font-family:var(--font-body),sans-serif;font-size:16px;
    padding:11px 38px 11px 38px;border-radius:12px;outline:none;
    transition:border-color 0.15s,box-shadow 0.15s;
    -webkit-appearance:none;appearance:none;
}
.fd-search-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(74,157,110,0.12);}
.fd-search-input::placeholder{color:var(--text-muted);}
.fd-search-input::-webkit-search-cancel-button,
.fd-search-input::-webkit-search-decoration{-webkit-appearance:none;display:none;}
.fd-search-clear{
    position:absolute;top:50%;right:8px;transform:translateY(-50%);
    width:26px;height:26px;display:none;align-items:center;justify-content:center;
    background:rgba(255,255,255,0.08);border:none;border-radius:50%;
    color:var(--text-muted);font-size:12px;line-height:1;cursor:pointer;padding:0;
}
.fd-search-clear:hover{background:rgba(255,255,255,0.14);color:var(--text);}
.fd-search.has-val .fd-search-clear{display:flex;}

/* Autocomplete dropdown for the player search. Mirrors .dpf-search-results
   on the rankings page so they look like the same component. */
.fd-search-results{
    position:absolute;top:calc(100% + 6px);left:0;right:0;
    max-height:min(60vh,360px);overflow-y:auto;
    background:var(--card);border:1px solid var(--card-border);
    border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,0.35);
    z-index:50;
}
.fd-search-results[hidden]{display:none;}
.fd-search-result{
    display:block;width:100%;text-align:left;
    background:transparent;border:none;
    color:var(--text);font:inherit;font-size:14px;
    padding:10px 14px;border-bottom:1px solid var(--card-border);
    cursor:pointer;
}
.fd-search-result:last-child{border-bottom:none;}
.fd-search-result:hover,.fd-search-result:focus{background:rgba(255,255,255,0.04);outline:none;}

/* Cards/courts/rounds use display:flex; the `hidden` attribute would
   otherwise be overridden by that, so force display:none when set. */
.fd-match[hidden],.fd-court[hidden],.fd-round[hidden]{display:none !important;}

/* DPF-style bracket tree: connector lines from draw.css target
   .bracket-match. Mirror them onto .fd-match so the FIP cells get the
   same horizontal input/output stubs. The vertical connector is on the
   .bracket-cell itself (draw.css) and works regardless of contents. */
.bracket-cell.has-input .fd-match::before{
    content:'';position:absolute;
    left:-10px;top:50%;width:10px;height:1px;
    background:var(--card-border);pointer-events:none;
}
.bracket-cell.has-output .fd-match::after{
    content:'';position:absolute;
    right:-10px;top:50%;width:10px;height:1px;
    background:var(--card-border);pointer-events:none;
}
/* Inside a bracket-cell, the match card fills the cell vertically so
   later-round cards (which span multiple rows) stay centred between
   feeders rather than floating to the top. */
.bracket-cell .fd-match{margin:0;height:auto;align-self:center;}
.bracket-scroll{padding-bottom:8px;}


/* Clickable match cards (those with pair-stats available) */
button.fd-match{
    width:100%;text-align:left;font:inherit;color:inherit;
    -webkit-appearance:none;appearance:none;
}
.fd-match--clickable{cursor:pointer;}
.fd-match--clickable:hover{border-color:var(--accent);}
.fd-match--clickable:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}

/* Modal: visual treatment mirrors .algo-modal-overlay from draw.css
   (blur backdrop, centered panel, sticky header). Keeps bottom-sheet on
   mobile because the two-pair-card body is taller than a typical modal. */
.fd-modal[hidden]{display:none;}
.fd-modal{
    position:fixed;inset:0;z-index:1000;
    display:flex;align-items:flex-end;justify-content:center;
    background:rgba(0,0,0,0.7);backdrop-filter:blur(4px);
    padding:0;
}
.fd-modal__backdrop{position:absolute;inset:0;}
.fd-modal__panel{
    position:relative;width:100%;max-width:1100px;
    background:var(--card);border:1px solid var(--card-border);
    border-radius:16px 16px 0 0;
    max-height:90vh;display:flex;flex-direction:column;overflow:hidden;
    animation:modalIn 0.2s ease;
}
@media(min-width:780px){
    .fd-modal{align-items:center;padding:24px;}
    .fd-modal__panel{border-radius:var(--radius);max-height:85vh;}
}
.fd-modal__header{
    display:flex;align-items:center;justify-content:space-between;
    padding:16px 20px;border-bottom:1px solid var(--card-border);
    flex-shrink:0;position:sticky;top:0;background:var(--card);z-index:1;
}
.fd-modal__title{font-size:14px;font-weight:600;color:var(--text);margin:0;}
.fd-modal__close{
    background:none;border:none;color:var(--text-muted);font-size:18px;
    cursor:pointer;padding:4px 8px;border-radius:4px;
    transition:all 0.15s;line-height:1;
}
.fd-modal__close:hover{background:rgba(255,255,255,0.1);color:var(--text);}
.fd-modal__body{
    overflow-y:auto;padding:14px;display:grid;grid-template-columns:1fr;gap:14px;
}
@media(min-width:780px){.fd-modal__body{grid-template-columns:1fr 1fr;padding:18px;gap:18px;}}

body.fd-modal-open{overflow:hidden;}

/* Modal pair card */
.fd-modal-pair{
    background:rgba(255,255,255,0.02);
    border:1px solid var(--card-border);border-radius:12px;
    padding:14px;display:flex;flex-direction:column;gap:12px;
    min-width:0;
}
.fd-modal-pair--dk{border-color:rgba(74,157,110,0.4);}
.fd-modal-pair__head{
    display:flex;align-items:flex-start;gap:10px;
    padding-bottom:10px;border-bottom:1px solid var(--card-border);
}
.fd-modal-pair__seed{
    font-family:var(--font-mono),monospace;font-size:11px;font-weight:700;
    color:var(--accent);background:var(--accent-dim);
    padding:3px 8px;border-radius:999px;flex-shrink:0;
}
.fd-modal-pair__names{flex:1;display:flex;flex-direction:column;gap:2px;min-width:0;}
.fd-modal-pair__meta{
    display:flex;flex-direction:column;align-items:flex-end;gap:4px;
    font-family:var(--font-mono),monospace;font-size:11px;color:var(--text-muted);
}
.fd-modal-pair__pts{display:flex;flex-direction:column;align-items:flex-end;font-size:14px;color:var(--text);font-weight:700;}
.fd-modal-pair__pts small{font-size:9.5px;font-weight:400;color:var(--text-muted);}
.fd-modal-player{display:flex;flex-direction:column;gap:6px;}
.fd-modal-player .fs-cell{padding:0;border:none;background:transparent;}
.fd-modal-section{
    background:rgba(255,255,255,0.015);border:1px solid var(--card-border);
    border-radius:8px;overflow:hidden;
}
.fd-modal-section > summary{
    cursor:pointer;list-style:none;padding:8px 12px;
    font-size:11.5px;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;
    color:var(--text-muted);
    display:flex;align-items:center;gap:6px;
}
.fd-modal-section > summary::-webkit-details-marker{display:none;}
.fd-modal-section > summary small{font-weight:400;text-transform:none;letter-spacing:0;color:var(--text-muted);opacity:0.85;}
.fd-modal-section__caret{margin-left:auto;font-size:11px;transition:transform 0.18s;}
.fd-modal-section[open] > summary{border-bottom:1px solid var(--card-border);color:var(--text);}
.fd-modal-section[open] > summary .fd-modal-section__caret{transform:rotate(180deg);}
.fd-modal-section .fs-cell{padding:10px 12px;}
.fd-modal-section .fs-subhead{display:none;}  /* "Bedste resultater" / "Tællende turneringer" already in summary */

/* Tighten the breakdown list inside the modal so it visually matches the
   podium list above it — same row rhythm, same row-tint feel. */
.fd-modal-section .fs-breakdown{gap:4px;}
.fd-modal-section .fs-bd-row{
    padding:5px 8px;border-bottom:none;border-radius:6px;
    background:rgba(255,255,255,0.025);
    font-size:12px;
}
.fd-modal-section .fs-bd-row__name{font-size:12px;}
.fd-modal-section .fs-bd-row__main{gap:6px;}
.fd-modal-section .fs-bd-toggle{
    margin-top:6px;padding:6px 10px;font-size:11px;
}

.fd-rounds{display:flex;flex-direction:column;gap:14px;padding:14px 0 16px;}
.fd-round{padding-top:0;}
.fd-round__title{
    font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.5px;
    color:var(--text-muted);font-family:var(--font-mono),monospace;
    margin:0 0 8px;cursor:pointer;list-style:none;
    display:flex;align-items:center;gap:8px;
    padding:4px 0 6px;border-bottom:1px solid var(--card-border);
}
.fd-round__title::-webkit-details-marker{display:none;}
.fd-round__title small{font-family:var(--font-mono),monospace;font-weight:400;font-size:10px;opacity:0.75;text-transform:none;letter-spacing:0;}
.fd-round__title .fs-caret{margin-left:auto;transition:transform 0.18s;}
.fd-round[open] > .fd-round__title .fs-caret{transform:rotate(180deg);}
.fd-round__matches{display:grid;grid-template-columns:1fr;gap:6px;}
@media(min-width:640px){.fd-round__matches{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(min-width:980px){.fd-round__matches{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}}

/* Court-grouped layout — one column per court, matches stacked in time order */
.fd-courts{display:flex;flex-direction:column;gap:14px;}
@media(min-width:780px){.fd-courts{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:10px;align-items:start;}}
.fd-court{
    background:transparent;
    border:1px solid var(--card-border);border-radius:8px;
    padding:8px;min-width:0;
}
.fd-court__name{
    font-family:var(--font-mono),monospace;font-size:10px;font-weight:700;
    text-transform:uppercase;letter-spacing:0.5px;color:var(--accent);
    margin:0 0 8px;display:flex;align-items:baseline;gap:8px;
}
.fd-court__name small{font-weight:400;font-size:10px;color:var(--text-muted);letter-spacing:0;text-transform:none;}
.fd-court__matches{display:flex;flex-direction:column;gap:6px;}

/* Match card — mirrors .bracket-match from draw.css. Compact dark card,
   11.5px body type, mono-font seeds and scores, accent green for winning side. */
.fd-match{
    background:var(--card);border:1px solid var(--card-border);
    border-radius:8px;padding:6px 8px;display:flex;flex-direction:column;gap:3px;
    min-width:0;font-size:11.5px;position:relative;
}
.fd-match--done{border-color:rgba(74,157,110,0.30);}
.fd-team{
    display:flex;align-items:center;gap:8px;color:var(--text-muted);
    min-width:0;line-height:1.35;
}
.fd-team--win{color:var(--text);font-weight:600;}
.fd-team__names{display:flex;flex-direction:column;gap:0;flex:1;min-width:0;}
.fd-team__player{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.fd-team__flag{margin-right:4px;font-size:10px;opacity:0.6;}
.fd-team__seed{
    font-family:var(--font-mono),monospace;font-size:9.5px;color:var(--text-muted);
    background:rgba(255,255,255,0.04);border-radius:3px;padding:0 4px;flex-shrink:0;
}
.fd-team__sets{display:flex;gap:3px;margin-left:auto;}
.fd-team__set{
    font-family:var(--font-mono),monospace;font-size:12px;font-weight:700;
    min-width:14px;text-align:center;color:var(--text-muted);
}
.fd-team--win .fd-team__set{color:var(--accent);}
.fd-match__meta{
    display:flex;gap:10px;flex-wrap:wrap;
    font-family:var(--font-mono),monospace;font-size:10px;color:var(--text-muted);
    padding-top:4px;border-top:1px dashed var(--card-border);margin-top:2px;
}
