#gameMenuRoot {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
    z-index: 2000;
    font-family: "PingFang TC", "Heiti TC", "Microsoft JhengHei", sans-serif;
}

.game-menu-toggle {
    width: 48px;
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.game-menu-toggle:active {
    transform: scale(0.96);
}

.game-menu-toggle span {
    width: 24px;
    height: 3px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.game-menu-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.game-menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.game-menu-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.game-menu-panel {
    position: absolute;
    top: 58px;
    left: 0;
    width: min(76vw, 280px);
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    transform: translateY(-8px) scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.game-menu-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.game-menu-title {
    margin-bottom: 10px;
    color: #555;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

.game-menu-link {
    display: block;
    padding: 12px 14px;
    margin-top: 8px;
    border-radius: 12px;
    color: #333;
    background: #f7f8ff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.game-menu-link:first-of-type {
    margin-top: 0;
}

.game-menu-link:hover,
.game-menu-link:focus {
    background: #eef2ff;
    transform: translateX(2px);
}

.game-menu-link.active {
    color: #fff;
    background: linear-gradient(135deg, #69b1ff 0%, #4096ff 100%);
    box-shadow: 0 6px 16px rgba(64, 150, 255, 0.28);
}

.game-menu-mask {
    position: fixed;
    inset: 0;
    z-index: 1999;
    display: none;
    background: rgba(0, 0, 0, 0.08);
}

.game-menu-mask.open {
    display: block;
}
