body {
    background-color: #feaf30d0; /* dim orange background */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    color: rgb(35, 35, 142);
    font-family: "enra-slab-variable", sans-serif;
    font-size: 1.5rem;
}

/* Styling all links */
a {
    color: rgb(35, 35, 142); /* Link color */
    text-decoration: none; /* Removes underline */
    font-weight: bold;
}

/* Styling links on hover */
a:hover {
    background-color: aliceblue;
    text-decoration: none; /* Underline on hover */
}

/* Styling links when focused or active */
a:focus, a:active {
    color: #004085; /* Link color when focused or active */
    text-decoration: underline;
}

#fab-container {
    position: fixed;
    bottom: 30px;
    right: 20px;
    cursor: pointer;
}

.h1 {
    text-align: center;
}

.hidden {
    display: none;
}

/* This class will be toggled by JavaScript */
.show {
    display: block;
}


footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 10px 0;
}


#dice {
    width: 350px;
    height: 350px;
    border: 3px solid rgb(35, 35, 142);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center; 
    font-size: 20px;
    cursor: pointer;
    user-select: none;
    padding: 2px;
    font-family: "enra-slab-variable",sans-serif;
    font-weight: 800;
    color: aliceblue;
    background-color: rgb(35, 35, 142);
    margin: 25px;
    transition: all 0.3s ease;
}

#dice:hover {
    background-color: rgba(35, 35, 142, 0.868); /* changing the background color on hover */
    transform: scale(.95); /* scaling up the dice on hover */
    border-radius: 20px; /* more rounded corners on hover */
}

@keyframes rotateZ {
    from { transform: rotateZ(0deg); }
    to { transform: rotateZ(720deg); }
}

.spinning {
    animation: rotateZ 3s linear;
}

#dice.finished-spinning {
    background-color: aliceblue; /* Change to your desired color */
    color: rgb(35, 35, 142);
    transition: background-color 0.3s ease; /* Smooth transition for color change */
}

#background-dice-image {
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: -1; /* Places the image behind other content */
    pointer-events: none; /* Ensures clicks pass through the image */
    max-width: 200px; /* Adjust the size as needed */
    cursor: pointer;
}


@media (max-width: 600px) {
    body {
        flex-direction: column; /* Reverse the order on smaller screens */
        align-content: center;
        justify-content: space-between; /* Aligns content to start and footer to end */
    }

    #intro-text {
        margin-top: 25%; /* Example: default bottom margin */
    }
    
    #dice {
        width: 60vw;  /* 60% of the viewport width */
        height: 60vw; /* Equal to the width to maintain a square shape */
        font-size: 3vw; /* Adjust the font size as needed */
        margin: 5px auto; /* Center the dice and adjust margin for spacing */
        max-width: 350px; /* Optional: max size to prevent it from becoming too large */
        max-height: 350px; /* Optional: same as max-width to maintain square shape */
    }
    footer {
        /* Remove position: fixed to allow it to be part of the flex flow */
        width: 100%;
        text-align: left;
        padding: 10px;

    }

    #fab-container {
        position: fixed;
        bottom: 20px;
        right: 20px;
        cursor: pointer;
    }
    #background-dice-image {
        position: fixed;
        left: 30;
        bottom: 30;
        z-index: -1; /* Places the image behind other content */
        pointer-events: none; /* Ensures clicks pass through the image */
        max-width: 150px; /* Adjust the size as needed */
        cursor: pointer;
    }
    a {
        color: aliceblue; /* Link color */
        background-color: rgba(35, 35, 142, .5);
        text-decoration: none; /* Removes underline */
        font-weight: bold;
        padding-left: 2px;
        padding-right: 2px;
    }
    
    /* Styling links on hover */
    a:hover {
        background-color: rgba(35, 35, 142, 1);
        text-decoration: none; /* Underline on hover */
    }
    
    /* Styling links when focused or active */
    a:focus, a:active {
        color: #004085; /* Link color when focused or active */
        text-decoration: underline;
    }
}
