@font-face {
    font-family: "Unbounded-ExtraBold";
    src: url("./font/Unbounded-ExtraBold.ttf");
}

@font-face {
    font-family: "Unbounded-Regular";
    src: url("./font/Unbounded-Regular.ttf");
}

@keyframes rotate {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    5% {
        transform: translate(5px, 5px) rotate(5deg);
    }
    10% {
        transform: translate(0, 0) rotate(0eg);
    }
    15% {
        transform: translate(-5px, 5px) rotate(-5deg);
    }
    20% {
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

@keyframes full-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

:root {
    font-size: 16px;
}

.icon {
    position: absolute;
    animation: rotate 4s ease-in-out infinite;
}

.rotate:hover {
    animation: full-rotate 0.5s ease-in-out;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    font-size: 16px;
}

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

h1,
p {
    margin: 0;
}

body {
    margin: 0;
    padding: 0;
    background-color: #210b2e;
    scrollbar-width: none;
    background: url("./images/desktop-bg.png");
    background-size: cover;
    position: relative;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
    background-color: #3b0554;
}

h1,
#scoreTetris,
#scoreSnake {
    font-family: "Unbounded-ExtraBold", sans-serif;
    font-size: 1.5rem;
    align-self: center;
    color: #fff;
    margin-block: 0 1.5rem;
}

.content {
    display: flex;
    flex-direction: column;
    position: static;
}

.header {
    display: flex;
    position: absolute;
    top: 0;
    width: 100%;
    padding: 1.875rem 0 1.875rem 4.063rem;
    background: radial-gradient(
            74.52% 220.24% at 50.03% 100%,
            #9d20ff 0%,
            rgba(157, 32, 255, 0) 61.78%
        ),
        #210b2e;
    box-shadow: -36.984px 3.698px 92.46px 0 #000;
    backdrop-filter: blur(40.12693405151367px);
    z-index: -1;
}

.header-logo {
    width: 18.469rem;
}

.rocket-mob {
    display: none;
}

.rocket {
    width: fit-content;
    height: auto;
    z-index: 1;
    overflow: hidden;
    margin-left: 16%;
}

.icon-overlay {
    display: flex;
    height: 100%;
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

.star {
    bottom: 37%;
    left: 9%;
    width: 8%;
    z-index: 20;
}

.heart {
    width: 18%;
    top: 10%;
    left: 13%;
    z-index: 20;
}

.star-right {
    top: 25%;
    right: 6%;
    width: 8%;
    z-index: 20;
}

.flash {
    bottom: 36%;
    right: 22%;
    width: 7%;
    z-index: 20;
}

.bottom {
    width: max-content;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 4%;
    z-index: 2;
}

.bottom-container {
    display: flex;
    flex-direction: column;
    position: relative;
    color: #ffffff;
    text-shadow: 0.219rem 0.438rem 1.688rem #3b055480,
        0 0.209rem 1.25rem #7d14d0cc;
    border-radius: 2.2rem;
    background: radial-gradient(
            348.89% 277.7% at 64.44% 134.3%,
            #ff440036 0%,
            rgba(157, 32, 255, 0) 30%
        ),
        rgba(157, 32, 255, 0.2);
    box-shadow: -23.115px 2.311px 57.787px 0 #00000045,
        0 1.578px 0 0 rgb(255, 71, 255) inset,
        4.062px 5.416px 14.759px 0 rgba(0, 0, 0, 0.25),
        1.354px -8.124px 1.291px -7.267px rgba(157, 32, 255, 0.2) inset,
        4.062px 4.062px 5.145px -5.416px #9d20ff inset,
        -4.062px -4.062px 2.422px -5.416px #9d20ff inset,
        -1px 8px 10.906px 4.062px rgb(255, 71, 255, 10%) inset,
        0 0 48.444px 0 rgba(255, 71, 255, 0.1) inset;
    backdrop-filter: blur(0.2rem);
    padding: 1.594rem 2.3rem;
}

.bottom-container::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(35% 1% at 40% 0%, #ffffff, transparent);
    z-index: 100;
}

.title {
    font-family: "Unbounded-ExtraBold", sans-serif;
    font-size: 9rem;
    line-height: 0.8;
}

.contrast {
    color: #ff4200;
}

.column {
    display: flex;
    flex-direction: row;
    align-items: center;
    line-height: 1.3;
}

.column .title {
    font-size: 5.7rem;
}

.smaller-text {
    font-family: "Unbounded-Regular", sans-serif;
    font-size: 2.3rem;
    letter-spacing: -0.178rem;
}

.carousel-container {
    width: min(70%, 950px);
    margin: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    padding-bottom: 5%;
    height: min(100dvh, 1000px);
}

.carousel {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel .item {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
    inset: 0;
    visibility: hidden;
    pointer-events: none;
}

.carousel .item.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.btn {
    position: absolute;
    transform: translateY(-50%);
    top: 50%;
    cursor: pointer;
    background: transparent;
    border: none;
}

.prev {
    left: -5%;
    transform: rotate(-90deg);
    transition: transform 0.5s ease-in-out;

    &:active,
    &:hover {
        transform: scale(1.5) rotate(-90deg);
    }
}

.next {
    right: -5%;
    transform: rotate(90deg);
    transition: transform 0.5s ease-in-out;
    &:active,
    &:hover {
        transform: scale(1.5) rotate(90deg);
    }
}

.dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    margin-top: 5rem;

    .dot {
        cursor: pointer;
        height: 1.25rem;
        width: 1.25rem;
        border-radius: 50%;
        background-color: #60066f;
        transition: all 0.3s ease;
        box-shadow: inset 1px 2px 7px 2px #2f0343, inset 1px 1px 0 1px #1c0229;

        &.active,
        &:hover {
            box-shadow: none;
            background-color: #d55aea;
            box-shadow: inset 2px 2px 5px 0px #f7c7ffc7, 1px 1px 2px 0px #230041;
        }
    }
}

.tetris-container {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.left-column {
    position: relative;
    display: flex;
    flex-direction: column;
}
.right-column {
    display: flex;
    flex-direction: column;
    margin-left: 2rem;
}

canvas {
    box-shadow: rgba(0, 0, 0, 0.27) -23.115px 2.311px 57.787px 0px,
        rgba(255, 71, 255, 0.331) 2px 2px 10px 0px inset,
        rgba(0, 0, 0, 0.25) 4.062px 5.416px 14.759px 0px,
        rgba(157, 32, 255, 0.2) 1.354px -8.124px 1.291px -7.267px inset,
        rgb(157, 32, 255) 4.062px 4.062px 5.145px -5.416px inset,
        rgb(157, 32, 255) -4.062px -4.062px 2.422px -5.416px inset,
        rgba(255, 71, 255, 0.1) -1px 8px 10.906px 4.062px inset,
        rgba(255, 71, 255, 0.1) 0px 0px 48.444px 0px inset;
    backdrop-filter: blur(0.2rem);
    border-radius: 0.438rem;
    background: rgba(157, 32, 255, 0.2);
}

.color-palette {
    color: #ff4200, #601172, rgb(217, 71, 184), #a95fd7, #9d29bc, #7d29f4,
        #8e0fa4, #feb0f2a2 rgba(255, 255, 255, 0), rgba(22, 0, 49, 0.855),
        rgb(246, 188, 253);
}

.start-button,
#startSnake {
    font-family: "Unbounded-ExtraBold", sans-serif;
    font-size: 1rem;
    text-transform: uppercase;
    position: absolute;
    top: 40%;
    left: 50%;
    width: max-content;
    padding: 1rem 2rem;
    transform: translateX(-50%);
    cursor: pointer;
    color: white;
    background-color: transparent;
    box-shadow: rgba(0, 0, 0, 0.27) -23.115px 2.311px 57.787px 0px,
        rgb(255, 71, 255) 0px 1.578px 0px 0px inset,
        rgba(0, 0, 0, 0.25) 4.062px 5.416px 14.759px 0px,
        rgba(157, 32, 255, 0.2) 1.354px -8.124px 1.291px -7.267px inset,
        rgb(157, 32, 255) 4.062px 4.062px 5.145px -5.416px inset,
        rgb(157, 32, 255) -4.062px -4.062px 2.422px -5.416px inset,
        rgba(255, 71, 255, 0.1) -1px 8px 10.906px 4.062px inset,
        rgba(255, 71, 255, 0.1) 0px 0px 48.444px 0px inset;
    border-radius: 0.438rem;
    backdrop-filter: blur(0.2rem);
    border-radius: 2.2rem;
    background: radial-gradient(
            348.89% 277.7% at 64.44% 134.3%,
            rgba(255, 68, 0, 0.21) 0%,
            rgba(157, 32, 255, 0) 30%
        ),
        rgba(157, 32, 255, 0.4);
    border: none;
}

/* SNAKE */
@keyframes grow {
    0% {
        scale: 0;
    }

    80% {
        scale: 1.5;
    }

    100% {
        scale: 0;
    }
}

#counter {
    font-family: "Unbounded-ExtraBold", sans-serif;
    color: white;
    font-size: 10rem;
}

#counter.grow {
    animation: grow 1s forwards;
}

