.game-market-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-family: "Microsoft JhengHei", sans-serif;
}

.navbar .navbar-title {
    max-width: none;
    min-width: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 9px;
    overflow: hidden;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar .brand-primary {
    flex: 0 0 auto;
    color: #f1c40f;
    font-size: 1em;
    font-weight: 700;
}

.navbar .brand-english {
    flex: 0 0 auto;
    color: #d1d5db;
    font-size: 0.58em;
    font-weight: 600;
    text-shadow: none;
}

.navbar .upload-btn-nav.header-favorites-link {
    border: 1px solid #4b5563;
    color: #e5e7eb;
    background: #2b313b;
    opacity: 1;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.navbar .upload-btn-nav.header-favorites-link:hover {
    border-color: #6b7280;
    color: #fff;
    background: #374151;
    opacity: 1;
}

.navbar .upload-btn-nav.header-favorites-link:focus-visible {
    outline: 3px solid #75bfff;
    outline-offset: 2px;
}

.header-favorites-icon {
    color: #f5b800;
    font-size: 1.05em;
}

.game-switcher-control { position: relative; }

.game-switcher-button {
    max-width: 250px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid #596170;
    border-radius: 5px;
    color: #fff;
    background: #292d35;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
}

.game-switcher-button:hover { border-color: #f1c40f; background: #343944; }
.game-switcher-button:focus-visible { outline: 3px solid #75bfff; outline-offset: 2px; }
.game-switcher-button [data-switcher-label] { overflow: hidden; text-overflow: ellipsis; }

.game-switcher-menu {
    min-width: 220px;
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    z-index: 450;
    display: none;
    padding: 6px;
    border: 1px solid #4c5360;
    border-radius: 6px;
    background: #242830;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.game-switcher-menu.is-open { display: block; }

.game-switcher-option {
    width: 100%;
    min-height: 42px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    border: 0;
    border-radius: 4px;
    color: #fff;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    letter-spacing: 0;
    text-align: left;
}

.game-switcher-option:hover,
.game-switcher-option:focus-visible { background: #3a404b; outline: none; }
.game-switcher-option img { width: 26px; height: 26px; object-fit: contain; }
.game-switcher-check { color: #f1c40f; font-weight: 800; }
.game-switcher-error { color: #ffcf70; font-size: 13px; }

@media (max-width: 1120px) and (min-width: 721px) {
    .game-switcher-server { display: none; }
    .game-switcher-button { max-width: 170px; }
}

@media (max-width: 720px) {
    .game-market-switcher {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }
    .game-switcher-control,
    .game-switcher-button { width: 100%; max-width: none; }
    .game-switcher-menu { width: 100%; position: static; box-sizing: border-box; margin-top: 5px; }

    .navbar:not(:has(.navbar-menu-button)) {
        min-width: 0;
        padding-right: 8px;
        padding-left: 8px;
        gap: 7px;
        overflow: visible;
    }
    .navbar:not(:has(.navbar-menu-button)) .navbar-logo-area { min-width: 0; flex: 0 1 auto; gap: 6px; overflow: hidden; }
    .navbar:not(:has(.navbar-menu-button)) .maple-logo { width: 30px; height: 30px; flex: 0 0 30px; }
    .navbar:not(:has(.navbar-menu-button)) .navbar-title { display: inline-flex; flex: 0 1 auto; }
    .navbar:not(:has(.navbar-menu-button)) .nav-links {
        min-width: 0;
        flex: 1 1 auto;
        justify-content: flex-end;
        gap: 6px;
    }
    .navbar:not(:has(.navbar-menu-button)) .nav-links > .upload-btn-nav:not(#login-nav-btn) { display: none; }
    .navbar:not(:has(.navbar-menu-button)) .game-market-switcher {
        width: auto;
        min-width: 0;
        flex: 1 1 auto;
        align-items: center;
        flex-direction: row;
        gap: 5px;
    }
    .navbar:not(:has(.navbar-menu-button)) .game-switcher-control { width: auto; min-width: 0; flex: 1 1 0; }
    .navbar:not(:has(.navbar-menu-button)) .game-switcher-button {
        width: 100%;
        max-width: 145px;
        min-width: 0;
        padding-right: 7px;
        padding-left: 7px;
        font-size: 12px;
    }
    .navbar:not(:has(.navbar-menu-button)) .game-switcher-menu {
        width: min(250px, calc(100vw - 16px));
        position: fixed;
        top: 58px;
        left: 8px;
    }
    .navbar:not(:has(.navbar-menu-button)) .game-switcher-control + .game-switcher-control .game-switcher-menu {
        right: 8px;
        left: auto;
    }
    .navbar:not(:has(.navbar-menu-button)) .user-menu-container { width: auto; flex: 0 0 auto; }
    .navbar:not(:has(.navbar-menu-button)) .user-nav-name { display: none; }
    .navbar:not(:has(.navbar-menu-button)) .user-nav-btn { padding-right: 4px; }
}

@media (max-width: 480px) {
    .navbar .navbar-title { gap: 0; font-size: 17px; }
    .navbar .brand-english { display: none; }
    .navbar:not(:has(.navbar-menu-button)) .navbar-logo-area { flex: 0 0 68px; gap: 4px; }
}
