* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: row;
    gap: 40px;
    justify-content: flex-start;
    align-items: flex-start;
    min-height: 100vh;
    background-color: #2c3e50;
    font-family: Arial, sans-serif;
    padding: 20px;
    width: 100%;
}

/* 难度选择界面样式 */
.difficulty-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 62, 80, 0.95);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.difficulty-menu {
    background-color: #34495e;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 90%;
    width: 400px;
}

.difficulty-menu h2 {
    color: #ecf0f1;
    margin-bottom: 25px;
    font-size: 28px;
}

.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.difficulty-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    width: 100%;
    margin: 0;
}

.difficulty-btn:hover {
    transform: translateY(-2px);
}

.difficulty-btn[data-level="easy"] {
    background-color: #2ecc71;
}
.difficulty-btn[data-level="easy"]:hover {
    background-color: #27ae60;
}

.difficulty-btn[data-level="normal"] {
    background-color: #3498db;
}
.difficulty-btn[data-level="normal"]:hover {
    background-color: #2980b9;
}

.difficulty-btn[data-level="hard"] {
    background-color: #e67e22;
}
.difficulty-btn[data-level="hard"]:hover {
    background-color: #d35400;
}

.difficulty-btn[data-level="hell"] {
    background-color: #e74c3c;
    border: 2px solid #c0392b;
}
.difficulty-btn[data-level="hell"]:hover {
    background-color: #c0392b;
}

.level-name {
    font-size: 20px;
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
}

.level-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.game-container {
    position: relative; /* 为覆盖层定位 */
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 24px;
    color: white;
    width: 100%;
    gap: 12px;
    flex-wrap: wrap;
}

.game-controls {
    display: none;
}

button {
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    margin: 0 10px;
}

button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.game-board {
    position: relative;
    width: min(90vw, 90vh, 1200px);
    height: min(90vw, 90vh, 1200px);
    background-color: #34495e;
    border: 2px solid #95a5a6;
    border-radius: 5px;
    display: grid;
    grid-template: repeat(60, 1fr) / repeat(60, 1fr);
    gap: 1px;
    aspect-ratio: 1 / 1;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden; /* 防止陨石动画溢出 */
}

