:root {
    --blue: #2ea6df;
    --orange: #f6c23e;
    --black: #000;
    --white: #fff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Museo500-Regular, sans-serif;
    background: #f4f7fa;
    color: #415463;
    font-size: clamp(1.125rem, 1.6vw, 1.35rem);
}

h1 {
    font-family: Museo500-Regular, sans-serif;
    font-size: clamp(2.75rem, 4vw, 3.75rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

h2, h3 {
    font-family: Museo500-Regular, sans-serif;
    color: #415463;
}

.header-top {
    background: var(--white);
    border-bottom: 0.125rem solid #e5e5e5;
    position: fixed;
    top: 0;
    inset-inline: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 80rem;
    margin-inline: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0.75rem 1.25rem;
}

.header-band {
    height: 4rem;
}

/* LOGO */

.header_logo {
    display: flex;
    flex-direction: column;

    justify-content: center;
    align-items: center;

    z-index: 999;

    background: #28a8e0;
    padding: 2rem;

    aspect-ratio: 1 / 1;

    transition: all .5s ease;
}

.logo {
    inline-size: 6rem;
    block-size: 6rem;

    display: grid;
    place-items: center;

    background: #28A8E0;
    margin-top: -1.5rem;
    margin-bottom: -3rem;
}

.logo svg {
    inline-size: 80%;
    block-size: auto;
    display: block;
}

.logo-inner {
    inline-size: 100%;
    block-size: 100%;

    display: grid;
    place-items: center;
}


/* DEFAULT SVG COLORS */
.logo svg .ellipse {
    fill: #28A8E0;                /* blue first */
    transition: fill 0.3s ease;
}

.logo svg .path {
    fill: #fff;                   /* white first */
    transition: fill 0.3s ease;
}

/* HOVER STATE */
.logo:hover {
    background: #fff;           /* blue tile */
}

.logo:hover svg .ellipse {
    fill: #fff;
}

.logo:hover svg .path {
    fill: #28A8E0;
}


/* NAV */

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    padding: 0.9rem 1.6rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;

    background: var(--blue);
    color: var(--white);
    border-radius: 0.25rem;

    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.nav-btn:hover {
    background: var(--orange);
    color: var(--black);
}


.home-section {
    padding: 4rem 1.25rem;
    background: #f4f7fa;
}

.home-inner {
    max-width: 80rem;
    margin-inline: auto;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.two-col.reverse {
    direction: rtl;
}

.two-col.reverse > * {
    direction: ltr;
}

.center {
    text-align: center;
}

img {
    width: 100%;
    height: auto;
    display: block;
}


.lead {
    font-size: 1.125rem;
    font-weight: 400;
    max-width: 38rem;
}
.step {
    color: #2ea6df;
    font-weight: 700;
    margin-right: 0.5rem;
}

.timeline {
    padding-left: 1rem;
}

.timeline li {
    margin-bottom: 0.5rem;
}

@media (max-width: 48rem) {
    .two-col {
        grid-template-columns: 1fr;
    }

    .two-col img {
        margin-top: 1.5rem;
    }
}

.home-section.intro .two-col {
    display: block;
}

.home-section.intro img {
    width: 100%;
    max-width: 100%;
    display: block;
    margin-top: 4rem;
}

/* text column layout */
.home-section.intro .two-col > div {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    align-items: start;
}

/* bigger h1 */
.home-section.intro h1 {
    font-size: clamp(3.5rem, 6vw, 5rem);
    line-height: 1.05;
    margin: 0;
}

/* EDGE-TO-EDGE VARIANT (sections 3–5) */
.home-section--edge {
    padding-inline: 0;
    background: #f4f7fa;
}

/* kill max-width for this variant */
.home-section--edge .home-inner {
    max-width: none;
    margin: 0;
}

/* layout becomes asymmetric (like pic 3) */
.home-section--edge .two-col {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 4rem;
    align-items: stretch;
}

/* full-height, edge image */
.home-section--edge img {
    height: 100%;
    object-fit: cover;
}

/* reverse variant */
.home-section--edge.reverse .two-col {
    direction: rtl;
}

.home-section--edge.reverse .two-col > * {
    direction: ltr;
}

/* keep text readable */
.home-section--edge .two-col > div {
    padding: 4rem 2.5rem;
    max-width: 40rem;
}


/* PHANTOM SECTION */
.home-section--phantom {
    padding-block: 4rem;
    background: #f4f7fa;
    overflow: hidden;
}

.phantom-grid {
    max-width: 80rem;
    margin-inline: auto;

    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: center;
    gap: 4rem;
}

/* IMAGE */
.phantom-image {
    position: relative;
}

.phantom-image img {
    width: calc(100% + ((100vw - 80rem) / 2));
    max-width: none;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* TEXT */
.phantom-text {
    max-width: 38rem;
    text-align: left;
}

/* REVERSE VARIANT */
.home-section--phantom.reverse .phantom-grid {
    grid-template-columns: 2fr 1fr;
}

.home-section--phantom.reverse .phantom-image img {
    margin-left: calc(-1 * ((100vw - 80rem) / 2));
}

/* FOOTER */
.site-footer {
    background: #f4f7fa;
    padding-block: 5rem 4rem;
    font-size: 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr 1fr;
    gap: 4rem;
}

/* BRAND */
.footer-brand p {
    max-width: 28rem;
    line-height: 1.6;
}

.footer-logo {
    inline-size: 5rem;
    margin-bottom: 1.5rem;
}

.footer-meta {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #7a8b99;
}

/* LINKS */
.footer-links h4,
.footer-socials h4,
.footer-partners h4 {
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li + li {
    margin-top: 0.5rem;
}

.footer-links a,
.footer-link {
    color: #415463;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-link:hover {
    color: var(--blue);
}

/* SOCIALS */
.social-icons {
    display: flex;
    gap: 0.75rem;
}

.social-icons img {
    inline-size: 2rem;
    block-size: 2rem;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.social-icons a:hover img {
    transform: translateY(-2px);
    opacity: 0.85;
}

/* PARTNERS */
.partner-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.partner-logos img {
    max-inline-size: 7rem;
    block-size: auto;
}

/* RESPONSIVE */
@media (max-width: 64rem) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        row-gap: 3rem;
    }
}

@media (max-width: 40rem) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}


/* PAGE HEADER */
.page-header {
    background: #f4f7fa;
    padding-block: 5rem 4rem;
}

.page-header h1 {
    font-size: clamp(3rem, 5vw, 4rem);
    line-height: 1.1;
    margin: 0;
}

/* BASKET SECTION */
.basket-section {
    max-width: 70rem;
}

.basket-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.basket-range {
    font-size: 1rem;
    font-weight: 400;
    color: #7a8b99;
}

/* TABLE */
.basket-table-wrap {
    overflow-x: auto;
}

.basket-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.basket-table thead th {
    text-align: left;
    font-weight: 600;
    color: #7a8b99;
    padding: 0.75rem 1rem;
}

.basket-table tbody tr {
    background: #fff;
}

.basket-table tbody tr + tr {
    border-top: 0.0625rem solid #e5e9ef;
}

.basket-table td {
    padding: 1rem;
    vertical-align: middle;
}

.basket-table td:first-child {
    width: 6rem;
    text-align: center;
}

.basket-table td:last-child {
    width: 6rem;
    text-align: right;
    font-weight: 600;
}

/* TEAM LINKS */
.basket-table a {
    color: #415463;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    transition: color 0.2s ease;
}

.basket-table a:hover {
    color: var(--blue);
}

/* ROW HOVER (subtle) */
.basket-table tbody tr:hover {
    background: #f9fbfd;
}

/* PAGE SWITCH */
.page-switch {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* BUTTONS */
.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.25rem;
}

.btn-primary {
    background: var(--blue);
    color: #fff;
}

.btn-outline {
    border: 0.125rem solid var(--blue);
    color: var(--blue);
}

/* TABLE */
.table-wrap {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.results-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: #7a8b99;
    font-weight: 600;
}

.results-table td {
    padding: 1rem;
    background: #fff;
}

.results-table tbody tr + tr {
    border-top: 0.0625rem solid #e5e9ef;
}

/* FIGHTS */
.fights-list {
    display: grid;
    gap: 0.75rem;
    max-width: 40rem;
}

.fight {
    display: grid;
    grid-template-columns: 1fr auto auto auto 1fr;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 0.25rem;
}

.fight .team:first-child {
    text-align: right;
}

.fight .team:last-child {
    text-align: left;
}

.score {
    font-weight: 700;
    min-width: 2.5rem;
    text-align: center;
}

.score.win {
    color: #2ea6df;
}

.score.lose {
    color: #7a8b99;
}

.vs {
    opacity: 0.5;
}
/* ================================================
   BRACKET / SPIDER
================================================ */

.bracket {
    display: grid;
    grid-template-columns: repeat(5, minmax(10rem, 1fr));
    gap: 2rem;
    align-items: stretch;   /* all rounds share the same height */
    position: relative;
    overflow-x: auto;
    padding: 0.4rem 0.25rem 0.4rem 0.4rem;
}

.round {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;  /* distributes matches so centres align across rounds */
    gap: 0.5rem;
}

.match {
    position: relative;
    z-index: 1;
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 0.2rem;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.12s;
}

.team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.32rem 0.6rem;
    font-size: 0.82rem;
    line-height: 1.3;
    gap: 0.4rem;
}

.team span {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

.team.win {
    background: #f0f3f7;
    font-weight: 600;
}

.team.lose {
    background: #fafafa;
    color: #9aa9b5;
    border-top: 1px solid #edf0f4;
}

/* ── Pending: match not yet played ── */
.team.pending {
    background: #f7f9fb;
}

.team.pending + .team.pending {
    border-top: 1px solid #edf0f4;
}

.team.pending span {
    color: #9aa9b5;
}

/* ── Primary highlight: the hovered match's full path ── */
.match:hover,
.match.path-active {
    box-shadow: 0 0 0 2px var(--blue);
}

.match:hover .team.win,
.match.path-active .team.win {
    background: #2ea6df;
    color: #fff;
}

.match:hover .team.lose,
.match.path-active .team.lose {
    background: #d0edf9;
    color: #1a6e9a;
    border-top-color: #a8d8f0;
}

/* ── Secondary highlight: loser branches ── */
.match.path-secondary {
    box-shadow: 0 0 0 2px #a8d8f0;
}

.match.path-secondary .team.win {
    background: #ddf0fb;
    color: #2a7fab;
}

.match.path-secondary .team.lose {
    background: #f0faff;
    color: #7ab4cc;
    border-top-color: #cce9f7;
}

/* SVG overlay for bracket connectors */
.bracket-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 0;
}

/* Empty slot – awaiting predkolo winner */
.team.empty-slot {
    color: #b0bec5;
    font-style: italic;
    border-top-color: #e8edf1;
}

/* Winner box */
.match.winner {
    border-color: #c8a227;
}

.match.winner .team.win {
    background: #fdf6e3;
    color: #7a5c00;
    font-weight: 700;
}

/* -----------------------------------------------
   Results page enhancements (table + weeks)
----------------------------------------------- */

/* Table header with controls */
.table-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.table-header h2 {
    margin: 0;
}

.table-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Search input */
.search-input {
    padding: 0.6rem 1rem;
    border: 1px solid #d0d7de;
    border-radius: 0.25rem;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    min-width: 220px;
}

.search-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(46, 166, 223, 0.1);
}

/* Collapsible container */
.collapsible-content {
    transition: all 0.3s ease;
}

.collapsible-content.collapsed {
    display: none;
}

/* Table styling (aligned with baskets table) */
.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.results-table thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: #7a8b99;
    font-weight: 600;
}

