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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f8ff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    width: 800px;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 标题部分 */
.game-header {
    text-align: center;
    padding: 20px;
    background-color: #ff6b6b;
    color: white;
}

.game-header h1 {
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* 游戏展示区 */
.game-main {
    position: relative;
    height: 300px;
    background-color: #87ceeb;
    overflow: hidden;
}

.game-area {
    position: relative;
    height: 100%;
    width: 100%;
}

/* 地面 */
.ground {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 50px;
    background-color: #8b4513;
}

/* 怪兽容器 */
.monster-container {
    position: absolute;
    bottom: 50px;
    width: 100px;
    height: 100px;
    transition: left 0.5s ease, right 0.5s ease;
}

.monster-container.left {
    left: 50px;
}

.monster-container.right {
    right: 50px;
}

/* 怪兽 */
.monster {
    width: 100px;
    height: 100px;
    border-radius: 50% 50% 30% 30%;
    position: relative;
    animation: monster-swing 2s infinite ease-in-out;
}

/* 左边怪兽 */
.monster-container.left .monster {
    background-color: #ff69b4;
}

/* 右边怪兽 */
.monster-container.right .monster {
    background-color: #98fb98;
}

@keyframes monster-swing {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

.monster-eye {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    top: 30px;
}

.monster-eye.left {
    left: 25px;
}

.monster-eye.right {
    right: 25px;
}

.monster-eye::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: black;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.monster-mouth {
    position: absolute;
    width: 40px;
    height: 20px;
    background-color: #ff1493;
    border-radius: 0 0 40px 40px;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
}

/* 城堡 */
.castle {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 150px;
}

/* 城堡屋顶 */
.castle::before {
    content: '';
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 80px solid #8b0000;
}

/* 城堡墙壁 */
.castle::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 120px;
    height: 80px;
    background-color: #a52a2a;
    border-radius: 5px;
}

/* 城堡大门 */
.castle-door {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 40px;
    background-color: #654321;
    border-radius: 5px 5px 0 0;
    z-index: 2;
}

/* 食物 */
.food {
    position: absolute;
    bottom: 70px;
    width: 30px;
    height: 30px;
    background-color: #ffd700;
    border-radius: 50%;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.food::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 15px;
    background-color: #228b22;
}

.food.left-food {
    left: 100px;
}

.food.right-food {
    right: 100px;
}

/* 操作区域 */
.game-footer {
    padding: 20px;
    background-color: #f5f5f5;
}

/* 开始游戏按钮 */
.start-container {
    text-align: center;
    padding: 20px;
}

.start-btn {
    padding: 15px 40px;
    font-size: 1.5rem;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.start-btn:hover {
    background-color: #45a049;
}

/* 游戏进行时的界面 */
.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.question-area {
    width: 30%;
    text-align: center;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.question {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    padding: 10px;
    font-size: 1rem;
    background-color: #e0e0e0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.option:hover {
    background-color: #bdbdbd;
}

.option.correct {
    background-color: #4caf50;
    color: white;
}

.option.incorrect {
    background-color: #f44336;
    color: white;
}

.option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* 分数区 */
.score-area {
    width: 30%;
    text-align: center;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.score {
    margin-bottom: 20px;
}

.player-name {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: #555;
}

.stars-container {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
}

.star {
    width: 25px;
    height: 25px;
    background-color: #e0e0e0;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    transition: background-color 0.3s ease;
}

.star.active {
    background-color: #ffd700;
}

.restart-btn {
    padding: 10px 30px;
    font-size: 1rem;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: auto;
}

.restart-btn:hover {
    background-color: #ff5252;
}

/* 胜利特效样式 */
.victory-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    display: none;
}

/* 胜利光环 */
.victory-halo {
    position: absolute;
    top: 50%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    box-shadow: 0 0 50px 20px rgba(255, 215, 0, 0.8), 0 0 100px 40px rgba(255, 215, 0, 0.3);
    animation: victory-halo-pulse 2s infinite ease-in-out;
    transform: translateY(-50%);
}

.victory-halo.left {
    left: 100px;
}

.victory-halo.right {
    right: 100px;
}

/* 胜利爆炸粒子 */
.victory-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #ffd700;
    border-radius: 50%;
    pointer-events: none;
}

/* 获胜文字 */
.victory-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: victory-text-appear 1s ease-in-out forwards;
}

/* 动画效果 */
@keyframes victory-halo-pulse {
    0%, 100% {
        transform: translateY(-50%) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-50%) scale(1.2);
        opacity: 1;
    }
}

@keyframes victory-text-appear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 获胜怪兽的特效 */
.monster-container.victory {
    animation: monster-victory 0.6s ease-in-out forwards;
}

@keyframes monster-victory {
    0% {
        transform: scale(1);
    }
    20% {
        transform: scale(1.2);
    }
    40% {
        transform: scale(0.9);
    }
    60% {
        transform: scale(1.1);
    }
    80% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.3);
    }
}

/* 失败怪兽的特效 */
.monster-container.defeat {
    opacity: 0.5;
    animation: monster-defeat 0.6s ease-in-out forwards;
}

@keyframes monster-defeat {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0.8);
    }
}