/* Keep admin navigation hidden until the session is verified. */
.top-left-actions a[data-admin-navigation][hidden] {
    display: none !important;
}

/* Shared top navigation */
.admin-player-link,
.channel-stats-link {
    position: relative;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(116, 222, 255, 0.28);
    background:
        linear-gradient(135deg, rgba(10, 22, 46, 0.92), rgba(32, 18, 58, 0.88));
    color: #d8f8ff;
    text-decoration: none;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 8px 18px rgba(3, 8, 22, 0.38),
        0 0 18px rgba(0, 191, 255, 0.12);
    backdrop-filter: blur(10px);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

.admin-player-link {
    gap: 6px;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
}

.admin-player-link::before {
    content: '▶';
    font-size: 0.62rem;
    color: #79ddff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.45);
}

.channel-stats-link {
    width: 30px;
    height: 30px;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.82rem;
    color: #9ce8ff;
}

.channel-stats-link i {
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.3));
}

.admin-player-link:hover,
.admin-player-link:focus-visible,
.channel-stats-link:hover,
.channel-stats-link:focus-visible {
    border-color: rgba(116, 222, 255, 0.52);
    background:
        linear-gradient(135deg, rgba(16, 34, 66, 0.96), rgba(43, 22, 73, 0.9));
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06) inset,
        0 10px 22px rgba(3, 8, 22, 0.45),
        0 0 22px rgba(0, 212, 255, 0.2);
    transform: translateY(-1px);
    outline: none;
}


.top-left-actions {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1250;
}

.top-left-actions--bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 20px;
    border: 0;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(8, 12, 28, 0.62), rgba(8, 12, 28, 0.42));
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
}

.top-left-actions__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: max-content;
    text-decoration: none;
    color: #f5fbff;
    font-family: 'Carter One', display;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
}

.top-left-actions__brand img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.18));
}

.top-left-actions--bar .top-left-actions__toggle {
    display: none;
}

.top-left-actions--bar .top-left-actions__menu {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 88px 12px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
}

.top-left-actions__toggle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(10, 15, 35, 0.85);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.top-left-actions__toggle:hover,
.top-left-actions__toggle[aria-expanded="true"] {
    transform: translateY(-1px) scale(1.03);
    background: linear-gradient(135deg, rgba(63, 81, 181, 0.85), rgba(123, 97, 255, 0.85));
    color: #fff;
    box-shadow: 0 10px 24px rgba(68, 97, 242, 0.35);
}

.top-left-actions__toggle:focus-visible {
    outline: 2px solid rgba(123, 97, 255, 0.85);
    outline-offset: 3px;
}

.top-left-actions__menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 188px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    background: rgba(8, 12, 28, 0.94);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-left-actions__menu[hidden] {
    display: none;
}

.top-left-actions__menu .music-menu-button,
.top-left-actions__menu .settings-button,
.top-left-actions__menu .rules-panel-toggle,
.top-left-actions__menu .channel-stats-link,
.top-left-actions__menu .admin-player-link {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: 44px;
    padding: 0 10px;
    border-radius: 0;
    border: 0;
    background: transparent;
    color: rgba(232, 250, 255, 0.82);
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    box-shadow: none;
    backdrop-filter: none;
    font-size: 0.97rem;
    font-weight: 700;
    transform: none;
    text-decoration: none;
    white-space: nowrap;
}

.top-left-actions__menu .music-menu-button:hover,
.top-left-actions__menu .settings-button:hover,
.top-left-actions__menu .settings-button.is-active,
.top-left-actions__menu .rules-panel-toggle:hover,
.top-left-actions__menu .rules-panel-toggle.is-active,
.top-left-actions__menu .channel-stats-link:hover,
.top-left-actions__menu .admin-player-link:hover {
    transform: none;
    background: transparent;
    color: #ffffff;
    box-shadow: none;
}

.top-left-actions__menu .music-menu-button:focus-visible,
.top-left-actions__menu .settings-button:focus-visible,
.top-left-actions__menu .rules-panel-toggle:focus-visible,
.top-left-actions__menu .channel-stats-link:focus-visible,
.top-left-actions__menu .admin-player-link:focus-visible {
    outline: none;
    color: #ffffff;
}

.top-left-actions__menu .music-menu-button::after,
.top-left-actions__menu .rules-panel-toggle::after,
.top-left-actions__menu .channel-stats-link::after,
.top-left-actions__menu .admin-player-link::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 6px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.92), rgba(255, 108, 66, 0.92));
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.22s ease;
}

.top-left-actions__menu .music-menu-button:hover::after,
.top-left-actions__menu .music-menu-button:focus-visible::after,
.top-left-actions__menu .rules-panel-toggle:hover::after,
.top-left-actions__menu .rules-panel-toggle:focus-visible::after,
.top-left-actions__menu .rules-panel-toggle.is-active::after,
.top-left-actions__menu .channel-stats-link:hover::after,
.top-left-actions__menu .channel-stats-link:focus-visible::after,
.top-left-actions__menu .admin-player-link:hover::after,
.top-left-actions__menu .admin-player-link:focus-visible::after {
    transform: scaleX(1);
}

.top-left-actions__menu .music-menu-button img {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.top-left-actions__menu .top-left-actions__label {
    line-height: 1;
}

.top-left-actions--bar .top-left-actions__menu .music-menu-button,
.top-left-actions--bar .top-left-actions__menu .rules-panel-toggle,
.top-left-actions--bar .top-left-actions__menu .channel-stats-link,
.top-left-actions--bar .top-left-actions__menu .admin-player-link {
    width: auto;
    min-width: max-content;
    flex: 0 0 auto;
    justify-content: center;
    align-self: center;
    padding: 0 10px;
}

.top-left-actions--bar .top-left-actions__menu .music-menu-button img {
    width: 20px;
    height: 20px;
}

.top-left-actions--bar .top-left-actions__menu .rules-panel-toggle.is-hidden {
    display: none !important;
}

.top-left-actions--bar > .settings-button,
.top-left-actions--bar > .rules-panel-toggle {
    position: absolute;
    top: 12px;
}

.top-left-actions--bar > .settings-button {
    right: 72px;
    left: auto;
    z-index: 12;
}

.top-left-actions--bar > .rules-panel-toggle {
    right: 20px;
    z-index: 12;
}

/* Prevent the standalone roulette button from flashing over the brand
   before JS moves it into the pinned top bar menu. */
.top-left-actions--bar ~ .music-menu-button {
    opacity: 0;
    pointer-events: none;
}

.top-left-actions--bar .top-left-actions__menu .music-menu-button {
    opacity: 1;
    pointer-events: auto;
}

.top-left-actions--page {
    position: relative;
    flex: 0 0 auto;
}

.top-left-actions--page .top-left-actions__menu {
    padding-right: 0;
}



@media (max-width: 600px) {
    .top-left-actions.top-left-actions--bar {
        top: 0;
        left: 0;
        gap: 8px;
        padding: 0 10px;
    }

    .top-left-actions--bar .top-left-actions__brand span {
        display: none;
    }
}
