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

body {
    background: #0a0a0f;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Microsoft YaHei', sans-serif;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 1280px;
    height: 720px;
    background: #1a1a2e;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(100, 100, 255, 0.3);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

#hp-bar {
    width: 200px;
    height: 20px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #555;
}

#hp-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff8844);
    transition: width 0.3s;
}

#score-display {
    color: #fff;
    font-size: 16px;
    text-shadow: 2px 2px 4px #000;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 8px;
    z-index: 10;
}

.screen.hidden {
    display: none;
}

.screen h1 {
    font-size: 64px;
    color: #fff;
    text-shadow: 0 0 20px #6366f1, 0 0 40px #6366f1;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 24px;
    color: #aaa;
    margin-bottom: 40px;
}

.difficulty-select {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.diff-btn {
    padding: 15px 30px;
    font-size: 18px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.diff-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.5);
}

.controls {
    color: #888;
    text-align: center;
}

.controls h3 {
    color: #aaa;
    margin-bottom: 15px;
}

.controls p {
    margin: 8px 0;
    font-size: 14px;
}

kbd {
    background: #333;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #555;
    font-family: monospace;
}

#game-over-screen h1 {
    color: #ff4444;
    text-shadow: 0 0 20px #ff4444;
}

#game-over-screen p {
    color: #ccc;
    font-size: 20px;
    margin: 10px 0;
}

#restart-btn {
    margin-top: 30px;
    padding: 15px 40px;
    font-size: 20px;
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

#restart-btn:hover {
    transform: scale(1.05);
}