.results-table tbody td {
    padding: 1rem;
    background: #fff;
    vertical-align: middle;
}

.results-table tbody tr + tr {
    border-top: 0.0625rem solid #e5e9ef;
}

.results-table tbody tr:hover {
    background: #f9fbfd;
}

.results-table a {
    color: #415463;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    transition: color 0.2s ease;
}

.results-table a:hover {
    color: var(--blue);
}

/* Weeks grid – cards */
.weeks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;

    align-items: start;
}


.week-card {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    overflow: hidden;
    border: 1px solid #e9eef2;
    transition: box-shadow 0.2s ease;
}

.week-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    cursor: pointer;
    border-bottom: 1px solid #e9eef2;
    font-weight: 600;
}

.week-header .week-number {
    font-size: 1.1rem;
    color: var(--blue);
}

.week-header .week-toggle {
    display: flex;
    align-items: center;
    color: #7a8b99;
}

.chevron {
    transition: transform 0.3s ease;
}

.week-header[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

.week-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.week-content.collapsed {
    display: none;
}

.week-content.expanded {
    display: block;
    padding: 1.25rem;
}

/* Fights list inside week card */
.fights-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fight {
    display: grid;
    grid-template-columns: 1fr auto auto auto 1fr;
    align-items: center;
    gap: 0.25rem 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #edf2f6;
    font-size: 0.9rem;
}

.fight:last-child {
    border-bottom: none;
}

.fight .team {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fight .team:first-child {
    text-align: right;
}

.fight .team:last-child {
    text-align: left;
}

.fight .score {
    font-weight: 600;
    min-width: 2rem;
    text-align: center;
    color: var(--blue);
}

.fight .vs {
    opacity: 0.4;
    font-size: 0.85rem;
}

.no-fights {
    color: #9aa9b5;
    font-style: italic;
    margin: 0.5rem 0;
    text-align: center;
}

/* Small screen adjustments */
@media (max-width: 48rem) {
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }

    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        width: 100%;
    }

    .weeks-grid {
        grid-template-columns: 1fr;
    }
}

