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

:root {
    --primary-dark: #0a0a0a;
    --secondary-dark: #111111;
    --accent-color: #00aa55;
    --accent-hover: #00cc66;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --card-bg: #1a1a1a;
    --card-hover: #222222;
    --border-color: #333333;
    --header-height: 70px;
    --error-color: #ff4757;
    --player-bg: #000000;
}

body {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary-dark);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    padding-top: calc(var(--header-height) + 50px);
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
}

.base-header {
    background-color: var(--secondary-dark);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    gap: 20px;
}


.logo-section {
    flex: 0 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    transition: opacity 0.3s ease;
}
.logo:hover { opacity: 0.9; }

.logo-icon {
    font-size: 32px;
    color: var(--accent-color);
}

.logo-text {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.logo-main {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
}

.logo-plus {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-color);
}


.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 25px;
    padding: 0;
    margin: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background-color: rgba(0, 170, 85, 0.8);
}

.nav-link i:first-child { font-size: 18px; }

.dropdown-arrow {
    font-size: 12px;
    margin-left: 5px;
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.nav-item.dropdown { position: relative; }

.nav-item.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 12px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(20, 20, 20, 0.98);
    min-width: 680px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    z-index: 1100;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translateX(-50%) translateY(-6px);
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(20, 20, 20, 0.98);
    border-left: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
}

.nav-item.dropdown:hover .dropdown-menu,
.nav-item.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.nav-item.dropdown:hover .dropdown-arrow,
.nav-item.dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--accent-color);
}

.dropdown-columns {
    display: flex;
    gap: 30px;
}

.dropdown-column {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
}

.dropdown-column a {
    display: block;
    color: var(--text-primary);
    padding: 8px 0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-column a:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    padding-left: 5px;
}


.header-controls {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-box:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(0, 170, 85, 0.15);
}

.search-input {
    background: transparent;
    border: none;
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    min-width: 250px;
    outline: none;
}
.search-input::placeholder { color: var(--text-secondary); }

.search-btn {
    background: transparent;
    border: none;
    padding: 12px 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 15px;
    transition: color 0.2s ease;
}
.search-btn:hover { color: var(--accent-color); }

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.back-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-color);
    background: rgba(0, 170, 85, 0.08);
}
.back-btn i { font-size: 13px; }

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
    order: -1;
}
.mobile-toggle:hover { background: rgba(255,255,255,0.08); }


.user-menu {
    display: flex;
    align-items: center;
}

.user-login-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s ease;
}
.user-login-btn:hover {
    color: var(--accent-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile:hover {
    opacity: 0.85;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 16px;
    flex-shrink: 0;
}

.user-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-logout {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
    flex-shrink: 0;
}
.user-logout:hover {
    background: rgba(255, 77, 87, 0.15);
    color: var(--error-color);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    width: 420px;
    max-width: calc(100vw - 32px);
    background: linear-gradient(160deg, #1c1c1c 0%, #141414 100%);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 20px;
    padding: 36px 32px 32px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);

    transform: translateY(-30px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    right: 16px;
    top: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
}
.modal-close:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

/* Заголовок модалки */
.modal-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
}
.modal-logo-icon { font-size: 26px; color: var(--accent-color); }
.modal-logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.modal-logo-text span { color: var(--accent-color); }

/* Tabs */
.auth-tabs {
    display: flex;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 28px;
    gap: 4px;
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    padding: 9px 12px;
    border-radius: 7px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    letter-spacing: 0.3px;
}

.auth-tab.active {
    background: var(--accent-color);
    color: var(--text-primary);
}

.auth-tab:not(.active):hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

/* Forms */
.auth-form {
    display: none;
    flex-direction: column;
    gap: 14px;
}
.auth-form.active { display: flex; }

.input-group {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 0 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 170, 85, 0.12);
}

.input-group i {
    color: var(--text-secondary);
    font-size: 15px;
    width: 18px;
    flex-shrink: 0;
}

.input-group input {
    background: transparent;
    border: none;
    padding: 14px 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    outline: none;
}
.input-group input::placeholder { color: rgba(255,255,255,0.25); }

.auth-submit {
    background: var(--accent-color);
    color: var(--text-primary);
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-top: 6px;
    letter-spacing: 0.3px;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}
.auth-submit:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(0, 170, 85, 0.3);
}
.auth-submit:active { transform: scale(0.98); }

