@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css");
@import url("/static/assets/fonts/PressStart2P-Regular.ttf");
@font-face {
    font-family: PressStart;
    src: url("/static/assets/fonts/PressStart2P-Regular.ttf");
    font-weight: 400;
    font-style: normal;
}

@keyframes blink {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

body {
    font-family: "PressStart";
    font-size: 2vh;
    text-shadow: #000000 3px 2px 3px;
    background-color: #181425;
    color: #fff;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

h4 {
    margin-top: 2vh;
    margin-bottom: 1vh;
    line-height: 20px;
}

h6 {
    margin: 0;
    color: darkgrey;
}

span {
    font-size: 1.2vh;
    color: #cecece;
    line-height: 20px;
}

#game {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#board {
    position: relative;
    overflow: visible;
}

.quitGame {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 10vw;
    height: 6vh;
    opacity: 0.7;
    font-family: PressStart;
    color: white;
    background-color: #181425;

    &:hover {
        background-color: red;
    }
}

.pseudo {
    display: grid;
    position: absolute;
    top: 15px;
    left: 15px;
    * {
        z-index: 10;
    }
}

.pseudo label {
    margin-bottom: 5px;
}

.pseudo input {
    padding: 10px;
    color: white;
    font-family: PressStart;
    font-size: smaller;
    background-color: #302f35be;
}

.hideMessage {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    opacity: 0.5;
}

.wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: absolute;
    bottom: 2vh;
    right: 6vw;
}