/* Button hover states */
.btn-outline:hover {
    background: var(--blue);
    color: #fff;
    cursor: pointer;
}

/* Ensure pointer on all buttons */
.btn {
    cursor: pointer;
}

.btn-outline {
    transition: background-color 0.2s ease, color 0.2s ease;
}

.fight .score.winner {
    color: #0066cc; /* or whatever blue you use */
    font-weight: bold;
}

.fight .score.loser {
    color: #999999; /* grey */
}

/* ── PREDKOLO FIGHTS ─────────────────────────────────────────────────────── */

.predkolo-fights-section {
    background: #eaf5fb;
}

.predkolo-subtitle {
    color: #6b8494;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
}

.predkolo-fights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38rem, 1fr));
    gap: 1.25rem;
}

/* ── Card ── */
.pk-card {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    background: #fff;
    border-radius: 0.625rem;
    border: 1px solid #c8dff0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.pk-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.11);
}

/* ── Each side ── */
.pk-side {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.4rem 1.5rem;
    transition: background 0.2s, opacity 0.2s;
    min-width: 0;
}

.pk-side.right {
    flex-direction: row-reverse;
    text-align: right;
}

/* ── Winner / loser states ── */
.pk-side.winner {
    background: linear-gradient(135deg, #e6f4ff 0%, #d0ecfa 100%);
    border-top: 3px solid var(--blue);
}

.pk-side.winner .pk-name {
    color: #0057a8;
    font-weight: 700;
}

.pk-side.winner .pk-score {
    color: #0057a8;
}

.pk-side.loser {
    opacity: 0.45;
}

/* ── Elements ── */
.pk-trophy {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.pk-name {
    flex: 1;
    font-size: 1.15rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pk-score {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--blue);
    flex-shrink: 0;
    line-height: 1;
}

/* ── Tooltip on score hover ── */
.pk-score.has-tip {
    cursor: help;
    position: relative;
}

.pk-score.has-tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 0.4rem);
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e4a;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 400;
    padding: 0.3rem 0.65rem;
    border-radius: 0.3rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 20;
}

