/*
 * Liigabrändi julkisille sivuille. Ladataan vain liigasivuilla, joten muu portaali pysyy
 * ennallaan. Värit tulevat muuttujista (BrandTheme::cssVars), ei tästä tiedostosta.
 */

body.has-league .topbar { border-bottom-color: var(--league-primary); }
body.has-league .card { border-left: 4px solid var(--league-primary); }

.cobrand { display: flex; align-items: center; gap: 14px; }
.cobrand-sep {
    font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--bella-muted); padding-left: 14px; border-left: 1px solid var(--bella-border); line-height: 1.35;
    max-width: 90px;
}
.cobrand img.league-logo { height: 30px; width: auto; display: block; margin: 0 6px; }

/* Hero */
.league-hero {
    background: var(--league-primary); color: var(--league-on-primary);
    border-radius: 14px; padding: 24px 26px; margin-bottom: 18px;
    box-shadow: 0 4px 14px rgba(22, 61, 92, 0.15);
}
.league-hero img { height: 36px; width: auto; display: block; margin-bottom: 14px; }
.league-hero h2 { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: inherit; line-height: 1.1; margin-bottom: 8px; }
.league-hero .hero-sub { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.92; }
.league-hero .hero-desc { margin-top: 12px; font-size: 0.95rem; }

/* Pilleri: liigan tunnus turnausriveillä */
.league-pill {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--league-primary); color: var(--league-on-primary);
    border-radius: 999px; padding: 4px 12px 4px 8px;
    font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    vertical-align: middle; white-space: nowrap; max-width: 100%;
}
.league-pill img { height: 13px; width: auto; }
.league-pill:hover { background: var(--league-primary-dark); color: var(--league-on-primary); text-decoration: none; }
.tournament-row .league-pill { margin-bottom: 5px; }

/* Sarjataulukko */
.standings-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.series-toggle { display: inline-flex; background: var(--bella-cream-soft); border: 1px solid var(--bella-border); border-radius: 20px; padding: 3px; gap: 2px; }
.series-toggle button { border: none; border-radius: 16px; padding: 5px 16px; font-size: 0.8rem; font-weight: 600; cursor: pointer; background: transparent; color: var(--bella-muted); font-family: var(--font-body); }
.series-toggle button.on { background: var(--league-primary); color: var(--league-on-primary); }
.standings-note { font-size: 0.82rem; color: var(--bella-muted); margin-top: 12px; }
.standings-wrap { overflow-x: auto; }
.course-legend { display: none; font-size: 0.78rem; color: var(--bella-muted); margin-top: 10px; }

