@import url('https://fonts.googleapis.com/css2?family=Rubik+Doodle+Shadow&display=swap');

/* Custom Variables to change block dimensions */
:root {
    --block-dimensions: 30px;
}

/* Global reset to enable consistency across browsers */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    color: white;
    background-color: black;
    font-family: "Rubik Doodle Shadow";
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

main {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
}

/* Title Section Styles */
.title-section {
    margin-block: 1rem;
    text-align: center;
    font-size: 220%;
    font-size: clamp(.9rem, 4vw, 2.8rem);
    letter-spacing: .5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid white;
}

/* Actions Sections Styles */
.action-section {
    display: flex;
    justify-content: space-evenly;
    padding-block: 1rem;
}

.action-section>* {
    gap: 2rem;
}

/* Level Section Styles */
.level-section {
    border-block: 1px solid white;
    text-align: center;
    letter-spacing: 5px;
    font-style: oblique;
    padding-block: 5px;
}

/* Stack Section Styles */
.stack-section {
    background-color: black;
    padding-block: 2rem;
    padding-inline: .5rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    column-gap: .5rem;
    row-gap: 1rem;
    align-items: flex-end;
}

/* Stack object styles */
.stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Block object styles */
.block {
    height: var(--block-dimensions);
    width: var(--block-dimensions);
    border: 1px solid white;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Action button styles */
.button {
    height: var(--block-dimensions);
    width: var(--block-dimensions);
    border: none;
}

.undo-button:active,
.reset-button:active,
.add-block-button:active,
.how-to-button:active {
    border: 2px solid white;
}

.undo-button {
    background: url(../icons/undo-icon.png) no-repeat center center/cover;
}

.reset-button {
    background: url(../icons/reset-icon.png) no-repeat center center/cover;
}

.add-block-button {
    background: url(../icons/add-icon.png) no-repeat center center/cover;
}

.how-to-button {
    background: url(../icons/how-to-icon.png) no-repeat center center/cover;
}

/* Styles for the how to play modal */
.how-to-modal {
    background-color: rgb(0, 0, 0, .9);
    text-align: center;
    font-size: 130%;
    display: none;
    height: 100vh;
    width: 100%;
    position: fixed;
    z-index: 1;
    font-family: monospace;
    padding: 1rem;
    overflow: auto;
    padding-bottom: 15rem;
    max-width: 600px;
}

.how-to-play__title {
    font-size: 250%;
    padding-block: 1rem;
}

.how-to-play__subtitle {
    font-size: 150%;
    padding: 1rem;
    margin: 1rem;
}

.how-to-play__content {
    padding: 1rem;
}

.close-button {
    font-size: 200%;
}

.gameplay-gif {
    width: 80%;
    aspect-ratio: 1/1;
    background: url(../gifs/gameplay.gif) no-repeat center center/cover;
    border: 1px solid white;
}

.addblock-gif {
    width: 80%;
    aspect-ratio: 1/1;
    background: url(../gifs/addblock.gif) no-repeat center center/cover;
    border: 1px solid white;
}

.undo-gif {
    width: 80%;
    aspect-ratio: 1/1;
    background: url(../gifs/undo.gif) no-repeat center center/cover;
    border: 1px solid white;
}

.reset-gif {
    width: 80%;
    aspect-ratio: 1/1;
    background: url(../gifs/reset.gif) no-repeat center center/cover;
    border: 1px solid white;
}

.how-to-play-action {
    padding-top: 1rem;
    padding-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Utility styles */

.flex {
    display: flex;
    justify-content: center;
}

.red {
    color: #e6194B;
}

.blue {
    color: #4363d8;
}

.yellow {
    color: #ffe119;
}

.green {
    color: #3cb44b;
}

.orange {
    color: #f58231;
}

.purple {
    color: #911eb4;
}

.cyan {
    color: #42d4f4;
}

.magenta {
    color: #f032e6;
}

.maroon {
    color: #800000;
}

.grey {
    color: #a9a9a9;
}

.olive {
    color: #808000;
}

/* Media queries */
@media screen and (min-width:360px) {
    :root {
        --block-dimensions: 40px;
    }
}

@media screen and (min-width:390px) {
    :root {
        --block-dimensions: 44px;
    }
}

@media screen and (min-width:414px) {
    :root {
        --block-dimensions: 46px;
    }

    .stack-section {
        max-width: 414px;
        align-self: center;
    }
}

@media screen and (min-width:768px) {
    :root {
        /* keep this */
        --block-dimensions: 50px;
    }

    .stack-section {
        max-width: 500px;
        align-self: center;
    }
}

@media screen and (min-width:1024px) {
    :root {
        /* keep this */
        --block-dimensions: 60px;
    }
}