/* ─── Light theme (default) ─── */
@font-face {
    font-family: 'Century Gothic';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/century-gothic-bold.ttf') format('truetype');
}

:root {
    --bg: #eef0f4;
    --bg-soft: #f8f9fb;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-2: #f3f5f9;
    --text: #0f172a;
    --text-secondary: #334155;
    --muted: #64748b;
    --border: #dde3ec;
    --border-light: #eef2f7;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-text: #ffffff;
    --primary-soft: rgba(79, 70, 229, 0.1);
    --accent: #0891b2;
    --accent-soft: rgba(8, 145, 178, 0.1);
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --danger-text: #991b1b;
    --success: #059669;
    --success-soft: #ecfdf5;
    --success-text: #047857;
    --warning-soft: #fffbeb;
    --warning-text: #b45309;
    --info-soft: #eff6ff;
    --info-text: #1d4ed8;
    --header-bg: rgba(255, 255, 255, 0.82);
    --header-border: rgba(15, 23, 42, 0.07);
    --footer-bg: rgba(255, 255, 255, 0.65);
    --card-border: rgba(15, 23, 42, 0.07);
    --input-bg: #ffffff;
    --table-hover: #f8fafc;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 16px 48px rgba(15, 23, 42, 0.12);
    --glow-1: rgba(79, 70, 229, 0.08);
    --glow-2: rgba(8, 145, 178, 0.06);
    --radius: 14px;
    --radius-sm: 10px;
    --header-h: 76px;
    --max-w: 1200px;
    --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-brand: 'Century Gothic', CenturyGothic, 'Apple Gothic', sans-serif;
    --brand-wordmark: #1f3278;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Dark theme ─── */
[data-theme="dark"] {
    --bg: #0c0e14;
    --bg-soft: #141820;
    --surface: #1a1f2b;
    --surface-raised: #222836;
    --surface-2: #222836;
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --muted: #94a3b8;
    --border: #2d3548;
    --border-light: #232a38;
    --primary: #818cf8;
    --primary-hover: #a5b4fc;
    --primary-text: #0f172a;
    --primary-soft: rgba(129, 140, 248, 0.18);
    --accent: #22d3ee;
    --accent-soft: rgba(34, 211, 238, 0.12);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.12);
    --danger-text: #fca5a5;
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.12);
    --success-text: #6ee7b7;
    --warning-soft: rgba(251, 191, 36, 0.12);
    --warning-text: #fcd34d;
    --info-soft: rgba(96, 165, 250, 0.12);
    --info-text: #93c5fd;
    --brand-wordmark: #e8eeff;
    --header-bg: rgba(12, 14, 20, 0.88);
    --header-border: rgba(255, 255, 255, 0.06);
    --footer-bg: rgba(12, 14, 20, 0.9);
    --card-border: rgba(255, 255, 255, 0.08);
    --input-bg: #141820;
    --table-hover: rgba(255, 255, 255, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.55);
    --glow-1: rgba(129, 140, 248, 0.12);
    --glow-2: rgba(34, 211, 238, 0.08);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    color-scheme: light;
    overflow-x: clip;
}

[data-theme="dark"] { color-scheme: dark; }

body {
    font-family: var(--font);
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 70% 55% at 50% -15%, var(--glow-1), transparent),
        radial-gradient(ellipse 50% 35% at 100% 0%, var(--glow-2), transparent);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition), color var(--transition);
    overflow-x: clip;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; display: block; }

.container {
    width: min(100% - 2.5rem, var(--max-w));
    margin-inline: auto;
}

.container-wide {
    width: min(100% - 2.5rem, 1360px);
    margin-inline: auto;
}

@media (min-width: 1280px) {
    :root { --max-w: 1280px; }
}

/* ─── Header ─── */
.site-header-shell {
    position: relative;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-bottom: 1px solid var(--header-border);
    height: var(--header-h);
    transition: background var(--transition), border-color var(--transition);
}

