/* 
   GK CyberSport - Liquid Glass Design System v2
   Полный дизайн с анимированным фоном
*/

:root {
    --bg: #0a0e1a;
    --bg-secondary: #0e1325;
    --card: #151c34;
    --card-glass: rgba(21, 28, 52, 0.85);
    --cardBorder: #243058;
    --glass-border: rgba(106, 168, 255, 0.15);
    --txt: #e7ecff;
    --muted: #9ba7c7;
    --accent: #6aa8ff;
    --accent-glow: rgba(106, 168, 255, 0.4);
    --win: #5cf29a;
    --win-glow: rgba(92, 242, 154, 0.4);
    --sc2-color: #8a2be2;
    --vl-color: #ff4655;
    --line: #6aa8ff;
    --line-glow: rgba(106, 168, 255, 0.5);
    --gold: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.4);
}

/* ===== АНИМИРОВАННЫЙ ФОН ===== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--txt);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Основной градиентный фон */
body {
    background: linear-gradient(180deg, 
        #0a0e1a 0%, 
        #0e1325 25%, 
        #111827 50%, 
        #0e1325 75%, 
        #0a0e1a 100%
    );
    background-attachment: fixed;
    position: relative;
}

/* Анимированные орбы по бокам */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0; /* Changed from -1 to 0 to ensure visibility above background */
    filter: blur(120px);
    opacity: 0.4;
}

body::before {
    top: calc(-200px + var(--scroll-y, 0) * 0.2px);
    left: -300px;
    background: radial-gradient(circle, rgba(106, 168, 255, 0.3) 0%, transparent 70%);
    animation: floatOrb1 20s ease-in-out infinite;
}

body::after {
    bottom: calc(-200px + var(--scroll-y, 0) * 0.15px);
    right: -300px;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.25) 0%, transparent 70%);
    animation: floatOrb2 25s ease-in-out infinite;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
    25% { transform: translate(50px, 100px) scale(1.1); opacity: 0.5; }
    50% { transform: translate(100px, 50px) scale(0.9); opacity: 0.35; }
    75% { transform: translate(30px, 150px) scale(1.05); opacity: 0.45; }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.35; }
    33% { transform: translate(-80px, -60px) scale(1.15); opacity: 0.45; }
    66% { transform: translate(-40px, -120px) scale(0.95); opacity: 0.3; }
}

/* Дополнительные декоративные элементы - появляются при скролле */
.bg-decoration {
    position: fixed;
    pointer-events: none;
    z-index: 0; /* Changed from -1 to 0 */
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0;
    transition: opacity 0.8s ease;
}

.bg-decoration.visible { opacity: 1; }

.bg-decoration-1 {
    width: 400px;
    height: 400px;
    top: 30%;
    right: -150px;
    background: radial-gradient(circle, rgba(255, 70, 85, 0.15) 0%, transparent 70%);
    transform: translateY(calc(var(--scroll-y, 0) * -0.15px));
    transition: opacity 0.8s ease, transform 0.1s linear;
}

.bg-decoration-2 {
    width: 350px;
    height: 350px;
    top: 60%;
    left: -120px;
    background: radial-gradient(circle, rgba(92, 242, 154, 0.12) 0%, transparent 70%);
    transform: translateY(calc(var(--scroll-y, 0) * -0.1px));
    transition: opacity 0.8s ease, transform 0.1s linear;
}

.container {
    width: 100%;
    box-sizing: border-box;
    margin: 28px auto;
    padding: 18px;
    position: relative;
    z-index: 1;
}

header { text-align: center; margin-bottom: 20px; }

h1.site-title { 
    font-size: 44px; 
    margin: 0; 
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent) 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleShimmer 8s ease-in-out infinite;
    background-size: 200% 200%;
}

@keyframes titleShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.site-subtitle { 
    color: var(--muted); 
    text-align: center; 
    margin-bottom: 40px; 
    font-size: 1.15em; 
    max-width: 600px; 
    margin-left: auto; 
    margin-right: auto;
    letter-spacing: 0.3px;
}

