.game-popup-root {
    position: fixed;
    top: 50%;
    left: 0;
    z-index: 10000;
    font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transform: translate(-100%, -50%);
    transition: transform 220ms ease;
}

.game-popup-root.has-online,
.game-popup-root.has-urgent {
    transform: translate(-100%, -50%);
}

.game-popup-root.is-open {
    transform: translate(0, -50%);
}

.game-popup-tab {
    position: absolute;
    top: 50%;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: 44px;
    min-height: 132px;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(0, 255, 135, 0.35);
    border-left: 0;
    border-radius: 0 10px 10px 0;
    background: #1E293B;
    color: var(--accent-color, #00FF87);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 900;
    writing-mode: vertical-rl;
    transform: translate(100%, -50%);
}

.game-popup-root.is-open .game-tab-arrow {
    transform: rotate(180deg);
}

.game-tab-text {
    color: var(--text-main, #E2E8F0);
    white-space: nowrap;
}

.game-tab-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.55rem;
    min-height: 1.55rem;
    padding: 0.1rem;
    border-radius: 999px;
    background: var(--accent-color, #00FF87);
    color: #071014;
    font-size: 0.78rem;
    line-height: 1;
    transform: rotate(90deg);
}

.game-tab-arrow {
    display: inline-block;
    color: var(--accent-color, #00FF87);
    font-size: 1.35rem;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform 180ms ease;
}

.game-popup-panel {
    width: min(380px, calc(100vw - 64px));
    max-height: min(620px, calc(100vh - 48px));
    overflow-y: auto;
    padding: 16px;
    border: 1px solid var(--border-color, rgba(148, 163, 184, .22));
    border-left: 0;
    border-radius: 0 12px 12px 0;
    background: var(--bg-card, rgba(21, 26, 34, .98));
    color: var(--text-main, #E2E8F0);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.45);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 135, 0.72) rgba(15, 23, 42, 0.72);
}

.game-popup-panel::-webkit-scrollbar {
    width: 0.65rem;
}

.game-popup-panel::-webkit-scrollbar-track {
    margin: 0.75rem 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
}

.game-popup-panel::-webkit-scrollbar-thumb {
    border: 2px solid rgba(15, 23, 42, 0.72);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(0, 255, 135, 0.95), rgba(56, 189, 248, 0.78));
}

.game-popup-close {
    position: absolute;
    right: 10px;
    top: 8px;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color, rgba(148, 163, 184, .22));
    border-radius: 999px;
    background: #1E293B;
    color: var(--text-main, #E2E8F0);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.game-popup-title {
    padding-right: 38px;
    font-weight: 900;
    color: var(--text-main, #E2E8F0);
}

.game-popup-message {
    margin-top: 8px;
    color: var(--text-muted, #94A3B8);
    line-height: 1.4;
}

.game-popup-actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.game-popup-actions button,
.game-popup-actions a {
    min-height: 38px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: var(--accent-color, #00FF87);
    color: #071014;
    font-weight: 900;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.game-popup-actions button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.game-popup-actions .secondary {
    background: #263241;
    color: var(--text-main, #E2E8F0);
}

.game-online-list {
    display: grid;
    gap: 8px;
}

.game-online-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border-color, rgba(148, 163, 184, .22));
    border-radius: 8px;
    background: #1E293B;
}

.game-online-name {
    min-width: 0;
    overflow: hidden;
    color: var(--text-main, #E2E8F0);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .game-popup-root {
        top: auto;
        right: 0;
        bottom: 0;
        display: flex;
        justify-content: center;
        transform: translateY(100%);
    }

    .game-popup-root.has-online,
    .game-popup-root.has-urgent {
        transform: translateY(100%);
    }

    .game-popup-root.is-open {
        transform: translateY(0);
    }

    .game-popup-tab {
        top: 0;
        right: auto;
        left: 50%;
        min-width: 0;
        min-height: 44px;
        writing-mode: horizontal-tb;
        transform: translate(-50%, -100%);
        border: 1px solid rgba(0, 255, 135, 0.35);
        border-bottom: 0;
        border-radius: 10px 10px 0 0;
        padding: 0.55rem 0.95rem;
    }

    .game-tab-count {
        transform: none;
    }

    .game-tab-arrow {
        transform: rotate(-90deg);
    }

    .game-popup-root.is-open .game-tab-arrow {
        transform: rotate(90deg);
    }

    .game-popup-panel {
        width: 100vw;
        max-height: min(78vh, 620px);
        border-left: 1px solid var(--border-color, rgba(148, 163, 184, .22));
        border-bottom: 0;
        border-radius: 12px 12px 0 0;
    }

    .game-online-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}
