        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            user-select: none;
            -webkit-user-select: none;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            overflow: hidden;
            background-color: #87CEEB;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            touch-action: none;
        }

        #gameCanvas {
            display: block;
            position: absolute;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            z-index: 5;
            cursor: pointer;
        }

        .ui-layer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            z-index: 20;
        }

        .header {
            padding: 20px;
            padding-top: max(20px, env(safe-area-inset-top));
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            pointer-events: none;
        }

        .header-left,
        .header-right {
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: auto;
        }

                .status-box {
            background: rgba(255, 255, 255, 0.95);
            padding: 8px 16px;
            border-radius: 12px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            font-size: 16px;
            font-weight: bold;
            color: #333;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s;
            width: fit-content;
            cursor: pointer;
        }

        .status-box:active {
            transform: scale(0.95);
        }

        #timerBox {
            position: absolute;
            top: 20px;
            top: max(20px, env(safe-area-inset-top));
            left: 50%;
            transform: translateX(-50%);
            z-index: 50;
            pointer-events: auto;
            cursor: default;
        }

                .basket-area {
            background: rgba(255, 255, 255, 0.95);
            padding: 10px 20px;
            border-radius: 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
            border: none;
            pointer-events: auto;
        }

        .basket-icon {
            font-size: 32px;
            line-height: 1;
        }

        .score-text {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
        }

        .score-label {
            font-size: 12px;
            color: #666;
            margin-bottom: 2px;
        }

        .score-number {
            font-size: 20px;
            font-weight: 800;
            color: #2196F3;
        }

        #levelIndicator {
            position: absolute;
            top: 140px;
            width: 100%;
            text-align: center;
            font-size: 22px;
            font-weight: bold;
            color: white;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            pointer-events: none;
            opacity: 0;
            transform: translateY(-20px);
            transition: opacity 0.5s, transform 0.5s;
            padding: 0 20px;
        }

        #levelIndicator.show {
            opacity: 1;
            transform: translateY(0);
        }

        .message-toast {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(0, 0, 0, 0.85);
            color: #fff;
            padding: 10px 20px;
            border-radius: 0;
            font-size: 15px;
            font-weight: bold;
            pointer-events: none;
            opacity: 0;
            white-space: nowrap;
            z-index: 600;
            /* 提升消息提示的层级 */
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            transition: opacity 0.1s;
        }

        .message-toast.show {
            animation: floatUpFade 0.8s ease-out forwards;
        }

        @keyframes floatUpFade {
            0% {
                transform: translate(-50%, -50%) scale(0.8);
                opacity: 0;
            }

            10% {
                transform: translate(-50%, -80%) scale(1.1);
                opacity: 1;
            }

            100% {
                transform: translate(-50%, -150%) scale(1);
                opacity: 0;
            }
        }

        .modal-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(5px);
            display: flex;
            justify-content: center;
            align-items: center;
            pointer-events: auto;
            z-index: 500;
            /* 从 200 提升到 500，确保在首页 (300) 的上方显示 */
            transition: opacity 0.3s;
        }

        .modal-content {
            border-radius: 20px;
            background: white;
            padding: 30px;
            border-radius: 24px;
            text-align: center;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
            max-width: 90%;
            width: 340px;
            animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        @keyframes popIn {
            from {
                transform: scale(0.8);
                opacity: 0;
            }

            to {
                transform: scale(1);
                opacity: 1;
            }
        }

        .hidden {
            opacity: 0;
            pointer-events: none;
            display: none !important;
        }

        /* 首页样式（低饱和柔和配色） */
        .home-screen {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background:
                radial-gradient(ellipse 80% 60% at 18% 18%, rgba(255, 255, 255, 0.5) 0%, transparent 55%),
                radial-gradient(ellipse 70% 50% at 88% 12%, rgba(200, 210, 220, 0.28) 0%, transparent 50%),
                radial-gradient(ellipse 90% 70% at 50% 100%, rgba(180, 195, 190, 0.22) 0%, transparent 55%),
                linear-gradient(165deg, #d7e2ea 0%, #e4ebe8 48%, #eef2f4 100%);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 300;
            transition: opacity 0.3s, background 0.4s ease;
            overflow: hidden;
            padding: 24px 12px;
            gap: 8px;
        }

        /* 背景装饰层 */
        .home-bg-decor {
            position: absolute;
            inset: 0;
            pointer-events: none;
            overflow: hidden;
            z-index: 0;
        }
        .float-blob {
            position: absolute;
            border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%;
            filter: blur(2px);
            opacity: 0.28;
            animation: blobDrift 14s ease-in-out infinite;
        }
        .blob-a {
            width: 220px; height: 220px; top: -40px; left: -30px;
            background: radial-gradient(circle at 30% 30%, #eef2f5, #c5d4df 70%);
        }
        .blob-b {
            width: 280px; height: 280px; bottom: -60px; right: -40px;
            background: radial-gradient(circle at 40% 40%, #e4ebe6, #c8d5d0 75%);
            animation-delay: -5s; animation-duration: 18s;
        }
        .blob-c {
            width: 160px; height: 160px; top: 35%; left: 55%;
            background: radial-gradient(circle at 50% 50%, #ebe6ee, #d4cfe0 80%);
            animation-delay: -9s; animation-duration: 16s; opacity: 0.22;
        }
        @keyframes blobDrift {
            0%, 100% { transform: translate(0, 0) scale(1); }
            33% { transform: translate(18px, -22px) scale(1.06); }
            66% { transform: translate(-14px, 12px) scale(0.96); }
        }
        .float-brick {
            position: absolute;
            font-size: 28px;
            opacity: 0.12;
            filter: drop-shadow(0 3px 5px rgba(0,0,0,0.08)) grayscale(0.25);
            animation: brickFloat 7s ease-in-out infinite;
            user-select: none;
        }
        .brick-1 { top: 12%; left: 8%; animation-delay: 0s; }
        .brick-2 { top: 18%; right: 10%; font-size: 34px; animation-delay: -2s; }
        .brick-3 { bottom: 22%; left: 14%; font-size: 22px; animation-delay: -3.5s; }
        .brick-4 { bottom: 28%; right: 12%; font-size: 26px; animation-delay: -1.2s; }
        @keyframes brickFloat {
            0%, 100% { transform: translateY(0) rotate(-6deg); }
            50% { transform: translateY(-14px) rotate(6deg); }
        }
        .home-grid-floor {
            position: absolute;
            left: 0; right: 0; bottom: 0;
            height: 38%;
            background:
                linear-gradient(to top, rgba(255,255,255,0.35), transparent),
                repeating-linear-gradient(
                    90deg,
                    transparent 0,
                    transparent 28px,
                    rgba(255,255,255,0.12) 28px,
                    rgba(255,255,255,0.12) 29px
                );
            mask-image: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
            -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
        }

        /* 标题区 */
        .home-hero {
            position: relative;
            z-index: 1;
            text-align: center;
            margin-bottom: 10px;
            animation: heroIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
        }
        @keyframes heroIn {
            from { opacity: 0; transform: translateY(-18px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .home-badge {
            display: inline-block;
            padding: 5px 14px;
            margin-bottom: 12px;
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.08em;
            color: #5a65a8;
            background: rgba(255, 255, 255, 0.82);
            border: 1px solid rgba(200, 210, 240, 0.9);
            border-radius: 999px;
            box-shadow: 0 3px 10px rgba(100, 120, 190, 0.08);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }
        .home-screen h1,
        .home-hero h1 {
            font-size: clamp(36px, 8vw, 56px);
            margin-bottom: 10px;
            font-weight: 900;
            letter-spacing: 0.04em;
            background: linear-gradient(120deg, #4a5f9a 0%, #6b7ec9 45%, #4a9a8a 100%);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            filter: none;
            text-shadow: none;
            line-height: 1.15;
        }
        .home-subtitle {
            font-size: 14px;
            font-weight: 600;
            color: rgba(70, 85, 98, 0.62);
            letter-spacing: 0.12em;
        }

        /* 内容玻璃面板 */
        .home-panel {
            position: relative;
            z-index: 1;
            width: min(620px, 94vw);
            padding: 22px 18px 18px;
            border-radius: 28px;
            background: rgba(255, 255, 255, 0.62);
            border: 1px solid rgba(230, 236, 240, 0.95);
            box-shadow:
                0 16px 40px rgba(50, 70, 90, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(14px) saturate(1.05);
            -webkit-backdrop-filter: blur(14px) saturate(1.05);
            animation: panelIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
        }
        @keyframes panelIn {
            from { opacity: 0; transform: translateY(22px) scale(0.97); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        .home-buttons {
            display: flex;
            flex-direction: column;
            flex-wrap: nowrap;
            justify-content: center;
            align-items: stretch;
            gap: 14px;
            padding: 0;
            width: 100%;
        }

        .home-utility-row {
            display: flex;
            gap: 10px;
            justify-content: center;
            flex-wrap: wrap;
        }

        .btn-home {
            background: rgba(255, 255, 255, 0.95);
            color: #333;
            border: none;
            padding: 14px 28px;
            font-size: 16px;
            font-weight: bold;
            border-radius: 30px;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .btn-home:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
        }

        .btn-home:active {
            transform: scale(0.96);
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        .btn-home.primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }

        .btn-home.btn-home-soft {
            background: rgba(255, 255, 255, 0.9);
            border: 1px solid #e2e8ee;
            color: #556575;
            padding: 11px 20px;
            font-size: 14px;
            border-radius: 999px;
            box-shadow: 0 3px 10px rgba(60, 80, 100, 0.06);
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
        }
        .btn-home.btn-home-soft:hover {
            background: #fff;
            color: #3d4f5f;
        }

        /* 主题切换时隐藏装饰，避免与 MC / 霓虹背景冲突 */
        .home-screen.mc-theme .home-bg-decor,
        .home-screen.tetris-theme .home-bg-decor {
            display: none;
        }
        .home-screen.mc-theme .home-panel,
        .home-screen.tetris-theme .home-panel {
            background: rgba(0, 0, 0, 0.35);
            border-color: rgba(255, 255, 255, 0.15);
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }
        .home-screen.mc-theme .home-badge,
        .home-screen.tetris-theme .home-badge {
            color: #fff;
            background: rgba(0, 0, 0, 0.4);
            border-color: rgba(255, 255, 255, 0.2);
        }
        .home-screen.mc-theme .home-subtitle,
        .home-screen.tetris-theme .home-subtitle {
            color: rgba(255, 255, 255, 0.75);
        }
        .home-screen.mc-theme .home-hero h1,
        .home-screen.tetris-theme .home-hero h1 {
            background: none;
            -webkit-background-clip: unset;
            background-clip: unset;
            color: #fff;
            filter: none;
        }

        /* 独立的排行榜界面样式 */
        .leaderboard-screen {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 400;
            /* 高于一切 */
            transition: opacity 0.3s;
        }

        .leaderboard-screen h1 {
            font-size: 40px;
            color: white;
            margin-bottom: 20px;
            text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
            font-weight: 900;
        }

        .lb-container {
            width: 90%;
            max-width: 450px;
            height: 60vh;
            background: white;
            border-radius: 0;
            padding: 20px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            overflow-y: auto;
        }

        /* 滚动条美化 */
        .lb-container::-webkit-scrollbar {
            width: 6px;
        }

        .lb-container::-webkit-scrollbar-thumb {
            background: #ccc;
            border-radius: 3px;
        }

        .lb-list {
            list-style: none;
            margin: 0;
            padding: 0;
            text-align: left;
        }

        .lb-item {
            border-radius: 12px;
            display: flex;
            justify-content: space-between;
            font-size: 16px;
            color: #FFF;
            margin-bottom: 12px;
            align-items: center;
            padding: 10px 15px;
            background: #f8f9fa;
            border-radius: 0;
            border-left: 5px solid transparent;
        }

        .lb-rank {
            font-weight: bold;
            width: 40px;
            display: inline-block;
        }

        /* 只有前三名有特殊样式 */
        .lb-item:nth-child(1) {
            border-left-color: #FFC107;
            background: #fffde7;
        }

        .lb-item:nth-child(1) .lb-rank {
            color: #FFC107;
            font-size: 20px;
        }

        .lb-item:nth-child(2) {
            border-left-color: #9E9E9E;
            background: #f5f5f5;
        }

        .lb-item:nth-child(2) .lb-rank {
            color: #9E9E9E;
            font-size: 18px;
        }

        .lb-item:nth-child(3) {
            border-left-color: #CD7F32;
            background: #efebe9;
        }

        .lb-item:nth-child(3) .lb-rank {
            color: #CD7F32;
            font-size: 18px;
        }

        .lb-info {
            text-align: right;
            font-weight: bold;
            color: #667eea;
        }

        h2 {
            margin-bottom: 12px;
            font-size: 24px;
            color: #FFF;
        }

        p {
            margin-bottom: 20px;
            color: #666;
            line-height: 1.5;
            font-size: 15px;
        }

        .btn-primary {
            border-radius: 50px;
            background: linear-gradient(135deg, #6b8fd6 0%, #7a7ec9 100%);
            color: white;
            border: none;
            padding: 12px 30px;
            font-size: 16px;
            font-weight: bold;
            border-radius: 12px;
            cursor: pointer;
            width: 100%;
            margin-bottom: 15px;
            box-shadow: 0 6px 14px rgba(100, 120, 190, 0.22);
            transition: transform 0.1s, box-shadow 0.1s, opacity 0.3s;
        }

        .btn-primary:active {
            transform: scale(0.98);
            box-shadow: 0 3px 8px rgba(100, 120, 190, 0.18);
        }

        .btn-secondary {
            background: transparent;
            color: #666;
            border: none;
            padding: 10px;
            margin-top: 5px;
            cursor: pointer;
            font-size: 14px;
            width: 100%;
        }

        /* 胜利庆祝界面 */
        .victory-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(8px);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 600;
            pointer-events: auto;
            animation: victoryFadeIn 0.5s ease-out;
        }

        @keyframes victoryFadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .victory-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            animation: victoryPopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        @keyframes victoryPopIn {
            0% { transform: scale(0.3) rotate(-10deg); opacity: 0; }
            60% { transform: scale(1.1) rotate(3deg); opacity: 1; }
            100% { transform: scale(1) rotate(0deg); opacity: 1; }
        }

        .victory-trophy {
            font-size: 100px;
            line-height: 1;
            animation: trophyBounce 1s ease-in-out infinite alternate;
            filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
        }

        @keyframes trophyBounce {
            0% { transform: translateY(0); }
            100% { transform: translateY(-15px); }
        }

        .victory-ribbon {
            background: linear-gradient(135deg, #FFD700 0%, #FFA000 50%, #FFD700 100%);
            color: #5D4037;
            padding: 16px 32px;
            border-radius: 16px;
            font-size: 20px;
            font-weight: 900;
            text-align: center;
            margin-top: 20px;
            box-shadow: 0 6px 20px rgba(255, 160, 0, 0.4);
            max-width: 85%;
            line-height: 1.5;
            border: 3px solid #FFF8E1;
        }

        .victory-subtitle {
            color: #FFD54F;
            font-size: 16px;
            margin-top: 12px;
            font-weight: bold;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        }

        .victory-buttons {
            display: flex;
            gap: 12px;
            margin-top: 30px;
        }

        /* 彩炮粒子 */
        .confetti {
            position: absolute;
            width: 10px;
            height: 10px;
            border-radius: 2px;
            animation: confettiFall linear forwards;
            pointer-events: none;
        }

        @keyframes confettiFall {
            0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
            80% { opacity: 1; }
            100% { transform: translateY(100vh) rotate(720deg) scale(0.5); opacity: 0; }
        }

        /* 开发者指令区 */
        .dev-console {
            position: absolute;
            top: 80px;
            right: 15px;
            width: 220px;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            gap: 6px;
            pointer-events: auto;
        }

        .dev-console input {
            background: rgba(0, 0, 0, 0.75);
            color: #0f0;
            border: 1px solid #0f0;
            border-radius: 8px;
            padding: 8px 10px;
            font-size: 13px;
            font-family: 'Courier New', monospace;
            outline: none;
            width: 100%;
        }

        .dev-console input::placeholder {
            color: rgba(0, 255, 0, 0.4);
        }

        .dev-console-log {
            background: rgba(0, 0, 0, 0.7);
            color: #0f0;
            border: 1px solid rgba(0, 255, 0, 0.3);
            border-radius: 8px;
            padding: 6px 10px;
            font-size: 11px;
            font-family: 'Courier New', monospace;
            max-height: 120px;
            overflow-y: auto;
            line-height: 1.5;
            word-break: break-all;
        }

        .dev-console-log::-webkit-scrollbar {
            width: 4px;
        }

        .dev-console-log::-webkit-scrollbar-thumb {
            background: #0f0;
            border-radius: 2px;
        }

        .dev-console-log .log-error {
            color: #f44;
        }

        .dev-console-log .log-info {
            color: #0ff;
        }
    
        
        
        /* Tetris 专属主题样式 (Cyberpunk Neon) */
        .home-screen.tetris-theme h1 {
            font-family: sans-serif !important;
            font-weight: 900 !important;
            font-size: 42px !important;
            color: #00f2fe !important;
            text-shadow: 0 0 10px #00f2fe, 0 0 20px #4facfe !important;
            letter-spacing: 4px;
        }
        .tetris-theme .btn-home {
            box-shadow: 0 0 8px rgba(0, 242, 254, 0.4) !important;
            transition: all 0.2s;
        }
        .tetris-theme .btn-home:hover {
            box-shadow: 0 0 15px rgba(0, 242, 254, 0.8) !important;
            transform: translateY(-2px);
        }

        /* Minecraft 专属主题样式 */
        .home-screen.mc-theme {
            background: url('./assets/bg.png?v=4') no-repeat center center !important;
            background-size: cover !important;
        }
        .mc-theme h1 {
            font-family: 'Press Start 2P', cursive !important;
            font-size: 36px !important;
            color: #FFF !important;
            text-shadow: 4px 4px 0px #3F3F3F !important;
            margin-bottom: 60px !important;
        }
        /* 橡木告示牌按钮 */
        .mc-theme .btn-home {
            position: relative;
            background: #A67843 !important;
            border: 3px solid #855E33 !important;
            border-radius: 0 !important;
            color: #382B1B !important;
            font-weight: bold !important;
            font-family: 'Press Start 2P', cursive !important;
            font-size: 14px !important;
            box-shadow: 0 6px 0px #5D4037 !important;
            padding: 12px 16px !important;
            margin: 0 10px 50px 10px !important;
            transition: all 0.1s !important;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        /* 修正横向排列下的木棍位置 */
        .mc-theme .home-buttons {
            flex-direction: row !important;
            align-items: flex-start !important;
        }
        .mc-theme .btn-home:active {
            transform: translateY(4px);
            box-shadow: 0 2px 0px #5D4037 !important;
        }
        /* 弹窗 UI 像素化 */
        .mc-theme .modal-content {
            background: #C6C6C6 !important;
            border: 4px solid #000 !important;
            border-radius: 0 !important;
            box-shadow: inset -4px -4px #555, inset 4px 4px #FFF !important;
            color: #333 !important;
        }
        .mc-theme .modal-content h2 {
            font-family: 'Press Start 2P', cursive !important;
            font-size: 18px !important;
            color: #333 !important;
        }
        /* 墙挂告示牌按钮 */
        .mc-theme .btn-home {
            position: relative;
            background: #A67843 !important;
            border: 3px solid #855E33 !important;
            border-radius: 0 !important;
            color: #382B1B !important;
            font-weight: bold !important;
            font-family: 'Press Start 2P', cursive !important;
            font-size: 14px !important;
            box-shadow: 4px 4px 0px rgba(0,0,0,0.4) !important;
            padding: 12px 20px !important;
            margin: 10px 15px !important;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: visible !important;
        }
        /* 移除木棍 */
        .mc-theme .btn-home::after {
            display: none !important;
        }
        /* 1:1 像素图标样式 */
        .mc-icon {
            display: inline-block;
            background-image: url('./assets/icons.png?v=2');
            background-size: 200% 200%;
            width: 24px;
            height: 24px;
            margin: 0 5px;
            border: none !important;
            outline: none !important;
            box-shadow: none !important;
        }
        .icon-grass { background-position: 0% 0%; }
        .icon-gold { background-position: 100% 0%; }
        .icon-cobble { background-position: 0% 100%; }
        .icon-diamond { background-position: 100% 100%; }
        .mc-theme .status-box, .mc-theme .basket-area {
            font-family: 'Press Start 2P', cursive !important;
            font-size: 12px !important;
            border-radius: 0 !important;
            background: rgba(198, 198, 198, 0.95) !important;
            border: 3px solid #000 !important;
            box-shadow: inset -3px -3px #555, inset 3px 3px #FFF !important;
            color: #333 !important;
        }
        .ui-layer.hidden {
            display: none !important;
        }

        /* 🟢 在线人数悬浮组件 */
        .online-indicator {
            position: absolute;
            top: 20px;
            right: 20px;
            top: max(20px, env(safe-area-inset-top));
            right: max(20px, env(safe-area-inset-right));
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            padding: 8px 16px;
            border-radius: 20px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            font-weight: bold;
            font-size: 14px;
            color: #333;
            cursor: pointer;
            z-index: 350;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: transform 0.2s, box-shadow 0.2s;
            pointer-events: auto;
        }
        .online-indicator:hover {
            transform: scale(1.05);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
        }
        .online-dot {
            width: 8px;
            height: 8px;
            background-color: #4CAF50;
            border-radius: 50%;
            display: inline-block;
            animation: pulse 1.5s infinite;
        }
        @keyframes pulse {
            0% { transform: scale(0.9); opacity: 0.6; }
            50% { transform: scale(1.2); opacity: 1; }
            100% { transform: scale(0.9); opacity: 0.6; }
        }

        /* 昵称及列表相关样式 */
        .username-input-field {
            width: 100%;
            padding: 12px 16px;
            border-radius: 12px;
            border: 2px solid #E0E0E0;
            font-size: 16px;
            margin-bottom: 20px;
            outline: none;
            text-align: center;
            transition: border-color 0.2s;
        }
        .username-input-field:focus {
            border-color: #a8b6c4;
        }

        .online-user-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            background: #F8F9FA;
            border-radius: 10px;
            margin-bottom: 8px;
            font-weight: 500;
            color: #333;
            border-left: 4px solid #4CAF50;
        }

        /* 适配 Minecraft 主题的在线人数 */
        .mc-theme .online-indicator {
            background: #A67843 !important;
            border: 3px solid #855E33 !important;
            border-radius: 0 !important;
            color: #382B1B !important;
            font-family: 'Press Start 2P', cursive !important;
            font-size: 10px !important;
            box-shadow: 4px 4px 0px rgba(0,0,0,0.4) !important;
        }
        .mc-theme .online-dot {
            animation: none !important;
            border-radius: 0 !important;
            background-color: #55FF55 !important;
            width: 6px !important; 
            height: 6px !important;
        }
        .mc-theme .online-user-item {
            font-family: 'Press Start 2P', cursive !important;
            font-size: 11px !important;
            border-radius: 0 !important;
            background: #C6C6C6 !important;
            border: 2px solid #000 !important;
            color: #333 !important;
            border-left: 5px solid #55FF55 !important;
            box-shadow: inset -2px -2px #555, inset 2px 2px #FFF !important;
        }

/* ============================================================
   模式六：军棋 HUD（v1.6）
   ============================================================ */
#junqiHud { position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 20; pointer-events: none; font-family: inherit; }
#junqiHud button { pointer-events: auto; }
#junqiTurnBar { position: absolute; top: 60px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.65); color: #fff; padding: 8px 22px; border-radius: 20px;
    font-size: 15px; font-weight: bold; letter-spacing: 1px; white-space: nowrap;
    border: 2px solid rgba(255,255,255,0.25); }
#junqiTurnBar.my-turn { border-color: #4caf50; color: #a5ffb0; }
#junqiDeployPanel { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.6); padding: 12px 16px; border-radius: 14px;
    pointer-events: auto; text-align: center; }
#junqiDeployTip { color: #ffe082; font-size: 13px; margin-bottom: 10px; }
#junqiResignBtn { position: absolute; bottom: 18px; right: 14px; margin: 0; padding: 8px 14px; }
#junqiExitBtn { position: absolute; top: 12px; left: 14px; margin: 0; padding: 8px 14px; }
#junqiRulesBtn { position: absolute; top: 12px; right: 14px; margin: 0; padding: 8px 14px; }


/* ============================================================
   首页模式平铺入口（v1.6.2 / 首页美化）
   ============================================================ */
.home-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin: 0 auto;
}
@media (max-width: 480px) {
    .home-mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
.home-mode-tile {
    position: relative;
    border: 1px solid #e2e8ee;
    border-radius: 18px;
    cursor: pointer;
    padding: 18px 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 800;
    color: #4a5a68;
    letter-spacing: 0.02em;
    background: #f4f6f8;
    box-shadow: 0 4px 12px rgba(50, 70, 90, 0.06);
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease, border-color 0.18s ease;
    overflow: hidden;
    isolation: isolate;
}
.home-mode-tile::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: #9aa8b5;
    border-radius: 18px 0 0 18px;
    pointer-events: none;
    z-index: 0;
}
.home-mode-tile::after {
    content: '';
    position: absolute;
    width: 90px; height: 90px;
    right: -28px; bottom: -32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    pointer-events: none;
    z-index: 0;
}
.home-mode-tile > * { position: relative; z-index: 1; }
.home-mode-tile:hover:not(.locked) {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(50, 70, 90, 0.1);
    border-color: #d0d8e0;
    filter: none;
}
.home-mode-tile:active:not(.locked) { transform: scale(0.97); }
.home-mode-tile .tile-icon {
    font-size: 30px;
    line-height: 1;
    filter: none;
    opacity: 0.92;
    transition: transform 0.2s ease;
}
.home-mode-tile:hover:not(.locked) .tile-icon { transform: scale(1.08); }
.home-mode-tile .tile-name { font-size: 14px; font-weight: 800; color: #3d4f5f; }
.home-mode-tile .tile-desc {
    font-size: 10px;
    font-weight: 600;
    color: #7a8b99;
    opacity: 1;
    letter-spacing: 0.04em;
}
.home-mode-tile.locked {
    background: #eef1f4 !important;
    border-color: #e2e6ea !important;
    box-shadow: none !important;
    opacity: 0.78;
    cursor: not-allowed;
    filter: grayscale(0.55);
    color: #8a96a0;
}
.home-mode-tile.locked::before { background: #c5ccd3 !important; }
.home-mode-tile.locked:hover { transform: none; filter: grayscale(0.55); }
.home-mode-tile.locked .tile-icon { filter: none; opacity: 0.7; }
.home-mode-tile.locked .tile-name,
.home-mode-tile.locked .tile-desc { color: #8a96a0; }

/* 各模式：柔和彩底 + 侧条，有辨识度但不刺眼 */
.home-mode-tile.mode-1 {
    background: linear-gradient(160deg, #eef1fb 0%, #e4e9f8 100%);
    border-color: #cfd8f0;
}
.home-mode-tile.mode-1::before { background: #7d8fd4; }
.home-mode-tile.mode-2 {
    background: linear-gradient(160deg, #fdf0f3 0%, #f7e2e8 100%);
    border-color: #efd0d8;
}
.home-mode-tile.mode-2::before { background: #d08a9a; }
.home-mode-tile.mode-3 {
    background: linear-gradient(160deg, #eaf6f0 0%, #dcefe5 100%);
    border-color: #c5e2d2;
}
.home-mode-tile.mode-3::before { background: #5fad8a; }
.home-mode-tile.mode-4 {
    background: linear-gradient(160deg, #fdf3ea 0%, #f6e6d6 100%);
    border-color: #ecd4bc;
}
.home-mode-tile.mode-4::before { background: #d4a06a; }
.home-mode-tile.mode-5 {
    background: linear-gradient(160deg, #f3eefb 0%, #e8e0f5 100%);
    border-color: #d6ccec;
}
.home-mode-tile.mode-5::before { background: #9a82c4; }
.home-mode-tile.junqi-tile,
.home-mode-tile.mode-6 {
    background: linear-gradient(160deg, #eef6eb 0%, #e0edd9 100%);
    border-color: #c8ddbf;
}
.home-mode-tile.junqi-tile::before,
.home-mode-tile.mode-6::before { background: #6fa86a; }
.home-mode-tile .tile-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.88);
    color: #5f8a62;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(160, 190, 150, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2;
}
.home-mode-tile.junqi-tile .tile-tag {
    background: #eef7ea;
    color: #4f8a52;
    border-color: #c5dfc0;
    box-shadow: none;
}

/* 入场交错动画 */
.home-mode-tile {
    animation: tilePop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.home-mode-tile:nth-child(1) { animation-delay: 0.05s; }
.home-mode-tile:nth-child(2) { animation-delay: 0.1s; }
.home-mode-tile:nth-child(3) { animation-delay: 0.15s; }
.home-mode-tile:nth-child(4) { animation-delay: 0.2s; }
.home-mode-tile:nth-child(5) { animation-delay: 0.25s; }
.home-mode-tile:nth-child(6) { animation-delay: 0.3s; }
@keyframes tilePop {
    from { opacity: 0; transform: translateY(12px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .float-blob, .float-brick, .home-mode-tile, .home-hero, .home-panel {
        animation: none !important;
    }
}

/* 军棋 HUD 窄屏防重叠：布局面板与右下认输错层（v1.6.2） */
@media (max-width: 540px) {
    #junqiResignBtn { bottom: 96px; }
    #junqiTurnBar { top: 56px; font-size: 13px; padding: 7px 16px; max-width: 88vw; white-space: normal; text-align: center; }
}

/* ============================================================
   联机大厅 / 创建房间（美化）
   ============================================================ */
.mp-lobby-overlay {
    background: rgba(40, 48, 56, 0.42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.mp-lobby-card {
    width: min(720px, 96vw) !important;
    max-width: 96vw !important;
    padding: 20px 22px 16px !important;
    border-radius: 28px !important;
    text-align: left !important;
    background:
        radial-gradient(ellipse 80% 50% at 8% 0%, rgba(120, 145, 220, 0.1), transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(140, 190, 180, 0.08), transparent 50%),
        #fafbfe !important;
    box-shadow:
        0 22px 56px rgba(60, 80, 140, 0.14),
        0 1px 0 rgba(255, 255, 255, 0.95) inset !important;
    border: 1px solid #e6eaf4;
}

/* 顶栏 */
.mp-lobby-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    margin-bottom: 6px;
    border-bottom: 1px solid #eef0f5;
}
.mp-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 14px;
    border: 1px solid #e6e9f0;
    border-radius: 999px;
    background: #f7f8fc;
    color: #455a64;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
    width: auto;
}
.mp-chip-btn:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(60, 80, 120, 0.1);
}
.mp-chip-btn:active { transform: scale(0.97); }
.mp-chip-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #8fae96;
    box-shadow: 0 0 0 3px rgba(143, 174, 150, 0.2);
    animation: pulse 1.6s infinite;
}
.mp-join-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f4f6fb;
    border: 1px solid #e6e9f0;
    border-radius: 999px;
    padding: 4px 4px 4px 14px;
}
.mp-join-label {
    font-size: 12px;
    font-weight: 700;
    color: #78909c;
    white-space: nowrap;
}
.mp-join-input {
    width: 72px;
    margin: 0;
    padding: 7px 4px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: #263238;
    outline: none;
}
.mp-join-input::placeholder {
    letter-spacing: 0;
    font-weight: 600;
    color: #b0bec5;
}
.mp-join-go {
    margin: 0;
    padding: 8px 14px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #6b8fd6, #7a7ec9);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    width: auto;
    box-shadow: 0 4px 10px rgba(100, 120, 190, 0.22);
}
.mp-join-go:active { transform: scale(0.97); }

/* 品牌标题 */
.mp-lobby-brand {
    text-align: center;
    padding: 8px 0 16px;
}
.mp-lobby-icon {
    width: 48px; height: 48px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border-radius: 16px;
    background: linear-gradient(145deg, #eef1fb, #ebe6f7);
    box-shadow: 0 6px 14px rgba(120, 130, 200, 0.14);
}
.mp-lobby-title {
    margin: 0 0 4px !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    color: #4a5f9a !important;
    letter-spacing: 0.04em;
}
.mp-lobby-desc {
    margin: 0 !important;
    font-size: 12px !important;
    color: #8a94a8 !important;
    font-weight: 600;
}

/* 双栏：创建 / 列表 */
.mp-lobby-initial {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 0;
    min-height: 300px;
}
.mp-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.mp-create-col {
    padding-right: 18px;
    border-right: 1px solid #eef0f5;
}
.mp-list-col {
    padding-left: 18px;
}
.mp-col-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 800;
    color: #37474f;
    letter-spacing: 0.02em;
}
.mp-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}
.mp-list-head .mp-col-title { margin: 0; }
.mp-list-badge {
    font-size: 10px;
    font-weight: 800;
    color: #6b74b0;
    background: #eef0fb;
    padding: 3px 8px;
    border-radius: 999px;
}

.mp-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}
.mp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}
.mp-field-label {
    font-size: 12px;
    font-weight: 700;
    color: #607d8b;
}
.mp-field-label em {
    font-style: normal;
    font-weight: 600;
    color: #b0bec5;
    margin-left: 4px;
}
.mp-field-hint {
    margin: 0 !important;
    font-size: 11px !important;
    color: #b0bec5 !important;
    line-height: 1.4 !important;
}
.mp-input {
    width: 100%;
    margin: 0;
    padding: 11px 14px;
    border: 1.5px solid #e6e9f0;
    border-radius: 14px;
    background: #f8f9fc;
    font-size: 14px;
    font-weight: 600;
    color: #263238;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    text-align: left;
    box-sizing: border-box;
}
.mp-input:focus {
    border-color: #a8b6c4;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(120, 140, 160, 0.12);
}
.mp-select {
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #90a4ae 50%),
        linear-gradient(135deg, #90a4ae 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 32px;
    cursor: pointer;
}
.mp-mode-pill {
    padding: 11px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eef1fb, #f3eef9);
    border: 1.5px solid #d4daf2;
    color: #5a65a8;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
}
.mp-create-btn {
    margin: 4px 0 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    border-radius: 16px !important;
    padding: 13px 18px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #6b8fd6 0%, #7a7ec9 100%) !important;
    box-shadow: 0 10px 22px rgba(100, 120, 190, 0.28) !important;
}
.mp-create-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

/* 房间列表 */
.mp-room-list {
    flex: 1;
    min-height: 220px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e8ecf6;
    border-radius: 16px;
    padding: 10px;
    background: linear-gradient(180deg, #f5f7fc 0%, #f8f9fc 100%);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mp-room-list::-webkit-scrollbar { width: 6px; }
.mp-room-list::-webkit-scrollbar-thumb {
    background: #cfd8dc;
    border-radius: 3px;
}
.mp-room-empty {
    margin: auto;
    padding: 28px 12px;
    text-align: center;
    color: #90a4ae;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
}
.mp-room-empty::before {
    content: '🏠';
    display: block;
    font-size: 28px;
    margin-bottom: 8px;
    opacity: 0.7;
}
.mp-room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eef0f5;
    box-shadow: 0 2px 6px rgba(40, 60, 100, 0.04);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.mp-room-item:hover {
    border-color: #cfd8f0;
    box-shadow: 0 6px 14px rgba(100, 120, 190, 0.12);
}
.mp-room-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    text-align: left;
}
.mp-room-id {
    font-size: 15px;
    font-weight: 900;
    color: #3d8f9a;
    letter-spacing: 0.12em;
}
.mp-room-sub {
    font-size: 12px;
    color: #7a8b99;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mp-room-sub .mode { color: #c4874a; font-weight: 700; }
.mp-room-join {
    margin: 0 !important;
    margin-bottom: 0 !important;
    padding: 7px 14px !important;
    width: auto !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    flex-shrink: 0;
    background: linear-gradient(135deg, #6b8fd6, #7a7ec9) !important;
    box-shadow: 0 4px 10px rgba(100, 120, 190, 0.22) !important;
}

/* 等待区 */
.mp-lobby-waiting {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 12px;
}
.mp-wait-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #e8f6f5 0%, #eef1fb 100%);
    border: 1px solid #d4e8e6;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}
.mp-wait-code, .mp-wait-count {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mp-wait-count { text-align: right; align-items: flex-end; }
.mp-wait-label {
    font-size: 11px;
    font-weight: 700;
    color: #78909c;
    letter-spacing: 0.04em;
}
.mp-code-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mp-wait-code strong {
    font-size: 28px;
    letter-spacing: 0.22em;
    color: #2f8f8a;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.mp-copy-btn {
    margin: 0;
    padding: 5px 10px;
    border: 1px solid #b8ddd9;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #2f8f8a;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    width: auto;
    transition: background 0.15s, color 0.15s, transform 0.12s;
}
.mp-copy-btn:hover { background: #fff; }
.mp-copy-btn:active { transform: scale(0.96); }
.mp-copy-btn.is-copied {
    background: #e5f5ef;
    color: #3d8f6a;
    border-color: #b5dfc8;
}
.mp-wait-count strong {
    font-size: 22px;
    color: #37474f;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* 状态条 */
.mp-wait-status {
    text-align: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #5a65a8;
    background: #eef0fb;
    border: 1px solid #d8ddf2;
    letter-spacing: 0.02em;
}
.mp-wait-status.is-ready {
    color: #3d8f6a;
    background: #e5f5ef;
    border-color: #c0e6d2;
}

.mp-wait-body {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 12px;
    align-items: stretch;
}
.mp-wait-info {
    background: #f7f8fc;
    border: 1px solid #eef0f5;
    border-radius: 18px;
    padding: 14px;
    text-align: left;
    display: flex;
    flex-direction: column;
}
.mp-info-list {
    list-style: none;
    margin: 0 0 4px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mp-info-list li {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    font-size: 13px;
}
.mp-info-k {
    color: #90a4ae;
    font-weight: 700;
    font-size: 12px;
}
.mp-info-v {
    color: #37474f;
    font-weight: 800;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mp-info-mode-row {
    align-items: start;
}
.mp-mode-chip {
    justify-self: end;
    display: inline-block;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff3e8;
    color: #c4874a !important;
    border: 1px solid #f0d8bc;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    word-break: break-word;
}
.mp-host-settings {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #dfe3ea;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mp-invite-btn {
    margin: 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    border-radius: 14px !important;
    padding: 11px !important;
    font-size: 13px !important;
    background: linear-gradient(135deg, #e8a07a, #d98b8b) !important;
    box-shadow: 0 8px 16px rgba(210, 130, 120, 0.22) !important;
}
.mp-guest-hint {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #eef0fb;
    color: #5a65a8;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    border: 1px solid #d8ddf2;
}
.mp-wait-players {
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-align: left;
    background: #f7f8fc;
    border: 1px solid #eef0f5;
    border-radius: 18px;
    padding: 14px;
}
.mp-wait-players .mp-list-head {
    margin-bottom: 10px;
}
.mp-wait-players .mp-col-title { margin: 0; }
.mp-players-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 88px;
    max-height: 160px;
    overflow-y: auto;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #eef0f5;
    padding: 8px;
    border-radius: 14px;
}
.mp-personalize {
    background: #fff;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid #eef0f5;
}
.mp-personalize-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.mp-color-label {
    font-size: 12px;
    color: #78909c;
    font-weight: 700;
}
.mp-lobby-card .color-picker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 1px 3px rgba(60, 80, 100, 0.12);
    transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
    /* 再压一点饱和度，避免 raw hex 仍偏艳 */
    filter: saturate(0.78) brightness(0.98);
}
.mp-lobby-card .color-picker:hover { transform: scale(1.1); }
.mp-lobby-card .color-picker.is-selected {
    border-color: #6a7886;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(60, 80, 100, 0.16);
    filter: saturate(0.85) brightness(1);
}
.mp-avatar-btn {
    margin: 0 0 0 auto;
    padding: 5px 10px;
    border: 1px solid #e0e4ef;
    border-radius: 999px;
    background: #f7f8fc;
    color: #546e7a;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    width: auto;
}
.mp-avatar-btn:hover { background: #eef1f6; }
.mp-wait-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}
.mp-start-btn {
    flex: 1.5;
    margin: 0 !important;
    margin-bottom: 0 !important;
    border-radius: 16px !important;
    padding: 13px 16px !important;
    font-size: 15px !important;
    background: linear-gradient(135deg, #5fad8a 0%, #6bb89a 100%) !important;
    box-shadow: 0 10px 20px rgba(80, 160, 130, 0.24) !important;
    transition: filter 0.15s, box-shadow 0.15s, opacity 0.2s !important;
}
.mp-start-btn.is-ready {
    filter: none;
    background: linear-gradient(135deg, #4fa57e 0%, #5fad8a 100%) !important;
    box-shadow: 0 12px 24px rgba(80, 160, 130, 0.3) !important;
}
.mp-leave-btn {
    flex: 1;
    margin: 0;
    padding: 13px 14px;
    border: 1px solid #e6e9f0;
    border-radius: 16px;
    background: #f4f6fb;
    color: #607d8b;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    width: auto;
    transition: background 0.15s, color 0.15s;
}
.mp-leave-btn:hover {
    background: #e9edf5;
    color: #455a64;
}
.mp-close-btn {
    display: block;
    width: 100%;
    margin: 4px 0 0;
    padding: 12px;
    border: none;
    border-radius: 14px;
    background: #f4f6fb;
    color: #90a4ae;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.mp-close-btn:hover {
    color: #546e7a;
    background: #e9edf5;
}
.mp-lobby-card.is-waiting .mp-close-btn {
    margin-top: 2px;
}

/* 进入等待房后收起大厅顶栏与品牌区，界面更聚焦 */
.mp-lobby-card.is-waiting .mp-lobby-topbar,
.mp-lobby-card.is-waiting .mp-lobby-brand {
    display: none;
}
.mp-lobby-card.is-waiting {
    padding-top: 18px !important;
}

.mp-player-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1.5px solid #e8ecf3;
    background: #fafbff;
    transition: border-color 0.15s, background 0.15s;
}
.mp-player-row.is-host {
    background: #f4f7f5;
    border-color: #d0dbd4;
}
.mp-player-avatar {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    border: 1px solid #000;
    border-radius: 6px;
    flex-shrink: 0;
}
.mp-player-avatar-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.mp-player-name {
    font-weight: 800;
    color: #37474f;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.mp-me-tag {
    font-size: 10px;
    font-weight: 800;
    color: #5f7080;
    background: #eef2f5;
    padding: 2px 7px;
    border-radius: 999px;
}
.mp-host-tag {
    margin-left: auto;
    font-size: 10px;
    font-weight: 800;
    color: #5a7260;
    background: #e8efea;
    padding: 2px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .mp-lobby-card { padding: 16px 14px 12px !important; border-radius: 22px !important; }
    .mp-lobby-initial {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .mp-create-col {
        padding-right: 0;
        border-right: none;
        padding-bottom: 14px;
        border-bottom: 1px solid #eef0f5;
    }
    .mp-list-col { padding-left: 0; }
    .mp-room-list { min-height: 160px; max-height: 220px; }
    .mp-wait-body { grid-template-columns: 1fr; }
    .mp-wait-actions { flex-direction: column; }
    .mp-join-box { width: 100%; justify-content: flex-end; }
    .mp-lobby-topbar { flex-direction: column; align-items: stretch; }
}
