@font-face {
    font-family: 'alagard';
    src: url('alagard.ttf');
}

@keyframes gainCardAnimation {
    0% {
        transform: scale(0.1, 0.1);
        top: 400px;
        left: 600px;
        opacity: 100%;
    }

    10% {
        transform: scale(1.4, 1.4);
        top: 400px;
        left: 600px;
    }

    15% {
        transform: scale(1, 1);
        top: 45px;
        left: 1130px;
    }

    70% {
        transform: scale(1, 1);
        top: 45px;
        left: 1130px;
        opacity: 100%;
    }

    75% {
        transform: scale(0, 1);
        top: 45px;
        left: 1130px;
    }

    80% {
        transform: scale(1, 1);
        top: 45px;
        left: 1130px;
        opacity: 100%;
    }

    95% {
        transform: scale(1, 1);
        top: 45px;
        left: 1130px;
        opacity: 100%;
    }

    100% {
        transform: scale(0.5, 0.5);
        top: 45px;
        left: 1130px;
        opacity: 0%;
    }
}

@keyframes gainCardValueAnimation {
    0% {
        opacity: 1;
    }

    75% {
        opacity: 1;
    }

    76% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

@keyframes virusAnimation {
    0% {
        transform: rotate(1deg);
    }

    25% {
        transform: rotate(-1deg);
    }

    50% {
        transform: rotate(1deg);
    }

    75% {
        transform: rotate(-1deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

@keyframes positive {
    0% {
        transform: scale(1, 1) translate(0px, 0px);
    }

    50% {
        transform: scale(2, 2) translate(0px, -4px);
        color: green;
    }

    100% {
        transform: scale(1, 1) translate(0px, 0px);
    }
}

@keyframes negative {
    0% {
        transform: scale(1, 1) translate(0px, 0px);
    }

    50% {
        transform: scale(0.9, 0.9) translate(0px, 4px);
        color: red;
        /* transform: scale(30, 30)  translate(0px, 4px); */
        /* background-color: red; */
    }

    100% {
        transform: scale(1, 1) translate(0px, 0px);
    }
}

* {
    --main-bg-color: #082c49;
    --main-text-color: #ffffff;
    --negociation-bg-color: #25194f;
    --negociation-text-color: #ffffff;
    --infection-bg-color: #310341;
    --infection-text-color: #feeae9;
    font-family: alagard;
}

body {
    position: relative;
    display: flex;
    margin: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--main-text-color);
    background-color: #212121;
    width: 100vw;
    height: 100vh;
}

#achievementsPopup {
    position: absolute;
    right: 110px;
    bottom: 10px;
    width: 250px;
    background-color: var(--main-bg-color);
    color: var(--main-text-color);
    padding: 4px;
    border: 1px solid var(--main-text-color);
    z-index: 50;
}

#returnToTheBoatPopup {
    display: inline-block;
    position: absolute;
    left: 0px;
    top: 0px;
    z-index: 50;
    /* background-color: red; */
    width: 200px;
    text-align: center;
    color: #feeae9;
    background-color: #082c49;
    padding: 8px;
}

.cultureLabel,
.resourceLabel {
    display: block;
}

.card {
    display: inline-block;
    box-sizing: border-box;
    height: 224px;
    width: 160px;
    margin: 15px;
    cursor: pointer;
    background-image: url("assets/images/card.png");
    background-size: cover;
    user-select: none;
    z-index: 1;
    text-align: center;
    padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    image-rendering: crisp-edges;
}

.cardText {
    vertical-align: top;
    position: relative;
    display: inline-block;
    font-family: alagard;
    font-size: x-large;
    margin-bottom: 5px;
    top: 136px;
    color: white;
}

#deckPage {
    #deckPageCardsContainer {
        /* display: flex; */
        width: 1200px;
        height: 800px;
        overflow-y: scroll;
        scrollbar-width: none;

        #deckPageEmerald,
        #deckPageFruit,
        #deckPageAnimal,
        #deckPageGold,
        #deckPageWood,
        #deckPageVirus {
            display: inline-block;
            width: 190px;
            vertical-align: top;

            .card {
                position: relative;
            }
        }
    }
}


