﻿
    body{
        overflow:hidden
        }

    #app {
        width: 100%;
        height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100%;
        margin: 0 auto;
    }

    #mainboard {
        width: 100%;
        height: 100%;
        position: relative;
        display: flex;
        z-index:2
    }

#board-container {
    /*flex: 1 1 auto;*/
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /*
        perspective: 1600px;
        perspective-origin: 50% 50%;*/
}

#board-slot {
    flex: 1 1 auto;
    min-width: 0; /* quan trọng: tránh tràn */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center; /* đảm bảo board ở giữa cột */
    position: relative;
    overflow: visible;
}

/* Đây là thằng bạn rotate/translate */
#board-visual {
    position: relative;
    transform-origin: 50% 50%;
    will-change: transform;
    perspective: 1600px;
    perspective-origin: 50% 50%;
}

#board {
    width: calc(100% - 100px);
    /*height: calc(100vh - 100px);*/
    height: 'auto';
    position: relative;
    /*background: #B2D3ED;*/
    /*margin-top:100px*/
    
    transform-style: preserve-3d;

   /* transform: rotateX(38deg);*/
}




    #bottom-step-container {
        width: 100%;
        position: absolute;
        bottom: 0;
        z-index: 2;
    
    }



    .bottom-step {
        position: absolute;
        bottom: 0;
        z-index: 8;
        border-radius: 7px;


    }

    #top-step-container {
        width: 100%;
        position: absolute;
        top: 0;
        z-index: 1
    }

    .top-step {

        position: absolute;
        top: 0
    }

    #left-step-container {
        height: 100%;
        position: absolute;
        left: 0;
        z-index:1
    }

    .left-step {
   
        position: absolute;
        left: 0;
    }

    #right-step-container {
        height: 100%;
        position: absolute;
        right: 0;
        z-index:2
    }

    .right-step {
   
        position: absolute;
        right: 0;
    }

    .top-left-step {
 
        position: absolute;
        top: 0;
        left: 0;
        z-index:19
    }

    .top-right-step {
  
        position: absolute;
        top: 0;
        right: 0;
        z-index:2000
    }

    .bottom-left-step {

        position: absolute;
        bottom: 0;
        left: 0;
        z-index:20;
        border-radius:15px;
    }

    .bottom-right-step {
        position: absolute;
        bottom: 0;
        right: 0;
        z-index: 999;
    }

    /*bottom*/
    /*
    .bottom-step-bottom {
        height: 11px;
        width: calc(100% - 8px);
        display: block;
        position: absolute;
        left: 3px;
        bottom: -8px;
        transform: rotate(0) skewX(-45deg);
        border-radius: 4px;
        z-index: 1;
    }
        */
    .bottom-step-bottom-left {
        width: 16px;
        height: 18px;
        display: block;
        position: absolute;
        bottom: -8px;
        left: -6px;
        z-index: 2;
        border-radius: 12px;
    }

    .bottom-step-bottom-main {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100%;
        z-index: 5;
        border-radius: 7px;
        height: 100%;
        left: 0;
    
    }

    .bottom-step-bottom-main-wrapper {
    
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100%;
        z-index: 4;
        border-radius: 7px;
        
    }


    /*top*/

    /*
    .top-step-top {
        height: 11px;
        width: calc(100% - 8px);
        display: block;
        position: absolute;
        left: 3px;
        bottom: -8px;
        transform: rotate(0) skewX(-45deg);
        border-radius: 4px;
        z-index: 1;
    }
    */
    .top-step-top-left {
        width: 16px;
        height: 18px;
        display: block;
        position: absolute;
        bottom: -8px;
        left: -6px;
        z-index: 2;
        border-radius: 12px;
    }

    .top-step-top-main {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100%;
        z-index: 5;
        border-radius: 7px;
        height: 100%;
        top: 0px;
        left: 0px;
    }

    .top-step-top-main-wrapper {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100%;
        z-index: 4;
        border-radius: 7px;
    }

    /*left*/
    /*
    .left-step-left {
        width: 11px;
        height: calc(100% - 10px);
        display: block;
        position: absolute;
        left: -7px;
        top: 5px;
        transform: rotate(0) skewY(-45deg);
        border-radius: 4px;
        z-index: 1
    }
    */
    .left-step-left-left {
        width: 18px;
        height: 16px;
        display: block;
        position: absolute;
        bottom: -4px;
        left: -7px;
        z-index: 2;
        border-radius: 12px;
    }

    .left-step-left-main {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100%;
        z-index: 5;
        border-radius: 7px;
        height: 100%;
        top: 0px;
        left: 0px;
    }

    .left-step-left-main-wrapper {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100%;
        z-index: 4;
        border-radius: 7px;
    }

    /*right*/
    /*
    .right-step-right {
        width: 11px;
        height: calc(100% - 10px);
        display: block;
        position: absolute;
        left: -7px;
        top: 5px;
        transform: rotate(0) skewY(-45deg);
        border-radius: 4px;
        z-index: 1
    }
    */
    .right-step-right-left {
        width: 18px;
        height: 16px;
        display: block;
        position: absolute;
        bottom: -4px;
        left: -7px;
        z-index: 2;
        border-radius: 12px;
    }

    .right-step-right-main {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100%;
        z-index: 5;
        border-radius: 7px;
        height: 100%;
        top: 0px;
        left: 0px;
    }

    .right-step-right-main-wrapper {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100%;
        z-index: 4;
        border-radius: 7px;
    }




    .bottom-left-step-square,
    .top-left-step-square,
    .top-right-step-square,
    .bottom-right-step-square {
        background: #b3b3b3;
        display: block;
        position: absolute;
        z-index: 2;
        top: 8px;
        bottom: 0px;
        left: -9px;
        width: 100%;
        height: 100%;
        border-top-left-radius: 15px;
        border-bottom-right-radius: 15px;
        border-bottom-left-radius: 15px;
        border-top-right-radius: 15px;
    }

    .bottom-left-step-square-main,
    .top-left-step-square-main,
    .top-right-step-square-main,
    .bottom-right-step-square-main {
        position: absolute;
        top: 0px;
        bottom: 0;
        left: 0px;
        z-index: 5;
        /*
        width: calc(100% - 2px);
        height: calc(100% - 2px);*/
        width:100%;
        height:100%;
    
    }

    .bottom-left-step-square-main-wrapper,
    .top-left-step-square-main-wrapper,
    .top-right-step-square-main-wrapper,
    .bottom-right-step-square-main-wrapper {
        position: absolute;
        z-index: 4;
        top: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-top-left-radius: 15px;
        border-bottom-right-radius: 15px;
        border-bottom-left-radius: 15px;
        border-top-right-radius: 15px;
    }

    .stepIcon {
        display: flex;
        text-align: center;
        height: 100%;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        position:relative
    }

        .stepIcon img {
            width:80%
            /*width:50%;*/
        }

        .stepIcon .stepText {
        
        position: absolute;
        top: calc(100% + 20px);
        
            padding: 0 10px;
        }

    .stepText {
        opacity: 0
    }

    .stepIcon:hover .stepText {
        opacity: 1;
            color:#fff !important;
            font-weight:bold
    }

    .stepBackground {
        display: flex;
        text-align: center;
        height: 100%;
        position: relative;
        background-size: cover !important;
        background-position: center !important;
        border-radius: 0px;
    }

        .stepBackground .stepText {
            position: absolute;
            top: calc(100% + 20px);
            padding: 0 10px;
        }

        .stepBackground:hover .stepText {
            opacity: 1;
            font-weight: bold;
            color:#fff !important
        }

        .left-step .stepIcon .stepText {
            right: calc(100% + 20px);
            padding: 10px 0;
            top: unset;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
        }

    .left-step .stepBackground .stepText {
        right: calc(100% + 20px);
        padding: 10px 0;
        top: unset;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .left-step .stepBackground {
        border-radius:7px
    }

    .top-step .stepIcon .stepText {
        bottom: calc(100% + 10px);
        padding: 0 10px;
        display: flex;
        justify-content: center;
        align-items: center;
        top: unset;
    }

    .top-step .stepBackground .stepText,
    .top-left-step .stepBackground .stepText,
    .top-right-step .stepBackground .stepText {
        bottom: calc(100% + 10px);
        padding: 0 10px;
        display: flex;
        justify-content: center;
        align-items: center;
        top: unset;
    }

    .top-step .stepBackground {
        border-radius: 7px
    }

    .top-right-step .stepBackground .stepText, .top-right-step .stepBackground .stepText,
    .bottom-left-step .stepBackground .stepText, .bottom-right-step .stepBackground .stepText {
        width: 100%;
    }

    .right-step .stepIcon .stepText {
        left: calc(100% + 10px);
        padding: 10px 0;
        top: unset;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .right-step .stepBackground .stepText {
        left: calc(100% + 20px);
        padding: 10px 0;
        top: unset;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .stepText.active{
        opacity:1
    }

#middleBoard {
    position: absolute;

    z-index: 20;
    

}

#middleBoardWraper {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 0px;
    flex-direction: row;
}

    #timeClock {
        flex: 3;
        position: relative;
        z-index: 1;
        display: flex;
        align-items: center;
        height: 100%;
        flex-direction: column;
    }

    #timeClock i{
        font-size:60px
    }

        #timeClock:before {
            content: "";
            position: absolute;
            right: 0;
            top: 5%;
            height: 90%;
            width: 1px;
            background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, /* transparent blue */ rgba(0, 0, 0, 0.7) 10%, /* blurred blue */ black 50%, /* center */ rgba(0, 0, 0, 0.7) 90%, /* blurred blue */ rgba(0, 0, 0, 0) 100% /* transparent */ );
            filter: blur(0.4px);
        }

    #timer-display {
        font-size: 40px;
    }

