/* Bầu Cua Game Styles */

.baucua-container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: stretch;
}

.history-panel {
    flex: 1;
    min-width: 250px;
    height: 650px;
    /* Fixed bounds per user request */
    display: flex;
    flex-direction: column;
}

.game-board {
    flex: 3;
    min-width: 300px;
    height: 650px;
    /* Synchronized with history panel */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* Plate and Bowl 3D Design */
.table-area {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.plate {
    position: absolute;
    width: 100%;
    height: 110%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #f0f0f0 70%, #d8d8d8 90%, #bbbbbb 100%);
    box-shadow:
        inset 0 5px 10px rgba(255, 255, 255, 0.9),
        0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    border: 1px solid #d0d0d0;
}

.plate-inner {
    width: 78%;
    height: 78%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, #f9f9f9 0%, #e0e0e0 70%, #cccccc 100%);
    box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    position: relative;
}

/* The 3 Dice */
.dice-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    width: 250px;
}

.dice {
    /* width: 80px; */
    height: 80px;
    /* background: #fff; */
    border-radius: 16px;
    box-shadow:
        inset -4px -4px 10px rgba(0, 0, 0, 0.15),
        inset 4px 4px 10px rgba(255, 255, 255, 1),
        0 12px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid #f0f0f0;
    overflow: hidden;
    padding: 2px;
}

/* Images inside dice */
.dice-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* Images in result display */
.result-img {
    /* width: 36px; */
    height: 36px;
    object-fit: cover;
    border-radius: 8px;
    vertical-align: middle;
    margin-right: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Images in history list */
.history-face-img {
    /* width: 28px; */
    height: 28px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Images in stats row */
.stat-face-img {
    /* width: 30px; */
    height: 30px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* The Bowl */
.bowl {
    position: absolute;
    top: 4%;
    left: 11%;
    width: 78%;
    height: 88%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #c3c3c3 40%, #646464 80%, #565656 100%);
    box-shadow:
        inset 20px 20px 40px rgba(255, 255, 255, 0.3),
        inset -20px -30px 40px rgba(0, 0, 0, 0.5),
        0 15px 30px rgba(0, 0, 0, 0.6),
        0 35px 50px rgba(0, 0, 0, 0.3);
    z-index: 2;
    transform-origin: center center;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s ease-in-out;
}

/* The bottom base of the bowl (đáy tô) pointing up towards camera */
.bowl::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32%;
    height: 32%;
    border-radius: 50%;
    background: transparent;
    border: 6px solid rgba(0, 0, 0, 0.25);
    box-shadow:
        inset 0 10px 15px rgba(0, 0, 0, 0.6),
        0 -3px 5px rgba(255, 255, 255, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.5);
}

/* Bowl lift animation */
.bowl.lifted {
    transform: translateY(-200px) scale(0.9);
    opacity: 0;
    pointer-events: none;
}

/* Shake Animation */
@keyframes shake-bowl {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    10% {
        transform: translate(-10px, -5px) rotate(-3deg);
    }

    20% {
        transform: translate(10px, 5px) rotate(3deg);
    }

    30% {
        transform: translate(-15px, 10px) rotate(-5deg);
    }

    40% {
        transform: translate(15px, -10px) rotate(5deg);
    }

    50% {
        transform: translate(-10px, 0px) rotate(-3deg);
    }

    60% {
        transform: translate(10px, 5px) rotate(3deg);
    }

    70% {
        transform: translate(-5px, -5px) rotate(-2deg);
    }

    80% {
        transform: translate(5px, 5px) rotate(2deg);
    }

    90% {
        transform: translate(-2px, 0px) rotate(-1deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

.shake {
    animation: shake-bowl 0.6s infinite ease-in-out;
}

/* History List */
.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.history-round {
    font-size: 0.9em;
    color: #bbb;
}

.history-faces {
    display: flex;
    gap: 8px;
    font-size: 20px;
}

/* custom scrollbar for history */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}