#negociationBoard {
    position: relative;
    display: flex;
    width: 1200px;
    height: 800px;
    padding: 0;
    background-image: url("assets/images/hud_cardgame_BG.png");
    background-position-x: -25px;
    background-position-y: -120px;
    justify-content: space-between;
    flex-direction: column;

    #playCardsContainer {
        display: inline-block;
        position: relative;
        width: 750px;
        height: 800px;
    }

    #roundHUD {
        position: absolute;
        top: 304px;
        left: 586px;
        z-index: 80;
        font-size: large;
    }

    #handContainer {
        position: relative;
        display: inline-block;
        vertical-align: bottom;
        text-align: left;
        flex: 1;
        top: 38px;

        .card:hover {
            transform: translateY(-14px) scale(1.1, 1.1);
            box-shadow: 10px 10px 5px 0px #25194e;
        }

        .grabbedCard {
            box-shadow: 10px 10px 5px 8px #25194e;
            transform: rotate(-7deg);
        }

        .grabbedCard:hover {
            transform: rotate(-7deg);
        }

        .grabbedCardTwo:hover {
            transform: rotate(7deg);
        }

        .grabbedCardThree:hover {
            transform: scale(1.02, 1.02);
        }

        .grabbedCardFour:hover {
            transform: scale(0.98, 0.98);
        }
    }

    #invisibleHandContainer {
        display: none;
    }

    #topCardContainer {
        position: absolute;
        left: 280px;
        top: 20px;
    }

    #bottomCardContainer {
        position: absolute;
        left: 280px;
        top: 338px;
        z-index: 100;
    }

    #leftCardContainer {
        position: absolute;
        left: 0px;
        top: 150px;
    }

    #rightCardContainer {
        position: absolute;
        top: 150px;
        left: 550px;
    }

    #rightCard,
    #leftCard,
    #topCard,
    #bottomCard {
        position: relative;
        top: 0px;
        left: 0px;
        width: 200px;
    }

    #rightCard {
        left: 150px;
    }

    #leftCard {
        left: -150px;
    }

    #topCard {
        top: -150px;
    }

    #rightCard.animateCard,
    #leftCard.animateCard,
    #topCard.animateCard {
        position: relative;
        left: 0px;
        top: 0px;
        transition: top 1s, left 1s;
    }

    #topCardTribeman,
    #leftCardTribeman,
    #bottomCardTribeman,
    #rightCardTribeman {
        position: relative;
        text-align: center;
        font-size: large;
        margin: 2px;
        padding: 2px;
        color: var(--main-text-color);
        z-index: 1;
    }

    .winningCard {
        box-shadow: 0px 0px 20px 20px #7f3674;

    }
}

#gameContainer {
    position: relative;
    width: 1250px;
    height: 945px;
    overflow: hidden;
    background-color: var(--infection-bg-color);

    div.screen {
        padding: 20px;
    }

    .screen {
        position: absolute;
        overflow: hidden;
        top: 120px;
        left: 25px;
        z-index: 5;
        box-sizing: border-box;
        min-width: 1200px;
        min-height: 800px;
        width: 1200px;
        height: 800px;
        max-width: 1200px;
        max-height: 800px;
        background-color: var(--main-bg-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--main-text-color);

        .buttonsContainer {
            display: flex;
            flex-direction: row;
            justify-content: space-around;
        }

        .button,
        #selectLang {
            min-width: 150px;
            min-height: 50px;
            margin: 5px 40px;
            border: 4px double var(--main-text-color);
            background: none;
            color: var(--main-text-color);
            font-size: x-large;
            cursor: pointer;
            box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
            transition-timing-function: ease-in;
            transition: all 0.6s;
        }

        .button:hover {
            box-shadow: 6px 6px 6px rgba(0, 0, 0, 0.5);
            transform: scale(1.1);
        }
    }

    #explorationMinimap {
        position: absolute;
        top: 130px;
        left: 35px;
        border: solid 4px #37518f;
        outline: 3px solid var(--main-bg-color);
        z-index: 1000;
    }

    .tutorialScreen {
        align-items: stretch;
        padding: 120px !important;

        p {
            font-size: 20px;
            line-height: 25px;
            text-align: justify !important;
            margin: 14px;
        }

        img {
            vertical-align: middle;
        }

        .lore {
            background-color: rgba(0, 0, 0, 0.75);
            padding: 8px;
        }
    }

    #explorationTutorialPage {
        background-color: var(--main-bg-color) !important;
        color: var(--main-text-color) !important;
    }

    #negociationTutorialPage {
        background-color: var(--negociation-bg-color) !important;
        color: var(--negociation-text-color) !important;
    }

    #infectionTutorialPage {
        background-color: var(--infection-bg-color) !important;
        color: var(--infection-text-color) !important;
    }

    #gameHUD {
        z-index: 10;
    }

    #backgroundGameHUD {
        z-index: 0;
    }

    #gameHUD,
    #backgroundGameHUD {
        position: absolute;
        width: 1250px;
        height: 945px;
        top: 0;
        left: 0;
        user-select: none;
        pointer-events: none;
        color: var(--main-text-color);

        #hudOld,
        #hudBanner,
        #hudFrame {
            position: absolute;
            top: 0;
            left: 0;
            width: 1250px;
            height: 945px;
        }

        #hudBanner {
            z-index: 5;
        }

        #hudDeckIcon {
            position: absolute;
            top: 58px;
            left: 1143px;
            width: 84px;
            height: 60px;
            z-index: 10;
            pointer-events: auto;
            cursor: pointer;
            transition: all 0.35s ease-in-out;
        }

        #hudDeckIcon:hover {
            top: 45px;
            padding-bottom: 13px;
        }

        #hudResourceMeter {
            position: absolute;
            top: 67px;
            left: 245px;
            width: 131px;
            height: 20px;
            z-index: 10;
        }

        #hudFrame {
            z-index: 15;
        }

        span {
            font-size: 18px;
            position: absolute;
            z-index: 20;
            top: 68px;
        }

        #cultureValue {
            left: 70px;
        }

        #resourcesValue {
            left: 180px;
        }
    }

    .animatedCard {
        opacity: 0%;
        position: absolute;
        animation: gainCardAnimation 3s;
        box-sizing: border-box;
        height: 112px;
        width: 80px;
        margin: 15px;
        cursor: pointer;
        background-image: url("assets/images/card.png");
        background-size: cover;
        user-select: none;
        z-index: 30;
        text-align: center;
        padding: 15px;
        transition: transform 0.2s, box-shadow 0.2s;
        image-rendering: crisp-edges;

        .cardText {
            animation: gainCardValueAnimation 3s;
            vertical-align: top;
            position: relative;
            display: inline-block;
            font-family: alagard;
            font-size: large;
            margin-bottom: 5px;
            top: 50px;
            color: white;
        }
    }
}

