/* =========================
   LAYOUT
========================= */

.game-container {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

/* =========================
   HEADER
========================= */

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 16px 20px;
    margin-bottom: 0px;

    border-radius: 14px;

    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

.engine-title {
    font-size: 16px;
    font-weight: bold;
    color: #aaa;
    margin: 0 auto;
}

.online-box {
    color: #aaa;
    font-size: 14px;
}

/* =========================
   BOARD
========================= */

.board-wrapper {
    flex-shrink: 0;
    width: 500px;
}

/* Desktop */
.chess-board-area {
    width: 500px;
    height: 500px;

    max-width: 100%;

    border-radius: 16px;
    overflow: hidden;

    box-shadow:
        0 10px 25px rgba(0,0,0,0.35);

    background: #222;
}

/* =========================
   RIGHT PANEL
========================= */

.side-panel {
    width: 260px;

    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* =========================
   TOOL BUTTONS
========================= */

.bot-control-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tool-btn {
    height: 50px;

    border: none;
    border-radius: 14px;

    font-weight: bold;
    font-size: 14px;

    cursor: pointer;

    background: #2e2e2e;
    color: white;

    transition: 0.2s;
}

.tool-btn:hover {
    transform: translateY(-2px);
    background: #444;
}

/* =========================
   QUICK MATCH
========================= */

.quick-match-btn {
    border: none;
    border-radius: 18px;

    padding: 20px;

    cursor: pointer;

    background: linear-gradient(
        135deg,
        #ffb347,
        #ff7b00
    );

    color: white;

    box-shadow:
        0 10px 20px rgba(255,140,0,0.35);
}

.quick-match-btn .main-text {
    font-size: 20px;
    font-weight: bold;
}

.quick-match-btn .sub-text {
    margin-top: 6px;
    font-size: 13px;
    opacity: 0.9;
}

/* =========================
   BACK BUTTON
========================= */

.btn-bottom-match {
    height: 50px;

    border: none;
    border-radius: 14px;

    background: #181818;
    color: white;

    font-weight: bold;

    cursor: pointer;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {

    .game-container {
        flex-direction: column;
        align-items: center;
        padding: 12px;
    }

    .game-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .board-wrapper {
        width: 100%;
    }

    .chess-board-area {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .side-panel {
        width: 100%;
    }

    .bot-control-tools {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tool-btn.disabled {

    animation: aiPulse 1s infinite;
}

@keyframes aiPulse {

    0% {
        opacity: 0.55;
    }

    50% {
        opacity: 0.85;
    }

    100% {
        opacity: 0.55;
    }
}

/* Trạng thái khi đang tìm trận */
.searching-active {
    background: #888888 !important; /* Đổi sang màu xám đậm hơn một chút */
    color: #ffffff;
    cursor: pointer; /* Đổi con trỏ chuột thành hình đồng hồ cát/vòng xoay */
    animation: pulseSearching 1.5s infinite ease-in-out; /* Thêm hiệu ứng đập nhịp hiệu ứng */
}

/* Định nghĩa hiệu ứng nhấp nháy nhẹ nhàng */
@keyframes pulseSearching {
    0% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(136, 136, 136, 0.4);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 10px rgba(136, 136, 136, 0);
    }
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(136, 136, 136, 0);
    }
}

.elo-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;       /* Khoảng cách vừa vặn giữa sao và số */
}

.elo-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
    animation: pulse 2.5s infinite ease-in-out; /* Ngôi sao co giãn nhẹ tạo độ sinh động */
}

.elo-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffd700; /* Màu vàng Gold gaming */
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4); /* Phát sáng nhẹ tinh tế */
    font-family: 'Segoe UI', Roboto, sans-serif;
}

/* Hiệu ứng nhịp đập êm ái cho ngôi sao */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}