.wrapper .top,
.wrapper .bottom {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.wrapper .square {
    box-shadow: 0 0 5px black;
    align-items: center;
    justify-content: center;
    height: 8vh;
    width: 4vw;
    border: 3px solid #cecece;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    display: flex;
    background-color: #33333370;
    transition: background-color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.wrapper .square i {
    color: #cecece;
    font-size: larger;
    transition: color 0.3s ease;
}

.wrapper .square:hover {
    border-color: #a0a0a0;
}

.wrapper .square:hover i {
    color: #a0a0a0;
}

.active {
    background-color: #64729275 !important;
    color: #fff;
    transform: scale(1.2);
    backdrop-filter: blur(4px);
}

.timer {
    position: absolute;
    top: 1rem;
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 8vh;
    width: 12vw;
    border: 3px solid #cecece;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    background-color: #33333370;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 0 5px black;
    transition: background-color 0.3s ease, transform 0.3s ease;

    &.timerDanger {
        color: red;
        animation: blink 1s infinite;
    }
}

.messagePopUp {
    opacity: 0;
    position: absolute;
    padding: 10px;
    text-align: center;
    background-color: #33333370;
    border: 3px solid #cecece;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    box-shadow: 0 0 5px black;
    backdrop-filter: blur(4px);
    transition: 0.3s;

    &.popActive {
        opacity: 1;
    }
}

.messagePopUp p {
    margin: 10px;
}

.contentMessagePopUp {
    display: block;
    max-width: 35vw;
    max-height: 20vh;
    padding-left: 10px;
    padding-right: 10px;
}

.interactBox {
    position: absolute;
    bottom: calc(-10vh - 4px);
    text-align: center;
    line-height: 3.5vh;
    height: 10vh;
    width: 45vw;
    background-color: #33333370;
    border: 3px solid #cecece;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    box-shadow: 0 0 5px black;
    transition: bottom 0.3s linear;
}

.interactBox p {
    margin: 0;
    line-height: 20px;
}

.enigmaBox {
    direction: rtl;
    text-align: center;
    position: absolute;
    padding: 6px;
    left: 0.1vw;
    max-height: 30vh;
    width: 20vw;
    background-color: #33333370;
    border: 3px solid #cecece;
    border-left: none;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    box-shadow: 0 0 5px black;
}

.questBox {
    text-align: center;
    line-height: 1.2rem;
    position: absolute;
    padding: 6px;
    right: 0;
    max-height: 50vh;
    width: 25vw;
    background-color: #33333370;
    border: 3px solid #cecece;
    border-right: none;
    border-bottom: 2px solid #000;
    box-shadow: 0 0 5px black;
}

.contentMessagePopUp,
.contentEnigmaBox,
.contentQuestBox {
    overflow-y: auto;
    scrollbar-color: grey transparent;
    scrollbar-width: thin;
    scroll-behavior: smooth;
    padding: 10px;
}

.contentEnigmaBox {
    height: 15vh;
    width: 19vw;
}

.contentQuestBox {
    height: 40vh;
    width: 24.5vw;
    text-align: left;
    padding-left: 7px;
}

.enigmaBox p,
.questBox p {
    font-size: 1.7vh;
}

.questBox p {
    margin-bottom: 0.5rem;
}

.questBox span {
    display: block;
    margin-top: -0.2rem;
    margin-left: 3rem;
    margin-bottom: 1rem;
}

.hiddenQuest {
    display: none;
}

.gameOver {
    padding: 35px;
    position: absolute;
    text-align: center;
    background-color: #33333370;
    border: 3px solid #cecece;
    border-right: none;
    border-bottom: 2px solid #000;
    box-shadow: 0 0 5px black;
    backdrop-filter: blur(6px);
    transition: 0.3;
    opacity: 0;

    &.gameOverActive {
        opacity: 1;
    }

    button {
        font-family: PressStart;
        padding: 10px 20px;
        font-size: 12px;
        cursor: pointer;
        background: #333333;
        color: white;
        border: none;
        border-radius: 5px;
    }
}

.gameOver h4 {
    font-size: x-large;
}

.gameOverContent {
    font-size: small;
    display: flex;
    justify-content: space-evenly;
    flex-direction: row;
    padding-top: 2vh;
}

.gameWin {
    padding: 35px;
    position: absolute;
    text-align: center;
    background-color: #33333370;
    border: 3px solid #cecece;
    border-right: none;
    border-bottom: 2px solid #000;
    box-shadow: 0 0 5px black;
    backdrop-filter: blur(6px);
    transition: 0.3;
    display: none;
}

.gameWin h4 {
    font-size: x-large;
}

.gameWinContent {
    font-size: small;
    display: flex;
    justify-content: space-around;
    flex-direction: row;
    padding-top: 2vh;
    a {
        text-decoration: none;
    }
    button {
        font-family: PressStart;
        padding: 10px 20px;
        font-size: 12px;
        cursor: pointer;
        background: #333333;
        color: white;
        border: none;
        border-radius: 5px;
    }
}

.overlay {
    position: fixed; /* Full screen */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1; /* Behind the box */
}

.enigme2_dragNdrop {
    z-index: 100;
    display: none;
    background: transparent;
    position: absolute;
    margin: auto;
    align-items: center;
    width: 70vw;
    border: 3px solid #cecece;
    border-left: 3px solid #cecece;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;

    .overlay {
        z-index: -1;
    }

    .dragNdrop_top {
        background-color: rgba(100, 114, 146, 0.5);
        width: 100%;
        display: flex;
        flex-wrap: wrap-reverse;
        justify-content: space-between;
        flex-direction: row;
    }
    .dragNdrop_title {
        display: flex;
        flex-wrap: nowrap;
        flex-direction: column;
        h3 {
            margin: 10px;
            margin-bottom: 10px;
            margin-left: 10px;
        }
        span {
            margin-left: 15px;
            margin-bottom: 5px;
        }
    }

    .workspace {
        width: auto;
        height: 50vh;
        background: #64729265;
        position: relative;
        border: 1px dashed #ccc;
    }
    .block {
        padding-left: 10px;
        padding-right: 10px;
        height: 50px;
        color: white;
        text-align: center;
        line-height: 50px;
        border-radius: 5px;
        position: absolute;
        cursor: grab;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -o-user-select: none;
        user-select: none;
    }
    .go-forward {
        background: #3498db;
    }
    .turn-left {
        background: #e74c3c;
    }
    .turn-right {
        background: #f1c40f;
    }
    .nested {
        position: relative;
        top: 0;
        left: 0;
    }

    .dragNdrop_bottom {
        padding: 10px 10px;
        background-color: rgba(100, 114, 146, 0.5);
        display: flex;
        align-items: center;
        flex-wrap: wrap-reverse;
        flex-direction: row;
        gap: 2vw;
    }
    .run-button {
        padding: 10px 20px;
        font-size: 16px;
        cursor: pointer;
        background: #27ae60;
        color: white;
        border: none;
        border-radius: 5px;
    }
    .clear-btn {
        padding: 10px 20px;
        font-size: 16px;
        cursor: pointer;
        background: rgba(255, 0, 0, 0.2);
        color: white;
        border: none;
        border-radius: 5px;
    }
    .clear-btn:hover {
        background-color: rgba(255, 0, 0, 0.8);
    }
}

.enigme4_findOrder {
    z-index: 100;
    display: none;
    background: transparent;
    position: absolute;
    margin: auto;
    align-items: center;
    width: 70vw;
    border: 3px solid #cecece;
    border-left: 3px solid #cecece;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;

    .overlay {
        z-index: -1;
    }

    .findOrder_top {
        background-color: rgba(100, 114, 146, 0.5);
        width: 100%;
        display: flex;
        flex-wrap: wrap-reverse;
        justify-content: space-between;
        flex-direction: row;
    }
    .findOrder_title {
        display: flex;
        flex-wrap: nowrap;
        flex-direction: column;
        h3 {
            margin: 10px;
            margin-bottom: 10px;
            margin-left: 10px;
        }
        span {
            margin-left: 15px;
            margin-bottom: 5px;
        }
    }

    .workspace {
        display: flex;
        flex-wrap: wrap;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        width: auto;
        height: 25vh;
        background: #64729265;
        position: relative;
        border: 1px dashed #ccc;

        img {
            width: 5vh;
            image-rendering: pixelated;
        }
    }
}

.enigme5_scroll {
    z-index: 100;
    display: none;
    background: transparent;
    margin: auto;
    position: absolute;
    justify-content: center;
    align-items: center;

    .overlay {
        z-index: -1;
    }

    .scroll {
        width: 25vw;
        border: 5px solid #a67c52;
        border-radius: 1vw;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        overflow: hidden;
        display: flex;
        justify-self: center;
        flex-direction: column;
        background-image: url("https://www.transparenttextures.com/patterns/paper-fibers.png");
        background-color: #d2b48c75; /* fallback or base color */
        background-blend-mode: multiply; /* or overlay, screen, etc. */
        background-repeat: no-repeat;
        background-size: cover;
    }

    .scroll_top {
        width: 100%;
        display: flex;
        flex-wrap: wrap-reverse;
        justify-content: space-between;
        flex-direction: row;
        border-bottom: 4px solid #a67c52;
    }
    .scroll_title {
        display: flex;
        flex-wrap: nowrap;
        flex-direction: column;
        h3 {
            margin: 10px;
            margin-bottom: 10px;
            margin-left: 10px;
        }
        span {
            margin-left: 15px;
            margin-bottom: 5px;
        }
    }

    .scroll_content {
        padding: 20px;
        overflow-y: auto;
        background-image: url("https://www.transparenttextures.com/patterns/paper-fibers.png");
        background-color: #d2b48c75; /* fallback or base color */
        background-blend-mode: multiply; /* or overlay, screen, etc. */
        background-repeat: no-repeat;
        background-size: cover;
    }

    .scroll_content ul {
        list-style: none;
        padding: 0;
    }

    .scroll_content li {
        margin-bottom: 10px;
        padding-left: 10px;
        border-left: 4px solid #a67c52;
        font-size: 16px;
        line-height: 18px;
        span {
            font-weight: bold;
            font-size: 24px;
            display: block;
            padding: 5px;
        }
    }
}

.closeSymbol {
    display: flex;
    cursor: pointer;
    font-size: x-large;
    justify-content: right;
    align-items: center;
    margin-right: 5px;
}

.confetti {
    position: fixed;
    top: 0;
    width: 10px;
    height: 10px;
    opacity: 0.8;
    z-index: 9999;
    animation: fall 3s ease-out forwards;
    border-radius: 2px;
}


@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}
