.checkers-page {
    max-width: 1400px;
    margin: 20px auto 30px auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.checkers-board-wrap {
    width: min(90vw, 720px);
    margin: 20px auto 30px auto;
}

.checkers-toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.checkers-toolbar-skill {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkers-toolbar-skill label {
    margin: 0;
    font-size: 0.92rem;
    color: #444;
    white-space: nowrap;
}

.checkers-toolbar-skill select {
    width: 140px;
}

.checkers-board-status {
    width: 100%;
    max-width: 720px;
    margin-bottom: 12px;
    padding: 10px 12px;
    box-sizing: border-box;
    border: 1px solid #d6d6d6;
    background: #fffdf8;
    color: #8b3e2f;
    font-size: 1rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.checkers-board-status.status-normal {
    background: #fffdf8;
    color: #8b3e2f;
    border-color: #d8c8bb;
}

.checkers-board-status.status-thinking {
    background: #eef4ff;
    color: #2450a6;
    border-color: #a8bde6;
}

.checkers-board-status.status-warning {
    background: #fff6da;
    color: #7a5a00;
    border-color: #e0c24f;
}

.checkers-board-status.status-win {
    background: #eaf7ea;
    color: #2e6b2e;
    border-color: #9fca9f;
    font-weight: 700;
}

.checkers-board {
    width: min(90vw, 720px);
    aspect-ratio: 1 / 1;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    border: 2px solid #5c372c;
    box-sizing: border-box;
    user-select: none;
    overflow: hidden;
    background: #5c372c;
}

.checkers-square {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.checkers-square.light {
    background: #e9dcc7;
}

.checkers-square.dark {
    background: #8f432f;
}

.checkers-square.selected {
    outline: 4px solid #2d6cdf;
    outline-offset: -4px;
    z-index: 1;
}

.checkers-square.legal::after {
    content: "";
    width: 18%;
    height: 18%;
    border-radius: 50%;
    background: rgba(80, 160, 255, 0.9);
    position: absolute;
}

.checkers-square.capture::after {
    content: "";
    position: absolute;
    inset: 10%;
    border: 4px solid rgba(220, 40, 40, 0.82);
    border-radius: 50%;
}

.checkers-square.must-play {
    box-shadow: inset 0 0 0 4px rgba(255, 176, 32, 0.9);
}

.checkers-square.last-from {
    box-shadow: inset 0 0 0 4px rgba(255, 196, 0, 0.75);
}

.checkers-square.last-to {
    box-shadow: inset 0 0 0 4px rgba(0, 170, 80, 0.75);
}

.checkers-square.last-capture {
    animation: capturePulse 0.5s ease-in-out 2;
}

@keyframes capturePulse {
    0%   { box-shadow: inset 0 0 0 2px rgba(220, 30, 30, 0.3); }
    50%  { box-shadow: inset 0 0 0 6px rgba(220, 30, 30, 0.85); }
    100% { box-shadow: inset 0 0 0 2px rgba(220, 30, 30, 0.3); }
}

.checkers-piece {
    width: 72%;
    height: 72%;
    border-radius: 50%;
    position: relative;
    box-sizing: border-box;
    pointer-events: none;
    box-shadow:
        inset 0 2px 6px rgba(255,255,255,0.25),
        inset 0 -3px 8px rgba(0,0,0,0.25),
        0 2px 4px rgba(0,0,0,0.2);
}

.checkers-piece.red {
    background: radial-gradient(circle at 30% 30%, #ff8a80, #c62828 70%);
    border: 2px solid #8e1b1b;
}

.checkers-piece.black {
    background: radial-gradient(circle at 30% 30%, #7c7c7c, #1f1f1f 70%);
    border: 2px solid #111;
}

.checkers-piece.king::after {
    content: "K";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffd54f;
    font-weight: 700;
    font-size: clamp(14px, 2vw, 24px);
    text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

.checkers-coord {
    position: absolute;
    font-size: 0.72rem;
    color: rgba(0, 0, 0, 0.35);
    pointer-events: none;
    line-height: 1;
}

.checkers-coord.file {
    bottom: 4px;
    right: 6px;
}

.checkers-coord.rank {
    top: 4px;
    left: 6px;
}

.checkers-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.checkers-info-panel {
    border: 1px solid #d6d6d6;
    background: #fafafa;
    padding: 14px;
    box-sizing: border-box;
}

.checkers-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #8b3e2f;
    margin-bottom: 10px;
}

.checkers-move-list {
    min-height: 120px;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px;
    box-sizing: border-box;
    line-height: 1.55;
    font-size: 0.95rem;
}

.captured-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.captured-label {
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 4px;
}

.captured-row {
    min-height: 42px;
    border: 1px solid #ddd;
    background: #fff;
    padding: 6px;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.captured-piece {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    position: relative;
    box-sizing: border-box;
}

.captured-piece.red {
    background: #c62828;
    border: 1px solid #8e1b1b;
}

.captured-piece.black {
    background: #222;
    border: 1px solid #111;
}

.captured-piece.king::after {
    content: "K";
    position: absolute;
    inset: 0;
    color: #ffd54f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .checkers-toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .checkers-toolbar-skill {
        justify-content: space-between;
    }

    .checkers-info-row {
        grid-template-columns: 1fr;
    }
}