.header-slogan-bar {
    background: transparent;
    border-bottom: 1px solid var(--header-border);
    padding: 0.55rem 0 0.75rem;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: var(--header-h);
    min-width: 0;
}

.header-slogan {
    margin: 0;
    padding: 0;
    text-align: center;
    font-family: var(--font-brand);
    font-size: clamp(1.2rem, 3.4vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--brand-wordmark);
    opacity: 1;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-feature-settings: 'liga' 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.header-profile {
    position: relative;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.header-profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.header-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-profile-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    margin: 0;
}

.header-notifications {
    position: relative;
}

.header-messages {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: grid;
    place-items: center;
    text-decoration: none;
    color: inherit;
    font-size: 1rem;
}

.header-messages-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    margin: 0;
}

.header-notifications-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: inherit;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 1rem;
    line-height: 1;
}

.header-notifications-btn:hover {
    background: var(--primary-soft);
}

.header-notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    margin: 0;
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(360px, calc(100vw - 24px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    z-index: 200;
    overflow: hidden;
}

.notifications-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.btn-link-sm {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.notifications-dropdown-body {
    max-height: 360px;
    overflow: auto;
}

.notification-item {
    display: block;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border);
}

.notification-item:last-child {
    border-bottom: 0;
}

.notification-item:hover {
    background: var(--primary-soft);
}

.notification-item.is-unread {
    background: color-mix(in srgb, var(--primary-soft) 70%, transparent);
}

.notification-item-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.notification-item-text {
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--muted);
}

.notification-item-time {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--muted);
}

.notification-empty {
    padding: 24px 14px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.notifications-backdrop {
    display: none;
}

@media (max-width: 960px) {
    .notifications-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 190;
        background: rgba(8, 10, 18, 0.45);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }
}

.pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.logo-brand {
    height: 48px;
    width: auto;
    max-width: min(170px, 46vw);
    object-fit: contain;
    display: block;
    background: transparent;
}

.logo-brand--dark { display: none; }

[data-theme="dark"] .logo-brand--light { display: none; }
[data-theme="dark"] .logo-brand--dark { display: block; }

.logo-mark {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 50%;
    display: block;
    background: transparent;
    flex-shrink: 0;
}

.logo span { color: var(--primary); }

.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    transition: all var(--transition);
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon { line-height: 1; }

[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
:not([data-theme="dark"]) .theme-toggle .icon-sun { display: block; }
:not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-left: auto;
    margin-right: 0.5rem;
}

.header-nav a {
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}

.header-nav a:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.header-menu-toggle {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: all var(--transition);
}

.header-menu-toggle:hover,
.header-menu-toggle[aria-expanded="true"] {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

.header-menu-icon {
    display: block;
    width: 16px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    position: relative;
}

.header-menu-icon::before,
.header-menu-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 16px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform var(--transition);
}

.header-menu-icon::before { top: -5px; }
.header-menu-icon::after { top: 5px; }

.header-menu-toggle[aria-expanded="true"] .header-menu-icon {
    background: transparent;
}

.header-menu-toggle[aria-expanded="true"] .header-menu-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.header-menu-toggle[aria-expanded="true"] .header-menu-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

.site-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(8, 10, 18, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    visibility: hidden;
}

.site-drawer-backdrop:not([hidden]) {
    display: block;
}

body.site-drawer-open .site-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.site-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 150;
    width: min(300px, 88vw);
    height: 100dvh;
    max-height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--header-border);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.28s ease, visibility 0.28s ease;
    display: flex;
    flex-direction: column;
    padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 1rem 1.5rem;
}

