* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    background: #afd33d;
    font-family: Arial, sans-serif;
}

/* Navigation */

.transform-nav {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 2rem;
}

.transform-nav a {
    color: white;
    font-weight: 700;
    text-decoration: none;
}

.transform-nav a:hover {
    opacity: 0.7;
}

/* Main layout */

.transform {
    padding: 1rem 2rem 3rem;
}

.transform-layout {
    width: min(1500px, 100%);
    min-height: 75vh;
    margin: 0 auto;

    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* Die area */

.die-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    min-width: 0;
}

.die-scene {
    width: 260px;
    height: 260px;

    perspective: 900px;
}

.die-cube {
    position: relative;

    width: 100%;
    height: 100%;

    transform-style: preserve-3d;

    transition: transform 1.2s cubic-bezier(0.15, 0.75, 0.25, 1);
}

.die-face {
    position: absolute;

    width: 260px;
    height: 260px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: white;
    border: 4px solid white;
    border-radius: 20px;

    overflow: hidden;

    backface-visibility: hidden;
}

.die-face img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.roll-button {
    padding: 0.8rem 2rem;

    border: 3px solid white;
    border-radius: 10px;

    background: #84a92a;
    color: white;

    font-size: 1rem;
    font-weight: 700;

    cursor: pointer;
}

.roll-button:hover {
    transform: translateY(-2px);
}

.roll-button:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Six cube faces */

.die-face-1 {
    transform: rotateY(0deg) translateZ(130px);
}

.die-face-2 {
    transform: rotateY(90deg) translateZ(130px);
}

.die-face-3 {
    transform: rotateY(180deg) translateZ(130px);
}

.die-face-4 {
    transform: rotateY(-90deg) translateZ(130px);
}

.die-face-5 {
    transform: rotateX(90deg) translateZ(130px);
}

.die-face-6 {
    transform: rotateX(-90deg) translateZ(130px);
}

/* Right two-thirds */

/* Sunflower display */

.sunflower-panel {
    min-height: 650px;
    padding: 2rem;

    display: flex;
    justify-content: center;
    align-items: center;

    background: white;
    border-radius: 18px;
    overflow: hidden;
}

.sunflower {
    width: 100%;
    min-height: 560px;

    display: flex;
    justify-content: center;
    align-items: center;
}

.sunflower-step {
    width: 90%;
    height: auto;
    max-height: 90%;
    object-fit: contain;
}

.sunflower-complete-video {
    width: 90%;
    height: auto;
    max-height: 90%;
    object-fit: contain;
    display: block;
}

/* End modal */

.end-modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
}

.end-modal.show {
    display: flex;
}

.end-modal-content {
    width: min(450px, 85%);
    padding: 2rem;

    background: #E97862;
    border: 4px solid white;
    border-radius: 18px;

    color: white;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;

    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.end-modal-content > p {
    margin: 0.35rem 0;
}

#resetTransform,
.next-transform {
    display: inline-block;
    padding: 0.8rem 2rem;

    border: 3px solid white;
    border-radius: 10px;
    background: #84a92a;

    color: white;
    font-family: Arial, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: normal;
    text-decoration: none;

    cursor: pointer;
}

#resetTransform {
    margin-top: 1rem;
}

.more-experiences {
    margin-top: 1rem;
}

.more-experiences p {
    margin: 0.25rem 0;
}

.next-transform {
    margin-top: 0.75rem;
}

#resetTransform:hover,
.next-transform:hover {
    opacity: 0.8;
}

/* Mobile */

@media (max-width: 800px) {

    .transform {
        padding: 1rem;
    }

    .transform-layout {
        grid-template-columns: 1fr;
    }

    .die-area {
        margin-bottom: 1rem;
    }

    .die-scene {
        width: 160px;
        height: 160px;
    }

    .die-face {
        width: 160px;
        height: 160px;
    }

    .die-face-1 {
        transform: rotateY(0deg) translateZ(80px);
    }

    .die-face-2 {
        transform: rotateY(90deg) translateZ(80px);
    }

    .die-face-3 {
        transform: rotateY(180deg) translateZ(80px);
    }

    .die-face-4 {
        transform: rotateY(-90deg) translateZ(80px);
    }

    .die-face-5 {
        transform: rotateX(90deg) translateZ(80px);
    }

    .die-face-6 {
        transform: rotateX(-90deg) translateZ(80px);
    }

    .sunflower-panel {
    height: 370px;
    min-height: 0;
    padding: 1rem;
    }

    .sunflower {
    height: 100%;
    min-height: 0;
    }

    .sunflower-step {
    width: 180%;
    max-width: none;
    max-height: none;
    height: auto;
    flex-shrink: 0;
    }

}