.pk-score.has-tip:hover::after {
    opacity: 1;
}

/* ── Divider ── */
.pk-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #b0bec5;
    background: #f4f7fa;
    border-left: 1px solid #e5eaee;
    border-right: 1px solid #e5eaee;
    flex-shrink: 0;
}

/* ── MOBILE ────────────────────────────────────────────────────────────────── */
@media (max-width: 40rem) {

    /* Shrink page-header vertical space */
    .page-header {
        padding-block: 2.5rem 2rem;
    }

    /* Stack / wrap the three nav buttons */
    .page-switch {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }

    .page-switch .btn {
        text-align: center;
        padding: 0.65rem 1rem;
    }

    /* Predkolo grid → single column */
    .predkolo-fights-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    /* pk-card → stack top/vs/bottom */
    .pk-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .pk-side {
        padding: 0.85rem 1rem;
        gap: 0.6rem;
    }

    /* Right side: drop the row-reverse so both sides read left→right */
    .pk-side.right {
        flex-direction: row;
        text-align: left;
        border-top: 1px solid #e5eaee;
    }

    /* winner border was on top for horizontal layout — move to left for vertical */
    .pk-side.winner {
        border-top: none;
        border-left: 4px solid var(--blue);
    }

    .pk-divider {
        padding: 0.35rem 1rem;
        border-left: none;
        border-right: none;
        border-top: 1px solid #e5eaee;
        border-bottom: 1px solid #e5eaee;
        text-align: center;
    }

    .pk-score {
        font-size: 1.8rem;
    }

    .pk-name {
        font-size: 1rem;
    }

    .pk-trophy {
        font-size: 1.2rem;
    }
}