.snake-container {
    display: flex;
    flex-direction: column;
    width: max-content;
    height: max-content;
    position: relative;
}

#game-board {
    width: min(90vw, 37.5rem);
    aspect-ratio: 1 / 1;
    height: auto;
    position: relative;

    box-shadow: rgba(0, 0, 0, 0.27) -23.115px 2.311px 57.787px 0px,
        rgba(255, 71, 255, 0.331) 2px 2px 10px 0px inset,
        rgba(0, 0, 0, 0.25) 4.062px 5.416px 14.759px 0px,
        rgba(157, 32, 255, 0.2) 1.354px -8.124px 1.291px -7.267px inset,
        rgb(157, 32, 255) 4.062px 4.062px 5.145px -5.416px inset,
        rgb(157, 32, 255) -4.062px -4.062px 2.422px -5.416px inset,
        rgba(255, 71, 255, 0.1) -1px 8px 10.906px 4.062px inset,
        rgba(255, 71, 255, 0.1) 0px 0px 48.444px 0px inset;
    backdrop-filter: blur(0.2rem);
    border-radius: 0.385rem;
    background: rgba(157, 32, 255, 0.2);
    justify-self: center;
}

.starter {
    transform: translateX(-50%);
    position: absolute;
    top: 40%;
    left: 50%;
    z-index: 100;
}

