:root {
    --bg: #050505;
    --primary: #ff3333;
    --primary-dim: rgba(255, 51, 51, 0.15);
    --text: #ffffff;
    --text-muted: #888;
    --border: rgba(255, 255, 255, 0.15);
    --font-mono: 'JetBrains Mono', monospace;
}

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

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

a {
    text-decoration: none;
    color: inherit;
}

.video-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: #000;
}

.video-bg__el {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

.video-bg__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.12), rgba(5, 5, 5, 0.62));
}

.header {
    position: fixed;
    top: 30px;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.header-inner {
    width: 100%;
    max-width: 1200px;
    height: 60px;
    background: rgba(5, 5, 5, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
}

.logo {
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.5px;
    white-space: nowrap;
    z-index: 102;
}

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

.controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 102;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    color: #666;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.lang-btn:hover {
    border-color: #555;
    color: #ddd;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.lang-active {
    color: #fff;
}

.user-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid var(--border);
    height: 30px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-name {
    font-weight: 700;
    text-transform: uppercase;
}

.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    padding: 120px 20px;
    min-height: 100vh;
}

.hero-content {
    max-width: 640px;
    width: 100%;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge {
    display: inline-block;
    border: 1px solid #5cff33;
    background: rgb(101 255 51 / 15%);
    color: #5cff33;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 20px;
}

.welcome-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.welcome-text span {
    color: #fff;
}

h1 {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 24px 0;
    text-transform: uppercase;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.description-box {
    text-align: left;
    background: rgba(0, 0, 0, 0.6);
    border-left: 3px solid var(--primary);
    padding: 24px;
    margin-bottom: 30px;
    backdrop-filter: blur(5px);
    width: 100%;
    border-radius: 0 8px 8px 0;
}

.description-box p {
    margin-bottom: 8px;
    color: #ccc;
    line-height: 1.5;
}

.prize-pool {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 16px;
    display: flex;
    align-items: center;
}

.highlight {
    color: var(--primary);
    font-weight: 800;
    font-size: 20px;
    margin-left: auto;
}

.auth-warning {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.auth-warning i {
    color: #f59e0b;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
}

.btn-discord {
    background: #5865F2;
    color: white;
    width: 100%;
}

.btn-discord:hover {
    background: #4752c4;
    box-shadow: 0 0 30px rgba(88, 101, 242, 0.3);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #d42020;
    box-shadow: 0 0 30px rgba(255, 51, 51, 0.3);
}

.btn-xl {
    flex-direction: column;
    width: 100%;
    border: 1px solid var(--primary);
    background: rgba(255, 51, 51, 0.08);
    gap: 6px;
    padding: 20px;
}

.btn-xl:hover {
    background: var(--primary);
}

.btn-info {
    background: rgba(0, 123, 255, 0.08);
    border: 1px solid #007bff;
    color: white;
    width: 100%;
}

.btn-info:hover {
    background: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.3);
}

.btn-sub {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.8;
    letter-spacing: 1px;
}

.sponsors-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    background: linear-gradient(to top, #000 20%, transparent);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 200;
    pointer-events: none;
}

.sponsors-label {
    font-size: 10px;
    color: #555;
    pointer-events: auto;
}

.sponsors-grid {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    pointer-events: auto;
}

.sponsors-grid a {
    opacity: 0.7;
    transition: 0.3s;
    filter: none;
    display: block;
    padding: 10px;
}

.sponsors-grid a:hover {
    opacity: 1;
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.sponsors-grid img {
    height: 36px;
    display: block;
    width: auto;
}

.sponsors-grid img.logo-lg {
    height: 46px;
}

.fade-in {
    animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-my-team {
    text-decoration: none;
    color: white;
    background: rgba(255, 0, 80, 0.8);
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    font-family: var(--font-mono);
}

.btn-my-team:hover {
    background: #ff0050;
    box-shadow: 0 0 15px rgba(255, 0, 80, 0.4);
    transform: translateY(-1px);
}

.error-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 10;
    padding: 20px;
}

.glitch-wrapper {
    margin-bottom: 20px;
}

.glitch {
    font-size: clamp(60px, 15vw, 120px);
    font-weight: 800;
    line-height: 1;
    position: relative;
    color: #fff;
    letter-spacing: -5px;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 #ff3333;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 #00ccff;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

.error-subtitle {
    font-size: 24px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.error-desc {
    color: #888;
    max-width: 400px;
    margin-bottom: 40px;
    font-size: 14px;
    line-height: 1.5;
}

.error-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(30px, 9999px, 10px, 0);
    }

    100% {
        clip: rect(60px, 9999px, 40px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(10px, 9999px, 80px, 0);
    }

    100% {
        clip: rect(50px, 9999px, 10px, 0);
    }
}


@media (max-width: 900px) {
    .header {
        top: 0;
        padding: 0;
    }

    .header-inner {
        border-radius: 0;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 0 20px;
    }

    .mobile-menu-btn {
        display: block;
        min-width: 44px;
        min-height: 44px;
    }

    .controls {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background: #0a0a0a;
        flex-direction: column;
        align-items: center;
        padding: 40px 20px;
        gap: 30px;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
        transform: translateY(-150%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 101;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .controls.active {
        transform: translateY(0);
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    .lang-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .user-wrap {
        border-left: none;
        padding-left: 0;
        flex-direction: column;
        height: auto;
        margin-top: 10px;
        flex-direction: row;
        gap: 15px;
    }

    .btn-my-team {
        margin-right: 0;
        width: auto;
        justify-content: center;
        white-space: nowrap;
        min-height: 44px;
    }

    .hero {
        padding-top: 100px;
        padding-bottom: 140px;
    }

    .video-bg__el {
        opacity: 0.22;
    }

    .sponsors-bar {
        background: linear-gradient(to top, #000 80%, transparent);
        padding-bottom: 40px;
        position: fixed;
        bottom: 0;
    }

    .description-box {
        text-align: center;
        border-left: none;
        border-top: 3px solid var(--primary);
        border-radius: 0 0 8px 8px;
        padding: 20px;
    }

    .btn {
        padding: 18px 32px;
        min-height: 54px;
        font-size: 15px;
    }

    h1 {
        font-size: clamp(28px, 8vw, 48px);
        margin-bottom: 20px;
    }

    .action-grid {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 14px;
    }

    .header-inner {
        padding: 0 15px;
    }

    .hero {
        padding-left: 15px;
        padding-right: 15px;
    }

    .sponsors-grid {
        gap: 15px;
    }

    .sponsors-grid img {
        height: 28px;
    }
    
    .sponsors-grid img.logo-lg {
        height: 36px;
    }

    h1 {
        font-size: clamp(24px, 8vw, 32px);
    }

    .badge {
        font-size: 10px;
        padding: 5px 10px;
    }

    .description-box {
        padding: 16px;
    }

    .prize-pool {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .highlight {
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


#toast-container {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

.toast {
    background: rgba(15, 15, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: translateX(100%);
    opacity: 0;
    border-left: 3px solid #555;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.05), transparent);
    pointer-events: none;
}

.toast.success {
    border-left-color: #5cff33;
}

.toast.success i {
    color: #5cff33;
}

.toast.error {
    border-left-color: #ff3333;
}

.toast.error i {
    color: #ff3333;
}

.toast.info {
    border-left-color: #33ccff;
}

.toast.info i {
    color: #33ccff;
}

.toast i {
    font-size: 18px;
}

@keyframes toastIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.hiding {
    animation: toastOut 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.stream-fab {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff0000, #cc0000);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.4);
    cursor: pointer;
    z-index: 1000;
    animation: streamPulse 2s infinite;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: #fff;
    font-size: 24px;
}

.stream-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(255, 0, 0, 0.6);
}

.stream-fab i {
    font-size: 28px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes streamPulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(255, 0, 0, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(255, 0, 0, 0.7), 0 0 40px rgba(255, 0, 0, 0.3);
    }
}

@media (max-width: 768px) {
    .stream-fab {
        bottom: 80px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .stream-fab i {
        font-size: 22px;
    }
}
