/* --- 基本布局 --- */
body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f0f0;
    margin-top: 20px;
    user-select: none;
}

h1 {
    margin: 0;
}

/* --- 游戏状态栏 --- */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 350px;
    /* 这个宽度需要根据你的棋盘大小调整 */
    margin: 15px 0;
    font-size: 1.2em;
}

#new-game-btn {
    padding: 8px 12px;
    font-size: 1em;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
}

#new-game-btn:hover {
    background-color: #0056b3;
}

/* --- 游戏状态的颜色 --- */
.status-playing {
    color: #333;
}

.status-won {
    color: green;
    font-weight: bold;
}

.status-lost {
    color: red;
    font-weight: bold;
}


/* --- 游戏棋盘 --- */
#game-board {
    display: grid;
    /* 网格列数将由 JS 设置 (例如 grid-template-columns: repeat(10, 35px)) */
    /* 网格行数将由 JS 设置 (例如 grid-template-rows: repeat(10, 35px)) */
    border: 3px solid #ccc;
    background-color: #bbb;
}

/* --- 格子 (Tile) --- */
.tile {
    width: 35px;
    height: 35px;
    box-sizing: border-box;
    /* 确保边框不会撑大格子 */
    border: 1px solid #999;

    /* 文字居中 */
    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 1.5em;
    font-weight: bold;
    user-select: none;
    -webkit-touch-callout: none;
    /* 防止双击时选中文本 */
}

/* 1. 隐藏状态 (默认) */
.tile.hidden {
    background-color: #ddd;
    border: 3px outset #eee;
    cursor: pointer;
}

.tile.hidden:hover {
    background-color: #e7e7e7;
}

/* 2. 标记状态 (插旗) */
.tile.flagged::before {
    content: '🚩';
    font-size: 1.2em;
}

/* 3. 翻开状态 */
.tile.revealed {
    background-color: #bbb;
    border: 1px solid #999;
}

/* 4. 雷的状态 */
.tile.mine {
    background-color: #ff4d4d;
    /* 踩到雷时显示红色 */
}

.tile.mine::before {
    content: '💣';
    font-size: 1.2em;
}

/* --- 数字颜色 --- */
[data-value="1"] {
    color: #0000ff;
}

[data-value="2"] {
    color: #008000;
}

[data-value="3"] {
    color: #ff0000;
}

[data-value="4"] {
    color: #00008b;
}

[data-value="5"] {
    color: #8b0000;
}

[data-value="6"] {
    color: #40e0d0;
}

[data-value="7"] {
    color: #000000;
}

[data-value="8"] {
    color: #808080;
}