#contensBoard {
    flex: 7;
    height: 100%;
    flex-direction: column;
    display: flex;
    align-items: center;
}

#message-container {
    position: relative;
    z-index: 1;
    font-size: 30px;
    text-align: center;
    width: 80%;
    flex-direction: column;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 10px 5px 10px;
    overflow: auto
}

.boardMessageHTML {
    font-size: 30px;
    color: #fff;
    max-height: 100%;
    overflow: hidden;
}


        .boardMessageHTML > div {
            color: #4b2aa6;
            text-shadow: 0 2px 6px rgba(255, 255, 255, 0.6);
            font-weight: 700;
        }

        #leftsideboard, #rightsideboard {
            display: flex;
            min-height: 60%;
            width: 200px;
            flex: 0 0 200px;
            visibility: hidden
        }

    #leftsideboard{
        padding-left:50px
    }

#rightsideboard {
    padding-right: 50px
}

    #leftsideboard .player-side, #rightsideboard .player-side {
        display: flex;
        flex-direction: column;
        /*gap: 3.6%;*/
        width: 100%;
       
        gap: 15px;
        justify-content: center
    }
            /*
            #leftsideboard .player-side::before,
            #leftsideboard .player-side::after {
                content: "";
                display: block;
                height: 3.6%;
            }
    */