.snake-part {
    border-radius: 0.313rem;
    width: var(--cell, 30px);
    height: var(--cell, 30px);
    background-color: #5f156f;
    position: absolute;
    box-shadow: inset #4b166094 0px 0px 1px 1px, inset #d55aea 2px 2px 5px 1px,
        inset #0c010ee6 -3px -3px 4px 0px, #210b2e82 0px 3px 5px 1px;
}

#food {
    width: var(--cell, 30px);
    height: var(--cell, 30px);

    background-color: #f5bea9;
    position: absolute;
    border-radius: 50%;
    box-shadow: inset #f5bea9d6 0px -2px 8px 1px, #210b2e7a 3px 4px 10px 0px,
        inset #4f1500 -4px -4px 7px, inset #ff4200 -5px -6px 7px 7px;
}

.mobile-controls {
    display: none;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    margin-top: 5rem;
    touch-action: none;
}

.mobile-controls .mc-row {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.mc-btn {
    font-family: "Unbounded-ExtraBold", sans-serif;
    font-size: 1.4rem;
    padding: 1rem;
    border-radius: 1rem;
    align-items: center;
    border: none;
    cursor: pointer;
    color: #fff;
    background: rgba(157, 32, 255, 0.35);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

@media screen and (min-width: 2500px) {
    :root {
        font-size: 24px;
    }

    .star {
        bottom: 37%;
        left: 14%;
        width: 8%;
    }

    .heart {
        width: 16%;
        top: 10%;
        left: 15%;
    }

    .flash {
        bottom: 37%;
        right: 24%;
        width: 6%;
    }

    .carousel-container {
        height: min(100dvh, 1500px);
    }
}

@media screen and (min-width: 1920px) and (max-width: 2500px) {
    :root {
        font-size: 20px;
    }

    .rocket {
        margin-left: 14%;
    }
}

@media screen and (max-width: 1300px) {
    :root {
        font-size: 14px;
    }

    .carousel-container {
        margin-top: 5%;
    }
}

@media screen and (max-width: 1200px) {
    :root {
        font-size: 13px;
    }
}

@media screen and (max-width: 1050px) {
    :root {
        font-size: 10.5px;
    }

    .bottom {
        bottom: 20%;
    }
}

@media screen and (max-width: 850px) {
    :root {
        font-size: 10px;
    }

    html,
    body {
        overflow: visible;
    }

    body {
        background-size: 150% 110%;
        background-position: bottom;
    }

    .header {
        justify-content: center;
        padding: 0.875rem;
    }

    .header-logo {
        margin-inline: auto;
        width: 40rem;
    }

    .rocket {
        display: none;
    }

    .rocket-mob {
        display: flex;
        height: auto;
        width: 100vw;
        margin-left: 0;
        margin-top: 0;
        z-index: -2;
    }

    .heart {
        width: 35%;
        top: 8%;
        left: 5%;
    }

    .star {
        display: none;
    }

    .flash {
        bottom: 26%;
        right: 7%;
        width: 16.5%;
    }

    .star-right {
        display: none;
    }

    .bottom {
        width: max-content;
        position: relative;
        margin-top: -15%;
        margin-inline: auto;
        transform: translateX(0);
        left: 0;
        z-index: 2;
    }

    .bottom-container {
        align-items: center;
    }

    .title {
        font-size: 10rem;
    }

    .column .title {
        font-size: 6.3rem;
    }

    canvas {
        box-shadow: rgba(0, 0, 0, 0.27) -4.115px 2.311px 9.787px 0px,
            rgba(255, 71, 255, 0.331) 2px 2px 3px 0px inset,
            rgba(0, 0, 0, 0.25) 2.062px 2.416px 6.759px 0px,
            rgba(157, 32, 255, 0.2) 1.354px -8.124px 1.291px -7.267px inset,
            rgb(157, 32, 255) 4.062px 4.062px 5.145px -5.416px inset,
            rgb(157, 32, 255) -4.062px -4.062px 2.422px -5.416px inset,
            rgba(255, 71, 255, 0.1) -1px 8px 10.906px 4.062px inset,
            rgba(255, 71, 255, 0.1) 0px 0px 9.444px 0px inset;
    }

    #game-board {
        box-shadow: rgba(0, 0, 0, 0.27) -5px 2.311px 10px 0px,
            rgba(255, 71, 255, 0.331) 2px 2px 4px 0px inset,
            rgba(0, 0, 0, 0.25) 4.062px 5.416px 14.759px 0px,
            rgba(157, 32, 255, 0.2) 1.354px -8.124px 1.291px -5.267px inset,
            rgb(157, 32, 255) 4.062px 4.062px 3.145px -5.416px inset,
            rgb(157, 32, 255) -4.062px -4.062px 2.422px -5.416px inset,
            rgba(255, 71, 255, 0.1) -1px 8px 3.906px -0.938px inset,
            rgba(255, 71, 255, 0.1) 0px 0px 32.444px 0px inset;
    }

    h1,
    #scoreTetris,
    #scoreSnake {
        font-size: 3.5rem;
    }

    .btn {
        top: 30%;
    }

    .btn img {
        width: 70%;
    }

    .carousel .item.active {
        align-items: self-start;
    }

    .carousel-container {
        width: min(90%, 630px);
        height: min(115dvh, 900px);
        margin-block: 10%;
        padding-bottom: 0;
    }

    .mobile-controls {
        display: flex;
        flex-wrap: wrap;
        margin-top: 2.5rem;
        gap: 1.25rem;
        touch-action: manipulation;
    }

    .mc-btn {
        font-size: 3rem;
        padding: 1.6rem 2rem;
        border-radius: 1.6rem;

        min-width: 64px;
        min-height: 64px;
    }

    .mobile-controls--snake .mc-row {
        gap: 1.25rem;
    }

    .mobile-controls--snake {
        flex-direction: column;
    }

    .start-button,
    #startSnake {
        font-size: 3rem;
    }

    .tetris-container {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        gap: 1.5rem;
        flex-wrap: nowrap;
    }

    .left-column {
        min-width: 0;
    }

    .left-column canvas {
        width: min(41vw, 300px);
        height: auto;
        aspect-ratio: 1 / 2;
        display: block;
    }

    .right-column {
        margin-left: 0;
        width: min(28vw, 220px);
        min-width: 110px;
        align-items: center;
    }

    #previewNext {
        width: min(28vw, 150px) !important;
        height: auto !important;
        aspect-ratio: 1 / 1;
    }

    .mobile-controls--tetris {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        margin-top: 1.2rem;
    }

    .mobile-controls--tetris .mc-btn {
        flex: 1 1 45%;
        min-width: 30px;
        min-height: 50px;
        font-size: 3rem;
        padding: 1.4rem;
        border-radius: 1.4rem;
    }

    .mobile-controls--tetris .mc-btn[data-tetris="rotate"] {
        flex-basis: 100%;
        font-size: 6rem;
    }
    #game-board {
        width: min(98vw, 95dvh);
        max-width: 52rem;
    }
}

