/* Cờ Ba Chân Specific Styles */

.cbc-btn-bot:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.cbc-board-wrapper {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
}

.cbc-cell {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
}

/* Điểm tròn ở giữa mỗi giao điểm để dễ click */
.cbc-cell::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    z-index: 1;
    transition: 0.2s;
}

.cbc-cell:hover::before {
    background: rgba(255,255,255,0.3);
    transform: scale(1.5);
}

/* Các ô có thể di chuyển tới (Phase 2) */
.cbc-cell.valid-move::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: rgba(46, 204, 113, 0.4);
    border: 2px solid #2ecc71;
    border-radius: 50%;
    z-index: 3;
    animation: pulseMove 1s infinite alternate;
}

@keyframes pulseMove {
    from { transform: scale(0.8); opacity: 0.7; }
    to { transform: scale(1.2); opacity: 1; }
}

/* Quân cờ */
.cbc-piece {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    z-index: 5;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5), inset 0 2px 5px rgba(255,255,255,0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    color: white;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.cbc-piece.player {
    background: radial-gradient(circle at 30% 30%, #60a5fa, #2563eb);
    border: 3px solid #1d4ed8;
}

.cbc-piece.bot {
    background: radial-gradient(circle at 30% 30%, #f87171, #dc2626);
    border: 3px solid #b91c1c;
}

/* Quân cờ đang được chọn (Phase 2) */
.cbc-piece.selected {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 10px 25px rgba(241, 196, 15, 0.8), inset 0 2px 5px rgba(255,255,255,0.6);
    border-color: #f1c40f;
}

/* Quân cờ trong Inventory */
.inventory-piece {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.inventory-piece.player {
    background: radial-gradient(circle at 30% 30%, #60a5fa, #2563eb);
    border: 2px solid #1d4ed8;
}
.inventory-piece.bot {
    background: radial-gradient(circle at 30% 30%, #f87171, #dc2626);
    border: 2px solid #b91c1c;
}

/* Animation chiến thắng */
.cbc-piece.win-piece {
    animation: winPulse 1s infinite alternate;
}

@keyframes winPulse {
    from { box-shadow: 0 0 10px #f1c40f, 0 0 20px #f1c40f; transform: scale(1.1); }
    to { box-shadow: 0 0 20px #f1c40f, 0 0 40px #f1c40f; transform: scale(1.2); }
}

/* Media Queries for small screens */
@media (max-width: 400px) {
    .cbc-board-wrapper {
        width: 270px;
        height: 270px;
    }
    .cbc-board-wrapper svg {
        width: 270px;
        height: 270px;
    }
    .cbc-board-wrapper svg line {
        /* Need to adjust lines or just scale the SVG. SVG will naturally scale if viewBox is set. Let's fix SVG in HTML later. */
    }
    .cbc-cell {
        width: 100%;
        height: 100%;
    }
    .cbc-piece {
        width: 60px;
        height: 60px;
    }
}

/* CSS cho Image Skins */
.cbc-piece.skin-active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.cbc-piece.skin-active img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
    transition: 0.2s;
}
.cbc-piece.skin-active.selected img {
    filter: drop-shadow(0 0 15px #f1c40f);
}

.inventory-piece.skin-active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.inventory-piece.skin-active img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
