/* chess.css */

.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.5); }

#chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 500px;
    border: 4px solid #1e293b;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.25),
                inset 0 0 25px rgba(0,0,0,0.4);
}

.chess-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    font-size: clamp(20px, 5vw, 42px);
    line-height: 1;
}
.chess-cell.light { background: #f0d9b5; }
.chess-cell.dark  { background: #b58863; }

.chess-cell.last-from,
.chess-cell.last-to {
    box-shadow: inset 0 0 0 3px rgba(250, 204, 21, 0.7);
}
.chess-cell.in-check {
    background: radial-gradient(circle at center, #f87171 0%, #991b1b 100%) !important;
    animation: checkPulse 1s ease-in-out infinite;
}
@keyframes checkPulse {
    0%, 100% { box-shadow: inset 0 0 8px rgba(239,68,68,0.7); }
    50%      { box-shadow: inset 0 0 18px rgba(239,68,68,1);   }
}

.chess-cell.move-target {
    cursor: pointer;
}
.chess-cell.move-target::after {
    content: '';
    position: absolute;
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.6);
    pointer-events: none;
}
.chess-cell.capture-target {
    cursor: pointer;
}
.chess-cell.capture-target::after {
    content: '';
    position: absolute;
    inset: 6%;
    border: 4px solid rgba(239, 68, 68, 0.8);
    border-radius: 50%;
    background: transparent;
    pointer-events: none;
}
.chess-cell.selected {
    background: linear-gradient(135deg, #fbbf24, #d97706) !important;
}

.piece {
    cursor: pointer;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease;
}
.piece:hover { transform: scale(1.05); }

/* Size of Font Awesome Icon in cells */
.piece i {
    font-size: clamp(24px, 6.2vw, 46px);
    display: block;
    line-height: 1;
}

/* White Pieces style: Solid White with Slate outline and soft drop shadow */
.piece.white i {
    color: #ffffff;
    -webkit-text-stroke: 1.5px #1e293b;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

/* Black Pieces style: Slate Charcoal with White outline and drop shadow */
.piece.black i {
    color: #334155;
    -webkit-text-stroke: 1.5px #ffffff;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

/* Промоція */
#promotion-modal {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(4px);
}
#promotion-modal.show { display: flex; }
.promotion-piece {
    width: 70px;
    height: 70px;
    background: #1e293b;
    border: 2px solid #4338ca;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.promotion-piece:hover {
    background: #4338ca;
    transform: scale(1.1);
}
.promotion-piece i {
    font-size: 38px;
}
.promotion-piece.white i {
    color: #ffffff;
    -webkit-text-stroke: 1px #1e293b;
}
.promotion-piece.black i {
    color: #334155;
    -webkit-text-stroke: 1px #ffffff;
}

/* Captured pieces sizing */
#player-top-captured span,
#player-bottom-captured span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}
#player-top-captured span i,
#player-bottom-captured span i {
    font-size: 18px;
    line-height: 1;
}
#player-top-captured .white i,
#player-bottom-captured .white i {
    color: #ffffff;
    -webkit-text-stroke: 1px #1e293b;
}
#player-top-captured .black i,
#player-bottom-captured .black i {
    color: #334155;
    -webkit-text-stroke: 1px #ffffff;
}