body.site-drawer-open .site-drawer {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

body.site-drawer-open {
    overflow: hidden;
}

.site-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.site-drawer-title {
    font-size: 1rem;
    font-weight: 700;
}

.site-drawer-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.site-drawer-close:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.site-drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.site-drawer-nav a {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.site-drawer-nav a:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.badge-count {
    background: var(--primary);
    color: var(--primary-text);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    margin-left: 0.25rem;
    vertical-align: middle;
}

[data-theme="dark"] .badge-count { color: #0f172a; }

.bottom-nav {
    display: none;
}

.team-logo-sm,
.team-logo-lg,
.team-logo-xs {
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
}

.team-logo-sm {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
    border-radius: 10px;
}

.team-logo-lg {
    width: 64px;
    height: 64px;
    font-size: 1.1rem;
}

.team-logo-xs {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
    border-radius: 6px;
}

.team-logo-sm img,
.team-logo-lg img,
.team-logo-xs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.match-card__team {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.match-card__team--away {
    justify-content: flex-end;
}

.match-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
}

.fav-btn.is-on {
    border-color: var(--primary);
    color: var(--primary);
}

.city-autocomplete {
    position: relative;
}

.city-autocomplete-list {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 240px;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.city-autocomplete-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}

.city-autocomplete-item:hover,
.city-autocomplete-item.is-active {
    background: var(--primary-soft);
}

.city-autocomplete-item.is-empty {
    cursor: default;
    color: var(--muted);
}

.city-autocomplete-item small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
    font-size: 12px;
}

.city-autocomplete-hint {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.city-autocomplete-error {
    margin: 6px 0 0;
    color: var(--danger);
    font-size: 13px;
}

.city-autocomplete.is-invalid .city-autocomplete-input {
    border-color: var(--danger);
}

.protocol-match-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.protocol-team {
    font-weight: 700;
    font-size: 1.05rem;
}

.protocol-team-right {
    text-align: right;
}

.protocol-score {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    min-width: 4rem;
    text-align: center;
}

@media (max-width: 960px) {
    :root {
        --bottom-nav-h: 64px;
    }

    .header-slogan {
        font-size: clamp(1rem, 4.2vw, 1.45rem);
        letter-spacing: 0.015em;
    }

    .header-actions {
        margin-left: auto;
    }

    .header-messages {
        display: none !important;
    }

    .notifications-dropdown {
        position: fixed;
        top: calc(var(--header-h) + 3.25rem);
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
    }

    body.notifications-open .notifications-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 120;
        height: var(--bottom-nav-h);
        padding: 0 0.35rem calc(0.25rem + env(safe-area-inset-bottom, 0px));
        background: var(--header-bg);
        backdrop-filter: blur(18px) saturate(180%);
        -webkit-backdrop-filter: blur(18px) saturate(180%);
        border-top: 1px solid var(--header-border);
        justify-content: space-around;
        align-items: stretch;
        gap: 0.15rem;
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        min-width: 0;
        padding: 0.35rem 0.25rem;
        border-radius: 10px;
        color: var(--text-secondary);
        font-size: 0.68rem;
        font-weight: 600;
        text-decoration: none;
        line-height: 1.1;
    }

    .bottom-nav-item:hover,
    .bottom-nav-item:focus {
        color: var(--primary);
        background: var(--primary-soft);
    }

    .bottom-nav-icon {
        font-size: 1.05rem;
        line-height: 1;
    }

    main {
        padding-bottom: calc(3rem + var(--bottom-nav-h));
    }

    .footer {
        padding-bottom: calc(1.5rem + var(--bottom-nav-h));
    }
}

@media (min-width: 961px) {
    .bottom-nav { display: none !important; }

    .site-header-shell {
        position: sticky;
        top: 0;
        z-index: 100;
        display: flex;
        align-items: center;
        background: var(--header-bg);
        backdrop-filter: blur(18px) saturate(180%);
        -webkit-backdrop-filter: blur(18px) saturate(180%);
        border-bottom: 1px solid var(--header-border);
        min-height: var(--header-h);
    }

    .site-header {
        position: static;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: none;
        height: auto;
        flex: 1;
        z-index: 2;
    }

    .site-header .header-inner {
        height: var(--header-h);
    }

    .header-slogan-bar {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: min(52vw, 640px);
        background: transparent;
        border: none;
        padding: 0;
        pointer-events: none;
        z-index: 1;
    }

    .header-slogan-bar .container {
        width: 100%;
        margin: 0;
        padding: 0;
    }
}

/* ─── Layout ─── */
main { padding: 2rem 0 4rem; flex: 1; }

@media (min-width: 1024px) {
    main { padding: 2.5rem 0 5rem; }
}

.page-header { margin-bottom: 2rem; }

.page-title {
    font-size: clamp(1.625rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.2;
    color: var(--text);
}

.page-subtitle {
    color: var(--muted);
    margin-top: 0.35rem;
    font-size: 0.95rem;
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* ─── Hero ─── */
.hero {
    padding: 2rem 0 1.5rem;
    margin-bottom: 1rem;
}

.hero-grid {
    display: grid;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1.2fr 1fr;
        gap: 3rem;
        padding: 1rem 0 2rem;
    }
    .hero-title { max-width: none; }
    .hero-text { max-width: 48ch; font-size: 1.1rem; }
}

.hero-eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

[data-theme="dark"] .hero-eyebrow {
    border-color: rgba(129, 140, 248, 0.25);
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.12;
    max-width: 14ch;
}

.hero-text {
    margin-top: 0.85rem;
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 42ch;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (min-width: 1024px) {
    .hero-stats { gap: 1rem; }
}

.section-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin: 2.5rem 0 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2.5rem 0 1rem;
}

.section-header .section-title { margin: 0; }

.home-matches-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}

@media (min-width: 900px) {
    .home-matches-grid {
        grid-template-columns: 1.2fr 1fr;
        gap: 1.75rem;
        align-items: start;
    }
}

.home-matches-grid .section-header {
    margin-top: 0.5rem;
}

.posts-feed--home {
    max-width: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 800px) {
    .posts-feed--home {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .posts-feed--home .vk-post-text--collapsed {
        max-height: 4.8em;
    }

    .posts-feed--home .vk-post-photo img {
        max-height: 160px;
        object-fit: cover;
        width: 100%;
    }
}

/* ─── Cards ─── */
.card {
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.35rem 1.5rem;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition), background var(--transition);
}

.card-hover:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.card-accent {
    border-top: 3px solid var(--primary);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

@media (min-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
    .grid-2 { gap: 1.5rem; }
}

@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.625rem 1.125rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-text);
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
}

[data-theme="dark"] .btn-primary {
    color: #0f172a;
    box-shadow: 0 2px 14px rgba(129, 140, 248, 0.35);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: var(--primary-text);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.45);
    transform: translateY(-1px);
}