.snake-head {
    background-image: url('player-head.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(39, 174, 96, 0.5);  /* 添加发光效果 */
}

.snake-body {
    background-color: #2ecc71;  /* 浅绿色蛇身 */
    border-radius: 4px;
}

.food {
    background-image: url('food.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(241, 196, 15, 0.7);  /* 添加明显的发光效果 */
    animation: pulse 1.5s infinite;  /* 添加脉冲动画 */
}

/* 食物的脉冲动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.mobile-controls {
    margin-top: 20px;
    display: none;
    align-items: center;
    gap: 12px;
}

.horizontal-controls {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 10px 0;
}

.mobile-controls button {
    width: 64px;
    height: 64px;
    font-size: 24px;
    padding: 0;
}

.enemy {
    background-color: #e74c3c;  /* 红色敌人身体 */
    border-radius: 4px;
    position: relative;
}

.enemy-head {
    background-image: url('enemy-head.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5);  /* 添加发光效果 */
}

/* Phone and tablet layouts: touch controls and a viewport-bound start menu. */
@media (max-width: 1100px) {
    body {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        min-height: 100svh;
        padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }

    .game-title {
        width: 100%;
        align-items: center;
        text-align: center;
    }

    .game-title .title-controls {
        flex-direction: row;
        justify-content: center;
    }

    .game-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .game-board {
        width: min(92vw, 62svh);
        height: min(92vw, 62svh);
    }

    .mobile-controls {
        display: flex;
    }

    .game-instructions {
        width: min(92vw, 520px);
        margin-top: 0;
    }

    .difficulty-overlay {
        position: fixed;
        inset: 0;
        width: auto;
        height: auto;
        padding: 16px;
        overflow-y: auto;
        align-items: flex-start;
    }

    .difficulty-menu {
        width: min(100%, 420px);
        margin: auto;
        padding: 22px 16px;
    }

    .difficulty-menu h2 {
        font-size: 24px;
        margin-bottom: 18px;
    }

    button, .difficulty-btn {
        min-height: 44px;
    }

    .mobile-controls {
        gap: 8px;
    }

    .mobile-controls button {
        width: 60px;
        height: 52px;
        margin: 0;
        font-size: 28px;
        touch-action: manipulation;
    }

    .horizontal-controls {
        gap: 12px;
        margin: 0;
    }
}

@media (max-width: 600px) {
    .game-title {
        padding: 4px 0 0;
        gap: 12px;
    }

    .game-title h1 {
        font-size: clamp(22px, 7vw, 30px);
    }

    .health-display {
        width: min(100%, 360px);
        margin: 0 auto;
        padding: 10px;
    }

    .game-info {
        font-size: 18px;
        margin-bottom: 4px;
    }

    .game-board {
        width: min(94vw, 56svh);
        height: min(94vw, 56svh);
    }

    .game-instructions {
        padding: 14px;
    }

    .instruction-item {
        margin-bottom: 8px;
        padding: 8px;
    }
}

@media (orientation: landscape) and (max-height: 650px) {
    body {
        padding: 8px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
    }

    .game-title {
        width: 220px;
        padding: 8px;
        gap: 8px;
    }

    .game-title h1 { font-size: 20px; }
    .health-display { margin-top: 0; padding: 8px; }
    .health-row { margin-bottom: 3px; }
    .game-board { width: min(68vw, 82svh); height: min(68vw, 82svh); }
    .game-instructions { display: none; }
    .mobile-controls { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

.magnet {
    background-image: url('magnet.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(155, 89, 182, 0.7);
    animation: pulse 1.5s infinite;
}

.magnet-range {
    background-color: rgba(155, 89, 182, 0.2);
    position: relative;
    z-index: 0;  /* 降低z-index，确保在最底层 */
}

.snake-head, .snake-body, .enemy, .enemy-head, .food, .magnet, .rocket, .enemy-head.super {
    position: relative;
    z-index: 3;  /* 确保游戏元素在最上层 */
}

.enemy-head.super {
    background-color: #f1c40f;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.8);
    transform: scale(1.1);
    background-image: url('chaoji.webp'); /* 使用超级敌人专属头像 */
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.enemy.super {
    background-color: #f1c40f;
    border: 1px solid #d4ac0d;
}

/* 超级敌人受伤效果 - 裂纹 */
.enemy-head.super.damage-1,
.enemy.super.damage-1 {
    position: relative;
}
.enemy-head.super.damage-1::after,
.enemy.super.damage-1::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 0, 0, 0.3) 10px,
        rgba(0, 0, 0, 0.3) 12px
    );
    pointer-events: none;
    z-index: 1;
}

.enemy-head.super.damage-2,
.enemy.super.damage-2 {
    position: relative;
}
.enemy-head.super.damage-2::after,
.enemy.super.damage-2::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        rgba(0, 0, 0, 0.5) 5px,
        rgba(0, 0, 0, 0.5) 7px
    ),
    repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 5px,
        rgba(0, 0, 0, 0.5) 5px,
        rgba(0, 0, 0, 0.5) 7px
    );
    pointer-events: none;
    z-index: 1;
}

/* 可选：给磁铁效果添加边框 */
.magnet-range {
    border: 1px solid rgba(155, 89, 182, 0.3);
}

/* 当磁铁效果和蛇头重叠时的特殊样式 */
.snake-head.magnet-range {
    background-color: #27ae60;  /* 保持蛇头原来的颜色 */
}

.enemy-head.magnet-range {
    background-color: #c0392b;  /* 保持敌人头部原来的颜色 */
}

