/**
 * 像素迷宫 - 样式表
 * 复古像素风格设计
 * 支持14x14地图、近路、道具背包系统、暂停功能
 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', Courier, monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    padding: 10px;
}

/* 游戏容器 */
.game-container {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 
        0 0 20px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
    border: 2px solid #333;
    max-width: 620px;
    width: 100%;
}

/* 游戏头部 */
.game-header {
    text-align: center;
    margin-bottom: 15px;
}

.game-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.level {
    color: #f1c40f;
    font-weight: bold;
}

#level {
    color: #fff;
    font-size: 18px;
}

.status {
    color: #2ecc71;
    font-size: 12px;
}

/* 背包栏 */
.inventory-bar {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 15px;
}

.inventory-title {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 8px;
    text-align: center;
}

.inventory-slots {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.inventory-slot {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #555;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    position: relative;
    transition: all 0.3s ease;
}

.inventory-slot.has-item {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    animation: item-pulse 2s infinite;
}

.inventory-slot .slot-number {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 10px;
    color: #888;
    font-weight: bold;
}

@keyframes item-pulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    }
}

/* Canvas 样式 */
#gameCanvas {
    display: block;
    margin: 0 auto 15px;
    border: 3px solid #444;
    border-radius: 4px;
    box-shadow: 
        0 0 10px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.2);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    max-width: 100%;
    height: auto;
}

/* 控制区域 */
.controls {
    text-align: center;
}

.instructions {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.instructions p {
    margin: 5px 0;
    font-size: 13px;
    color: #ccc;
}

.instructions strong {
    color: #fff;
}

/* 道具图例 */
.item-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.item-legend span {
    font-size: 11px;
    color: #aaa;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
}

/* 按钮区域 */
.buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 暂停按钮特殊样式 */
.btn-pause {
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
}

.btn-pause:hover {
    background: linear-gradient(135deg, #e74c3c 0%, #f39c12 100%);
}

.btn-pause.paused {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.btn-pause.paused:hover {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

/* 响应式设计 */
@media (max-width: 600px) {
    .game-container {
        padding: 10px;
    }
    
    .game-header h1 {
        font-size: 22px;
    }
    
    .stats {
        flex-direction: column;
        text-align: center;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 350px;
    }
    
    .inventory-slot {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .instructions p {
        font-size: 11px;
    }
    
    .item-legend {
        gap: 8px;
    }
    
    .item-legend span {
        font-size: 10px;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 12px;
    }
}

/* 动画效果 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.level {
    animation: pulse 2s infinite;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