#boardtimeline {
    position: absolute;
    top: 50%;
    left: 50%;
    display: inline-block;
    padding: 5px;
    /* background: rgba(255, 0, 0, 0.2); */
    transform: translate(-50%, -50%);
    z-index: -1;
    overflow: hidden;
    /*border: 20px solid #125e7d;*/
    margin-top: 10px;
    border-radius: 10px;
}

        #boardtimeline > svg.border-timer {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
        }
        /* Smooth sweep each second */
        #boardtimeline .progress-path {
            transition: stroke-dasharray .6s linear, stroke-dashoffset .6s linear;
        }

        #boardtimeline .progress-arrow {
            transition: transform .6s linear;
        }

    #progressbar-arrow {
        height: 20px;
        width: 20px;
        position: absolute;
        transition: left 0.6s linear, top 0.6s linear; /* smooth 200ms animation */

        z-index: 10;
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        border-left: 25px solid #ffd400; /* Arrow color */
        visibility: hidden;
        display:none
    }


    
    /*
        .playerCurrentTurn .player-info .nickname-text,
        .playerCurrentTurn .player-cards-on-turn .card,
        .player-label .player-info .nickname-text,
        .player-label .player-cards-on-turn .card{
            transition: height 0.5s ease, width 0.5s ease;
        }
    */
    .player-label .rank,
    .player-label .nickname-text,
    .player-cards-small .card,
    .player-cards-on-turn .card {
        transition: all 0.5s ease; /* smooth height/width changes */
    }


