* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: #0f1c2e;
    color: #fff;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

#ui-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 10;
}

#score-display,
#evolution-display,
#health-display,
#combo-display {
    background: rgba(15, 28, 46, 0.8);
    border: 2px solid #4a9eff;
    border-radius: 10px;
    padding: 10px 20px;
    text-align: center;
    min-width: 120px;
}

#combo-display {
    border-color: #ffd700;
}

#combo-display span {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
}

.multiplier {
    font-size: 16px !important;
    color: #fff !important;
    margin-top: 5px;
}

.label {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

#health-bar {
    width: 100%;
    height: 10px;
    background: #333;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

#health-bar::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff6666);
    transition: width 0.3s ease;
}

#spirit-display {
    background: rgba(15, 28, 46, 0.8);
    border: 2px solid #00bfff;
    border-radius: 10px;
    padding: 10px 20px;
    text-align: center;
    min-width: 120px;
}

#spirit-bar {
    width: 100%;
    height: 10px;
    background: #333;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

#spirit-bar::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #00bfff, #00ffff);
    transition: width 0.3s ease;
}

#skill-bar {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.skill-icon {
    width: 60px;
    height: 60px;
    background: rgba(15, 28, 46, 0.8);
    border: 2px solid #4a9eff;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.skill-icon.ready {
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.skill-icon.cooldown {
    border-color: #ff4444;
    opacity: 0.6;
}

.skill-icon.locked {
    border-color: #666;
    opacity: 0.3;
    cursor: not-allowed;
}

.skill-icon:hover:not(.locked) {
    transform: translateY(-5px);
}

.skill-key {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 2px;
}

.skill-name {
    font-size: 10px;
    color: #ccc;
}

.cooldown-text {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 12px;
    font-weight: bold;
    color: #ff4444;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 4px;
    border-radius: 3px;
}

#controls-hint {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(15, 28, 46, 0.8);
    border: 1px solid #4a9eff;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 12px;
    color: #4a9eff;
    z-index: 10;
}

#controls-hint p {
    margin: 0;
}

.pause-controls {
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid #4a9eff;
    border-radius: 10px;
    padding: 20px 40px;
    margin-bottom: 30px;
}

.pause-controls .control-group {
    margin-bottom: 20px;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 28, 46, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.screen h1 {
    font-size: 48px;
    color: #4a9eff;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(74, 158, 255, 0.5);
}

.screen h2 {
    font-size: 36px;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.subtitle {
    font-size: 18px;
    color: #888;
    margin-bottom: 40px;
}

.instructions {
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid #4a9eff;
    border-radius: 10px;
    padding: 20px 40px;
    margin-bottom: 40px;
    text-align: left;
}

.instructions p {
    margin: 10px 0;
    font-size: 14px;
    color: #ccc;
}

button {
    background: linear-gradient(135deg, #4a9eff, #2d7dd2);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(74, 158, 255, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.5);
}

button:active {
    transform: translateY(0);
}

.final-score,
.final-stage {
    font-size: 20px;
    color: #ccc;
    margin: 10px 0;
}

.final-score span,
.final-stage span {
    color: #4a9eff;
    font-weight: bold;
    font-size: 24px;
}

.death-message {
    font-size: 22px;
    color: #ff6b6b;
    font-weight: bold;
    margin: 20px 0;
    text-align: center;
    padding: 15px 30px;
    background: rgba(255, 107, 107, 0.1);
    border-left: 4px solid #ff6b6b;
    border-radius: 5px;
}

.stage-description {
    font-size: 18px;
    color: #ffd700;
    font-style: italic;
    margin: 15px 0;
    text-align: center;
    padding: 10px 20px;
    background: rgba(255, 215, 0, 0.1);
    border-left: 4px solid #ffd700;
    border-radius: 5px;
}

#evolution-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 28, 46, 0.95);
    border: 3px solid #ffd700;
    border-radius: 20px;
    padding: 30px 50px;
    text-align: center;
    z-index: 50;
    animation: fadeInOut 3s ease forwards;
}

#evolution-message h3 {
    font-size: 28px;
    color: #ffd700;
    margin-bottom: 10px;
}

#evolution-message p {
    font-size: 18px;
    color: #fff;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

@media (max-width: 768px) {
    #ui-overlay {
        flex-direction: column;
        align-items: flex-start;
    }

    #score-display,
    #evolution-display,
    #health-display {
        margin-bottom: 10px;
        min-width: 100px;
    }

    .screen h1 {
        font-size: 32px;
    }

    .instructions {
        padding: 15px 25px;
        font-size: 12px;
    }

    button {
        padding: 12px 30px;
        font-size: 16px;
    }

    #skill-bar {
        bottom: 20px;
        gap: 5px;
    }

    .skill-icon {
        width: 50px;
        height: 50px;
    }

    .skill-key {
        font-size: 14px;
    }

    .skill-name {
        font-size: 9px;
    }

    #controls-hint {
        font-size: 10px;
        padding: 8px 10px;
        bottom: 80px;
        left: 10px;
        right: 10px;
    }
}