/* style.css (美化V2 - 优化布局和信息栏宽度) */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* 更改背景为浅蓝色渐变，模拟截图效果 */
    background: linear-gradient(135deg, #e0f7fa 0%, #bbdefb 100%);
    /* 浅青色到浅蓝色的渐变 */
    color: #333;
    margin: 0;
    padding: 0;
    user-select: none;
    min-height: 100vh;
    /* 确保渐变铺满整个视口 */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 删除了原有的 header 和 footer 样式 */

main {
    display: flex;
    justify-content: center;
    padding: 0;
    max-width: 1400px;
    /* 增加最大宽度以容纳更大的边栏 */
    width: 100%;
}

#game-container {
    display: flex;
    background-color: white;
    padding: 30px;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* 棋盘信息栏样式 - 扩大宽度并优化布局 */
#game-info {
    margin-right: 30px;
    width: 280px;
    /* 扩大宽度 (原为 250px, 现为 280px) */
    padding: 20px;
    border-radius: 12px;
    background-color: #ffffff;
    align-self: flex-start;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

#game-info h3 {
    margin-top: 15px;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    font-size: 1.1em;
}

/* 回合/部署信息卡片样式 */
#turn-display,
#steps-display {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    box-shadow: none;
    /* 背景色在 JS 中动态设置，这里统一重置 */
    background-color: transparent;
}

/* 炮塔状态区域的文字 */
#tower-hp-info p {
    font-size: 1em;
    font-weight: 500;
    margin: 5px 0;
    padding: 5px 0;
    /* 移除背景色，更简洁 */
}


/* 颜色主题 - 保持不变 */
.p1-color {
    color: #1e88e5;
}

.p2-color {
    color: #e53935;
}

/* -------------------- 棋盘样式 (保持不变) -------------------- */
#board {
    display: grid;
    grid-template-columns: repeat(21, 35px);
    grid-template-rows: repeat(10, 35px);
    border: 1px solid #bdbdbd;
    background-color: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.cell {
    width: 35px;
    height: 35px;
    border: 1px solid #cfd8dc;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* 棋盘区域划分和边界类 (保持不变) */
.cell.base-p1 {
    background-color: #e3f2fd;
}

.cell.base-p2 {
    background-color: #ffebee;
}

.cell.base-boundary-right {
    border-right: 2px solid #2196F3 !important;
}

.cell.base-boundary-left {
    border-left: 2px solid #F44336 !important;
}

.cell.area-boundary-right {
    border-right: 2px dashed #2196F3 !important;
}

.cell[data-col="12"] {
    border-right: 2px dashed #F44336 !important;
}

.cell.win-column {
    background-color: rgba(255, 255, 0, 0.1);
}

.cell:hover {
    background-color: #bbdefb !important;
}

/* 棋子样式 (保持不变) */
.piece {
    width: 80%;
    height: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
}

.pawn.p1 {
    background-color: #1e88e5;
    border-radius: 50%;
}

.pawn.p2 {
    background-color: #e53935;
    border-radius: 50%;
}

.tower {
    border-radius: 4px;
    font-size: 1.1em;
}

.tower.p1 {
    background-color: #1565c0;
}

.tower.p2 {
    background-color: #c62828;
}

.building {
    border-radius: 4px;
    font-size: 1.1em;
    color: #616161;
    border: 2px dashed;
    background-color: #fff9c4;
}

.building.p1 {
    border-color: #42a5f5;
}

.building.p2 {
    border-color: #ef5350;
}

.info-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.7em;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    color: #333;
}


/* -------------------- 控制面板样式 - 统一卡片背景 -------------------- */
#controls {
    margin-left: 30px;
    width: 280px;
    /* 保持与信息栏相同的宽度，使其对称 */
    padding: 20px;
    border-radius: 12px;
    background-color: #ffffff;
    /* 统一使用白色背景 */
    align-self: flex-start;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

#controls h2 {
    margin-top: 0;
    font-size: 1.4em;
    color: #424242;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}


/* -------------------- 核心按钮美化 -------------------- */
/* 所有按钮基础样式 (类似截图中的圆角、卡片式) */
#action-buttons button,
#end-turn-button {
    width: 100%;
    padding: 15px 15px;
    margin-bottom: 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.05em;
    transition: background-color 0.3s, transform 0.1s, box-shadow 0.3s;
    text-align: left;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    color: white;
    /* 统一颜色，由 JS 设置背景色 */
}

/* 悬停反馈 (Hover Effect) - 保持突出效果 */
#action-buttons button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 结束回合按钮 (悬停) */
#end-turn-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}