/* 主游戏样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    overflow: hidden;
}

.game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #E67E22 0%, #D35400 100%);
}

#gameCanvas {
    display: block;
    background-color: #E67E22;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 游戏UI元素 */
.game-ui {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.score, .treasures, .lives {
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.treasures::before {
    content: "🏆";
    margin-right: 8px;
    font-size: 18px;
}

.lives::before {
    content: "❤️";
    margin-right: 8px;
    font-size: 18px;
}

/* 游戏控制器 */
.game-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.mobile-controls {
    display: none;
    gap: 20px;
}

.mobile-controls button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

#upBtn, #downBtn, #leftBtn, #rightBtn {
    font-size: 24px;
}

#actionBtn {
    width: 80px;
    height: 80px;
    background-color: rgba(232, 126, 4, 0.8);
}

/* 游戏消息 */
.game-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    z-index: 100;
    min-width: 300px;
}

.game-message h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #E67E22;
}

.game-message p {
    margin-bottom: 25px;
    font-size: 16px;
}

#startBtn {
    background: linear-gradient(135deg, #E67E22 0%, #D35400 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#startBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(230, 126, 34, 0.5);
}

/* 地图和玩家 */
.player {
    position: absolute;
    width: 32px;
    height: 32px;
    background-color: #2980b9;
    border-radius: 50%;
    z-index: 2;
    transition: all 0.1s ease;
}

.treasure {
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: gold;
    border-radius: 4px;
    z-index: 1;
    animation: glow 1.5s infinite alternate;
}

.obstacle {
    position: absolute;
    background-color: #7f5539;
    z-index: 1;
}

.map-tile {
    position: absolute;
    background-color: #83c5be;
    z-index: 0;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px gold;
    }
    to {
        box-shadow: 0 0 15px gold, 0 0 30px orange;
    }
}

/* 游戏图标和物品 */
.item {
    position: absolute;
    width: 20px;
    height: 20px;
    z-index: 1;
}

.key {
    background-color: #f1c40f;
    border-radius: 2px;
}

.door {
    background-color: #8b4513;
    border-radius: 2px;
}

.enemy {
    position: absolute;
    width: 28px;
    height: 28px;
    background-color: #c0392b;
    border-radius: 5px;
    z-index: 3;
}

/* 响应式 */
@media (max-width: 768px) {
    .mobile-controls {
        display: flex;
    }
    
    .game-ui {
        flex-direction: row;
        top: 10px;
        left: 10px;
        right: 10px;
        justify-content: space-between;
    }
}

/* 游戏iframe内嵌样式 */
#game-iframe {
    width: 100%;
    height: 600px;
    border: none;
}

@media (max-width: 768px) {
    #game-iframe {
        height: 400px;
    }
}

/* 游戏页面样式调整 */
.game-frame {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    background-color: #E67E22;
}

.game-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 15px;
}

.game-controls button {
    background-color: #E67E22;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-controls button:hover {
    background-color: #D35400;
}

/* 游戏动画 */
@keyframes floating {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

@keyframes shine {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* 响应式调整 */
@media (max-width: 600px) {
    .game-container {
        height: 70vh;
    }
    
    .game-message {
        padding: 20px;
        min-width: 250px;
    }
    
    .game-message h2 {
        font-size: 22px;
    }
    
    .mobile-controls button {
        width: 50px;
        height: 50px;
    }
    
    #actionBtn {
        width: 70px;
        height: 70px;
    }
} 