/*
  1. Use a more-intuitive box-sizing model.
*/
*,
*::before,
*::after {
    box-sizing: border-box;
    /* border: solid 1px; */
}
/*
2. Remove default margin
*/

* {
    margin: 0;
}
/*
Typographic tweaks!
3. Add accessible line-height
4. Improve text rendering
*/
body {
    line-height: 1.5;
    font-family: "kablammo-variable", sans-serif;
    font-variation-settings: "MORF" 0;
}
/*
5. Improve media defaults
*/
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}
/*
6. Remove built-in form typography styles
*/
input,
button,
textarea,
select {
    font: inherit;
}
/*
7. Avoid text overflows
*/
p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
    margin: 0;
    padding: 0;
}
/*
8. Create a root stacking context
*/
#root,
#__next {
    isolation: isolate;
}

h1 {
    font-size: clamp(1rem, 4vw, 5rem);
    margin-bottom: 2rem;
}

body {
    background-image: url("./img/desert.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* for all screens */
.info {
    display: none;
    opacity: 0;
    transition: all 1s ease-out;
}

canvas {
    position: relative;
    background-color: black;
    display: block;
    border-radius: 1rem;
    -webkit-box-shadow: 0px 0px 10px 3px #ef9248;
    box-shadow: 0px 0px 10px 3px #ef9248;
}

button {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 2.1rem;
    height: 2.1rem;
    border: 2px solid black;
    cursor: pointer;
    background-color: rgb(253, 181, 80);
}

button:hover {
    background-color: rgb(225, 108, 45);
}

button:active {
    background-color: rgb(202, 80, 44);
}

button:disabled,
button[disabled] {
    border: 1px solid #999999;
    border: 2px solid black;
    background-color: #cccccc;
    color: #666666;
    cursor: default;
}

.start {
    display: flex;
    position: absolute;
    background: url("./img/9_intro_outro_screens/start/startscreen_1.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: right;
    width: 100%;
    height: 100%;
    border-radius: 1rem;
    z-index: 3;
}

.game-over {
    display: flex;
    position: absolute;
    background: url("./img/9_intro_outro_screens/game_over/game over.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 100%;
    border-radius: 1rem;
    z-index: 3;
    overflow: hidden;
}

.you-won {
    display: flex;
    position: absolute;
    background: url("./img/9_intro_outro_screens/start/you-won.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 100%;
    border-radius: 1rem;
    z-index: 3;
    overflow: hidden;
}

.d-none {
    display: none !important;
}

.d-flex {
    display: flex;
}

.d-none-invisible {
    visibility: hidden;
}

.play-game {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    border-radius: 1rem;
}

.buttons-top {
    position: absolute;
    top: 1rem;
    display: flex;
    justify-content: end;
    gap: 1.25rem;
    z-index: 5;
    width: 100%;
    margin-right: 1rem;
    transition: top 200ms ease-in-out 200ms;
}

.info-button-top {
    margin-right: auto;
    margin-left: 1rem;
}

.buttons-bottom-left-side,
.buttons-bottom-right-side {
    display: flex;
    justify-content: space-between;
    gap: 3rem;
    margin-inline: 1rem;
}

.music-off,
.music-on {
    margin-right: 1rem;
}

.buttons-bottom {
    position: absolute;
    display: none;
    bottom: 0.4rem;
    justify-content: space-between;
    gap: 1.25rem;
    z-index: 1;
    width: 100%;
    transition: bottom 200ms ease-in-out 200ms;
}

.buttons-bottom img {
    width: 1.875rem;
    height: 1.875rem;
}

.info-button-bottom {
    margin: 0;
}

.button-description {
    display: flex;
    flex-direction: row;
}

.button-description div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.description-how-to-play {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.description-how-to-play div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.description {
    font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
    font-size: clamp(1rem, 4vw, 2rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 1rem;
    max-width: 46.875rem;
    gap: 1.5rem;
}
.description-on-canvas-content {
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.description-on-canvas button,
.description button {
    cursor: auto;
    width: 1.8rem;
    height: 1.8rem;
}

.description-on-canvas button.space,
.description button.space {
    cursor: auto;
    width: 4.5rem;
    height: 1.6rem;
    border-radius: 0.3125rem;
    font-size: clamp(0.5rem, 4vw, 1rem);
}

.description-on-canvas button:hover {
    background-color: rgb(253, 181, 80);
}

.description button:active {
    background-color: rgb(253, 181, 80);
}

.description button:hover {
    background-color: rgb(253, 181, 80);
}

.description-on-canvas .close {
    border: none;
    cursor: pointer;
}

.description-on-canvas div .close-button {
    border: none;
    align-self: end;
    margin: 0.4rem 0.4rem 0 0;
}

.close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.game-description,
.button-description {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    max-width: 45rem;
    gap: 1rem;
}

.button-description-on-canvas {
    display: flex;
    flex-direction: column;
    align-items: center;
}

h4 {
    font-size: clamp(1rem, 4vw, 1.2rem);
}

.maximize-off,
.maximize {
    border: none;
    margin-right: 1rem;
}

.info-on-canvas {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    position: absolute;
    width: 100%;
    height: 100%;
}

.description-on-canvas {
    font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    backdrop-filter: blur(40px);
    max-width: 450px;
    max-height: 280px;
    z-index: 3;
    border-radius: 1rem;
    overflow-y: auto;
    padding: 0 0 0 1.25rem;
    margin-left: auto;
    margin-right: auto;
    bottom: 20%;
    top: 20%;
    left: 0;
    right: 0;
    text-align: center;
    overflow: hidden;
}

.break,
.play-again-you-won,
.play-again {
    font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    width: fit-content;
    height: fit-content;
    z-index: 3;
    border-radius: 1rem;
    padding-inline: 1rem;
    margin-left: auto;
    margin-right: auto;
    bottom: 20%;
    top: -10%;
    left: 0;
    right: 0;
    text-align: center;
    transition: top 200ms ease-in-out 200ms;
}

.play-again-show {
    top: 12%;
}
.buttons-top-now-show {
    top: -3rem;
}

.buttons-bottom-now-show {
    bottom: -3rem !important;
}

@media only screen and (max-width: 720px) {
    canvas {
        width: 100%;
    }
    .info-button {
        display: flex;
    }
    .description {
        display: none;
    }

    .title {
        display: none;
    }

    .buttons-bottom {
        display: flex;
    }
}

@media only screen and (max-width: 600px) and (min-height: 400px) {
    .info {
        background-color: rgb(253, 181, 80);
        z-index: 999;
        position: fixed;
        max-width: 100%;
        min-height: 100vh;
        opacity: 1;
        inset: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}

@media only screen and (max-height: 480px) {
    canvas {
        height: 100vh;
    }
}

.fullscreen canvas {
    height: 100vh;
    width: 100vw;
}

.fullscreen .buttons-bottom {
    position: absolute;
    display: flex;
    left: 50%;
    bottom: 0.5rem;
    transform: translate(-50%, 0);
}
