/* ==================== Main Header ==================== */

.siteHeader {
    position: sticky;
    top: 0;
    z-index: 900;
}

.siteHeader__bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 66px;
    padding: 10px 20px;
    box-shadow: var(--nav-shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}


/* ==================== Brand ==================== */

.siteBrand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 10px;
    min-height: var(--nav-control-height);
    padding: 4px 9px 4px 5px;
    color: var(--nav-text-strong);
    text-decoration: none;
}

/* ==================== Header Content ==================== */

.siteHeader__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1 1 auto;
    gap: 18px;
    min-width: 0;
}

/* ==================== Main Navigation ==================== */

.siteNav {
    display: flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
}

.siteNav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--nav-control-height);
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--nav-text);
    font-size: 13px;
    font-weight: 550;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.siteNav__link::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 5px;
    height: 2px;
    border-radius: 999px;
    opacity: 0;
    transform: scaleX(0.45);
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
}

.siteNav__link:hover {
    color: var(--nav-text-strong);
    background: var(--nav-surface-hover);
    text-decoration: none;
    transform: translateY(-1px);
}

.siteNav__link:hover::after {
    opacity: 0.45;
    transform: scaleX(1);
}

.siteNav__link:focus-visible {
    color: var(--nav-text-strong);
    outline: 2px solid;
    outline-offset: 2px;
}

.siteNav__link--active {
    color: var(--nav-text-strong);
    background:
        linear-gradient(
            145deg,
            rgba(117, 140, 255, 0.20),
            rgba(117, 140, 255, 0.08)
        );
    border-color: var(--nav-border-active);
}

.siteNav__link--active::after {
    opacity: 1;
    transform: scaleX(1);
}

/* ==================== Right Actions ==================== */

.siteHeader__actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 9px;
}


/* ==================== Language Switcher ==================== */

.langSwitcher {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    background: var(--nav-surface);
    border: 1px solid var(--nav-border);
    border-radius: 11px;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.24);
}

.langBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--nav-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}

.langBtn:hover {
    color: var(--nav-text-strong);
    background: rgba(255, 255, 255, 0.045);
    text-decoration: none;
}

.langBtn:focus-visible {
    outline: 2px solid;
    outline-offset: 2px;
}

.langBtn--active {
    color: var(--nav-text-strong);
    background:
        linear-gradient(
            160deg,
            rgba(255, 255, 255, 0.15),
            rgba(255, 255, 255, 0.07)
        );
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

/* ==================== Navbar Dropdown Triggers ====================
   The panels themselves are the shared .dd component in components/dropdown.css;
   only the navbar-shaped triggers live here. */

.siteHeader .dd__trigger {
    min-height: var(--nav-control-height);
    background: var(--nav-surface);
    border: 1px solid var(--nav-border);
    border-radius: 11px;
    color: var(--nav-text-strong);
}

.siteHeader .dd__trigger:hover {
    background: var(--nav-surface-hover);
    border-color: rgba(255, 255, 255, 0.16);
}

.siteHeader .dd__trigger:focus-visible {
    outline: 2px solid;
    outline-offset: 2px;
}

/* ==================== Timezone Switcher ==================== */

.tzSwitcher__trigger {
    padding: 0 10px 0 12px;
}

.tzSwitcher__value {
    /* Fits the widest offset label ("UTC+14"), so picking a shorter one does
       not make the trigger jump. */
    min-width: 50px;
    font-size: var(--dd-item-font-size);
    font-weight: var(--dd-item-font-weight);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Leftmost control in the actions row, so the panel grows to the right —
   the mirror of the right-anchored user menu at the other end. */
.tzSwitcher__menu {
    left: 0;
    right: auto;
}

/* ==================== User Dropdown ==================== */

.userMenu__trigger {
    max-width: 190px;
    padding: 4px 10px 4px 5px;
}

.userMenu__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background:
        linear-gradient(
            145deg,
            rgba(117, 140, 255, 0.32),
            rgba(90, 104, 190, 0.18)
        );
    color: #ffffff;
    font-size: 12px;
    font-weight: 750;
}

.userMenu__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
}