@media screen and (max-width: 500px) {
    :root {
        font-size: 7px;
    }

    .carousel .item {
        margin-top: 10%;
    }
}

@media screen and (max-width: 430px) {
    :root {
        font-size: 5.5px;
    }

    html,
    body {
        overflow: visible;
    }

    .icon-overlay {
        height: max-content;
    }

    .flash {
        bottom: 19%;
        right: 7%;
        width: 19.5%;
    }

    .bottom-container {
        padding: 7.455rem 3.818rem;
        border-radius: 6.364rem;
    }

    .bottom-container::after {
        background: radial-gradient(35% 1% at 18% 0%, #ffffff85, transparent);
        border-radius: 6.364rem 6.364rem 0 0;
    }

    .smaller-text {
        font-size: 5.636rem;
    }
}

@media screen and (max-width: 320px) {
    :root {
        font-size: 4px;
    }

    .carousel .item {
        margin-top: 0%;
    }

    .carousel-container {
        height: min(77dvh, 900px);
    }

    .mc-btn {
        font-size: 2rem;
        padding: 0.6rem 1rem;
        border-radius: 1.6rem;
        min-width: 35px;
        min-height: 35px;
    }

    .right-column {
        margin-left: 0;
        width: min(26vw, 220px);
        min-width: 90px;
        align-items: center;
    }

    .left-column canvas {
        width: min(43vw, 300px);
        height: auto;
        aspect-ratio: 1 / 2;
        display: block;
    }
}