[data-theme="dark"] .btn-primary:hover { color: #0f172a; }

.btn-secondary {
    background: var(--surface-raised);
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-soft);
    color: var(--text);
    border-color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: transparent;
}

[data-theme="dark"] .btn-danger { color: #0f172a; }

.btn-danger:hover { filter: brightness(1.08); color: #fff; }
[data-theme="dark"] .btn-danger:hover { color: #0f172a; }

.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.8125rem; }
.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-block { width: 100%; }

/* Looking for team switch */
.status-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0.85rem 0.4rem 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--muted);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.status-switch-knob {
    width: 28px;
    height: 16px;
    border-radius: 999px;
    background: var(--border);
    position: relative;
    flex-shrink: 0;
    transition: background var(--transition);
}

.status-switch-knob::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--surface-raised);
    transition: transform var(--transition);
}

.status-switch.is-on {
    background: var(--success-soft);
    border-color: transparent;
    color: var(--success-text);
}

.status-switch.is-on .status-switch-knob {
    background: var(--success);
}

.status-switch.is-on .status-switch-knob::after {
    transform: translateX(12px);
}

.looking-toggle-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.looking-note-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.looking-note-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    color: var(--text-secondary);
}

.looking-note-form textarea {
    min-height: 96px;
    resize: vertical;
}

.looking-note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.65rem;
}

.looking-note-public .looking-note-text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.looking-note-preview {
    margin: 0.45rem 0 0;
    line-height: 1.45;
}

.tabs a.tab-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.tabs a.tab-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

