/* Dama (Checkers) Game Styles */
#dama-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    width: 100%;
    aspect-ratio: 1;
    margin: 0 auto;
    border: 3px solid var(--text);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    touch-action: none;
}

.game-board-container {
    width: min(90vw, 70vh, 700px);
    max-width: 700px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .game-board-container {
        width: min(95vw, 80vh, 600px);
    }
}

@media (max-width: 480px) {
    .game-board-container {
        width: min(100%, 90vh);
    }
}

.dama-cell {
    aspect-ratio: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background-color 0.15s ease;
}

.dama-cell.light {
    background: #f0d9b5;
}

.dama-cell.dark {
    background: #b58863;
}

.dama-cell.selected {
    background: #7fc97f !important;
    box-shadow: inset 0 0 8px rgba(0, 100, 0, 0.5);
}

.dama-cell.valid-move {
    background: #aed581 !important;
    cursor: pointer;
}

.dama-cell.capture-move {
    background: #ef9a9a !important;
    cursor: pointer;
}

.dama-cell.preview-move {
    background: rgba(144, 238, 144, 0.4) !important;
}

/* Move indicators */
.move-indicator {
    width: 30%;
    height: 30%;
    background: rgba(0, 128, 0, 0.6);
    border-radius: 50%;
    position: absolute;
    pointer-events: none;
    animation: pulse 1s ease-in-out infinite;
}

.capture-indicator {
    width: 70%;
    height: 70%;
    border: 4px solid rgba(200, 0, 0, 0.7);
    border-radius: 50%;
    position: absolute;
    pointer-events: none;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.7;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Pieces */
.piece {
    width: 80%;
    height: 80%;
    min-width: 24px;
    min-height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.piece:hover {
    transform: scale(1.08);
}

.piece.black {
    background: radial-gradient(circle at 30% 30%, #555, #111);
    border: 2px solid #000;
}

.piece.white {
    background: radial-gradient(circle at 30% 30%, #fff, #ccc);
    border: 2px solid #999;
}

/* Movable pieces - subtle glow */
.piece.movable {
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.6), 0 3px 6px rgba(0, 0, 0, 0.3);
    animation: movableGlow 1.5s ease-in-out infinite;
}

.piece.movable.must-capture {
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.7), 0 3px 6px rgba(0, 0, 0, 0.3);
    animation: captureGlow 1s ease-in-out infinite;
}

@keyframes movableGlow {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.4), 0 3px 6px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.7), 0 3px 6px rgba(0, 0, 0, 0.3);
    }
}

@keyframes captureGlow {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.5), 0 3px 6px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(244, 67, 54, 0.8), 0 3px 6px rgba(0, 0, 0, 0.3);
    }
}

/* King pieces */
.piece.king::after {
    content: '♔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.piece.black.king::after {
    color: #ffd700;
}

.piece.white.king::after {
    color: #8b4513;
}

/* Piece count */
.piece-count {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Game status */
#game-status {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    margin: 0.5rem 0;
    transition: all 0.2s ease;
}

#game-status.black-turn {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

#game-status.white-turn {
    color: #8b4513;
    background: rgba(139, 69, 19, 0.05);
}

#game-status.white-turn.thinking {
    animation: thinking 1s ease-in-out infinite;
}

@keyframes thinking {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

#game-status.must-capture {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

#game-status.winner {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
}

/* Responsive */
@media (max-width: 480px) {
    .piece.king::after {
        font-size: 1rem;
    }

    .move-indicator {
        width: 25%;
        height: 25%;
    }

    .capture-indicator {
        width: 60%;
        height: 60%;
        border-width: 3px;
    }
}