.asas-multi-player {
    width: 100%;
    margin: 16px 0;
    background: #000;
    border-radius: 6px;
    overflow: visible;
    position: relative;
}

.asas-player-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px;
    background: #111;
    border-bottom: 1px solid #222;
    position: relative;
    z-index: 20;
}

.asas-server-toggle {
    appearance: none;
    border: 1px solid #333;
    background: #1d1d1d;
    color: #fff;
    border-radius: 5px;
    padding: 9px 12px;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
}

.asas-server-toggle:hover,
.asas-server-toggle:focus {
    background: #292929;
    outline: none;
}

.asas-server-menu {
    position: absolute;
    left: 10px;
    top: calc(100% - 1px);
    min-width: 220px;
    max-width: calc(100% - 20px);
    background: #151515;
    border: 1px solid #333;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 20px rgba(0,0,0,.35);
    overflow-y: auto;
    overflow-x: hidden;
    max-height: min(600px, calc(100vh - 24px));
    z-index: 2147483647;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.asas-server-menu[hidden] {
    display: none;
}

.asas-server-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    border-bottom: 1px solid #252525;
    background: transparent;
    color: #ddd;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
}

.asas-server-option:last-child {
    border-bottom: 0;
}

.asas-server-option:hover,
.asas-server-option:focus {
    background: #222;
    outline: none;
}

.asas-server-option.is-active {
    background: #292929;
    color: #fff;
}

.asas-server-option-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asas-server-option-status {
    flex: 0 0 auto;
    font-size: 11px;
    color: #888;
}

.asas-server-option-status.is-available {
    color: #75d48a;
}

.asas-server-option-status.is-checking {
    color: #d7b85d;
}

.asas-server-option-status.is-unavailable {
    color: #e97878;
}

.asas-episode-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: #111;
    border-top: 1px solid #222;
}

.asas-episode-nav-side {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.asas-episode-nav-right {
    margin-left: auto;
}

.asas-episode-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #1d1d1d;
    color: #fff;
    font-size: 13px;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
}

.asas-episode-nav-link:hover,
.asas-episode-nav-link:focus {
    background: #292929;
    color: #fff;
    outline: none;
    text-decoration: none;
}

.asas-episode-nav-link[hidden] {
    display: none;
}

.asas-auto-next-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ddd;
    font-size: 13px;
    line-height: 1.3;
    cursor: pointer;
    white-space: nowrap;
}

.asas-auto-next-control input {
    margin: 0;
}

.asas-player-status {
    min-height: 0;
    padding: 0 10px;
    background: #111;
    color: #999;
    font-size: 12px;
    line-height: 1.5;
}

.asas-player-status:empty {
    display: none;
}

.asas-player-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 180px;
    background: #000;
}

.asas-player-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

@media (max-width: 600px) {
    .asas-player-toolbar {
        padding: 8px;
    }

    /* Keep the dropdown attached to the player while the page scrolls.
       The menu itself scrolls when the provider list is taller than the
       available mobile space; it must NOT be position:fixed. */
    .asas-server-menu {
        position: absolute;
        min-width: 220px;
        max-width: calc(100vw - 16px);
        max-height: min(600px, calc(100vh - 24px));
        max-height: min(600px, calc(100dvh - 24px));
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 2147483647;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: auto;
        touch-action: pan-y;
    }
    .asas-server-menu {
        height: auto !important;
        overscroll-behavior-y: contain;
        scrollbar-gutter: stable;
    }
    .asas-server-option {
        min-height: 42px;
        flex: 0 0 auto;
    }

    .asas-server-menu {
        height: auto !important;
        overscroll-behavior-y: contain;
        scrollbar-gutter: stable;
    }
    .asas-server-option {
        min-height: 42px;
        flex: 0 0 auto;
    }

    .asas-server-menu::-webkit-scrollbar { width: 8px; }
    .asas-server-menu::-webkit-scrollbar-thumb { background: #666; border-radius: 8px; }

    .asas-server-toggle {
        font-size: 13px;
        padding: 8px 10px;
    }

    .asas-player-frame {
        min-height: 160px;
    }

    .asas-episode-nav {
        padding: 7px 8px;
    }

    .asas-episode-nav {
        flex-wrap: wrap;
    }

    .asas-episode-nav-side {
        max-width: 100%;
    }

    .asas-episode-nav-right {
        margin-left: auto;
    }

    .asas-episode-nav-link,
    .asas-auto-next-control {
        padding: 7px 8px;
        font-size: 12px;
    }
}