/* ─── Forms ─── */
.form-group { margin-bottom: 1.125rem; }

label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
}

input[type=text], input[type=email], input[type=password],
input[type=date], input[type=datetime-local], input[type=number],
select, textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.9375rem;
    background: var(--input-bg);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

select option,
select optgroup {
    background: var(--input-bg);
    color: var(--text);
}

.panel-soft {
    background: var(--info-soft);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    color: var(--text);
}

.panel-soft--warn {
    background: var(--warning-soft);
    border-left-color: var(--warning-text);
}

.auth-card { max-width: 420px; margin-top: 0.5rem; }

.checkbox-list { display: grid; gap: 0.5rem; }

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--surface);
    transition: background var(--transition), border-color var(--transition);
}

.checkbox-item:hover {
    background: var(--bg-soft);
    border-color: var(--primary);
}

.filter-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-form .form-group { margin-bottom: 0; flex: 1; min-width: 160px; }
.filter-form .form-group.narrow { flex: 0; width: 160px; min-width: 140px; }

/* ─── Tables ─── */
.table-wrap, .table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 1024px) {
    table.data-table, table.standings-table, table.matrix-table { font-size: 0.9rem; }
    table.data-table th, table.standings-table th, table.matrix-table th,
    table.data-table td, table.standings-table td, table.matrix-table td {
        padding: 0.85rem 1.15rem;
    }
}

table.data-table, table.standings-table, table.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: var(--surface);
}

table.data-table th, table.standings-table th, table.matrix-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--bg-soft);
    font-weight: 600;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table.data-table td, table.standings-table td, table.matrix-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

table.data-table tr:last-child td,
table.standings-table tr:last-child td,
table.matrix-table tr:last-child td { border-bottom: none; }

table.data-table tbody tr:hover td,
table.standings-table tbody tr:hover td { background: var(--table-hover); }

.team-name-cell, .team-name { font-weight: 600; color: var(--text); }
.points-col { font-weight: 700; color: var(--primary); }
.self-cell { background: var(--bg-soft); color: var(--muted); }

.table-legend {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.5;
}

.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 0.875rem; }

/* ─── Tags ─── */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--bg-soft);
    color: var(--muted);
    border: 1px solid var(--border);
}

.tag-success { background: var(--success-soft); color: var(--success-text); border-color: transparent; }
.tag-warning { background: var(--warning-soft); color: var(--warning-text); border-color: transparent; }
.tag-danger { background: var(--danger-soft); color: var(--danger-text); border-color: transparent; }
.tag-primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }

.tag-count {
    flex-shrink: 0;
    white-space: nowrap;
    border-radius: 8px;
    font-size: 0.68rem;
    line-height: 1.2;
    padding: 0.3rem 0.55rem;
}

.team-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.6rem;
}

.looking-toggle-section + .looking-toggle-section {
    margin-top: 1rem;
}

/* ─── Messages ─── */
.messages { margin-bottom: 1.25rem; display: grid; gap: 0.5rem; }

.message {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.message-success { background: var(--success-soft); color: var(--success-text); border-color: rgba(52, 211, 153, 0.25); }
.message-error, .message-danger { background: var(--danger-soft); color: var(--danger-text); border-color: rgba(248, 113, 113, 0.25); }
.message-info, .message-warning { background: var(--info-soft); color: var(--info-text); border-color: rgba(96, 165, 250, 0.25); }

/* ─── Avatar ─── */
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--primary);
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border);
}

.avatar-lg { width: 88px; height: 88px; font-size: 1.35rem; border-radius: 16px; }

/* ─── Lists ─── */
.list-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-light);
}

.list-item:last-child { border-bottom: none; }
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; font-size: 0.9375rem; color: var(--text); margin-bottom: 0.1rem; }
.list-item-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.1rem; }
.list-item-title-row > span:first-child { font-weight: 600; font-size: 0.9375rem; color: var(--text); }

.list-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    border-radius: var(--radius-sm);
    padding: 0.25rem 0;
    transition: background var(--transition);
}

