/* /vct/ pages. Same column, font and colors as the rest of the site. */

.vct-content {
    width: 60%;  /* left edge lines up with the page title; wider than other pages for tables */
    margin-left: 25%;
    margin-top: 10px;
    font-size: 16px;
    color: var(--text);
}

.vct-nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.vct-nav a { color: var(--accent); }
.vct-nav a:hover { color: var(--accent-hover); }

.vct-content h2 {
    font-size: 22px;
    margin: 36px 0 12px;
}

.vct-content h3 {
    font-size: 17px;
    margin: 28px 0 8px;
}

.vct-content a.small { font-size: 13px; margin-left: 8px; }

/* Sortable tables (sort.js) */
.sort-header { cursor: pointer; user-select: none; }
.sort-header:hover { color: var(--accent); }
.sort-header[data-dir="desc"]::after { content: " 93"; }
.sort-header[data-dir="asc"]::after { content: " 91"; }

.lead { font-size: 18px; line-height: 1.5; }
.note { font-size: 14px; color: var(--muted); line-height: 1.5; }
.muted { color: var(--faint); }
.nowrap { white-space: nowrap; }
.winner { font-weight: bold; }
.up { color: var(--accent); }
.down { color: var(--muted); }

.steps li { margin-bottom: 8px; line-height: 1.5; }

/* Headline numbers */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.stat {
    border: 1px solid var(--border);
    padding: 12px 14px;
}

.stat-value { font-size: 24px; color: var(--accent); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Tables */
.table-scroll { overflow-x: auto; }

.vct-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px;
}

.vct-table th,
.vct-table td {
    text-align: left;
    padding: 7px 8px;
    border-bottom: 1px solid var(--row-line);
    vertical-align: top;
}

.vct-table th {
    font-weight: normal;
    color: var(--muted);
    border-bottom: 1px solid var(--border-strong);
}

.vct-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.vct-table tbody tr:hover { background: var(--hover-bg); }

/* Tabs on the best performances page */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 4px;
}

.tabs a {
    font-size: 14px;
    padding: 5px 12px;
    border: 1px solid var(--border);
}

.tabs a.active,
.tabs a.active:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Events grouped by year on the overview */
.year-group { margin: 10px 0; }
.year-group summary { cursor: pointer; font-size: 18px; padding: 6px 0; }

/* Match stats and round squares: each team gets a color (edge, tint, tag). Defaults here; real team
   colors come from colors.py as inline CSS variables on the match wrapper. */
