body {
    padding: 0;
    margin: 0;
}

:root {
    /* --cardwidth: 100px; */
    /* --cardheight: 150px; */
}

.gamecontainer {
    width: 100vw;
    height: 100vh;
    background-color: green;
    position: relative;

    display: grid;
    grid-template-columns: 250px 4fr;
}

#containerright, #containerleft {
    position: relative;
}
#containerleft {
    white-space: pre-wrap;
    padding: 2px;;
}

.hand {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    min-width: var(--cardwidth);
}

.deck, .deckempty, .deckselect {
    position: absolute;
    width: var(--cardwidth);
    height: var(--cardheight);
    background-color: darkred;
    border: 2px solid #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    z-index: 1;
}
.deckempty {
    background-color: rgba(60, 54, 46, 0.083);
    padding: 1px;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.367);
    border-radius: 11px;
    z-index: unset;
}
.deckselect {
    background-color: goldenrod;
    box-shadow: 0px 0px 5px goldenrod;
    right: 0;
    top: 0;
    z-index: 100;
    box-sizing: border-box;
    border-color: red;
    font-size: 3rem;
    animation: deckselect 1s linear infinite alternate;
}

@keyframes deckselect {
    0% {
        box-shadow: 0px 0px 0px goldenrod;
        background-color: rgba(218, 165, 32, 0.3);
    }
    100% {
        box-shadow: 0px 0px 15px goldenrod;
        background-color: rgba(255, 166, 0, 0.6);
    }
}


.card {
    width: var(--cardwidth);
    height: var(--cardheight);
    background-color: white;
    border: 2px solid black;
    color: black;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    z-index: 1;
    transition-duration: 0.5s;
    position: relative;
    
    /* animation: carddraw 0.5s ease-out 1; */
    /* --animfromx: 10px; */
    /* --animfromy: 10px; */
}

.carddraw {
    animation: carddraw 0.5s ease-out 1;
    --animfromx: 10px;
    --animfromy: 10px;
}

@keyframes carddraw {
    0% {
        transform: translate(var(--animfromx), var(--animfromy));
        opacity: 0;
    }

    50% {
        opacity: 1;
        rotate: 5deg;
    }

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

.card:hover {
    /* transform-origin: center bottom; */
    /* scale: 1.1; */
    box-shadow: 4px 4px 2px gold, -4px -4px 2px gold;
}

.herocard {
    scale: 1.3;
    transform-origin: center;
}
.cardplaceholder::before {
    content: var(--text-card);
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.5;
    font-size: 0.8rem;
}

.cardmenu {
    font-size: 0.8rem;
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #444;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
}

.cardtop.cardmenu, .cardtop .cardmenu {
    bottom: unset;
    top: 100%;
}
.cardright.cardmenu, .cardright .cardmenu {
    right: unset;
    left: 100%;
    bottom: unset;
    top: 0;
}

.cardmenuitem {
    padding: 10px 20px;
    cursor: pointer;
    white-space: nowrap;
    color: black;
}

.cardmenuitem:hover {
    background-color: #eee;
}



/* DECK POPUP */
#deck-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 2px solid #444;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    width: 600px;
    max-width: 90vw;
    max-height: 70vh;
    overflow: auto;
    display: none;
    z-index: 10000;
}
#deck-popup .card {
    /* z-index: unset; */
    transition-duration: 0;
    animation: none;
}
#deck-popup-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}
#deck-popup-header h3 {
    margin: 0;
}
#close-popup-btn {
    background: darkred;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
}

#close-popup-btn:hover {
    background: crimson;
}

#deck-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
}

#card-popup {
    display: none;
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 10000;

    /* display: flex; */
    justify-content: center;
    align-items: center;
}
#card-popup .card-popup-content{
    transform-origin: center center;
    scale: 2;
    text-align: center;
    background-color: rgba(214, 183, 7, 0.582);
    padding: 20px 10%;
}