.userMenu__mobileName {
    display: none;
}

.userMenu__form {
    margin: 0;
}

/* Destructive action — the only place a navbar dropdown item deviates from the
   shared neutral hover. */
.userMenu__logout:hover {
    background: rgba(255, 92, 92, 0.12);
}


/* ==================== Hamburger Toggle ==================== */

.siteMenuToggle {
    display: none;
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin-left: auto;
    border: 1px solid var(--nav-border);
    border-radius: 12px;
    background: var(--nav-surface);
    cursor: pointer;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease;
}

.siteMenuToggle:hover {
    background: var(--nav-surface-hover);
    border-color: rgba(255, 255, 255, 0.16);
}

.siteMenuToggle:focus-visible {
    outline: 2px solid;
    outline-offset: 2px;
}

.siteMenuToggle__line {
    position: absolute;
    left: 11px;
    right: 11px;
    height: 2px;
    border-radius: 999px;
    background: #ffffff;
    transition:
        top 0.22s ease,
        opacity 0.22s ease,
        transform 0.22s ease;
}

.siteMenuToggle__line:nth-child(1) {
    top: 14px;
}

.siteMenuToggle__line:nth-child(2) {
    top: 21px;
}

.siteMenuToggle__line:nth-child(3) {
    top: 28px;
}

.siteHeader.is-open .siteMenuToggle__line:nth-child(1) {
    top: 21px;
    transform: rotate(45deg);
}

.siteHeader.is-open .siteMenuToggle__line:nth-child(2) {
    opacity: 0;
}

.siteHeader.is-open .siteMenuToggle__line:nth-child(3) {
    top: 21px;
    transform: rotate(-45deg);
}

/* ==================== Page Header and Breadcrumbs ==================== */

.pageTitle {
    min-width: 0;
}

.breadcrumbs-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
    margin: 0 0 16px;
}

@media (max-width: 980px) {
    .siteHeader {
        margin-bottom: 16px;
    }

    .siteHeader__bar {
        min-height: 62px;
        padding: 8px 9px;
    }

    .siteMenuToggle {
        display: block;
    }

    .siteHeader__content {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        z-index: 30;
        display: grid;
        gap: 12px;
        padding: 12px;
        background: rgba(12, 17, 44, 0.98);
        border: 1px solid var(--nav-border);
        border-radius: 16px;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-8px);
        transition:
            opacity 0.2s ease,
            visibility 0.2s ease,
            transform 0.2s ease;
    }

    .siteHeader.is-open .siteHeader__content {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .siteNav {
        display: grid;
        gap: 5px;
        width: 100%;
    }

    .siteNav__link {
        justify-content: flex-start;
        width: 100%;
        min-height: 48px;
        padding: 0 14px;
        border-radius: 11px;
        font-size: 14px;
    }

    .siteNav__link::after {
        top: 10px;
        bottom: 10px;
        left: 5px;
        right: auto;
        width: 3px;
        height: auto;
        transform: scaleY(0.4);
    }

    .siteNav__link:hover::after,
    .siteNav__link--active::after {
        transform: scaleY(1);
    }

    .siteHeader__actions {
        display: flex;
        justify-content: space-between;
        width: 100%;
        padding-top: 11px;
        border-top: 1px solid rgba(255, 255, 255, 0.07);
    }

}


