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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at center, #0a0a2e 0%, #000 100%);
}

#gameCanvas {
    display: block;
    background: linear-gradient(180deg, #000010 0%, #0a0a2e 50%, #1a0a3e 100%);
    box-shadow: 0 0 40px rgba(80, 80, 200, 0.3);
    touch-action: none;
}

/* HUD */
#hud {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 480px;
    max-width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    color: #fff;
    font-size: 14px;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 5;
}

.hud-left, .hud-right {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hud-right {
    text-align: right;
}

.hud-item {
    letter-spacing: 1px;
}

.hud-item span {
    color: #ffd93d;
    font-weight: bold;
}

/* 覆盖层 */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 20, 0.85);
    backdrop-filter: blur(4px);
    color: #fff;
    z-index: 10;
    text-align: center;
    padding: 20px;
}

.title {
    font-size: 52px;
    margin-bottom: 16px;
    background: linear-gradient(90deg, #4dd2ff, #ffd93d, #ff6b9d);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(77, 210, 255, 0.5);
    letter-spacing: 4px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: brightness(1); }
    to { filter: brightness(1.3); }
}

.subtitle {
    font-size: 18px;
    color: #aaa;
    margin-bottom: 28px;
}

.instructions {
    margin-bottom: 28px;
    color: #ccc;
    font-size: 15px;
    line-height: 2;
}

.key {
    display: inline-block;
    padding: 2px 10px;
    margin: 0 4px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    font-family: monospace;
    color: #4dd2ff;
}

.powerup-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
    margin-bottom: 32px;
    font-size: 14px;
    color: #ccc;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-item .icon {
    font-size: 18px;
}

.btn {
    padding: 12px 40px;
    font-size: 18px;
    color: #fff;
    background: linear-gradient(135deg, #4dd2ff 0%, #4d7cff 100%);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    letter-spacing: 2px;
    box-shadow: 0 4px 20px rgba(77, 124, 255, 0.5);
    transition: transform 0.15s, box-shadow 0.15s;
    margin: 6px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 26px rgba(77, 124, 255, 0.7);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #888 0%, #555 100%);
    box-shadow: 0 4px 20px rgba(120, 120, 120, 0.4);
}

.final-stats {
    font-size: 20px;
    line-height: 2;
    margin-bottom: 24px;
    color: #ddd;
}

.final-stats span {
    color: #ffd93d;
    font-weight: bold;
}

.new-record {
    color: #ff6b9d;
    font-size: 22px;
    font-weight: bold;
    animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-6px); }
}

#mobileControls {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    z-index: 5;
    pointer-events: none;
}

.hidden {
    display: none !important;
}

/* 响应式 */
@media (max-width: 600px) {
    .title {
        font-size: 36px;
    }
    .subtitle {
        font-size: 14px;
    }
    .instructions {
        font-size: 13px;
    }
    .powerup-legend {
        font-size: 12px;
    }
    .btn {
        padding: 10px 30px;
        font-size: 16px;
    }
}