.list-link:hover .list-item-title { color: var(--primary); }

.list-arrow {
    color: var(--muted);
    font-size: 1.1rem;
    transition: transform var(--transition), color var(--transition);
}

.list-link:hover .list-arrow { transform: translateX(3px); color: var(--primary); }

/* ─── Tabs ─── */
.tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0.35rem;
    background: var(--bg-soft);
    border-radius: 999px;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    border: 1px solid var(--border);
    width: fit-content;
    max-width: 100%;
}

@media (min-width: 1024px) {
    .tabs { margin-bottom: 1.5rem; }
}

.tab-btn {
    padding: 0.5rem 1.1rem;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-radius: 999px;
    white-space: nowrap;
    transition: all var(--transition);
}

.tab-btn:hover { color: var(--text-secondary); }

.tab-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.tab-panel {
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.35rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

@media (min-width: 1024px) {
    .tab-panel { padding: 1.75rem 2rem; }
}

.tab-panel h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.15rem;
    color: var(--text);
}

/* ─── Matches & schedule ─── */
.schedule-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.schedule-header {
    margin-bottom: 1.75rem;
}

.schedule-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.round-section { margin-bottom: 2rem; }

.round-title {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    padding: 0.35rem 0.85rem;
    margin-bottom: 0.85rem;
    background: var(--primary-soft);
    border-radius: 999px;
    border: 1px solid transparent;
}

[data-theme="dark"] .round-title {
    border-color: rgba(129, 140, 248, 0.2);
}

.match-card {
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.match-card--schedule {
    display: flex;
    align-items: stretch;
    max-width: 920px;
}

.match-card--schedule.match-card--no-date .match-card__body {
    width: 100%;
}

.match-card--schedule:hover {
    border-color: rgba(79, 70, 229, 0.35);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.match-card__time {
    flex-shrink: 0;
    width: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.15rem;
    padding: 1rem 0.65rem;
    background: var(--bg-soft);
    border-right: 1px solid var(--border);
}

.match-card__date {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.3;
}

.match-card__clock {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}

.match-card__body {
    flex: 1;
    padding: 0.9rem 1.25rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.match-card__teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem 1.25rem;
    align-items: center;
}

.match-card__team {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.3;
}

.match-card__team--away { text-align: right; }

.match-card__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-width: 88px;
    padding: 0.45rem 0.85rem;
    background: var(--primary-soft);
    border-radius: 10px;
    border: 1px solid transparent;
}

[data-theme="dark"] .match-card__center {
    border-color: rgba(129, 140, 248, 0.18);
}

.match-card__result {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--text);
    line-height: 1;
}

.match-card__sets {
    font-size: 0.68rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.35;
    max-width: 140px;
}

.match-card__vs {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
}