/*
    .player-label.playerCurrentTurn {
        flex-direction: column;
    }*/

        .player-cards-on-turn {
           
           
            transition: opacity 100.3s ease;
        }

.playerCurrentTurn .player-cards-on-turn {
    display: flex;
    opacity: 1;
   
    padding-bottom: 10px;
    z-index: 10;
}

    .player-cards-small {
        display: block;
        opacity: 1;
        transition: opacity 0.3s ease;
    }

    .playerCurrentTurn .player-cards-small {
        opacity: 0;
        display: none;
    }

    .playerCurrentTurn .player-cards-on-turn .card img {
        display: block;
        opacity: 1;
    }
/*
    .player-side .player-label.playerCurrentTurn {
        border:none
    }

    .player-side .player-label.playerCurrentTurn {
        margin-bottom: 40px;
        margin-top: 20px
    }
        */
/*
        .player-side .player-label.playerCurrentTurn:first-child {
            margin-bottom: 40px;
            margin-top: 0px
        }
        */

/*
    .playerCurrentTurn .nickname {
        align-items: start
    }*/

   


    .tile-icon {
        position: absolute;
        inset: 0;
        margin: auto;
        max-width: 90%;
        max-height: 90%;
        z-index: 10;
        pointer-events: none;
    }

    .box {
        width: 100%;
        height: 100%;
        position: relative;
   
        --w: 300px;
        --h: 200px;
        --d: 100px;
    }

    .box__face {
        position: absolute;
        display: flex;
        align-items: center;
        justify-content: center;

        display:none
    }

    .box__face--front {
        width: 100%;
        height: 100%;
        display: flex;
        position: relative;
        z-index: 3;
        overflow: hidden;
    }

        .box__face--front::before {
            content: "";
            position: absolute;
            left: -10%;
            top: -20%;
            width: 70%;
            height: 55%;
            background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.45), rgba(255,255,255,0) 70%);
            transform: rotate(-12deg);
            pointer-events: none;
            z-index: 9; /* dưới icon, trên nền */
            opacity: .9;
        }

    .box__face--back {
        width: 100%;
        height: 100%
    }

    .showFrontOuter {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 4px;
    }

    .showFrontBorder {
        position: absolute;
        top: 2px;
        left: 2px;
        width: calc(100% - 4px);
        height: calc(100% - 4px);
        border-radius: 4px;
    }

    .showFrontBackground {
        position: absolute;
        top: 4px;
        left: 4px;
        width: calc(100% - 8px);
        height: calc(100% - 8px);
        border-radius: 4px;
        box-shadow: inset 0 10px 14px rgba(255, 255, 255, .12), inset 0 -14px 18px rgba(0, 0, 0, .12);
    }




    #bottom-step-container .box__face--bottom, #left-step-container .box__face--bottom, #right-step-container .box__face--bottom {
        height: 20px;
        display: block;
        position: absolute;
        left: 2px;
        bottom: -19px;
        transform: rotate(0) skewX(15deg);
        border-radius: 4px;
        z-index: 1;
        width: 100%;
        border-bottom-right-radius: 8px;
        border-top-left-radius: 2px;
    }

    #bottom-step-container .box__face--right {
        width: 24px;
        height: calc(100% + 7px);
        display: block;
        position: absolute;
        bottom: -19px;
        right: -4px;
        z-index: 2;
        border-radius: 12px;
        border-top-right-radius: 4px;
    }

    #left-step-container .box__face--right {
        width: 24px;
        height: calc(100% + -10px);
        display: block;
        position: absolute;
        bottom: -19px;
        right: -6px;
        z-index: 2;
        border-radius: 12px;
        border-top-right-radius: 4px;
    }

    #left-step-container .box__face--bottom {
        border-bottom-right-radius: 14px;
    }

#right-step-container .box__face--right {
    width: 24px;
    height: calc(100% + -10px);
    display: block;
    position: absolute;
    bottom: -7px;
    left: -6px;
    z-index: 2;
    border-radius: 12px;
    border-top-left-radius: 4px;
}



    #right-step-container .box__face--bottom {
        border-bottom-right-radius: 14px;
        left:0;
        display:none
    }


    #bottom-step-container .box__face--top, #left-step-container .box__face--top, #right-step-container .box__face--top {
        height: 15px;
        width: calc(100% + 0px);
        display: block;
        position: absolute;
        left: 2px;
        top: 0px;
        transform: rotate(0) skewX(15deg);
        border-radius: 4px;
        z-index: 1;
        border-top-right-radius: 10px;
        border-bottom-right-radius: 0px;
    }

    #left-step-container .box__face--top {
        left: 3px;
        height: 29px;
        border-bottom-right-radius: 5px;
        border-top-right-radius: 4px;
        top: 3px;
    }


