* {
    box-sizing: border-box;
    font-family: 'pixels', sans-serif;
}

:root {
    --earth-color: rgba(0, 106, 28, 0.8);
    --fire-color: rgba(168, 0, 13, 0.8);
    --water-color: rgba(27, 34, 114, 0.8);
    --wind-color: rgba(10, 153, 174, 0.8);
}

body {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('../img/background.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    overflow: hidden;
}

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

h1 {
    font-size: 36px;
    text-shadow: 1px 1px white;
    margin: 0;
}

.mobile-view {
    
}

.canvas-container {
    width: 720px;
    height: 480px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px 10px rgba(28, 32, 29, 0.8);
}

canvas {
    display: block;
}

/* ===== Start Screen general ===== */
.h1-wrapper {
    position: absolute;
    top: 100px;
    padding: 16px;
    background-image: linear-gradient(180deg,
            var(--earth-color),
            var(--fire-color),
            var(--water-color),
            var(--wind-color));
    box-shadow: 0 0 0 10px;
    border-radius: 40px;
    z-index: 3;
    transition: 825ms ease;
    cursor: default;
}

.start-screen {
    height: 500px;
    width: 750px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-image: linear-gradient(120deg,
            rgba(138, 172, 161, 0.9),
            rgba(127, 140, 129, 0.9),
            rgba(145, 180, 154, 0.9),
            rgba(152, 149, 136, 0.9),
            rgba(126, 132, 130, 0.9));
}

.end-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 500px;
    width: 750px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-image: linear-gradient(120deg,
            rgba(138, 172, 161, 0.9),
            rgba(127, 140, 129, 0.9),
            rgba(145, 180, 154, 0.9),
            rgba(152, 149, 136, 0.9),
            rgba(126, 132, 130, 0.9));
}

.end-screen span:last-child {
    margin-top: 36px;
    cursor: pointer;
    border: 2px solid black;
    border-radius: 20px;
    padding: 8px;
}

/* ===== Mobile UI ===== */
.sidebar {
    position: absolute;
    top: 64px;
    right: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    z-index: 999 !important;
}

.movement-wrapper {
    display: flex;
    justify-content: space-between;
    position: absolute;
    bottom: 16px;
    right: 16px;
    left: 72px;
}

.movement-wrapper div {
    display: flex;
    gap: 16px;
}

.ability-wrapper {
    display: flex;
    gap: 16px;
    flex-direction: column;
    position: absolute;
    bottom: 16px;
    left: 16px;
}

.sidebar img,
.ability-wrapper img,
.movement-wrapper img {
    height: 40px;
    cursor: pointer;
}


/* ===== Character Selection ===== */
.sub-header-selection {
    font-size: 20px;
    padding: 8px;
    background-color: rgba(126, 132, 130, 0.5);
    border-radius: 20px;
    cursor: default;
    box-shadow: 0 0 10px 10px rgba(126, 132, 130, 0.5);
}

.character-selection-container {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%);
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.selection-wrapper {
    display: flex;
    align-items: center;
    gap: 40px;
}

.selection-wrapper div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 86px;
    width: 86px;
    font-size: 20px;
    font-weight: 700;
    gap: 8px;
    padding: 8px;
    border-radius: 20px;
    transition: 225ms ease-in-out;
    cursor: pointer;
}

.selection-wrapper img {
    height: 40px;
}

.selection-wrapper div:hover {
    text-shadow: 1px 1px white;
}

.highlight1 {
    background-color: var(--earth-color);
    text-shadow: 1px 1px white;
}

.highlight2 {
    background-color: var(--fire-color);
    text-shadow: 1px 1px white;
}

.highlight3 {
    background-color: var(--water-color);
    text-shadow: 1px 1px white;
}

.highlight4 {
    background-color: var(--wind-color);
    text-shadow: 1px 1px white;
}

.selection-wrapper div:nth-child(1):hover {
    background-color: var(--earth-color);
}

.selection-wrapper div:nth-child(2):hover {
    background-color: var(--fire-color);
}

.selection-wrapper div:nth-child(3):hover {
    background-color: var(--water-color);
}

.selection-wrapper div:nth-child(4):hover {
    background-color: var(--wind-color);
}

.start-btn {
    padding: 8px;
    border-radius: 20px;
    cursor: pointer;
    background-image: linear-gradient(270deg,
            rgba(138, 172, 161, 0.8),
            rgba(127, 140, 129, 0.8),
            rgba(145, 180, 154, 0.8),
            rgba(152, 149, 136, 0.8),
            rgba(126, 132, 130, 0.8));
}


/* ===== How to play ===== */
.how-to-play {
    padding-left: 20px;
    display: flex;
    gap: 16px;
    color: black;
    cursor: default;
}

.commands {
    min-width: 35%;
}

.commands p {
    font-size: 20px;
}

.commands div {
    padding: 6px;
    line-height: 1.5;
}

.commands span {
    padding: 4px;
    border: 1px solid black;
    border-radius: 3px;
    margin-right: 6px;
}

.explain {
    line-height: 1.5;
}

.explain p:first-child {
    font-size: 20px;
}


.ingame-commands {
    display: block !important;
    position: absolute;
    right: 64px;
    top: 64px;
    background-color: antiquewhite;
    border: 4px solid darkgray;
    border-radius: 20px;
    padding: 8px;
    z-index: 999;
    max-height: 90vh;
}


/* ===== Animations ===== */

.fadeIn {
    animation-name: fadeIn;
    animation-fill-mode: forwards;
    animation-duration: 800ms;
}

.fadeOut {
    animation: fadeOut;
    animation-fill-mode: forwards;
    animation-duration: 800ms;
}


@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 50%;
    }

    100% {
        opacity: 100%;
    }
}


@keyframes fadeOut {
    0% {

        opacity: 100%;
    }

    50% {
        opacity: 50%;
    }

    99% {
        opacity: 1%;
    }

    100% {
        opacity: 0%;
    }
}