/**
 * Выпадающее меню хедера: админка, игры, подписи секций.
 * Подключается после header.css (home + pages с header.php).
 */

/* header.css: .admin-link — fixed corner; в меню нужен обычный блок */
.dropdown-menu .admin-link {
    position: static;
    bottom: auto;
    right: auto;
    opacity: 1;
    font-size: inherit;
    z-index: auto;
    margin-top: auto;
    padding: 12px 16px 0;
    max-width: 430px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 8px;
    width: 100%;
}

.menu-section-label {
    padding: 10px 16px 2px;
    max-width: 430px;
    width: 100%;
    margin: 0 auto;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}

.menu-section-label--site {
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .menu-section-label {
    color: #94a3b8;
}

[data-theme="light"] .menu-section-label--site {
    border-top-color: #e2e8f0;
}

.menu-games-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}

.menu-games-btn .games-arrow {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.45);
    transition: transform 0.25s ease;
}

.menu-games-dropdown {
    max-width: 430px;
    width: 100%;
    margin: 0 auto;
}

.menu-games-dropdown .games-submenu {
    position: static;
    transform: none;
    min-width: 0;
    margin-top: 8px;
    display: none;
    opacity: 1;
    visibility: visible;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 8px;
    box-shadow: none;
    backdrop-filter: none;
}

.menu-games-dropdown.open .games-submenu {
    display: flex;
    flex-direction: column;
}

.menu-games-dropdown.open .games-arrow {
    transform: rotate(180deg);
}

.game-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    border-radius: 12px;
    transition: background 0.2s ease;
    background: transparent;
}

.game-link:hover {
    background: rgba(255, 199, 44, 0.15);
}

.game-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    flex-shrink: 0;
}

.game-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    display: block;
}

.game-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    display: block;
    margin-top: 2px;
}

.menu-list-link--admin {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(127, 29, 29, 0.08));
    border-color: rgba(248, 113, 113, 0.24);
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu.active .menu-list-link,
.dropdown-menu.active .menu-games-dropdown,
.dropdown-menu.active .menu-section-label {
    opacity: 0;
    animation: menuFadeIn 0.24s ease forwards;
}

.dropdown-menu.active .admin-link {
    opacity: 0;
    animation: menuFadeIn 0.24s ease 0.38s forwards;
}

[data-theme="light"] .menu-games-btn .games-arrow,
[data-theme="light"] .menu-list-sub {
    color: #64748b;
}

[data-theme="light"] .menu-games-dropdown .games-submenu {
    background: #fff;
    border-color: #e2e8f0;
}

[data-theme="light"] .game-link:hover {
    background: rgba(217, 119, 6, 0.08);
}

[data-theme="light"] .game-name {
    color: #0f172a;
}

[data-theme="light"] .game-desc {
    color: #64748b;
}

[data-theme="light"] .menu-list-link--admin {
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.95), rgba(254, 242, 242, 0.98));
    border-color: rgba(239, 68, 68, 0.18);
}

@media (max-width: 480px) {
    .dropdown-menu .admin-link {
        padding-left: 12px;
        padding-right: 12px;
    }
}
