* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    overflow: hidden;
    background: linear-gradient(to bottom, #1a1a2e, #16213e);
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    display: block;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
    border-radius: 0;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#poem-text {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 24px;
    font-weight: 300;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.9);
    text-align: center;
    max-width: 80%;
    font-style: italic;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    letter-spacing: 2px;
}

#poem-text.show {
    opacity: 1;
}

#score {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#instructions {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#start-screen, #game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: white;
}

h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
}

h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.poem-title {
    font-size: 20px;
    font-style: italic;
    margin-bottom: 30px;
    opacity: 0.9;
}

button {
    padding: 15px 40px;
    font-size: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

button:active {
    transform: translateY(0);
}

#audio-upload {
    margin-top: 30px;
    text-align: center;
}

#audio-upload label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
}

#audio-file {
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: white;
}

#final-score {
    font-size: 24px;
    margin-bottom: 30px;
}


#timeline-editor {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    max-width: 600px;
}

#timeline-editor h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

#timeline-editor p {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 10px;
}

#timeline-config {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: white;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
}

#save-timeline-btn, #edit-timeline-btn {
    margin-top: 10px;
    padding: 10px 25px;
    font-size: 16px;
}

#edit-timeline-btn {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    margin-bottom: 15px;
}