.auth-error {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
    min-height: 18px;
}


main {
    margin-top: 50px;
    margin-bottom: 80px;
}

footer {
    background: var(--secondary-dark);
    padding: 25px 0;
    border-top: 1px solid var(--border-color);
}

.footer-simple {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}


::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--secondary-dark); }
::-webkit-scrollbar-thumb { background: var(--accent-color); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }


.nav-link,
.dropdown-column a,
.back-btn,
.search-btn,
.user-login-btn,
.user-logout,
.mobile-toggle {
    touch-action: manipulation;
}


@media (max-width: 1400px) {
    .container { padding: 0 30px; }
    .dropdown-menu { min-width: 580px; }
}

@media (max-width: 1200px) {
    .nav-link { padding: 10px 15px; font-size: 14px; }
    .search-input { min-width: 200px; }
    .dropdown-menu { min-width: 600px; }
    .dropdown-columns { gap: 20px; }
}

@media (max-width: 992px) {
    .container { padding: 0 20px; }

    .mobile-toggle { display: flex; align-items: center; justify-content: center; }

    .main-nav {
        display: none;
        position: fixed;
        top: calc(var(--header-height) + 30px);
        left: 0;
        right: 0;
        background: var(--secondary-dark);
        padding: 16px 20px 24px;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        z-index: 1001;
        justify-content: flex-start;
        overflow-y: auto;
        max-height: calc(100vh - var(--header-height) - 30px);
    }
    .main-nav.open { display: block; }

    .nav-menu { flex-direction: column; gap: 10px; }
    .nav-link { justify-content: flex-start; padding: 14px 16px; font-size: 15px; }
    .nav-item.dropdown::after { display: none; }

    .dropdown-menu {
        position: static;
        transform: none !important;
        min-width: 100%;
        max-height: none;
        border: none;
        border-top: 1px solid var(--border-color);
        border-radius: 0;
        margin: 0;
        padding: 12px 0 12px 16px;
        background: rgba(255,255,255,0.03);
        box-shadow: none;
        backdrop-filter: none;
        opacity: 1;
        visibility: visible;
        pointer-events: none;
        display: none;
    }
    .dropdown-menu::before { display: none; }

    .nav-item.dropdown.active .dropdown-menu { display: block; pointer-events: auto; }
    .nav-item.dropdown:hover .dropdown-menu { display: none; }
    .nav-item.dropdown.active:hover .dropdown-menu { display: block; }

    .dropdown-columns { flex-direction: column; gap: 0; }
    .dropdown-column { min-width: 100%; }
    .dropdown-column a { padding: 14px 0; font-size: 16px; border-radius: 0; border-bottom: 1px solid var(--border-color); }
    .dropdown-column a:hover { padding-left: 0; }

    .search-box {
        width: 42px;
        border-radius: 21px;
        transition: width 0.3s ease;
    }
    .search-box:focus-within { width: 210px; }

    .search-input {
        min-width: 0;
        width: 0;
        padding: 0;
        opacity: 0;
        transition: width 0.3s ease, opacity 0.2s ease, padding 0.2s ease;
    }
    .search-box:focus-within .search-input { width: calc(100% - 42px); padding: 0 12px; opacity: 1; }

    .search-btn { width: 42px; height: 42px; padding: 0; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; }
}

@media (max-width: 768px) {
    .header-content { height: 60px; gap: 12px; }
    .logo-main, .logo-plus { font-size: 22px; }
    .logo-icon { font-size: 22px; }
    .logo { gap: 10px; }
    main { margin-top: calc(60px + 25px); }
    .main-nav { top: calc(60px + 15px); }

    .user-name { max-width: 80px; }
}

@media (max-width: 576px) {
    .container { padding: 0 15px; }
    .logo-main, .logo-plus { font-size: 18px; }
    .logo-icon { font-size: 18px; }
    .user-name { display: none; }
}

@media (min-width: 993px) {
    .mobile-toggle { display: none !important; }
    .main-nav { display: flex !important; }
}

.profile-info {
    padding: 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.profile-info p {
    margin: 10px 0;
    font-size: 16px;
}

.profile-actions {
    padding: 20px;
    text-align: center;
}

.profile-logout-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.profile-logout-btn:hover {
    background-color: #c0392b;
}