@media (max-width: 560px) {
    .siteHeader {
        top: 0;
        margin-left: 0;
        margin-right: 0;
    }

    .siteHeader__bar {
        border-radius: 14px;
    }

    .siteBrand {
        min-width: 0;
    }

    .siteBrand__title {
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 14px;
    }

    .siteBrand__icon {
        width: 34px;
        height: 34px;
    }

    .siteHeader__content {
        padding: 10px;
        border-radius: 14px;
    }

    .siteHeader__actions {
        align-items: stretch;
        gap: 8px;
    }

    .langSwitcher {
        flex: 1 1 auto;
    }

    .langBtn {
        flex: 1 1 50%;
        min-width: 0;
    }

    .tzSwitcher,
    .userMenu {
        flex: 1 1 auto;
        min-width: 0;
    }

    .tzSwitcher__trigger,
    .userMenu__trigger {
        justify-content: center;
        width: 100%;
        max-width: none;
    }

    .tzSwitcher__value {
        min-width: 0;
    }

    .userMenu__name {
        max-width: 100px;
    }

    /* The triggers are a third of the row wide here, too narrow to anchor a
       190px panel to — pin each one to its own side of the row instead and let
       the panel keep a readable width without leaving the screen. */
    .tzSwitcher__menu {
        left: 0;
        right: auto;
        width: min(var(--dd-width), calc(100vw - 32px));
    }

    .userMenu__dropdown {
        left: auto;
        right: 0;
        width: min(var(--dd-width), calc(100vw - 32px));
    }

    .pageHeader {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .pageActions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .langSwitcher {
        padding: 2px;
        border-radius: 10px;
    }

    .langBtn {
        padding: 6px 10px;
        font-size: 12px;
        letter-spacing: 1px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .siteHeader *,
    .siteHeader *::before,
    .siteHeader *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.breadcrumbs {
    min-width: 0;
    margin: 0 0 12px;
}

.breadcrumbs__list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: rgba(255, 255, 255, 0.42);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
}

.breadcrumbs__item:not(:last-child)::after {
    content: "/";
    flex: 0 0 auto;
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.20);
}

.breadcrumbs__link {
    display: inline-block;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.46);
    text-decoration: none;
    padding: 0 4px;
    transition:
        color 0.16s ease,
        background-color 0.16s ease;
}

.breadcrumbs__link:hover {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
}

.breadcrumbs__link:focus-visible {
    outline: 2px solid;
    outline-offset: 3px;
    border-radius: 3px;
}

.breadcrumbs__current {
    display: inline-block;
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
    color: rgba(255, 255, 255, 0.70);
}

@media (max-width: 600px) {
    .breadcrumbs {
        margin-bottom: 9px;
    }

    .breadcrumbs__item {
        font-size: 10px;
    }

    .breadcrumbs__item:not(:last-child)::after {
        margin: 0 6px;
    }

    .breadcrumbs__link {
        max-width: 120px;
    }

    .breadcrumbs__current {
        max-width: 170px;
    }
}

/* ==================== Tournaments Toolbar (breadcrumbs + view controls) ==================== */

.tournamentsToolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 32px;
    margin-bottom: 16px;
}

.tournamentsToolbar > .breadcrumbs-bar {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.tournamentsToolbar .breadcrumbs__list {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    margin: 0;
    padding: 0;
}

.tournamentsToolbar > .view-toggle,
.tournamentsToolbar > .uc-view-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 8px;
    width: auto;
    margin: 0 0 0 auto;
}

.tournamentsToolbar .matchSearchWrapper {
    margin: 0;
}

.tournamentsToolbar .matchSearchInput,
.tournamentsToolbar .view-btn,
.tournamentsToolbar .uc-view-btn {
    height: 32px;
    box-sizing: border-box;
}

.tournamentsToolbar .view-btn,
.tournamentsToolbar .uc-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tournamentsToolbar .view-toggle,
.tournamentsToolbar .uc-view-toggle {
    margin-bottom: 0;
}

.tournamentDetailsTop .breadcrumbs-bar {
    height: 32px;
}

@media (max-width: 700px) {
    .tournamentsToolbar {
        gap: 8px;
    }

    .tournamentsToolbar > .breadcrumbs-bar {
        overflow: hidden;
    }

    .tournamentsToolbar .breadcrumbs__list {
        overflow: hidden;
    }

    .tournamentsToolbar .breadcrumbs__link,
    .tournamentsToolbar .breadcrumbs__current {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tournamentsToolbar > .view-toggle,
    .tournamentsToolbar > .uc-view-toggle {
        flex: 0 0 auto;
        width: auto;
    }

    .tournamentsToolbar .matchSearchInput {
        width: 140px;
    }
}