#right-step-container .box__face--top {
    left: -6px;
    height: 29px;
    border-bottom-left-radius: 18px;
    border-top-left-radius: 4px;
    top: 3px;
    transform: rotate(0) skewX(-15deg);
} 

    #top-step-container .box__face--bottom {
        height: 25px;
        width: calc(100% - 7px);
        display: block;
        position: absolute;
        left: 2px;
        bottom: -24px;
        transform: rotate(0) skewX(15deg);
        border-radius: 4px;
        z-index: 1;
        width: 100%;
        border-bottom-right-radius: 8px;
        border-top-left-radius: 2px;
    }

    #top-step-container .box__face--right {
        width: 24px;
        height: calc(100% + 1px);
        display: block;
        position: absolute;
        bottom: -24px;
        right: -4px;
        z-index: 2;
        border-radius: 12px;
        border-top-right-radius: 7px;
    }

     #top-step-container .box__face--top {
        height: 15px;
        width: calc(100% + 0px);
        display: block;
        position: absolute;
        left: 2px;
        top: 0px;
        transform: rotate(0) skewX(15deg);
        border-radius: 4px;
        z-index: 1;
        border-top-right-radius: 10px;
        border-bottom-right-radius: 0px;
    }


    .bottom-step-bottom-main::after,
    .bottom-left-step-square-main::after,
    .bottom-right-step-square-main::after,
    .left-step-left-main::after,
    .right-step-right-main::after,
    .top-step-top-main::after {
        content: "";
        position: absolute;
        left: 12%;
        right: 12%;
        bottom: -6px;
        height: 16px;
        background: rgba(0,0,0,.18);
        filter: blur(10px);
        transform: skewX(-10deg);
        pointer-events: none;
        z-index: -1;
    }

    .bottom-step-bottom-main,
    .bottom-left-step-square-main,
    .bottom-right-step-square-main,
    .left-step-left-main,
    .right-step-right-main,
    .top-step-top-main {
        filter: drop-shadow(-2px 8px 8px rgba(0,0,0,.14)) drop-shadow(-1px 2px 2px rgba(0,0,0,.10));
        overflow: visible;
        position: relative;
        isolation: isolate;
    }

    .left-step-left-main, .bottom-left-step-square-main {
        filter: drop-shadow(-2px 7px 7px rgba(0,0,0,.12)) drop-shadow(-1px 2px 2px rgba(0,0,0,.08));
    }

    .box__face--front {
        z-index: 3;
    }

    #bottom-step-container .box__face--right,
    #left-step-container .box__face--right,
    #top-step-container .box__face--right {
        z-index: 2;
    }

    #bottom-step-container .box__face--bottom,
    #left-step-container .box__face--bottom,
    #top-step-container .box__face--bottom,
    #bottom-step-container .box__face--top,
    #left-step-container .box__face--top,
    #top-step-container .box__face--top {
        z-index: 1;
    }

#bottom-step-container .bottom-right-step .box__face--right, #bottom-step-container .bottom-right-step .box__face--top {
    display: none
}

#bottom-step-container .bottom-right-step .box__face--bottom {
    transform: rotate(0) skewX(-11deg);
    left: -2px;
    border-bottom-right-radius: 8px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 8px;
    border-top-left-radius: 0;
}


#bottom-step-container .bottom-step[data-index='2'] .box__face--bottom {
    transform: rotate(0) skewX(-5deg);
    left: -1px;
    border-bottom-right-radius: 8px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 8px;
    border-top-left-radius: 0;
}

#bottom-step-container .bottom-step[data-index='3'] .box__face--bottom {
    transform: rotate(0) skewX(-4deg);
    left: -1px;
    border-bottom-right-radius: 8px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 8px;
    border-top-left-radius: 0;
}

