/* style.css */
* {
    box-sizing: border-box; /* 確保邊框不會撐開格子大小 */
}

body {
    background-color: #f5f0e1;
    font-family: 'Noto Sans TC', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 遊戲畫面總容器 */
.map-wrapper {
    position: relative;
    width: 600px;
    height: 600px;
    background-color: white;
    outline: 2px solid #5a4b3b; /* 使用 outline 取代 border，確保內部空間完美維持 600x600 */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 網格容器 */
.map-container {
    display: grid;
    /* 強制鎖定每個格子為 30px，20*30=600，保證不跑位 */
    grid-template-columns: repeat(20, 30px);
    grid-template-rows: repeat(20, 30px);
    width: 600px;
    height: 600px;
}

/* 單個格子樣式 */
.cell {
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    color: #5a4b3b;
    user-select: none;
}

/* 牆字樣式 */
.cell.wall {
    color: #a67c52;
    border: 2px solid #a67c52;
}

.cell.armory {
    color: #1976d2;
}

/* 玩家單獨實體樣式 */
.player-entity {
    position: absolute;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    color: #d32f2f; /* 紅色 "我" */
    transition: transform 0.1s ease-out; /* 滑動動畫 */
    pointer-events: none;
    top: 0;
    left: 0;
    z-index: 10;
    background-color: white; /* 稍微蓋住底下的線條，讓字體更清楚 */
}

.hint {
    color: #5a4b3b;
    font-weight: bold;
    margin-top: 15px;
}

/* 下方常駐技能快捷鍵樣式 */
.active-skills-container {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.active-skill-slot {
    width: 60px;
    height: 60px;
    border: 2px solid #5a4b3b;
    background-color: #e9e0d1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: #5a4b3b;
    border-radius: 4px;
    cursor: pointer;
}

.active-skill-slot.filled {
    border-color: #d32f2f;
    color: #d32f2f;
    background-color: #fff9c4;
}

/* 彈出視窗相關樣式 */
.hidden { display: none !important; }

.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background-color: #e9e0d1;
    padding: 25px;
    border-radius: 8px;
    border: 3px solid #5a4b3b;
    position: relative;
    width: 400px;
}

.close-btn {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 28px; font-weight: bold; cursor: pointer; color: #5a4b3b;
}

.close-btn:hover { color: #d32f2f; }
h3 { margin: 0 0 10px 0; font-size: 16px; color: #5a4b3b; }
.inventory-container { display: flex; gap: 10px; margin-bottom: 20px;}
.skill-item {
    width: 50px; height: 50px;
    border: 2px solid #a67c52; background-color: white;
    display: flex; justify-content: center; align-items: center;
    font-size: 20px; font-weight: bold; color: #5a4b3b;
    cursor: pointer; border-radius: 4px;
}
.skill-item:hover { background-color: #d7ccc8; }