.match-card__status {
    font-size: 0.65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.match-card__meta {
    margin-top: 0.65rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.75rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.match-card__meta::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .match-card__team { font-size: 1rem; }
    .match-card__body { padding: 1rem 1.5rem; }
}

@media (max-width: 640px) {
    .match-card--schedule {
        flex-direction: column;
        max-width: none;
    }

    .match-card__time {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 0.65rem;
        padding: 0.65rem 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .match-card__teams {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.65rem;
    }

    .match-card__team--away { text-align: center; }

    .match-card__center { margin: 0 auto; }

    .match-card__meta { justify-content: center; }
}

/* ─── Stats ─── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), background var(--transition);
}

.stat-box strong {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}

.stat-box span {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
    margin-top: 0.2rem;
    display: block;
}

/* ─── Admin ─── */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    align-items: start;
}

@media (min-width: 1280px) {
    .admin-layout { grid-template-columns: 260px 1fr; gap: 2.5rem; }
}

.admin-nav-wrap {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    z-index: 90;
}

.admin-nav-toggle {
    display: none;
}

.sidebar-nav {
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 0.85rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-nav a {
    display: block;
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.15rem;
    transition: all var(--transition);
    white-space: nowrap;
}

.sidebar-nav a:hover,
.sidebar-nav a.current {
    background: var(--primary-soft);
    color: var(--primary);
}

.sidebar-divider {
    margin: 0.65rem 0;
    border: none;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .admin-nav-wrap {
        position: sticky;
        top: var(--header-h);
        z-index: 95;
    }

    .admin-nav-toggle {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.85rem 1rem;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: var(--surface);
        color: var(--text);
        font-family: inherit;
        font-size: 0.9375rem;
        font-weight: 600;
        cursor: pointer;
        box-shadow: var(--shadow-sm);
    }

    .admin-nav-toggle-chevron {
        transition: transform var(--transition);
        color: var(--muted);
    }

    .admin-nav-toggle.is-open .admin-nav-toggle-chevron {
        transform: rotate(180deg);
    }

    .sidebar-nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: calc(100% + 0.4rem);
        max-height: min(70vh, 420px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem;
        border-radius: var(--radius);
        border: 1px solid var(--border);
        background: var(--surface);
        box-shadow: var(--shadow-hover);
        margin: 0;
        width: 100%;
    }

    .sidebar-nav.is-open {
        display: block;
    }

    .sidebar-nav a {
        margin-bottom: 0.1rem;
        padding: 0.75rem 0.9rem;
        white-space: normal;
    }

    .sidebar-nav a.current {
        background: var(--primary-soft);
        color: var(--primary);
        font-weight: 700;
    }

    .admin-main {
        min-width: 0;
        padding-bottom: 2rem;
    }

    .admin-filter-grid--3,
    .admin-filter-grid--2,
    .admin-filter-grid--auto {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .admin-nav-toggle { display: none !important; }
    .sidebar-nav { display: block !important; }
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

/* ─── Footer ─── */
.footer {
    padding: 1.5rem;
    color: var(--muted);
    font-size: 0.8125rem;
    border-top: 1px solid var(--border);
    background: var(--footer-bg);
    transition: background var(--transition);
}

.footer-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    text-align: center;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
}

/* ─── Misc ─── */
.meta-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }

.format-note {
    margin: 1.25rem 0 1.5rem;
    padding: 1rem 1.15rem;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--muted);
    line-height: 1.55;
    border-left: 3px solid var(--primary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
}

.player-card {
    display: flex;
    gap: 0.875rem;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.profile-header-card {
    display: flex;
    gap: 1.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.invite-details {
    position: relative;
    display: inline-block;
}

.invite-details > summary {
    list-style: none;
    cursor: pointer;
}

.invite-details > summary::-webkit-details-marker {
    display: none;
}

.invite-details-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    padding: 0.35rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-md, 0 10px 24px rgba(0, 0, 0, 0.12));
}

.invite-details-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.invite-details-item:hover {
    background: var(--bg-muted, rgba(127, 127, 127, 0.12));
}

.invite-details-item.is-disabled {
    opacity: 0.65;
    cursor: default;
}

.info-list p {
    padding: 0.45rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
}

.info-list p:last-child { border-bottom: none; }
.info-list strong { color: var(--text); font-weight: 600; }

.tournament-layout {
    display: grid;
    gap: 2rem;
}

@media (min-width: 1280px) {
    .tournament-layout {
        grid-template-columns: 1fr;
    }
}

.auth-page {
    min-height: calc(100vh - var(--header-h) - 120px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 480px;
}

.admin-dash-card {
    text-decoration: none;
    color: inherit;
    text-align: center;
    display: block;
}

.admin-dash-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.admin-dash-count {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--primary);
    margin: 0.35rem 0 0.5rem;
}

/* ─── VK-style posts feed ─── */
.posts-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 550px;
    margin: 0 auto 2rem;
}

.vk-post {
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.vk-post-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px 8px;
}

.vk-post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}