.vct-content { --team1: #6b6b70; --team2: #a8a8ad; }

.vct-table tr.team1 td:first-child { box-shadow: inset 4px 0 0 var(--team1); padding-left: 12px; }
.vct-table tr.team2 td:first-child { box-shadow: inset 4px 0 0 var(--team2); padding-left: 12px; }
.vct-table tr.team1 { background: color-mix(in srgb, var(--team1) 8%, transparent); }
.vct-table tr.team2 { background: color-mix(in srgb, var(--team2) 8%, transparent); }
.vct-table tr.team1 .team-tag { color: var(--team1-l, var(--team1)); font-weight: bold; }
.vct-table tr.team2 .team-tag { color: var(--team2-l, var(--team2)); font-weight: bold; }
:root[data-theme="dark"] .vct-table tr.team1 .team-tag { color: var(--team1-d, var(--team1)); }
:root[data-theme="dark"] .vct-table tr.team2 .team-tag { color: var(--team2-d, var(--team2)); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .vct-table tr.team1 .team-tag { color: var(--team1-d, var(--team1)); }
    :root:not([data-theme="light"]) .vct-table tr.team2 .team-tag { color: var(--team2-d, var(--team2)); }
}

.team-swatch { display: inline-block; width: 12px; height: 12px; vertical-align: middle; margin: 0 4px 0 14px; }
.team-swatch:first-child { margin-left: 0; }
.team-swatch.team1 { background: var(--team1); }
.team-swatch.team2 { background: var(--team2); }

/* Round strip */
.map-block { margin: 36px 0 22px; }

.map-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.map-head h3 { margin: 0; }

.strip {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.sq {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    font-size: 12px;
    border: 1px solid transparent;
    box-sizing: border-box;
}

.legend .sq { width: 14px; height: 14px; vertical-align: middle; margin: 0 4px 0 12px; }
.legend .sq:first-child { margin-left: 0; }

.sq.w1 { background: var(--team1); color: var(--team1-on, #fff); }
.sq.w2 { background: var(--team2); color: var(--team2-on, #fff); }
.sq.off { opacity: 0.35; }

a.sq.w1:link, a.sq.w1:visited, a.sq.w1:hover { color: var(--team1-on, #fff); }
a.sq.w2:link, a.sq.w2:visited, a.sq.w2:hover { color: var(--team2-on, #fff); }
a.sq:hover { border-color: var(--text); }

/* Round page */
.round-nav {
    display: flex;
    justify-content: space-between;
    margin: 12px 0;
}

.chart-box {
    position: relative;
    height: 320px;
    margin: 12px 0 20px;
}

/* Player filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: end;
    margin: 12px 0;
}

.filters label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--muted);
    min-width: 0;      /* let long dropdowns (tournament names) shrink to the screen */
    max-width: 100%;
}

.filters select,
.filters input {
    padding: 6px 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    max-width: 100%;
}

.filters input { width: 90px; }

.filters button {
    padding: 7px 14px;
    border: 1px solid var(--button-bg);
    background: var(--button-bg);
    color: var(--button-text);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
}

@media (max-width: 900px) {
    .vct-content {
        width: auto;
        margin: 10px 16px 0;
    }
}

/* Buy calculator */
.calc-form input { width: 110px; }
.vct-table tr.calc-best td { color: var(--accent); font-weight: bold; }

/* Round page: link into the buy calculator */
.calc-cta { margin: 18px 0; max-width: 440px; }
.calc-cta-title { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.calc-team.team1 { --c: var(--team1); --cl: var(--team1-l, var(--team1)); --cd: var(--team1-d, var(--team1)); }
.calc-team.team2 { --c: var(--team2); --cl: var(--team2-l, var(--team2)); --cd: var(--team2-d, var(--team2)); }
.vct-content a.calc-team,
.vct-content a.calc-team:visited {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--c);
    background: color-mix(in srgb, var(--c) 6%, transparent);
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.vct-content a.calc-team:hover {
    background: color-mix(in srgb, var(--c) 14%, transparent);
    border-color: var(--c);
}
.calc-tag { font-weight: bold; font-size: 17px; min-width: 48px; color: var(--cl); }
.calc-what { font-size: 14px; color: var(--muted); }
.calc-arrow { margin-left: auto; color: var(--muted); transition: transform 0.15s; }
.calc-team:hover .calc-arrow { transform: translateX(3px); color: var(--text); }
:root[data-theme="dark"] .calc-tag { color: var(--cd); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .calc-tag { color: var(--cd); }
}
/* Calculator: example spots */
.calc-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;  /* cards keep their own height; the link sits under the second */
    margin: 14px 0 18px;
}
.calc-example-wrap { flex: 1 1 260px; display: flex; flex-direction: column; }
.calc-examples > .calc-example { flex: 1 1 260px; }
.vct-content a.calc-example,
.vct-content a.calc-example:visited {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.vct-content a.calc-example:hover { background: var(--hover-bg); border-color: var(--accent); }
.calc-example-kicker { font-size: 12px; color: var(--accent); }
.calc-example-title { font-size: 16px; font-weight: bold; }
.calc-example-sub { font-size: 13px; color: var(--muted); }
.vct-content a.calc-example-link { align-self: flex-end; font-size: 13px; margin-top: 6px; color: var(--accent); }
.vct-content a.calc-example-link:hover { color: var(--accent-hover); }

/* Round page: the map name links back to that map on the match page */
.vct-content h2 a.map-link { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 4px; }
.vct-content h2 a.map-link:hover { color: var(--accent); text-decoration-color: var(--accent); }
.map-block { scroll-margin-top: 20px; }

/* Round page: which team color is which on the chart */
.chart-teams .legend { margin: 0 0 6px; }
