/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background-color: #000;
    color: #fff;
    overflow: hidden;
}

/* 游戏容器 */
#game-container {
    width: 800px;
    height: 600px;
    margin: 50px auto;
    position: relative;
    background-color: #1a1a1a;
    border: 2px solid #fff;
}

/* 战斗场景 */
#battle-scene {
    width: 100%;
    height: 100%;
    position: relative;
    display: none;
}

/* 敌人区域 */
#enemy-area {
    width: 100%;
    height: 200px;
    position: relative;
    background-color: #2a2a2a;
    border-bottom: 2px solid #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#enemy {
    width: 80px;
    height: 120px;
    position: relative;
    margin-bottom: 10px;
}

/* Sans的头部 */
#enemy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background-color: #fff;
    border-radius: 50%;
}

/* Sans的眼睛 */
#enemy::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 20px;
    background-color: transparent;
}

/* 左眼睛 */
#enemy::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 15px;
    width: 10px;
    height: 10px;
    background-color: #000;
    border-radius: 50%;
    box-shadow: 30px 0 0 #000;
}

#enemy-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

#enemy-hp {
    width: 300px;
}

.hp-bar {
    width: 100%;
    height: 10px;
    background-color: #333;
    border: 1px solid #fff;
    overflow: hidden;
}

#enemy-hp-fill {
    width: 100%;
    height: 100%;
    background-color: #f00;
}

/* 弹幕躲避区域 */
#bullet-hell-area {
    width: 100%;
    height: 200px;
    background-color: #000;
    position: relative;
    overflow: hidden;
}

#player {
    width: 20px;
    height: 20px;
    background-color: #0ff;
    position: absolute;
    top: 170px;
    left: 390px;
    border-radius: 50%;
}

/* 弹幕 */
.bullet {
    width: 8px;
    height: 8px;
    background-color: #f00;
    position: absolute;
    border-radius: 50%;
}

/* 玩家血条 */
#player-hp {
    width: 100%;
    height: 100px;
    background-color: #2a2a2a;
    border-top: 2px solid #fff;
    padding: 20px;
    display: flex;
    align-items: center;
}

.hp-label {
    font-size: 20px;
    font-weight: bold;
    margin-right: 10px;
}

#player-hp .hp-bar {
    flex: 1;
    margin: 0 10px;
}

#player-hp-fill {
    width: 100%;
    height: 100%;
    background-color: #0f0;
}

.hp-value {
    font-size: 18px;
    min-width: 60px;
}

/* 战斗按钮 */
#action-buttons {
    width: 100%;
    height: 100px;
    background-color: #2a2a2a;
    border-top: 1px solid #444;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

#action-buttons button {
    background-color: #333;
    color: #fff;
    border: 2px solid #fff;
    padding: 10px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.2s ease;
}

#action-buttons button:hover {
    background-color: #555;
    transform: scale(1.05);
}

#action-buttons button:active {
    transform: scale(0.95);
}

/* 剧情对话区域 */
#dialogue-box {
    width: 100%;
    height: 200px;
    background-color: rgba(0, 0, 0, 0.8);
    border-top: 2px solid #fff;
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 20px;
    display: none;
    flex-direction: column;
}

#dialogue-text {
    flex: 1;
    font-size: 18px;
    line-height: 1.5;
    margin-bottom: 10px;
}

#dialogue-speaker {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #0ff;
}

#next-dialogue {
    align-self: flex-end;
    background-color: #333;
    color: #fff;
    border: 2px solid #fff;
    padding: 8px 20px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
}

/* 开始界面 */
#start-screen {
    width: 100%;
    height: 100%;
    background-color: #000;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#start-screen h1 {
    font-size: 48px;
    margin-bottom: 40px;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
}

#start-screen p {
    font-size: 24px;
    color: #aaa;
}

/* 动画效果 */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#enemy {
    animation: float 2s ease-in-out infinite;
}

#start-screen p {
    animation: blink 1s ease-in-out infinite;
}

/* 响应式设计 */
@media (max-width: 800px) {
    #game-container {
        width: 100vw;
        height: 100vh;
        margin: 0;
    }
}