#bottom-step-container .bottom-step[data-index='4'] .box__face--bottom {
    transform: rotate(0) skewX(-3deg);
    left: 0px;
    border-bottom-right-radius: 8px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 8px;
    border-top-left-radius: 0;
}

#bottom-step-container .bottom-step[data-index='5'] .box__face--bottom {
    /*
    transform: rotate(0) skewX(-3deg);
    left: 0px;
    border-bottom-right-radius: 4px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 6px;
    border-top-left-radius: 0;
        */
    transform: rotate(0) skewX(9deg);
    left: 2px;
    border-bottom-right-radius: 12px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 8px;
    border-top-left-radius: 0;
}

#top-step-container .top-step[data-index='19'] .box__face--bottom {
    transform: rotate(0) skewX(-5deg);
    left: -1px;
    border-bottom-right-radius: 8px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 8px;
    border-top-left-radius: 0;
}

#top-step-container .top-step[data-index='18'] .box__face--bottom {
    transform: rotate(0) skewX(-4deg);
    left: -1px;
    border-bottom-right-radius: 8px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 8px;
    border-top-left-radius: 0;
}

#top-step-container .top-step[data-index='17'] .box__face--bottom {
    transform: rotate(0) skewX(-3deg);
    left: 0px;
    border-bottom-right-radius: 8px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 8px;
    border-top-left-radius: 0;
}

#top-step-container .top-step[data-index='16'] .box__face--bottom {
    transform: rotate(0) skewX(9deg);
    left: 2px;
    border-bottom-right-radius: 12px;
    border-top-right-radius: 0;
    border-bottom-left-radius: 8px;
    border-top-left-radius: 0;
}

#bottom-step-container .showFrontOuter {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 0;
    left:1px;

}

#bottom-step-container .bottom-left-step .box__face--bottom{
    left:5px
}

#player-rank-bar {
    display: none
}



#app:before {
    opacity: 1;
    /*background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 70%), linear-gradient(180deg, #9b95ff, #8a83f2) !important;*/
    background: url(../images/purple-background.png?v=1) center/cover no-repeat !important;
}

#app::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-repeat: repeat;
    background-size: 512px 512px;
    background-image: url("../images/noise_strong.png");
    opacity: 1;
    z-index: 1;
}

#middleBoardBackground {
    z-index: 1;
    justify-content: center;
    align-items: center;
    display: flex;
    padding-top: 3%;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
  
}

#middleBoardBackground:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-radius: 4px;
    height: calc(100% - 20px);
    margin-top: 29px;
    width: calc(100% - 16px) !important;
    margin-left: 8px;
    background-origin: border-box;
    background-clip: border-box, content-box;
    box-shadow: 0 0 18px rgb(235 67 235 / 35%), inset 0 0 0 2px rgb(235 155 235 / 52%);
}

#middleBoardBackground:after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url(../images/noise_strong.png);
    pointer-events: none;
    background-repeat: repeat;
    background-size: 512px 512px;
    opacity: 1;
    z-index: 1;
}

#middleBoardBackgroundContent {
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.65) 0%, rgba(210, 190, 255, 0.55) 35%, rgba(170, 140, 255, 0.55) 60%, rgb(61 39 107 / 45%) 100%);
    backdrop-filter: blur(2px);
    border-radius: 10px;
    transform: translateZ(0.01px);
    will-change: transform;
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-radius: 4px;
    height: calc(100% - 20px);
    margin-top: 29px;
    width: calc(100% - 16px) !important;
    margin-left: 8px;
    background-origin: border-box;
    background-clip: border-box, content-box;
    box-shadow: inset 0 10px 16px rgba(255,255,255,.18), inset 0 -20px 28px rgba(40,60,160,.45);
}


    #middleBoardBackgroundContent:before {
        content: "";
        position: absolute;
        inset: -6px;
        border-radius: 28px;
         background: radial-gradient(ellipse at center, rgba(180, 200, 255, .25), rgba(120, 80, 200, .15) 45%, transparent 70%);
        opacity: 0.55;
        filter: blur(10px);
        z-index: -1;
    }


    #middleBoardBackgroundContent:after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        box-shadow: 0 26px 42px rgba(0,0,0,.35);
  
        z-index: -1;
    }



    #top-step-container .top-right-step .box__face--right,
    #top-step-container .top-right-step .box__face--top,
    #top-step-container .top-right-step .box__face--bottom {
        display: none
    }

