/* ===== 开始界面 / 响应式 / 神器与隐身样式 / 低帧模式 ===== */

        #start-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            /* 实景背景图（夜幕竞技场，CC0 贴图合成）+ 压暗渐变保证前景可读 */
            background:
                linear-gradient(180deg, rgba(6, 8, 24, 0.30) 0%, rgba(6, 8, 24, 0.12) 34%, rgba(6, 8, 24, 0.62) 72%, rgba(4, 5, 16, 0.88) 100%),
                url('../assets/ui/title_bg.png') center / cover no-repeat,
                #0a0e24;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 100;
            pointer-events: auto;
            /* visibility 延迟切换：淡出动画播完才隐藏；恢复显示时立即取消延迟 */
            transition: opacity .8s ease, visibility 0s linear 0s;
        }
        #start-screen.hidden {
            opacity: 0;
            pointer-events: none;
            /* 关键修复：仅 opacity:0 时，子元素 .hero-select/.hero-btn 的
               pointer-events:auto 会覆盖父级 none，导致开局后隐形英雄按钮
               仍拦截屏幕中央区域的点击（左键射击"有时失效"的根因）。
               visibility:hidden 使整棵子树退出命中测试。 */
            visibility: hidden;
            transition: opacity .8s ease, visibility 0s linear .8s;
        }
        #start-screen .title {
            font-size: clamp(48px, 9vw, 104px);
            font-weight: 900;
            text-align: center;
            margin-bottom: 4px;
            color: #ffd257;
            /* 像素硬描边 + 暖光，替代旧渐变文字（背景图上更聚焦） */
            text-shadow:
                0 4px 0 #7a4a08,
                0 8px 0 rgba(20, 10, 0, 0.55),
                0 0 42px rgba(255, 190, 60, 0.42),
                0 0 90px rgba(255, 160, 40, 0.22);
            letter-spacing: 6px;
            pointer-events: none;
            animation: titleFloat 3.6s ease-in-out infinite;
        }
        @keyframes titleFloat {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-7px); }
        }
        #start-screen .subtitle {
            font-size: clamp(14px, 2vw, 24px);
            color: rgba(255, 235, 190, 0.78);
            margin-bottom: 26px;
            letter-spacing: 10px;
            font-weight: 300;
            text-shadow: 0 2px 0 rgba(10, 8, 2, 0.7);
            pointer-events: none;
        }
        .hero-select {
            display: flex;
            gap: 18px;
            margin-bottom: 30px;
            flex-wrap: wrap;
            justify-content: center;
            pointer-events: auto;
            position: relative;
            z-index: 10;
            width: 100%;
            max-width: 960px;
            padding: 0 16px;
        }
        .hero-btn {
            flex: 1 1 190px;
            min-width: 150px;
            max-width: 225px;
            padding: 0 0 14px;
            font-size: clamp(14px, 1.6vw, 19px);
            font-weight: bold;
            background: linear-gradient(180deg, rgba(28, 34, 62, 0.88), rgba(14, 17, 36, 0.94));
            border: 3px solid rgba(140, 160, 220, 0.30);
            border-radius: 10px;
            color: #b8c4e8;
            cursor: pointer;
            transition: all .18s ease;
            pointer-events: auto !important;
            text-align: center;
            line-height: 1.4;
            position: relative;
            z-index: 20;
            overflow: hidden;
            box-shadow: 0 6px 0 rgba(4, 6, 16, 0.85), inset 0 2px 0 rgba(255, 255, 255, 0.08);
        }
        /* 立绘舞台区：角色 HD 立绘 + 底部光晕 */
        .hero-btn .hero-portrait {
            display: block;
            position: relative;
            height: 128px;
            margin: 0 0 10px;
            background:
                radial-gradient(ellipse at 50% 78%, rgba(120, 150, 255, 0.28), rgba(120, 150, 255, 0.0) 62%),
                linear-gradient(180deg, rgba(60, 74, 120, 0.35), rgba(24, 30, 56, 0.55));
            border-bottom: 2px solid rgba(90, 110, 170, 0.25);
        }
        .hero-btn .hero-sprite {
            display: block;
            width: 96px;
            height: 128px;
            object-fit: contain;
            margin: 0 auto;
            filter: drop-shadow(0 5px 0 rgba(4, 6, 16, 0.55));
            transition: transform .18s ease;
        }
        .hero-btn:hover {
            background: linear-gradient(180deg, rgba(44, 54, 92, 0.92), rgba(22, 27, 52, 0.95));
            border-color: rgba(190, 210, 255, 0.55);
            color: #fff;
            transform: translateY(-4px);
            box-shadow: 0 10px 0 rgba(4, 6, 16, 0.85), 0 16px 30px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.1);
        }
        .hero-btn:hover .hero-sprite { transform: scale(1.08) translateY(-3px); }
        .hero-btn.selected {
            border-color: #ffcc44;
            background: linear-gradient(180deg, rgba(88, 68, 24, 0.6), rgba(38, 30, 13, 0.94));
            color: #ffdd77;
            box-shadow: 0 6px 0 rgba(4, 6, 16, 0.85), 0 0 30px rgba(255, 200, 68, 0.30), inset 0 2px 0 rgba(255, 230, 150, 0.18);
        }
        .hero-btn.selected .hero-portrait {
            background:
                radial-gradient(ellipse at 50% 78%, rgba(255, 200, 68, 0.35), rgba(255, 200, 68, 0.0) 62%),
                linear-gradient(180deg, rgba(96, 78, 32, 0.4), rgba(44, 36, 16, 0.55));
        }
        .hero-btn.selected .hero-sprite { filter: drop-shadow(0 5px 0 rgba(4, 6, 16, 0.55)) drop-shadow(0 0 16px rgba(255, 200, 68, 0.5)); }
        /* 武器小图章：卡片右下角展示本命武器 */
        .hero-btn .hero-weapon {
            position: absolute;
            right: 8px;
            bottom: 46px;
            width: 40px;
            height: 40px;
            background: rgba(8, 10, 24, 0.72);
            border: 2px solid rgba(150, 170, 230, 0.35);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 3px 0 rgba(4, 6, 16, 0.7);
        }
        .hero-btn .hero-weapon img {
            width: 30px;
            height: 30px;
            object-fit: contain;
        }
        .hero-btn .name {
            font-size: 1.2em;
            pointer-events: none;
        }
        .hero-btn .desc {
            font-size: 0.55em;
            font-weight: normal;
            opacity: 0.72;
            margin-top: 4px;
            pointer-events: none;
        }
        #start-screen .btn-start {
            padding: 18px 60px;
            font-size: clamp(20px, 2.5vw, 32px);
            font-weight: bold;
            color: #fff;
            /* Kenney UI Pack（CC0）红色按钮贴图 */
            background: url('../assets/ui/btn_red.png') center / 100% 100% no-repeat;
            border: none;
            border-radius: 14px;
            cursor: pointer;
            transition: all .18s ease;
            box-shadow: 0 0 34px rgba(255, 100, 50, 0.3);
            letter-spacing: 2px;
            pointer-events: auto !important;
            position: relative;
            z-index: 20;
            min-width: 200px;
            text-shadow: 0 2px 0 rgba(90, 20, 8, 0.7);
        }
        #start-screen .btn-start:hover {
            transform: translateY(-2px);
            box-shadow: 0 0 54px rgba(255, 100, 50, 0.5);
            filter: brightness(1.08);
        }
        #start-screen .btn-start:active {
            transform: translateY(3px);
            filter: brightness(0.92);
        }
        #start-screen .btn-start:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }
        #start-screen .countdown {
            font-size: clamp(60px, 8vw, 100px);
            color: #ffd93d;
            font-weight: bold;
            margin-top: 20px;
            animation: pulse .5s ease-in-out infinite alternate;
            text-shadow: 0 0 40px rgba(255, 200, 50, 0.4);
            pointer-events: none;
        }
        @keyframes gradientMove {
            0%,
            100% {
                background-position: 0% 50%;
            }
            50% {
                background-position: 100% 50%;
            }
        }
        @keyframes pulse {
            0% {
                transform: scale(1);
                opacity: 1;
            }
            100% {
                transform: scale(1.2);
                opacity: 0.7;
            }
        }
        #start-screen .deco {
            position: absolute;
            border-radius: 50%;
            background: rgba(255, 200, 100, 0.05);
            pointer-events: none !important;
            z-index: 0;
            animation: float 20s ease-in-out infinite;
        }
        @keyframes float {
            0%,
            100% {
                transform: translate(0, 0) scale(1);
            }
            25% {
                transform: translate(50px, -30px) scale(1.1);
            }
            50% {
                transform: translate(-20px, 40px) scale(0.9);
            }
            75% {
                transform: translate(30px, -20px) scale(1.05);
            }
        }
        @media (max-width:768px) {
            #level-up-ui,
            #shop-ui {
                min-width: auto;
                width: 90%;
                padding: 30px 20px;
            }
            #start-screen .title {
                font-size: clamp(36px, 8vw, 60px);
            }
            #start-screen .btn-start {
                padding: 14px 40px;
                font-size: clamp(16px, 2vw, 24px);
            }
            .hero-btn {
                padding: 0 0 10px;
                min-width: 120px;
                flex: 1 1 140px;
            }
            .hero-btn .hero-portrait { height: 104px; }
            .hero-btn .hero-sprite { width: 78px; height: 104px; }
            .hero-btn .hero-weapon { width: 34px; height: 34px; bottom: 42px; }
            .hero-btn .hero-weapon img { width: 25px; height: 25px; }
            #leaderboard-box {
                min-width: auto;
                width: 90%;
                padding: 20px;
            }
            #game-over {
                padding: 30px 20px;
                min-width: auto;
                width: 90%;
            }
            #settings-box {
                min-width: auto;
                width: 90%;
                padding: 20px;
            }
            .shop-item {
                flex-wrap: wrap;
                gap: 8px;
            }
        }
        .shop-item.artifact-item {
            border: 2px solid #ffd700 !important;
            box-shadow: 0 0 30px rgba(255, 215, 0, 0.35) !important;
            background: rgba(255, 215, 0, 0.08) !important;
            animation: artifactPulse 1.8s ease-in-out infinite;
            position: relative;
        }
        .shop-item.artifact-item .name {
            color: #ffd700 !important;
            font-weight: bold;
        }
        .shop-item.artifact-item .artifact-badge {
            display: inline-block;
            background: linear-gradient(135deg, #ffd700, #ffb800);
            color: #1a1a2e;
            font-size: 12px;
            font-weight: bold;
            padding: 2px 12px;
            border-radius: 12px;
            margin-left: 8px;
            vertical-align: middle;
            animation: badgeGlow 1.2s ease-in-out infinite alternate;
            letter-spacing: 0.5px;
            text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
        }
        @keyframes artifactPulse {
            0%,
            100% {
                box-shadow: 0 0 25px rgba(255, 215, 0, 0.2), inset 0 0 15px rgba(255, 215, 0, 0.05);
            }
            50% {
                box-shadow: 0 0 50px rgba(255, 215, 0, 0.45), inset 0 0 25px rgba(255, 215, 0, 0.1);
            }
        }
        @keyframes badgeGlow {
            0% {
                box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
            }
            100% {
                box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
            }
        }
        /* 隐身条样式已并入 base.css 的 .stealth-fill（HUD 统一条形系统） */
        body.low-fps #hud-left,
        body.low-fps #hud-right,
        body.low-fps .controls-hint {
            backdrop-filter: none;
        }
        body.low-fps .hp-fill,
        body.low-fps .shield-fill,
        body.low-fps .stealth-fill,
        body.low-fps .exp-fill {
            transition: none;
        }
        /* 低帧模式：关闭纯装饰性动画，降低合成负担 */
        body.low-fps .event-text,
        body.low-fps .stealth-line,
        body.low-fps .shop-item.artifact-item,
        body.low-fps .shop-item.artifact-item .artifact-badge,
        body.low-fps #start-screen .title,
        body.low-fps #start-screen .deco,
        body.low-fps #curse-box {
            animation: none !important;
        }
        /* 键盘可达性：焦点可见但不突兀 */
        button:focus-visible,
        input:focus-visible {
            outline: 2px solid rgba(255, 204, 68, 0.7);
            outline-offset: 2px;
        }