#titleButtons {
    opacity: 0;
    margin-top: 0px;
    transition: all 2s ease-in-out;
}

#titlePage {
    .title {
        font-size: 45px;
        font-family: alagard;
    }

    #buttonStart {
        transform: scale(1.2) !important;
        border: 4px double var(--main-text-color);
    }

    #buttonStart:hover {
        transform: scale(1.3) !important;
    }
}

#settingsPage {
    .buttonsContainer {
        flex-direction: column !important;
    }

    #resetTutorialTooltip {
        position: absolute;
        left: 755px;
        top: 314px;
        background-color: #335189;
        padding: 4px;
    }

    option {
        background-color: var(--infection-bg-color);
        color: var(--main-text-color);
        cursor: pointer;
    }
}

#infectionBoard {
    background-image: url("assets/images/hud_virusgame_bg.png");
    background-position-x: -25px;
    background-position-y: -120px;
}

#gameOverPage,
#scoreboardPage {
    .finalScore {
        min-width: 600px;
        display: flex;
        flex-direction: column;
        align-items: stretch;

        .playerNameSpan {
            width: 200px;
        }

        h2,
        h3,
        p,
        tr {
            display: flex;
            justify-content: space-between;
            margin-top: 0;

            transform: scaleX(3);
            opacity: 0;
            transition: all 0.5s;
            transition-timing-function: ease-out;
        }

        h3 {
            border-bottom: 1px solid var(--main-text-color);
        }

        p {
            font-size: 20px;
        }

        p:has(em) {
            font-size: 18px;
            margin-bottom: 5px;
        }


        #scoreboardLocal1,
        #scoreboardLocal2,
        #scoreboardLocal3,
        #scoreboardLocal4,
        #scoreboardLocal5,
        #scoreboardLocal6,
        #scoreboardLocal7,
        #scoreboardLocal8,
        #scoreboardLocal9,
        #scoreboardLocal10 {
            font-family: 'Courier New', Courier, monospace;
            font-weight: bold;
        }


        #scoreboardOnline1,
        #scoreboardOnline2,
        #scoreboardOnline3,
        #scoreboardOnline4,
        #scoreboardOnline5,
        #scoreboardOnline6,
        #scoreboardOnline7,
        #scoreboardOnline8,
        #scoreboardOnline9,
        #scoreboardOnline10 {
            font-family: 'Courier New', Courier, monospace;
            font-weight: bold;
        }
    }

    table {
        margin: 15px 0;

        tr {
            display: flex;
            flex-direction: row;
            justify-content: stretch;

            td {
                flex: 1;
                font-size: 20px;
                margin-bottom: 5px;
            }

            td:last-child {
                text-align: end;
            }

            .large {
                flex: 3;
                text-align: center;
            }
        }
    }

    .visible {
        transform: scaleX(1) !important;
        opacity: 1 !important;
    }
}

.underlined {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}