html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #050520;
    color: #e8eeff;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Heiti SC", Arial, sans-serif;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ===== 无障碍 / SEO 辅助文本 ===== */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== App Shell ===== */
#app {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#game {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

/* ===== HUD ===== */
.hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    z-index: 10;
    pointer-events: none;
    font-size: 13px;
    flex-wrap: wrap;
}

.hud-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.hud-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(12, 20, 44, 0.75);
    border: 1px solid rgba(80, 120, 220, 0.35);
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hud-chip .icon {
    font-size: 14px;
    opacity: 0.9;
}

.hud-chip .label {
    color: #8a96c0;
    font-size: 11px;
}

.hud-chip .value {
    color: #e8eeff;
    font-weight: 700;
    font-family: "Menlo", "Consolas", monospace;
    font-size: 14px;
}

.hud-chip.danger {
    border-color: rgba(255, 80, 110, 0.6);
    box-shadow: 0 0 12px rgba(255, 80, 110, 0.3);
}

.hud-chip.danger .value {
    color: #ff6b8a;
}

.hud-chip.combo-active {
    border-color: rgba(255, 180, 60, 0.6);
    box-shadow: 0 0 14px rgba(255, 180, 60, 0.35);
}

.hud-chip.combo-active .value {
    color: #ffcc44;
}

/* ===== Bottom Hint ===== */
.bottom-hint {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11.5px;
    color: rgba(150, 170, 220, 0.7);
    z-index: 10;
    pointer-events: none;
    padding: 0 16px;
    letter-spacing: 0.3px;
}

.bottom-hint kbd {
    display: inline-block;
    padding: 1px 6px;
    background: rgba(40, 60, 120, 0.6);
    border: 1px solid rgba(100, 140, 220, 0.5);
    border-radius: 4px;
    font-family: "Menlo", monospace;
    font-size: 10.5px;
    color: #a8b8e0;
    margin: 0 2px;
}

/* ===== Overlays ===== */
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: rgba(5, 5, 32, 0.75);
    animation: fadeIn 0.2s ease;
}

.overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== Panel ===== */
.panel {
    width: min(92vw, 480px);
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 30px;
    background: linear-gradient(160deg, rgba(18, 24, 56, 0.98), rgba(10, 14, 36, 0.98));
    border: 1px solid rgba(90, 140, 240, 0.35);
    border-radius: 18px;
    box-shadow: 0 0 0 1px rgba(120, 160, 255, 0.08),
    0 24px 60px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(80, 120, 255, 0.15);
    animation: panelIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes panelIn {
    from {
        transform: translateY(16px) scale(0.96);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.panel h1,
.panel h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
    background: linear-gradient(135deg, #4cf0ff, #a060ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.panel .subtitle {
    text-align: center;
    color: #7a86b0;
    font-size: 12px;
    letter-spacing: 4px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

/* ===== Form ===== */
.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 12px;
    color: #8a96c0;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.field select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(8, 14, 36, 0.9);
    border: 1px solid rgba(80, 120, 220, 0.35);
    border-radius: 10px;
    color: #e8eeff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%238a96c0' d='M6 8L2 4h8z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.field select:focus {
    border-color: #4cf0ff;
    box-shadow: 0 0 0 3px rgba(76, 240, 255, 0.12);
}

.field select option {
    background: #0a0e24;
    color: #e8eeff;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s, background 0.2s;
    outline: none;
    text-decoration: none;
    box-sizing: border-box;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #3a7bf5, #7a4cf5);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(80, 120, 255, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 8px 28px rgba(80, 120, 255, 0.55);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(40, 50, 100, 0.6);
    color: #c0c8e8;
    border: 1px solid rgba(100, 140, 220, 0.35);
}

.btn-secondary:hover {
    background: rgba(50, 65, 130, 0.7);
    border-color: rgba(120, 160, 255, 0.6);
}

.btn-ghost {
    margin-top: 10px;
    background: rgba(28, 40, 84, 0.5);
    color: #9fb4ff;
    border: 1px dashed rgba(100, 140, 220, 0.5);
    font-size: 14px;
}

.btn-ghost:hover {
    background: rgba(44, 62, 124, 0.72);
    color: #d6e4ff;
    border-color: rgba(140, 180, 255, 0.8);
}

.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.btn-row .btn {
    flex: 1;
}

/* ===== 更多游戏导航 ===== */
.more-games-nav {
    margin-top: 14px;
    text-align: center;
    font-size: 12.5px;
}

.more-games-nav a {
    color: #8fa6e0;
    text-decoration: none;
    border-bottom: 1px dashed rgba(120, 160, 240, 0.5);
    padding-bottom: 1px;
    transition: color 0.2s, border-color 0.2s;
}

.more-games-nav a:hover {
    color: #4cf0ff;
    border-color: #4cf0ff;
}

/* ===== Description ===== */
.desc {
    background: rgba(8, 14, 36, 0.6);
    border: 1px solid rgba(60, 90, 160, 0.25);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 12.5px;
    line-height: 1.75;
    color: #98a4cc;
    margin-bottom: 18px;
}

.desc strong {
    color: #4cf0ff;
    font-weight: 600;
}

.desc em {
    color: #ffcc44;
    font-style: normal;
    font-weight: 600;
}

/* ===== Game Over Stats ===== */
.game-over-title {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 4px;
    margin: 0 0 4px;
    background: linear-gradient(135deg, #ff6b8a, #ffcc44);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.final-score {
    text-align: center;
    margin: 16px 0 20px;
}

.final-score .label {
    font-size: 11px;
    color: #7a86b0;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.final-score .value {
    font-size: 52px;
    font-weight: 800;
    font-family: "Menlo", "Consolas", monospace;
    background: linear-gradient(135deg, #4cf0ff, #a060ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-top: 6px;
    filter: drop-shadow(0 0 20px rgba(76, 240, 255, 0.4));
}

.final-score .high {
    font-size: 12px;
    color: #7a86b0;
    margin-top: 8px;
}

.final-score .high em {
    color: #ffcc44;
    font-style: normal;
    font-weight: 700;
    font-family: "Menlo", monospace;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}

.stat-box {
    background: rgba(8, 14, 36, 0.7);
    border: 1px solid rgba(60, 90, 160, 0.25);
    border-radius: 10px;
    padding: 12px 14px;
    transition: border-color 0.2s;
}

.stat-box:hover {
    border-color: rgba(100, 160, 255, 0.5);
}

.stat-box .label {
    font-size: 11px;
    color: #7a86b0;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.stat-box .value {
    font-size: 20px;
    font-weight: 700;
    font-family: "Menlo", "Consolas", monospace;
    color: #e8eeff;
    line-height: 1;
}

.stat-box .value.good {
    color: #44ff88;
}

.stat-box .value.bad {
    color: #ff6b8a;
}

.stat-box .value.accent {
    color: #4cf0ff;
}

.stat-box .value.gold {
    color: #ffcc44;
}

/* ===== Pause Overlay ===== */
#pauseOverlay .pause-panel {
    text-align: center;
    padding: 36px 56px;
    background: rgba(10, 14, 36, 0.9);
    border: 1px solid rgba(90, 140, 240, 0.4);
    border-radius: 16px;
    box-shadow: 0 0 60px rgba(80, 120, 255, 0.25);
}

#pauseOverlay .pause-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 8px;
    background: linear-gradient(135deg, #4cf0ff, #a060ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

#pauseOverlay .pause-hint {
    font-size: 13px;
    color: #8a96c0;
    letter-spacing: 1px;
}

#pauseOverlay .pause-hint kbd {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(40, 60, 120, 0.6);
    border: 1px solid rgba(100, 140, 220, 0.5);
    border-radius: 5px;
    font-family: "Menlo", monospace;
    font-size: 12px;
    color: #a8b8e0;
    margin: 0 3px;
}

/* ===== Responsive ===== */
@media (max-width: 560px) {
    .hud {
        padding: 8px 10px;
        font-size: 11px;
        gap: 6px;
    }

    .hud-chip {
        padding: 4px 9px;
        font-size: 11px;
    }

    .hud-chip .label {
        display: none;
    }

    .hud-chip .value {
        font-size: 12px;
    }

    .panel {
        padding: 22px 20px;
    }

    .final-score .value {
        font-size: 40px;
    }

    .stat-box .value {
        font-size: 17px;
    }

    .bottom-hint {
        font-size: 10px;
    }
}

/* ===== 滚动条 ===== */
.panel::-webkit-scrollbar {
    width: 6px;
}

.panel::-webkit-scrollbar-track {
    background: transparent;
}

.panel::-webkit-scrollbar-thumb {
    background: rgba(100, 140, 220, 0.3);
    border-radius: 3px;
}