@font-face {
    font-family: 'Silkscreen-Regular';
    src: url('Silkscreen-Regular.ttf') format('truetype');
    /* You can specify other font formats (e.g., woff, woff2, eot) here for better browser compatibility */
}

body {
    background: linear-gradient(45deg, #000, #000);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    color: #FFF;
    font-family: 'Silkscreen-Regular', sans-serif;
}

body h1 {
    text-align: center;
    font-family: 'Silkscreen-Regular', sans-serif;
}

#game-wrapper {

    position: relative;
}

#mobile-controls-container,
#game-container {
    display: grid;
    width: 100%;
    /* Use the full width */
    max-width: 100vh;
    /* Limit the height to the viewport height */
    margin: auto;
    grid-gap: 0px;
}

.cell {
    width: 100%;
    padding-top: 100%;
    /* This creates a square aspect ratio */
    position: relative;
}

.cell-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: lightgrey;
    border: 0px solid black;
    border-radius: 10px;
}

.obstacle {
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, #c0392b, #922b21);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.exit {
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, #27ae60, #1e8449);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.player {
    color: #FFF;
    font-weight: bold;
    text-align: center;
    font-size: 100%;
    width: 100px;
    height: 100px;
    background-color: #3498db;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#level-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2em;
    color: white;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    display: none;
    /* Initially hidden */
    z-index: 1000;
    /* Ensure it's above other elements */
}

/* Add this to your CSS */
.path {
    border: 1px red dotted;
}

.cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border: 1px solid #fff;
    border-radius: 10px;
}

.cell-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 0;
    /* Initially set font size to 0 */
}

#mobile-controls {
    display: flex;
    flex-direction: column;
    /* Stack buttons vertically */
    align-items: center;
    /* Center buttons horizontally */
    margin-top: 10px;
    /* Adjust margin as needed */
}

#mobile-controls_row1,
#mobile-controls_row2,
#mobile-controls_row3 {
    display: flex;
    /* Display buttons in rows */
    justify-content: center;
    /* Center buttons horizontally within each row */
    width: 100%;
    /* Ensure full width of the container */
}

#mobile-controls_row1 button,
#mobile-controls_row3 button {
    flex: 0;
    /* Take no additional height, allowing the other buttons to be in the same row */
    margin-right: 0px;
    /* Adjust margin between the buttons */
    width: 33%;
}

#mobile-controls_row2 {
    flex: 1;
    /* Make the second row take all available height */
    justify-content: space-between;
    /* Distribute buttons evenly */
    align-items: center;
    /* Center buttons vertically */
}

#mobile-controls_row1 button,
#mobile-controls_row2 button,
#mobile-controls_row3 button {
    flex: 0 0 33%;
    /* Each button takes 30% of the available width */
    font-size: 2em;
    /* Adjust font size as needed */
    padding: 10px;
    /* Adjust padding as needed */
    cursor: pointer;
    color: #fff;
    border-radius: 10px;
    margin-bottom: 0px;
    margin-top: 0px;
}

/* Specific styling for the up button */
#up-button {
    flex: 0;
    /* Take no additional height, allowing the other buttons to be in the same row */
    margin-right: 0px;
    /* Adjust margin between the buttons */
}

#down-button {
    flex: 0;
    /* Take no additional height, allowing the other buttons to be in the same row */
    margin-right: 0px;
    /* Adjust margin between the buttons */
}

#mobile-controls-container {
    position: absolute;
    top: 0px;
}

/* CSS for fade-out animation */
.fade-out {
    opacity: 0.8;
    background-color: transparent;
    border: 1px #000 solid;
    transition: opacity 0.5s ease-out;
}

/* CSS for fade-in animation */
.fade-in {
    opacity: 0.5;
    background-color: #000;
    border: 0px #000 solid;
    transition: opacity 0.5s ease-in;
}
.menu-button {
    background-color: #3498db;
    color: #fff;
    border: none;
    padding: 15px 30px;
    margin: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease-in-out;
}

.menu-button:hover {
    background-color: #2980b9;
}
.menu {
    display: flex;
    flex-direction: column;
    align-items: center;
}





.menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    width:100%;
    justify-content: center;
}

.menu-button {
    background-color: #3498db;
    color: #fff;
    border: none;
    padding: 15px 30px;
    margin: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease-in-out;
    width:80%;
}

.menu-button:hover {
    background-color: #2980b9;
}

.back-button {
    background-color: #e74c3c;
}
#load-game-button{
background-color:darkgray;
}

.cube {
    width: 200px;
    height: 200px;
    transform-style: preserve-3d;
    animation: wobble 2s infinite alternate;
    margin-bottom:30%;
}

.face {
    position: absolute;
    width: 200px;
    height: 200px;
    background-color: rgba(0, 0, 255, 1);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    border: 1px solid #000;
    color: #FFF;
}

.front { transform: translateZ(100px); }
.back { transform: translateZ(-100px) rotateY(180deg); }
.left { transform: translateX(-100px) rotateY(-90deg); }
.right { transform: translateX(100px) rotateY(90deg); }
.top { transform: translateY(-100px) rotateX(90deg); }
.bottom { transform: translateY(100px) rotateX(-90deg); }

@keyframes wobble {
    0%, 100% {
        transform: rotateX(0deg) rotateY(0deg) scale(1);
    }
    25% {
        transform: rotateX(5deg) rotateY(5deg) scale(1.05);
    }
    50% {
        transform: rotateX(-5deg) rotateY(-5deg) scale(0.95);
    }
    75% {
        transform: rotateX(5deg) rotateY(5deg) scale(1.05);
    }
}