#board::after {
    content: "";
    position: absolute;
    inset: -18px;
    border-radius: 8px;
    z-index: -1;
    transform: translateY(20px);
    /*
    background: linear-gradient(to bottom, #8266d5 0%, #7d5dd5 100%);
    box-shadow: inset 0 2px 4px rgba(255,255,255,.15), 0 14px 22px rgba(0,0,0,.3);
        */

        padding: 2px;
        box-shadow: 0 0 18px rgb(235 67 235 / 35%), inset 0 0 0 2px rgb(235 155 235 / 52%);
        background: linear-gradient(180deg, rgb(117 12 117 / 55%), rgb(123 11 123 / 0%)) top / 100% 2px no-repeat, linear-gradient(90deg, rgb(99 29 99 / 35%), rgb(147 71 211 / 15%), rgb(99 29 99 / 35%)) 0 0 / 100% 100%;
    }

#board::before {
    content: "";
    position: absolute;
    inset: -18px;
    border-radius: 15px;
    z-index: -1;
    top: calc(100% + 35px);
    height: 35px;
    border-top-right-radius: 0;
    border-top-left-radius: 0;
    transform: rotateX(-30deg) translateZ(-10px);
    border-radius: 0 0 20px 20px;
    box-shadow: inset 0px 0px 3px rgb(185 161 185 / 90%), 0 26px 60px rgba(0, 0, 0, .15), inset 0 10px 18px rgba(255, 255, 255, 0), inset 0 -16px 22px rgb(69 3 69 / 95%);
    filter: blur(.2px);
    background: radial-gradient(90px 46px at 25% 42%, rgba(255, 90, 50, .55), rgba(255, 90, 50, 0) 70%), radial-gradient(120px 55px at 60% 44%, rgba(255, 70, 90, .48), rgba(255, 70, 90, 0) 72%), radial-gradient(110px 55px at 82% 43%, rgba(255, 95, 60, .40), rgba(255, 95, 60, 0) 72%), linear-gradient(90deg, rgba(255, 120, 200, 0) 0%, rgba(255, 120, 200, .35) 10%, rgba(255, 150, 80, .55) 35%, rgba(255, 220, 255, .25) 50%, rgba(255, 150, 80, .55) 65%, rgba(255, 120, 200, .35) 90%, rgba(255, 120, 200, 0) 100%);
    opacity: 1;
    pointer-events: none;
}



#board-frame {
    background: radial-gradient(ellipse at 50% 55%, rgba(255,220,140,.90) 10%, rgba(255,170,70,.95) 22%, rgba(255,120,0,.65) 55%, rgba(255,120,0,0) 75%);
    position: absolute;
    left: 6%;
    right: 6%;
    top: 100%;
    height: 4px;
    transform: translateY(36px);
    z-index: 1;
}

#board-frame-bottom {
    background: radial-gradient(ellipse at 50% 55%, rgba(255, 220, 140, .90) 10%, rgba(255, 170, 70, .95) 22%, rgba(255, 120, 0, .65) 55%, rgba(255, 120, 0, 0) 75%);
    position: absolute;
    left: 1%;
    right: 1%;
    top: 100%;
    height: 1px;
    transform: translateY(66px);
    z-index: 1;
}