table.standings { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.standings th {
    font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--bella-muted); text-align: center; padding: 8px; border-bottom: 2px solid var(--league-primary); vertical-align: bottom;
}
table.standings th .course { display: block; font-size: 0.6rem; color: #8a95a1; letter-spacing: 0.02em; margin-top: 2px; max-width: 130px; margin-left: auto; margin-right: auto; }
table.standings th .tag-prov { display: inline-block; background: #fff3cd; color: #6d5400; border-radius: 4px; padding: 1px 6px; font-size: 0.58rem; margin-left: 4px; letter-spacing: 0.04em; }
table.standings th.left, table.standings td.left { text-align: left; }
table.standings td { padding: 9px 8px; text-align: center; border-bottom: 1px solid #f0ead9; }
table.standings tr.prize td { background: var(--league-tint); }
table.standings td.pos { font-weight: 700; color: var(--bella-navy); white-space: nowrap; }
table.standings td.name { font-weight: 600; color: var(--bella-navy); }
table.standings td.name small { font-weight: 400; color: var(--bella-muted); margin-left: 6px; white-space: nowrap; }
table.standings td.total { font-weight: 800; font-size: 1rem; color: var(--bella-navy); }
table.standings td.prov { font-style: italic; }
table.standings td.dropped, table.standings td.dropped span { color: #b3b9c2; text-decoration: line-through; }
table.standings td.dnp { color: #b3b9c2; }
table.standings tr.incomplete td { opacity: 0.7; }
table.standings tr.incomplete td.pos { color: #b3b9c2; font-weight: 400; }
table.standings tr.incomplete-first td { border-top: 2px solid #e2dccb; }
table.standings td.fill::after { content: "*"; font-size: 0.7em; vertical-align: super; }
table.standings td .sub { display: block; font-size: 0.68rem; color: #8a95a1; font-weight: 400; }
.rank-badge {
    display: inline-block; min-width: 22px; height: 22px; line-height: 22px; padding: 0 6px; border-radius: 11px;
    background: var(--league-primary); color: var(--league-on-primary); font-size: 0.72rem; font-weight: 700; text-align: center;
}
.stp-under { color: #0a7a3a; }
.stp-over  { color: #b23a1a; }
.stp-e     { color: var(--bella-muted); }

/* Kauden parhaat kierrokset */
.best-rounds { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.best-rounds h3 { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bella-muted); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 2px solid var(--league-primary); font-weight: 600; }
.best-rounds ol { list-style: none; }
.best-rounds li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f0ead9; font-size: 0.9rem; }
.best-rounds li.extra { display: none; }
.best-rounds.show-all li.extra { display: flex; }
.best-rounds .n { font-weight: 700; color: var(--bella-navy); min-width: 1.4rem; }
.best-rounds .who { font-weight: 600; color: var(--bella-navy); flex: 1; min-width: 0; }
.best-rounds .who small { display: block; font-weight: 400; color: var(--bella-muted); font-size: 0.78rem; }
.best-rounds .score { font-weight: 800; font-size: 1.05rem; }
.link-button { background: none; border: none; color: var(--bella-link); cursor: pointer; font: inherit; padding: 0; }
.link-button:hover { text-decoration: underline; }

/* Osakilpailut ja säännöt */
.round-tag { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; color: var(--league-primary-dark); margin-right: 4px; }
.status-chip { display: inline-block; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; white-space: nowrap; }
.status-chip.final { background: #e9ecef; color: #495057; }
.status-chip.live { background: var(--league-primary); color: var(--league-on-primary); }
.status-chip.upcoming { background: #fff3cd; color: #6d5400; }
.replay-chip { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 6px; background: #e6f4ea; color: #0a6e3d; font-size: 0.7rem; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.tournament-row a.btn-go.secondary { background: transparent; color: var(--bella-navy); border: 2px solid var(--bella-navy); padding: 5px 12px; }
.tournament-row a.btn-go.secondary:hover { background: var(--bella-cream); }
.round-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
ul.league-rules { font-size: 0.92rem; }
ul.league-rules li { margin: 4px 0 4px 18px; }

/* Yhteistyö alatunnisteessa */
.sponsor-footer { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 22px 0 36px; color: var(--bella-muted); flex-wrap: wrap; }
.sponsor-footer img { height: 26px; width: auto; display: block; }
.sponsor-footer .sep { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; }

@media (max-width: 600px) {
    .cobrand { gap: 10px; }
    .cobrand-sep { display: none; }
    .cobrand img.league-logo { height: 24px; margin: 0; }
    .league-hero { padding: 18px; }
    .league-hero h2 { font-size: 1.5rem; }
    .best-rounds { grid-template-columns: 1fr; }
    .round-actions { width: 100%; }
    .round-actions a.btn-go { flex: 1; text-align: center; }

    /* Puhelimella koko taulukko mahtuu leveyteen ilman vaakavieritystä */
    table.standings { font-size: 0.84rem; }
    table.standings th { padding: 6px 3px; font-size: 0.6rem; letter-spacing: 0.04em; }
    table.standings td { padding: 8px 3px; }
    table.standings th .course, table.standings th .tag-prov, table.standings .col-played, table.standings td.name small { display: none; }
    table.standings td.total { font-size: 0.92rem; }
    .rank-badge { min-width: 20px; height: 20px; line-height: 20px; padding: 0 4px; font-size: 0.68rem; }
    .course-legend { display: block; }
}
