/* 3D Dice Component Styles */

.dice-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 15px;
    perspective: 1200px; /* Increased perspective for better 3D effect */
    overflow: hidden;
    filter: drop-shadow(-6px 12px 8px rgba(0, 0, 0, 0.3));
}

.dice {
    position: relative;
    width: 60px;
    height: 60px;
    transform-style: preserve-3d;
    transition: transform 1s ease;
    cursor: pointer;
    margin: 30px;
    /* Initial 3D tilt for better visual effect */
    transform: rotateX(12deg) rotateY(5deg);
}

.dice.rolling {
    transition: transform 1s ease;
}

.face {
    position: absolute;
    width: 60px;
    height: 60px;
    background: #ffffff;
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    padding: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
}

/* Position each face of the cube */
.face.front  { transform: rotateY(0deg) translateZ(30px); }
.face.back   { transform: rotateY(180deg) translateZ(30px); }
.face.right  { transform: rotateY(90deg) translateZ(30px); }
.face.left   { transform: rotateY(-90deg) translateZ(30px); }
.face.top    { transform: rotateX(90deg) translateZ(30px); }
.face.bottom { transform: rotateX(-90deg) translateZ(30px); }

/* Dice dots */
.dot {
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
}

/* Face 1 - single dot in center */
.face.front {
    justify-content: center;
    align-items: center;
}

/* Face 2 - two dots diagonal */
.face.left {
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
}

/* Face 3 - three dots diagonal */
.face.top {
    justify-content: space-around;
    align-items: stretch;
    flex-direction: column;
}
.face.top .dot:first-child {
  margin-left: 5px;
  align-self: flex-start;
}
.face.top .dot:nth-child(2) {
    align-self: center;
}
.face.top .dot:last-child {
    align-self: flex-end;
    margin-right: 5px;
}

/* Face 4 - four dots in corners */
.face.bottom {
    justify-content: space-around;
    align-content: space-around;
    gap: 19px
}

/* Face 5 - five dots (four corners + center) */
.face.right {
    justify-content: space-around;
    align-content: space-around;
    gap: 19px
}
.face.right .dot:nth-child(3) {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Face 6 - six dots in two columns */
.face.back {
    justify-content: space-between;
    align-content: space-between;
    flex-direction: column;
}
.face.back .dot {
    width: 8px;
}

/* Roll button */
.roll-button {
    background: #437c62;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.roll-button:hover {
    background: #356149;
}

.roll-button:disabled {
    background: #999;
    cursor: not-allowed;
}

/* Result display */
.result {
    font-size: 18px;
    font-weight: bold;
    color: #437c62;
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(67, 124, 98, 0.1);
    border: 2px solid rgba(67, 124, 98, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    .dice {
        width: 50px;
        height: 50px;
        margin: 20px;
    }
    
    .face {
        width: 50px;
        height: 50px;
        padding: 6px;
    }
    
    .face.front  { transform: rotateY(0deg) translateZ(25px); }
    .face.back   { transform: rotateY(180deg) translateZ(25px); }
    .face.right  { transform: rotateY(90deg) translateZ(25px); }
    .face.left   { transform: rotateY(-90deg) translateZ(25px); }
    .face.top    { transform: rotateX(90deg) translateZ(25px); }
    .face.bottom { transform: rotateX(-90deg) translateZ(25px); }
    
    .dot {
        width: 6px;
        height: 6px;
    }
}