/* ЗАГОЛОВКИ РАЗДЕЛОВ */
.section-title {
    font-size: 24px;
    color: var(--txt);
    margin-bottom: 24px;
    text-align: center;
    position: relative;
    padding-bottom: 14px;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: 2px;
}

/* ===== ЭФФЕКТ СТЕКЛА ===== */
.glass-card {
    background: linear-gradient(135deg, var(--card-glass) 0%, rgba(26, 35, 64, 0.85) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ===== НАВИГАЦИЯ ===== */
.main-nav-container {
    display: flex;
    justify-content: center;
    margin: 0 auto 40px auto;
    max-width: 600px;
}

.main-nav-glass {
    display: flex;
    background: linear-gradient(135deg, var(--card-glass) 0%, rgba(26, 35, 64, 0.9) 100%);
    border-radius: 20px;
    padding: 10px;
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    text-decoration: none;
    color: var(--txt);
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    position: relative;
    border: 1px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.nav-item:hover {
    background: rgba(106, 168, 255, 0.12);
    border: 1px solid rgba(106, 168, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(106, 168, 255, 0.2);
}

.nav-item-active {
    background: linear-gradient(135deg, rgba(106, 168, 255, 0.2) 0%, rgba(106, 168, 255, 0.1) 100%);
    border: 1px solid rgba(106, 168, 255, 0.35);
    color: #e7ecff;
    box-shadow: 
        0 4px 20px rgba(106, 168, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-icon { font-size: 18px; margin-right: 10px; }
.nav-text { font-size: 14px; letter-spacing: 0.4px; }

.nav-glow {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 14px;
    background: radial-gradient(circle at center, rgba(106, 168, 255, 0.25) 0%, transparent 70%);
    opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
.nav-item-active .nav-glow { opacity: 1; animation: navPulse 2.5s ease-in-out infinite; }
@keyframes navPulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.5; } }

/* ===== ВКЛАДКИ ЭТАПОВ ===== */
.stages-nav-container {
    display: flex;
    justify-content: center;
    margin: 40px 0 30px 0;
}

.stages-nav-glass {
    display: flex;
    background: linear-gradient(135deg, var(--card-glass) 0%, rgba(26, 35, 64, 0.9) 100%);
    border-radius: 18px;
    padding: 10px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(15px);
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90%;
}

.stage-tab {
    margin: 0;
    flex: 0 1 auto;
    min-width: 130px;
}

.stage-tab-content {
    display: none;
    padding: 0;
    animation: fadeIn 0.4s ease;
}

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

/* ===== КАРТОЧКИ ===== */
.links {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
    min-height: 200px;
}

.card {
    background: linear-gradient(135deg, var(--card-glass) 0%, rgba(26, 35, 64, 0.9) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 22px 26px;
    width: 300px;
    text-align: center;
    color: inherit;
    text-decoration: none;
    display: block;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(15px);
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(106, 168, 255, 0.3),
        0 0 30px rgba(106, 168, 255, 0.1);
    border-color: rgba(106, 168, 255, 0.4);
}

.card::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.7s ease;
}
.card:hover::before { left: 100%; }

.card h2 { margin: 0 0 8px 0; font-size: 18px; color: #cfe3ff; font-weight: 700; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Приветственная карточка */
.welcome-card {
    background: linear-gradient(135deg, var(--card-glass) 0%, rgba(26, 35, 64, 0.9) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-bottom: 36px;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: conic-gradient(from 0deg, transparent, rgba(106, 168, 255, 0.03), transparent, rgba(138, 43, 226, 0.02), transparent);
    animation: rotateBg 30s linear infinite;
}

@keyframes rotateBg {
    to { transform: rotate(360deg); }
}

.welcome-card h2 { 
    color: var(--txt); 
    margin-bottom: 16px; 
    font-size: 28px; 
    position: relative; 
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.welcome-card p { 
    color: var(--muted); 
    font-size: 16px; 
    max-width: 650px; 
    margin: 0 auto; 
    position: relative; 
    z-index: 1; 
    line-height: 1.7; 
}

/* Информационные карточки */
.info-section { margin: 48px 0; }

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.info-card {
    background: linear-gradient(135deg, var(--card-glass) 0%, rgba(26, 35, 64, 0.85) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.35s ease;
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #c084fc);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    border-color: rgba(106, 168, 255, 0.35);
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(106, 168, 255, 0.08);
}

.info-card:hover::before { opacity: 1; }

.info-card h3 { 
    color: var(--txt); 
    margin: 0 0 16px 0; 
    font-size: 20px; 
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.info-card p { color: var(--muted); margin: 0 0 16px 0; font-size: 14px; line-height: 1.7; }

/* ССЫЛКИ С ПОДЧЁРКИВАНИЕМ СНИЗУ */
.info-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    position: relative;
    padding-bottom: 4px;
}

.info-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), #8fb7ff);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.info-link:hover { color: #8fb7ff; transform: translateX(4px); }
.info-link:hover::after { width: 100%; }

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.stat-item {
    background: linear-gradient(135deg, var(--card-glass) 0%, rgba(26, 35, 64, 0.85) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #c084fc);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(106, 168, 255, 0.15);
}

.stat-item:hover::before { transform: scaleX(1); }

.stat-number {
    font-size: 2.4em;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #8fb7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.stat-label { color: var(--muted); font-size: 0.9em; font-weight: 500; }

/* Актуальные турниры */
.actual-tournaments {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.actual-card {
    width: 380px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--card-glass) 0%, rgba(26, 35, 64, 0.9) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 22px;
    text-decoration: none;
    color: inherit;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.25);
}

.actual-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(106, 168, 255, 0.3);
    border-color: rgba(106, 168, 255, 0.4);
}

/* Изображения */
.tournament-image {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.tournament-image-small {
    width: 100%;
    height: 120px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.card:hover .tournament-image, .actual-card:hover .tournament-image { 
    filter: brightness(0.85); 
    transform: scale(1.02);
}

/* Бейджи */
.game-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 10;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    letter-spacing: 0.5px;
}
.game-sc2 { background: linear-gradient(135deg, var(--sc2-color), #6a0dad); color: white; }
.game-vl { background: linear-gradient(135deg, var(--vl-color), #cc3700); color: white; }

.status-badge { 
    display: inline-block; 
    padding: 3px 10px; 
    border-radius: 12px; 
    font-size: 12px; 
    font-weight: 600; 
    margin-left: 8px;
    backdrop-filter: blur(8px);
}
.status-announced { background: rgba(106, 168, 255, 0.2); color: #6aa8ff; }
.status-ongoing { background: rgba(92, 242, 154, 0.2); color: #5cf29a; }
.status-finished { background: rgba(155, 167, 199, 0.2); color: #9ba7c7; }
.status-cancelled { background: rgba(255, 106, 106, 0.2); color: #ff6a6a; }

/* ===== ФИЛЬТРЫ ===== */
.filters-section-compact {
    background: linear-gradient(135deg, var(--card-glass) 0%, rgba(26, 35, 64, 0.85) 100%);
    border-radius: 18px;
    padding: 24px;
    margin: 24px auto 36px auto;
    border: 1px solid var(--glass-border);
    max-width: 620px;
    backdrop-filter: blur(20px);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.25);
}
.filter-group-compact { margin-bottom: 16px; }
.filter-group-compact:last-child { margin-bottom: 0; }
.filter-subtitle-compact { 
    color: #8fb7ff; 
    font-size: 12px; 
    font-weight: 700; 
    margin-bottom: 10px; 
    text-align: center; 
    text-transform: uppercase; 
    letter-spacing: 1px;
}
.filters-compact { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }

.filter-btn {
    display: flex; 
    align-items: center; 
    padding: 10px 18px;
    background: rgba(21, 28, 52, 0.7);
    border: 1px solid rgba(106, 168, 255, 0.15);
    border-radius: 12px; 
    color: var(--txt);
    font-size: 13px; 
    font-weight: 500; 
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    font-family: inherit;
    backdrop-filter: blur(10px);
}
.filter-btn:hover { 
    background: rgba(106, 168, 255, 0.12); 
    border-color: rgba(106, 168, 255, 0.35); 
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(106, 168, 255, 0.15);
}
.filter-active {
    background: linear-gradient(135deg, rgba(92, 242, 154, 0.18) 0%, rgba(92, 242, 154, 0.08) 100%);
    border: 1px solid rgba(92, 242, 154, 0.4); 
    color: #5cf29a;
    box-shadow: 0 0 16px rgba(92, 242, 154, 0.15);
}
.filter-icon { margin-right: 8px; font-size: 13px; }

/* ===== СЕТКА (BRACKET) ===== */
.bracket-page {
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.bracket-container {
    position: relative;
    background: linear-gradient(135deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    padding: 24px;
    overflow: auto;
    margin: 20px auto;
    box-sizing: border-box;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.35),
        0 8px 30px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Полноэкранный режим */
.bracket-container:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 24px !important;
    background: var(--bg) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: auto !important;
    transform: none !important;
}

.bracket-container:-webkit-full-screen,
.bracket-container:-moz-full-screen { 
    width: 100vw !important; height: 100vh !important; margin: 0 !important; 
    background: var(--bg) !important; overflow: auto !important; 
}

/* Кнопки управления */
.btn-back, .btn-fullscreen {
    position: fixed; 
    z-index: 10000;
    background: linear-gradient(135deg, var(--card-glass), rgba(26, 35, 64, 0.95));
    border: 1px solid var(--glass-border);
    color: var(--txt); 
    padding: 14px 20px; 
    border-radius: 12px;
    cursor: pointer; 
    font-weight: 600; 
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.btn-back { left: 20px; top: 20px; display: flex; align-items: center; }
.btn-fullscreen { 
    right: 20px; top: 20px; 
    width: 50px; height: 50px; 
    display: flex; align-items: center; justify-content: center; 
    font-size: 20px; 
    padding: 0;
}
.btn-back:hover, .btn-fullscreen:hover { 
    background: linear-gradient(135deg, rgba(106, 168, 255, 0.2), rgba(106, 168, 255, 0.1));
    border-color: rgba(106, 168, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(106, 168, 255, 0.2);
}

/* КАРТОЧКИ МАТЧЕЙ */
.bracket-container .match {
    position: absolute;
    display: flex; 
    flex-direction: column; 
    justify-content: center;
    border-radius: 14px; 
    padding: 0; 
    font-size: 16px; 
    line-height: 1.2;
    z-index: 3; 
    box-sizing: border-box;
    background: linear-gradient(135deg, rgba(21, 28, 52, 0.95) 0%, rgba(26, 35, 64, 0.95) 100%);
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.2),
        0 2px 10px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    backdrop-filter: blur(10px);
}

.bracket-container .match:hover { 
    transform: translateY(-5px) scale(1.02); 
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.3),
        0 8px 24px rgba(106, 168, 255, 0.15),
        0 0 0 1px rgba(106, 168, 255, 0.35);
    z-index: 10; 
}

.bracket-container .match-content { 
    position: relative; 
    width: 100%; 
    height: 100%; 
    border-radius: 14px; 
    overflow: hidden; 
    z-index: 1; 
}

/* Разделительная линия */
.bracket-container .match::after {
    content: "";
    position: absolute;
    left: 14px; right: 14px;
    top: 50%;
    border-top: 1px dashed rgba(106, 168, 255, 0.25);
    transform: translateY(-0.5px);
    z-index: 2;
}

.bracket-container .match.-has-winner::after {
    border-top: 2px solid rgba(92, 242, 154, 0.85);
    box-shadow: 0 0 14px rgba(92, 242, 154, 0.4);
    animation: pulse-glow 2.5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 12px rgba(92, 242, 154, 0.35); }
    50% { box-shadow: 0 0 20px rgba(92, 242, 154, 0.55); }
}

/* Строки */
.bracket-container .row {
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    padding: 12px 16px; 
    height: 50%; 
    box-sizing: border-box;
    position: relative; 
    overflow: hidden;
    transition: all 0.2s ease;
}
.bracket-container .row:first-child { border-radius: 14px 14px 0 0; }
.bracket-container .row:last-child { border-radius: 0 0 14px 14px; }

.bracket-container .row.-winner {
    background: linear-gradient(135deg, rgba(92, 242, 154, 0.22) 0%, rgba(92, 242, 154, 0.12) 100%);
    z-index: 1;
}

/* Ники - ИСПРАВЛЕНО: убрали отрицательные margin */
.bracket-container .nick {
    flex: 1; 
    max-width: 150px; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap;
    font-weight: 600; 
    color: var(--txt); 
    margin-right: 12px; 
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    outline: none;
    padding: 2px 4px;
    border-radius: 4px;
}

.bracket-container .nick:hover {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
    background: rgba(106, 168, 255, 0.1);
}

/* Подсветка ника - ИСПРАВЛЕНО: без залезания на счёт */
.bracket-container .nick.player-highlight {
    color: var(--accent) !important;
    text-shadow: 0 0 10px var(--accent-glow);
    background: rgba(106, 168, 255, 0.15) !important;
}

/* Счёт */
.bracket-container .score {
    flex-shrink: 0; 
    min-width: 32px; 
    font-weight: 700; 
    color: var(--accent);
    background: rgba(106, 168, 255, 0.12);
    padding: 4px 8px; 
    border-radius: 8px; 
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Заголовки раундов */
.bracket-container .round-head,
.bracket-container .round-head-semifinal,
.bracket-container .round-head-final {
    position: absolute; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    padding: 14px 0; 
    border-radius: 14px; 
    font-weight: 800; 
    z-index: 2; 
    text-align: center;
    background: linear-gradient(135deg, rgba(106, 168, 255, 0.15), rgba(106, 168, 255, 0.05));
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

.bracket-container .round-head-semifinal {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.15), rgba(147, 51, 234, 0.05));
}

.bracket-container .round-head-final { 
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.1));
    box-shadow: 
        0 4px 28px rgba(255, 165, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.bracket-container .round-icon { font-size: 22px; margin-bottom: 5px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3)); }
.bracket-container .round-text { font-size: 15px; color: #e7ecff; letter-spacing: 0.5px; margin-bottom: 3px; }
.bracket-container .round-format { font-size: 14px; color: #8fb7ff; font-weight: 600; }
.bracket-container .round-head-final .round-text { color: var(--gold); }
.bracket-container .round-head-final .round-format { color: #FFA500; }
.bracket-container .round-head-semifinal .round-text { color: #d8b4fe; }
.bracket-container .round-head-semifinal .round-format { color: #c084fc; }

/* Метаданные */
.bracket-container .match-badge-container {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none; z-index: 20; overflow: visible;
}

.bracket-container .meta {
    position: absolute; top: 6px; right: 6px;
    padding: 5px 10px; font-size: 10px; color: var(--muted);
    background: rgba(21, 28, 52, 0.95);
    border: 1px solid var(--cardBorder);
    border-radius: 8px;
    opacity: 0; transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
}

.bracket-container .match:hover .meta {
    opacity: 1; transform: translateY(-30px);
}

/* Линии */
.connector-line { position: absolute; pointer-events: none; z-index: 1; }
.line-path { 
    stroke: var(--line); 
    stroke-width: 3; 
    fill: none; 
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 5px var(--line-glow));
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: lineDraw 1.5s ease-in-out forwards;
}

@keyframes lineDraw { 
    from { stroke-dashoffset: 1000; opacity: 0; } 
    to { stroke-dashoffset: 0; opacity: 1; } 
}

/* Стили для встроенных сеток */
.stage-tab-content .bracket-container {
    background: linear-gradient(135deg, rgba(255,255,255,.03), rgba(255,255,255,.01)) !important;
    border: 1px solid rgba(255,255,255,.08) !important;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.3) !important;
}

/* ===== ГРУППОВОЙ ЭТАП ===== */
.groups-tabs-container {
    background: linear-gradient(135deg, var(--card-glass), rgba(26, 35, 64, 0.9));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    margin: 20px 0;
    backdrop-filter: blur(15px);
}

.groups-tabs {
    display: flex;
    background: linear-gradient(135deg, rgba(21, 28, 52, 0.95), rgba(26, 35, 64, 0.95));
    border-bottom: 1px solid var(--cardBorder);
    overflow-x: auto;
    padding: 0 12px;
}

.group-tab {
    background: rgba(255,255,255,0.04);
    border: none;
    padding: 18px 30px;
    color: var(--muted);
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    border-radius: 12px 12px 0 0;
    margin: 10px 4px 0 4px;
    position: relative;
    border: 1px solid transparent;
    border-bottom: none;
    font-family: inherit;
}

.group-tab:hover {
    background: rgba(106, 168, 255, 0.12);
    color: var(--txt);
    transform: translateY(-3px);
}

.group-tab.active {
    background: linear-gradient(135deg, rgba(106, 168, 255, 0.18), rgba(106, 168, 255, 0.08));
    color: var(--accent);
    border-color: rgba(106, 168, 255, 0.35);
    border-bottom: 1px solid var(--card);
    margin-bottom: -1px;
    z-index: 2;
}

.group-tab.active::after {
    content: ""; 
    position: absolute; 
    bottom: -1px; 
    left: 0; 
    right: 0; 
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #8fb7ff);
    border-radius: 2px 2px 0 0;
}

.group-tab-content { display: none; }
.group-tab-content.active { display: block; animation: fadeIn 0.4s ease; }

.group-section { 
    padding: 32px; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
    background: var(--card); 
}
.group-section:last-child { border-bottom: none; }
.group-section-title { 
    color: var(--accent); 
    margin-bottom: 22px; 
    font-size: 20px; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

/* Таблицы */
.table-container { 
    width: 100%; 
    overflow-x: auto; 
    border-radius: 12px; 
    border: 1px solid var(--cardBorder);
    background: rgba(21, 28, 52, 0.5);
}

.teams-table, .matches-table { 
    width: 100%; 
    border-collapse: collapse; 
    background: transparent; 
    min-width: 600px; 
}

.teams-table th, .matches-table th {
    background: rgba(21, 28, 52, 0.95); 
    padding: 18px 22px; 
    text-align: left;
    font-weight: 700; 
    color: var(--accent); 
    border-bottom: 1px solid var(--cardBorder);
    font-size: 13px; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.teams-table td, .matches-table td {
    padding: 16px 22px; 
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--txt); 
    font-size: 14px; 
    background: rgba(21, 28, 52, 0.3);
    transition: background 0.2s ease;
}

.teams-table tr:last-child td { border-bottom: none; }
.teams-table tr:hover td { background: rgba(106, 168, 255, 0.06); }

/* Квалифицированные команды */
.teams-table tr.qualified td {
    background: rgba(92, 242, 154, 0.06);
}
.teams-table tr.qualified td:first-child {
    color: #5cf29a !important; 
    font-weight: 800; 
    border-left: 4px solid #5cf29a;
}
.teams-table tr.qualified:hover td { background: rgba(92, 242, 154, 0.1); }

/* Победитель матча в таблице */
.matches-table .match-winner {
    color: #5cf29a !important; 
    font-weight: 700 !important;
}

/* СЧЁТ В ГРУППОВЫХ МАТЧАХ - ИСПРАВЛЕНО */
.match-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700; 
    color: var(--accent);
    background: linear-gradient(135deg, rgba(106, 168, 255, 0.15), rgba(106, 168, 255, 0.08));
    border: 1px solid rgba(106, 168, 255, 0.25);
    padding: 8px 14px; 
    border-radius: 10px;
    min-width: 36px; 
    text-align: center;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.match-score-winner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, rgba(92, 242, 154, 0.6), rgba(76, 175, 80, 0.5));
    border: 1px solid rgba(92, 242, 154, 0.5);
    padding: 8px 14px; 
    border-radius: 10px;
    min-width: 36px;
    text-align: center;
    box-shadow: 
        0 2px 12px rgba(92, 242, 154, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ===== СОЦИАЛЬНЫЕ СЕТИ ===== */
.social-section { margin: 70px 0 50px 0; text-align: center; }

.social-links { 
    display: flex; 
    justify-content: center; 
    gap: 22px; 
    flex-wrap: wrap; 
    margin-top: 32px; 
}

.social-link {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 14px; 
    padding: 28px 22px;
    background: linear-gradient(135deg, var(--card-glass), rgba(26, 35, 64, 0.9));
    border: 1px solid var(--glass-border); 
    border-radius: 16px;
    text-decoration: none; 
    color: var(--txt); 
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1); 
    width: 145px;
    position: relative; 
    overflow: hidden;
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.social-link:hover { 
    transform: translateY(-6px); 
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(106, 168, 255, 0.3);
    border-color: rgba(106, 168, 255, 0.4); 
}

/* Анимированное подчёркивание СНИЗУ */
.social-link::after {
    content: ''; 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #c084fc);
    transform: scaleX(0); 
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 0 16px 16px;
}
.social-link:hover::after { transform: scaleX(1); }

.social-icon { 
    width: 52px; 
    height: 52px; 
    background-size: contain; 
    background-repeat: no-repeat; 
    background-position: center; 
    filter: brightness(0.9); 
    transition: all 0.3s ease; 
}
.social-link:hover .social-icon { 
    filter: brightness(1.1) drop-shadow(0 0 8px rgba(106, 168, 255, 0.4)); 
    transform: scale(1.1); 
}
.social-text { font-weight: 600; font-size: 13px; letter-spacing: 0.3px; }

/* SVG Иконки */
.social-icon.discord { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127.14 96.36'%3E%3Cpath fill='%235865F2' d='M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z'/%3E%3C/svg%3E"); }
.social-icon.telegram { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2326A5E4' d='M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm5.562 8.158l-1.99 9.359c-.145.658-.537.818-1.084.509l-3-2.21-1.447 1.394c-.159.159-.295.295-.605.295l.213-3.053 5.56-5.022c.241-.213-.054-.334-.373-.118l-6.869 4.326-2.96-.924c-.643-.203-.658-.643.136-.95l11.566-4.458c.536-.196 1.006.128.832.941z'/%3E%3C/svg%3E"); }
.social-icon.twitch { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%239146FF' d='M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714z'/%3E%3C/svg%3E"); }

/* Анимации */
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(18px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.loading-indicator, .error-message { 
    text-align: center; 
    padding: 48px; 
    background: linear-gradient(135deg, var(--card-glass), rgba(26, 35, 64, 0.9)); 
    border-radius: 16px; 
    margin: 24px 0; 
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(15px);
}

/* Адаптивность */
@media (max-width: 768px) {
    .container { padding: 0 12px; }
    .actual-card { width: 100%; max-width: 360px; }
    .nav-item { padding: 12px 18px; font-size: 13px; }
    .groups-tabs { flex-direction: column; padding: 8px; }
    .group-tab { 
        border-radius: 10px; 
        margin: 4px 0; 
        width: 100%; 
        box-sizing: border-box; 
    }
    .group-tab.active { border-bottom: 1px solid var(--accent); }
    .group-tab.active::after { display: none; }
    .stages-nav-glass { flex-direction: column; align-items: center; max-width: 280px; }
    .stage-tab { width: 200px; }
    .social-link { width: 120px; padding: 20px 16px; }
    
    body::before, body::after {
        width: 300px;
        height: 300px;
        filter: blur(80px);
    }
}

:root {
    --gk-strip-height: calc(48px + env(safe-area-inset-top, 0px));
    --gk-gutter: clamp(12px, 1.5vw, 30px);
}
html, body { scroll-padding-top: calc(var(--gk-strip-height) + 12px); }
.community-space { height: var(--gk-strip-height); }
.community-strip {
    position: fixed;
    z-index: 100100;
    inset: 0 0 auto;
    box-sizing: border-box;
    margin: 0;
    width: 100%;
    max-width: none;
    height: var(--gk-strip-height);
    padding: env(safe-area-inset-top, 0px) var(--gk-gutter) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #fff4df;
    background: linear-gradient(110deg, #251d33, #39283d 65%, #302439);
    border: 0;
    border-bottom: 1px solid #806579;
    box-shadow: 0 3px 12px #0d081c55;
    font: 600 16px/1.2 "Segoe UI", sans-serif;
}
.community-message { display: flex; align-items: center; gap: 14px; min-width: 0; }
.community-message img { width: 39px; height: 29px; object-fit: contain; }
.community-message span { font: italic 500 clamp(16px,1.3vw,21px)/1.15 Georgia, serif; }
.community-strip a {
    flex: none; display: inline-flex; align-items: center; gap: 8px;
    color: #ffedbc; text-decoration: none; min-height: 40px; font-size: 14px;
}
.community-strip a:hover { text-decoration: underline; text-underline-offset: 4px; }
.community-strip a:focus-visible { outline: 2px solid #ffedbc; outline-offset: 2px; }
.container { padding-inline: var(--gk-gutter); }
.actual-tournaments, .links {
    display: grid; align-items: stretch;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
}
.actual-tournaments { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.links > .card, .actual-tournaments > .card {
    box-sizing: border-box; width: 100%; max-width: none; min-width: 0;
}
.actual-tournaments .tournament-image { height: clamp(155px, 18vw, 350px); box-sizing: border-box; }
.links .tournament-image-small { height: clamp(120px, 10vw, 215px); box-sizing: border-box; }
body > .bracket-container:not(:fullscreen), .stage-tab-content .bracket-container:not(:fullscreen) {
    width: 100%; max-width: 100%; box-sizing: border-box; overflow: auto;
}
.stage-tab-content, .group-tab-content, .olympic-system-container, .swiss-system-container { min-width: 0; overflow-x: auto; }
body .btn-back, body .btn-fullscreen { top: calc(var(--gk-strip-height) + 12px); }
#fullscreen-overlay {
    top: var(--gk-strip-height); height: calc(100% - var(--gk-strip-height));
}
#fullscreen-exit { top: calc(var(--gk-strip-height) + 12px); }
@media (max-width: 700px) {
    .community-message { gap: 8px; }
    .community-message img { width: 28px; height: 22px; }
    .community-strip a { font-size: 13px; gap: 4px; }
    .container { margin-block-start: 12px; }
    .container:has(.btn-back) > header, body:has(> div > #btn-back) .container > header { padding-top: 42px; }
    .actual-tournaments, .links { gap: 14px; }
    .info-cards { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 350px) {
    .community-message span { font-size: 14px; }
}

.double-elimination-fullwidth .bracket-section > :is(.winners-bracket-container, .losers-bracket-container, .finals-bracket-container) {
    box-sizing: border-box; width: 100%; max-width: 100%; overflow: auto;
}
@media (max-width: 700px) {
    .main-nav-glass { box-sizing: border-box; width: 100%; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 5px; }
    .main-nav-glass .nav-item { flex: 1 1 auto; padding: 10px 6px; }
    .container h1.site-title { font-size: clamp(28px,8vw,40px); overflow-wrap: anywhere; }
    .swiss-system-container { box-sizing: border-box; }
    #fullscreen-overlay .fullscreen-tabs-container { padding-inline-end: 42px; flex-wrap: wrap; }
}