.rocket {
    background-image: url('rocket.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.7);
    animation: pulse 1.5s infinite;
}

.shield {
    background-image: url('shield.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.7);  /* 蓝色发光效果 */
    animation: pulse 1.5s infinite;
}

/* 添加护盾效果样式 */
.shield-active {
    box-shadow: 0 0 12px rgba(52, 152, 219, 0.9);  /* 蓝色发光效果 */
}

/* 添加传送门样式 */
.portal {
    background-image: url('porta.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0;
    box-shadow: 0 0 8px rgba(142, 68, 173, 0.7);  /* 紫色发光效果 */
    animation: rotate 2s linear infinite;
}

/* 传送门旋转动画 */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.bomb {
    background-image: url('bomb.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(192, 57, 43, 0.7);  /* 红色发光效果 */
    animation: pulse 1.5s infinite;
}

.explosion {
    background-color: rgba(192, 57, 43, 0.5);
    box-shadow: 0 0 16px rgba(192, 57, 43, 0.8);
    animation: explode 0.8s ease-out;
    z-index: 4;
}

/* 添加爆炸后的危险区域样式 */
.danger-zone {
    background-color: rgba(192, 57, 43, 0.3);
    box-shadow: inset 0 0 10px rgba(192, 57, 43, 0.5);
    animation: dangerPulse 2s infinite;
    z-index: 1;  /* 确保在底层 */
}

/* 爆炸动画 */
@keyframes explode {
    0% { 
        transform: scale(0) rotate(0deg);
        opacity: 1;
        background-color: rgba(192, 57, 43, 1);
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0.8;
        background-color: rgba(192, 57, 43, 0.8);
    }
    100% { 
        transform: scale(1) rotate(360deg);
        opacity: 0;
        background-color: rgba(192, 57, 43, 0.5);
    }
}

/* 火箭加速特效 - 红色火焰 */
.snake-body.rocket-boost::after,
.enemy.rocket-boost::after,
.snake-head.rocket-boost::after,
.enemy-head.rocket-boost::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 69, 0, 0.6) 0%, rgba(255, 0, 0, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    animation: firePulse 0.2s infinite alternate;
}

/* 无敌状态闪烁效果 */
.invincible {
    opacity: 0.5;
    animation: blink 0.2s infinite;
}

@keyframes blink {
    0% { opacity: 0.3; }
    50% { opacity: 0.8; }
    100% { opacity: 0.3; }
}

@keyframes firePulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.9;
    }
}
/* 危险区域脉冲动画 */
@keyframes dangerPulse {
    0% {
        background-color: rgba(192, 57, 43, 0.2);
        box-shadow: inset 0 0 10px rgba(192, 57, 43, 0.3);
    }
    50% {
        background-color: rgba(192, 57, 43, 0.3);
        box-shadow: inset 0 0 15px rgba(192, 57, 43, 0.5);
    }
    100% {
        background-color: rgba(192, 57, 43, 0.2);
        box-shadow: inset 0 0 10px rgba(192, 57, 43, 0.3);
    }
}

/* 添加屏幕震动动画 */
@keyframes shake {
    0%, 100% { transform: translate(0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-5px, -5px); }
    20%, 40%, 60%, 80% { transform: translate(5px, 5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes meteorShake {
    0%, 100% { transform: translate(0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-10px, -10px); }
    20%, 40%, 60%, 80% { transform: translate(10px, 10px); }
}

.meteor-shake {
    animation: meteorShake 0.8s ease-in-out;
}

.game-title {
    color: white;
    text-align: left;
    padding: 20px;
    font-size: 1.2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 移动按钮到标题组件中 */
.game-title .title-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 血量显示区域样式 */
.health-display {
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    min-width: 150px;
}

.health-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 16px;
}

.health-row:last-child {
    margin-bottom: 0;
}

.health-label {
    color: #ecf0f1;
    font-weight: bold;
    min-width: 50px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.health-hearts {
    color: #e74c3c;
    font-size: 20px;
    letter-spacing: 3px;
    text-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
}

.health-shields {
    color: #3498db;
    font-size: 20px;
    letter-spacing: 3px;
    text-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.health-boss {
    color: #2c3e50;
    font-size: 20px;
    letter-spacing: 3px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

/* 管理按钮样式 */
#adminButtonContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 15px;
}

.admin-button {
    padding: 5px;
    border: none;
    border-radius: 4px;
    background: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.admin-button:hover {
    transform: scale(1.05);
}

.admin-button-img {
    width: 40px;
    height: 40px;
    vertical-align: middle;
}

.admin-password-prompt {
    margin-top: 10px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    color: white;
    text-align: center;
}

.admin-password-prompt p {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.admin-password-input {
    width: 150px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
}

.admin-password-submit,
.admin-password-cancel {
    padding: 5px 10px;
    margin: 0 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.admin-password-submit {
    background: #4CAF50;
    color: white;
}

.admin-password-cancel {
    background: #999;
    color: white;
}

/* 危险区域内的传送门样式 */
.portal.danger-zone {
    background-color: rgba(192, 57, 43, 0.3);
    border: 2px solid rgba(142, 68, 173, 0.7);
    box-shadow: 0 0 8px rgba(142, 68, 173, 0.7), inset 0 0 10px rgba(192, 57, 43, 0.5);
}

/* 修改危险区域内的蛇身样式 */
.snake-body.danger-zone {
    background-color: rgba(46, 204, 113, 0.5) !important;  /* 半透明的蛇身颜色 */
}

/* 修改危险区域内的敌人身体样式 */
.enemy.danger-zone {
    background-color: rgba(231, 76, 60, 0.5) !important;  /* 半透明的敌人颜色 */
}

/* 确保所有游戏元素在危险区域上方 */
.snake-head, .snake-body, .enemy, .enemy-head, .food, .magnet, .rocket, .shield, .portal {
    position: relative;
    z-index: 2;
}

.danger-zone {
    z-index: 1;
}

.lucky-block {
    background-image: url('lucky-block.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.7);  /* 金色发光效果 */
    animation: pulse 1.5s infinite;
}

/* 生命护盾样式 - 浅蓝色圆形带+号 */
.life-shield {
    background: linear-gradient(135deg, #87CEEB 0%, #00BFFF 50%, #87CEEB 100%);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(135, 206, 235, 0.8);
    animation: shieldGlow 2s ease-in-out infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.life-shield::after {
    content: '+';
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

@keyframes shieldGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(135, 206, 235, 0.8); }
    50% { box-shadow: 0 0 15px rgba(135, 206, 235, 1), 0 0 20px rgba(0, 191, 255, 0.6); }
}

/* 生命护盾激活状态 - 蓝色条纹效果 */
.snake-body.life-shield-active {
    background: linear-gradient(90deg, 
        #2ecc71 0%, #2ecc71 20%, 
        #00BFFF 20%, #00BFFF 40%, 
        #2ecc71 40%, #2ecc71 60%, 
        #00BFFF 60%, #00BFFF 80%, 
        #2ecc71 80%, #2ecc71 100%
    ) !important;
}

.snake-head.life-shield-active {
    border: 3px solid #00BFFF !important;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.8) !important;
}

.enemy.life-shield-active {
    background: linear-gradient(90deg, 
        #e74c3c 0%, #e74c3c 20%, 
        #00BFFF 20%, #00BFFF 40%, 
        #e74c3c 40%, #e74c3c 60%, 
        #00BFFF 60%, #00BFFF 80%, 
        #e74c3c 80%, #e74c3c 100%
    ) !important;
}

.enemy-head.life-shield-active {
    border: 3px solid #00BFFF !important;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.8) !important;
}

.game-instructions {
    width: 300px;
    background-color: rgba(52, 73, 94, 0.9);
    border-radius: 10px;
    padding: 20px;
    color: white;
    margin-top: 60px;  /* 调整到垂直居中 */
}

.game-instructions h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #ecf0f1;
    font-size: 24px;
}

.instruction-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: rgba(44, 62, 80, 0.6);
    border-radius: 8px;
}

.instruction-item .icon {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.instruction-item .description {
    flex: 1;
}

.instruction-item h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #3498db;
}

.instruction-item p {
    margin: 0;
    font-size: 14px;
    color: #bdc3c7;
}

/* 确保所有图标都有正确的样式 */
.instruction-item .icon.snake-head,
.instruction-item .icon.enemy-head,
.instruction-item .icon.food,
.instruction-item .icon.magnet,
.instruction-item .icon.rocket,
.instruction-item .icon.shield,
.instruction-item .icon.portal,
.instruction-item .icon.bomb,
.instruction-item .icon.lucky-block,
.instruction-item .icon.life-shield {
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

/* 说明区域的生命护盾图标样式 */
.instruction-item .icon.life-shield {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #87CEEB 0%, #00BFFF 50%, #87CEEB 100%);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(135, 206, 235, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.instruction-item .icon.life-shield::after {
    content: '+';
    color: white;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

/* 分身样式 */
.snake-head.clone {
    background-image: url('player-head.png');
    opacity: 0.7;  /* 略暗于本体 */
    filter: brightness(0.8);
}

.snake-body.clone {
    background-color: rgba(46, 204, 113, 0.7);  /* 略暗于本体 */
}

/* BOSS样式 */
.enemy.boss {
    background-color: #c0392b;  /* 深红色 */
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(192, 57, 43, 0.9);  /* 更强的发光效果 */
}

.enemy-head.boss {
    background-image: url('enemy-head.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(192, 57, 43, 1);  /* 更强的发光效果 */
    transform: scale(1.2);  /* 头部稍大 */
}

/* BOSS入场效果 */
@keyframes bossEntrance {
    0%, 100% { 
        filter: brightness(1);
        transform: scale(1);
    }
    25%, 75% { 
        filter: brightness(1.5);
        transform: scale(1.02);
    }
    50% { 
        filter: brightness(2);
        transform: scale(1.05);
    }
}

.boss-entrance {
    animation: bossEntrance 0.5s ease-in-out infinite, shake 0.5s ease-in-out infinite;
}

/* BOSS危险区域样式 */
.boss-danger-zone {
    background-color: rgba(192, 57, 43, 0.3);
    box-shadow: inset 0 0 10px rgba(192, 57, 43, 0.5);
    animation: bossDangerPulse 1s infinite;
}

@keyframes bossDangerPulse {
    0%, 100% {
        background-color: rgba(192, 57, 43, 0.3);
        box-shadow: inset 0 0 10px rgba(192, 57, 43, 0.5);
    }
    50% {
        background-color: rgba(192, 57, 43, 0.5);
        box-shadow: inset 0 0 15px rgba(192, 57, 43, 0.7);
    }
}

/* 生命值显示样式 */
#livesDisplay, .lives-display {
    color: #e74c3c;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    display: block;
    letter-spacing: 4px;
    white-space: nowrap;
    margin-bottom: 10px;
    text-align: center;
}

/* BOSS生命值显示样式 */
#bossLivesDisplay {
    color: #c0392b;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    display: block;
    letter-spacing: 4px;
    white-space: nowrap;
    margin-bottom: 10px;
    text-align: center;
}

/* 隐藏BOSS模式相关样式 */
.magnifier {
    background-image: url('放大镜.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    animation: magnifierPulse 1.5s infinite;
}

@keyframes magnifierPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.key {
    background-image: url('钥匙.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    animation: keyGlow 1s infinite;
}

@keyframes keyGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.lock {
    background-image: url('锁.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.hidden-boss-head {
    background-color: #000000;
    border: 2px solid #333;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.hidden-boss-body {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 2px;
}

@keyframes meteorWarning {
    0%, 100% {
        background-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
    }
    50% {
        background-color: rgba(255, 255, 255, 0.8);
        box-shadow: 0 0 12px rgba(255, 255, 255, 1);
    }
}

.meteor-warning {
    animation: meteorWarning 0.6s infinite;
}

.meteor-blocked {
    background-color: #2c3e50;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6);
}

.falling-meteor {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ff5722 0%, #c0392b 60%, transparent 100%);
    border-radius: 50%;
    box-shadow: 0 0 10px #ff5722, 0 0 20px #c0392b;
    z-index: 100;
    animation: meteorFall 1s ease-in forwards;
}

.falling-meteor::after {
    content: '';
    position: absolute;
    bottom: 50%; /* 从中心开始 */
    left: 0;
    width: 100%;
    height: 80px; /* 拖尾长度 */
    background: linear-gradient(to top, rgba(255, 87, 34, 0.8), transparent);
    transform-origin: bottom;
    z-index: -1;
}

@keyframes meteorFall {
    0% {
        top: -20%;
        opacity: 1;
        transform: scale(1);
    }
    100% {
        top: var(--target-top);
        opacity: 1;
        transform: scale(2);
    }
}

/* 胜利特效动画 */
@keyframes floatUp {
    0% {
        top: 100%;
        opacity: 0;
        transform: translateY(0) rotate(0deg);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: -10%;
        opacity: 0;
        transform: translateY(-100vh) rotate(360deg);
    }
}

@keyframes medalPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes starTwinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes medalSwing {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(-15deg);
    }
    50% {
        transform: translate(-50%, -50%) rotate(15deg);
    }
}
