/* 背景网格样式 */
#bg-pattern {
    background-image: 
      linear-gradient(45deg, #1f2937 25%, transparent 25%), 
      linear-gradient(-45deg, #1f2937 25%, transparent 25%), 
      linear-gradient(45deg, transparent 75%, #1f2937 75%), 
      linear-gradient(-45deg, transparent 75%, #1f2937 75%);
    background-size: 100px 100px;
    background-position: 0 0, 0 50px, 50px -50px, -50px 0px;
}

/* 棋盘格子颜色 */
.square-white {
    background-color: #f0d9b5;
}
.square-black {
    background-color: #b58863;
}
.square-highlight {
    background-color: rgba(255, 255, 0, 0.4);
}
.square-possible {
    position: relative;
}
.square-possible::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 棋子图片，我们使用维基百科的开源国际象棋图片 SVG */
.piece {
    width: 100%;
    height: 100%;
    background-size: cover;
    cursor: grab;
    transition: transform 0.1s;
}
.piece:active {
    cursor: grabbing;
    transform: scale(1.1);
}

/* 拖拽时的样式 */
.dragging {
    opacity: 0.5;
}

/* 提示：可以移动到的空格子（中心点） */
.hint-dot::after {
    content: '';
    position: absolute;
    width: 25%;
    height: 25%;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; /* 让点击穿透到下面的方格 */
}

/* 提示：可以吃子的格子（透明圆圈） */
.hint-capture::after {
    content: '';
    position: absolute;
    width: 85%;
    height: 85%;
    border: 6px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* 将军时的红色印记 */
.in-check {
    background: radial-gradient(circle, rgba(255, 0, 0, 0.8) 0%, rgba(255, 0, 0, 0) 70%) !important;
}

/* 将死时的红色背景和特效 */
.in-checkmate {
    background-color: rgba(255, 0, 0, 0.9) !important;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.in-checkmate .piece {
    transform: rotate(90deg); /* 棋子倒下 */
    transition: transform 0.5s ease-in-out;
}

/* 纸条滚动条样式 */
#rule-content::-webkit-scrollbar {
    width: 8px;
}
#rule-content::-webkit-scrollbar-track {
    background: transparent;
}
#rule-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