.vk-post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vk-post-meta {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.vk-post-author {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
}

.vk-post-author a {
    color: var(--text);
    text-decoration: none;
}

.vk-post-author a:hover {
    text-decoration: underline;
}

.vk-post-sub {
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.35;
    color: var(--muted);
}

.vk-post-sub a {
    color: var(--muted);
    text-decoration: none;
}

.vk-post-sub a:hover {
    color: var(--primary);
}

.vk-post-badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 5px 8px;
    border-radius: 6px;
    background: var(--primary-soft, rgba(124, 140, 252, 0.15));
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.vk-post-content {
    padding: 10px 12px 12px;
}

.vk-post-content--title {
    padding-bottom: 8px;
}

.vk-post-photo + .vk-post-content {
    padding-top: 10px;
}

.vk-post-lead {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
}

.vk-post-lead-link {
    color: var(--text);
    text-decoration: none;
}

.vk-post-lead-link:hover {
    color: var(--primary);
}

.vk-post-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    word-break: break-word;
}

.vk-post-text--collapsed {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

.vk-post-expand-btn {
    display: inline-block;
    margin-top: 2px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    color: var(--muted);
    cursor: pointer;
    text-align: left;
}

.vk-post-expand-btn:hover {
    color: var(--primary);
    text-decoration: none;
}

.vk-post-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 400px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.12);
}

.vk-post-photo img {
    width: auto;
    max-width: 100%;
    max-height: 400px;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
}

.posts-feed--single .vk-post-photo,
.posts-feed--single .vk-post-photo img {
    max-height: 480px;
}

.vk-post-linkbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border-top: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease;
}

.vk-post-linkbar:hover {
    background: rgba(255, 255, 255, 0.05);
}

.vk-post-linkbar-arrow {
    font-size: 18px;
    line-height: 1;
    color: var(--muted);
}

.posts-feed--single {
    margin-top: 0;
}

.posts-back-link {
    max-width: 550px;
    margin: 1rem auto 0;
    font-size: 14px;
}

.posts-back-link a {
    color: var(--primary);
    text-decoration: none;
}

.posts-back-link a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .vk-post {
        border-radius: 10px;
    }

    .vk-post-header,
    .vk-post-content {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* VK Video player (матчи / посты) */
.video-watch-page {
    padding-top: 0.5rem;
    padding-bottom: 2rem;
}

.video-watch {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.video-watch-head {
    margin-bottom: 1rem;
    text-align: center;
}

.video-watch-crumb {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted, var(--text-secondary));
    line-height: 1.4;
}

.video-watch-crumb a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.video-watch-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 0.35rem 0.55rem;
    margin: 0;
    font-size: clamp(1.25rem, 2.6vw, 1.75rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.video-watch-team {
    min-width: 0;
}

.video-watch-score {
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    font-weight: 800;
    padding: 0 0.15rem;
}

.video-watch-vs {
    color: var(--text-muted, var(--text-secondary));
    font-weight: 600;
}

.video-watch-sets {
    margin: 0.45rem 0 0;
    font-size: 0.95rem;
    color: var(--text-muted, var(--text-secondary));
    font-variant-numeric: tabular-nums;
}

.video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 240px;
    background: #0a0a0a;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.video-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-player--in-post {
    border-radius: 10px;
    margin-top: 0.25rem;
    min-height: 180px;
}

.video-watch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
    justify-content: center;
}

.video-watch-actions .btn {
    min-height: 44px;
    padding-inline: 1.1rem;
}

@media (max-width: 720px) {
    .video-watch-page.container-wide {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
        max-width: none;
    }

    .video-watch {
        max-width: none;
    }

    .video-watch-head {
        padding: 0 1rem;
        text-align: left;
    }

    .video-watch-title {
        justify-content: flex-start;
        font-size: 1.2rem;
    }

    .video-watch-sets {
        font-size: 0.875rem;
    }

    .video-player {
        border-radius: 0;
        border-left: none;
        border-right: none;
        min-height: min(56vw, 280px);
    }

    .video-watch-actions {
        padding: 0 1rem;
        justify-content: stretch;
    }

    .video-watch-actions .btn {
        flex: 1 1 calc(50% - 0.35rem);
        text-align: center;
        justify-content: center;
    }
}