/*
@media (min-width: 2300px) {
    #bottom-step-container .box__face--bottom, #left-step-container .box__face--bottom, #right-step-container .box__face--bottom {
        height: 35px;
        bottom: -34px;
        left: 5px;
    }

    #top-step-container .box__face--bottom {
        height: 35px;
        bottom: -34px;
        left: 5px;
    }

    #top-step-container .box__face--right {
        bottom: -34px;
        right: -9px
    }

    #bottom-step-container .box__face--right {
        bottom: -34px;
        right: -9px;
    }

    #bottom-step-container .bottom-right-step .box__face--bottom {
        left: -3px;
    }

    #board::after {
        transform: translateY(35px);
    }

    #board::before {
        transform: rotateX(-30deg) translateZ(-12px);
        top: calc(100% + 53px)
    }

    #board-frame {
        transform: translateY(51px);
    }
}
*/


    /*







    .box__face--right,
    .box__face--left {
        width: var(--d);
        height: var(--h);
        left: calc((var(--w) - var(--d) + 6px) / 2);
    }

    .box__face--top,
    .box__face--bottom {
        width: var(--w);
        height: var(--d);
        top: calc((var(--h) - var(--d)) / 2);
   
    }

    .box__face--front {
        transform: rotateY( 0deg) translateZ(calc(var(--d) / 2));
   
    }

    .box__face--back {
        transform: rotateY(180deg) translateZ(calc(var(--d) / 2));
   
    }

    .box__face--right {
        transform: rotateY( 90deg) translateZ(calc(var(--w) / 2));
   
    }

    .box__face--left {
        transform: rotateY(-90deg) translateZ(calc(var(--w) / 2));
  
    }

    .box__face--top {
        transform: rotateX( 90deg) translateZ(calc(var(--h) / 2));
  
    }

    .box__face--bottom {
        transform: rotateX(-90deg) translateZ(calc(var(--h) / 2));
        box-shadow: 0 8px 6px rgba(0,0,0,.18);

    }


    .box.show-front {
         transform: translateZ(calc(var(--d) / -2))  rotateY( -8deg) rotateX(40deg)

    }



        */


.dice-stage {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 60;
    pointer-events: none;
    gap: 60px; /* khoảng cách 2 dice */

    transition: transform .6s cubic-bezier(.25,.8,.25,1);
}

    /* Vị trí ban đầu */
    .dice-stage.center {
        transform: translateX(0);
    }



    /* Sau khi roll xong */
    .dice-stage.left {
        transform: translateX(-45vw); /* chỉnh theo layout của bạn */
    }


.dice-scene {
    perspective: 800px;
}

.dice.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(1);
}

.dice.visible {
    opacity: 1;
    visibility: visible;
}
.dice.visible {
    animation: dicePop .25s ease-out;
}

#diceA, #diceB {
    backface-visibility: hidden;
    transform-style: preserve-3d;
    
}

#diceStage {
    perspective: 1200px;

}

@keyframes dicePop {
    from {
        transform: scale(.2);
    }

    to {
        transform: scale(1);
    }
}
.dice {
    position: relative;
    width: 120px;
    height: 120px;
    transform-style: preserve-3d;
    transform: scale(1) rotateX(0deg) rotateY(0deg);
    transition: transform .4s ease-out;
}

.face {
    position: absolute;
    width: 120px;
    height: 120px;
    background: linear-gradient( 145deg, #ffffff, #dcdcff );
    border-radius: 4px;
    box-shadow: inset -8px -8px 14px rgba(0,0,0,.12), inset 6px 6px 12px rgba(255,255,255,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 110px;
    font-weight: bold;
    color: #333;
}


.front {
    transform: rotateY(0deg) translateZ(60px);
}

.back {
    transform: rotateY(180deg) translateZ(60px);
}

.right {
    transform: rotateY(90deg) translateZ(60px);
}

.left {
    transform: rotateY(-90deg) translateZ(60px);
}

.top {
    transform: rotateX(90deg) translateZ(60px);
}

.bottom {
    transform: rotateX(-90deg) translateZ(60px);
}

.dice.show {
    transform: scale(1);
}


.dice.rolling {
    transition: transform 1.4s cubic-bezier(.15,.8,.25,1);
    transform: scale(1) rotateX(1080deg) rotateY(1440deg);
}

.dice.locked {
    transition: none !important;
   
}

.dice .face {
    opacity: 1;
    visibility: visible;
    transition: opacity .25s ease;
   
}

/* khi lock: ẩn hết */
.dice.locked .face {
    opacity: 0;
    visibility: hidden;
}

/* chỉ hiện mặt đúng kết quả */
.dice.locked[data-result="1"] .face[data-value="1"],
.dice.locked[data-result="2"] .face[data-value="2"],
.dice.locked[data-result="3"] .face[data-value="3"],
.dice.locked[data-result="4"] .face[data-value="4"],
.dice.locked[data-result="5"] .face[data-value="5"],
.dice.locked[data-result="6"] .face[data-value="6"] {
    opacity: 1;
    visibility: visible;
}

#middleBoardWraper{
    background:none !important
}