body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(to bottom, 
        #87CEEB 0%,     /* 天空蓝 */
        #98D8E8 20%,    /* 浅蓝 */
        #B0E0E6 40%,    /* 粉蓝 */
        #F0F8FF 60%,    /* 爱丽丝蓝 */
        #FFFFFF 80%,    /* 白色云层 */
        #E6F3FF 100%    /* 淡蓝白 */
    );
    font-family: 'Arial', sans-serif;
    position: relative;
    overflow: hidden;
}

/* 添加云朵效果 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.8) 15%, transparent 16%),
        radial-gradient(circle at 60% 20%, rgba(255, 255, 255, 0.6) 20%, transparent 21%),
        radial-gradient(circle at 80% 40%, rgba(255, 255, 255, 0.7) 18%, transparent 19%),
        radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.5) 25%, transparent 26%),
        radial-gradient(circle at 90% 70%, rgba(255, 255, 255, 0.6) 22%, transparent 23%),
        radial-gradient(circle at 10% 80%, rgba(255, 255, 255, 0.4) 30%, transparent 31%);
    animation: clouds 30s linear infinite;
    pointer-events: none;
}

@keyframes clouds {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(100px); }
}

.game-container {
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

h1 {
    color: white;
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.score-board {
    color: #ff8c00;
    font-size: 1.5em;
    margin-bottom: 20px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
    border: 3px solid white;
    border-radius: 10px;
    background-color: #2c3e50;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.controls {
    margin-top: 20px;
}

button {
    padding: 12px 24px;
    margin: 0 10px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#startBtn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

#startBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#endBtn {
    background: linear-gradient(45deg, #f44336, #d32f2f);
    color: white;
}

#endBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.instructions {
    margin-top: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.ai-controls {
    margin-top: 15px;
}

#aiModeBtn {
    background: linear-gradient(45deg, #9b59b6, #8e44ad);
    color: white;
    padding: 10px 20px;
    font-size: 14px;
}

#aiModeBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.ranking-board {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.ranking-board h3 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 1.3em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.rank-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-weight: bold;
}

.snake-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin: 0 10px;
}

.snake-color.red { background-color: #e74c3c; }
.snake-color.blue { background-color: #3498db; }
.snake-color.green { background-color: #27ae60; }

.rank-number {
    font-size: 1.2em;
    min-width: 25px;
}

.snake-name {
    flex: 1;
    text-align: left;
    margin-left: 10px;
}

.snake-score {
    font-size: 1.1em;
    color: #ff8c00;
}

.difficulty-controls {
    margin-top: 15px;
}

.difficulty-controls h3 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 1.1em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.difficulty-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.difficulty-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(5px);
}

.difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.difficulty-btn.active {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    border-color: #f39c12;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

.difficulty-btn.active:hover {
    background: linear-gradient(45deg, #e67e22, #d35400);
}