*{
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    box-sizing: border-box;
}

body{
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0f7fa;
    font-family: 'Arial', sans-serif;
}

.container{
    display: grid;
    place-items: center;
    width: 300px;
    padding: 40px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    text-align: center;
    perspective: 600px;
}

.dice{
    position: relative;
    width: 120px;
    height: 120px;
    transform-style: preserve-3d;
    transition: 1s ease;
    margin-bottom: 20px;
    animation: rolling 2s ease;
}

@keyframes rolling{
    50%{
        transform: rotateX(455deg) rotateY(455deg);
    }
}

.face{
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    border: 5px solid #ddd;
    transform-style: preserve-3d;
    background: linear-gradient(145deg, #dddbd8, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    color: #333; 
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.face::before{
    position: absolute;
    content: '';
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background: #f6f3f0;
    transform: translateZ(-1px);
}

.face::after{
    position: absolute;
    content: '';
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #131210

}

.front{
    transform: translateZ(50px);
}

.back{
    transform: rotateX(180deg) translateZ(50px);
}

.top{
    transform: rotateX(90deg) translateZ(50px);
}

.bottom{
    transform: rotateX(-90deg) translateZ(50px);
}

.right{
    transform: rotateY(90deg) translateZ(50px);
}

.left{
    transform: rotateY(-90deg) translateZ(50px);
}


.front::after{
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
}

.back::after{
    margin: -35px 0 0 -30px;
    box-shadow: 40px 0,
                0 25px,
                40px 25px,
                0 50px,
                40px 50px;
}

.top::after{
    margin: -30px 0 0 -30px;
    box-shadow: 40px 40px;
}

.bottom::after{
    margin: -36px 0 0 -36px;
    box-shadow: 26px 26px,
                52px 52px,
                52px 0,
                0 52px;
}

.right::after{
    margin: -30px 0 0 -30px;
    box-shadow: 40px 0px,
                0 40px,
                40px 40px;
}

.left::after{
    margin: -35px 0 0 -35px;
    box-shadow: 25px 25px,
                50px 50px;
}

.roll{
    cursor: pointer;
    color: #ffffff;
    background-color: #00796b; 
    margin-top: 20px; 
    padding: 12px 24px; 
    border-radius: 5px; 
    font-size: 18px; 
    font-weight: bold;
    border: none;
    transition: background-color 0.3s, transform 0.2s; 
}

.roll:hover{
    color: #fff;
    background-color: #004d40;
    transform: scale(1.05);
}

.roll:active {
    background-color: #00332b; 
    transform: scale(0.95);
}

.roll:focus {
    outline: none;
}