/* --- Dice Simulator Specific Styles --- */

#results-section {
    min-height: 300px;
    perspective: 1500px;
    background-color: var(--bs-tertiary-bg, var(--bs-body-bg));
}

.dice-scene {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    min-height: 200px;
    flex-wrap: wrap;
    padding: 2rem 0;
}

.cube-container {
    width: 100px;
    height: 100px;
    position: relative;
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

.face {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 2px solid #495057;
    /* Fixed border color */
    border-radius: 10px;
    font-size: 2.8rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    /* ▼ Fixed light background regardless of theme */
    background-color: #f8f9fa;
    color: #212529;
    /* ▲ Fixed light background regardless of theme */
    backface-visibility: hidden;
    transition: filter 0.3s ease-out;
    filter: blur(0px);
}

.face span {
    display: inline-block;
    transition: filter 0.3s ease-out, transform 0.3s;
    filter: blur(0px);
}

.cube.is-rolling .face {
    filter: blur(1px);
}

.cube.is-rolling .face span {
    filter: blur(4px);
    transform: scale(1.2);
}

/* --- Coloring --- */
/* These styles override the above when coloring is enabled */
.dice-scene.colored .cube[data-color-index="0"] .face {
    background-color: #0d6efd;
    color: white;
    border-color: #fff;
}

.dice-scene.colored .cube[data-color-index="1"] .face {
    background-color: #198754;
    color: white;
    border-color: #fff;
}

.dice-scene.colored .cube[data-color-index="2"] .face {
    background-color: #dc3545;
    color: white;
    border-color: #fff;
}

.dice-scene.colored .cube[data-color-index="3"] .face {
    background-color: #ffc107;
    color: #333;
    border-color: #333;
}

.dice-scene.colored .cube[data-color-index="4"] .face {
    background-color: #0dcaf0;
    color: white;
    border-color: #fff;
}

.dice-scene.colored .cube[data-color-index="5"] .face {
    background-color: #6f42c1;
    color: white;
    border-color: #fff;
}

.dice-scene.colored .cube[data-color-index="6"] .face {
    background-color: #fd7e14;
    color: white;
    border-color: #fff;
}

.dice-scene.colored .cube[data-color-index="7"] .face {
    background-color: #20c997;
    color: white;
    border-color: #fff;
}

.dice-scene.colored .cube[data-color-index="8"] .face {
    background-color: #d63384;
    color: white;
    border-color: #fff;
}

.dice-scene.colored .cube[data-color-index="9"] .face {
    background-color: #6c757d;
    color: white;
    border-color: #fff;
}


/* --- 3D Face Positions --- */
.face-1 {
    transform: rotateY(0deg) translateZ(50px);
}

.face-2 {
    transform: rotateX(-90deg) translateZ(50px);
}

.face-3 {
    transform: rotateY(90deg) translateZ(50px);
}

.face-4 {
    transform: rotateY(-90deg) translateZ(50px);
}

.face-5 {
    transform: rotateX(90deg) translateZ(50px);
}

.face-6 {
    transform: rotateY(180deg) translateZ(50px);
}

.result-text-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bs-border-color);
}

/* --- Button Animation --- */
#roll-btn {
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] #roll-btn {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#roll-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

[data-bs-theme="dark"] #roll-btn:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

#roll-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}