:root {
    --active-player-color: rgb(204, 238, 255);
    --target-player-color: rgba(215, 18, 18, 0.705);
    --body-color: #767490;
    --map-square-color: #ab8d5a;
    --tile-size: 200px;
    --character-size: calc(var(--tile-size) - 20px);
    --item-size: 50%;
    --column-amount: 4;
    --character-font: calc(var(--tile-size) / 12);
    --character-head-font: calc(var(--tile-size) / 8);
    --hp-visual-height: calc(var(--character-head-font)*1.25);
    --stats-rest-height: calc(var(--character-head-font)*1.6);
}

/* Start Menu */
.start-menu {
    width: 100vw;
    height: 100vh;
    background-color: gray;
    position: fixed;
    text-align: center;
    align-content: center;
    z-index: 20;
}

.start-menu h1 {
    font-size: 100px;
    color: blue;
    text-shadow: 5px 5px black;
}

.start-buttons {
    margin-top: 100px;
    display: flex;
    justify-content: space-evenly;
}

#player-count {
    width: 100px;
    height: 50px;
    border-radius: 5px;
}

body {
    background-color: var(--body-color);
}

.table-scroll {
    overflow-y: scroll;
    height: 300px;
}

.round-counter {
    width: 120px;
    height: 35px;
    background-color: white;
    border: 1px solid black;
    display: inline-block;
    align-items: center;
}

.cs-color {
    display: none;
}

.card-area, .map-area {
    padding: 20px;
    display: grid;
    /* grid: repeat(3, var(--tile-size))/ repeat(3, var(--tile-size)); */
    grid-auto-rows: var(--tile-size);
    grid-auto-columns: var(--tile-size);
    gap: 5px;
}

/* .card-area {
    position: absolute;
    top: 33px;
    left: 0px;
} */


/* Character Styling */
.character-card {
    margin: 10px;
    background-color: gray;
    /* width: var(--character-size); */
    height: var(--tile-size);
    border-radius: 10% 10% 0 0;
    border: dashed black 2px;
    position: relative;
    line-height: .8;
}

.character-card.boss {
    width: 250px;
    height: 280px;
    border: dashed black 4px;
}

.character-stats {
    background-color: white;
    width: calc(100% + 4px);
    position: absolute;
    left: -2px;
    bottom: calc(var(--hp-visual-height));
    height: var(--stats-rest-height);
    min-height: 20px;
    margin-bottom: -6px;
    border: black solid 2px;
    padding: 1px calc(var(--character-font)/3);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: var(--stats-rest-height);
    font-size: var(--character-font);
    transition: .5s
}

.character-stats:hover {
    height: auto;
}

.character-stats h3 {
    grid-column: span 2;
    font-size: var(--character-head-font);
    overflow-x: clip;
    overflow-y: visible;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.character-icon {
    height: 75%;
    width: 100%;
    display: flex;
    justify-items: center;
}

img.image {
    height: 90%;
    margin: 5% auto;
    transition: 2s;
    transition-delay: 2s;
}

.dead {
    transform: rotateX(180deg);
    opacity: .5;
    transition: .5s;
}

.hp-visual {
    width: calc(100% + 4px);
    height: var(--hp-visual-height);
    border: 2px black solid;
    background-color: red;
    font-weight: bold;
    position: absolute;
    left: -2px;
    bottom: -2px;
    text-align: center;
}

.hp-green {
    background-color: green;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transition: 1s;
    transition-delay: 1.5s;
}

.hp-number {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: var(--character-head-font)
}

.hp-number .max {
    transition: 2s;
}

.modal-character-view {
    display: flex;
    /* width: 100%; */
    flex-wrap: wrap;
    flex: auto;
}

.modal-character-view .character-card:not(.boss) {
    height: 240px;
    width: 150px;
}

.modal-character-view .character-card .character-stats{
    font-size: 12px;
    height: fit-content;
}

.modal-character-view .character-card .character-icon {
    height: calc(100% - 110px);
}

.active-player {
    border-color: var(--active-player-color) !important;
    z-index: 1;
}

.targeted {outline: 4px solid var(--target-player-color);}

.character-card.p1 {grid-row: 1; grid-column: 1; order: -1;}
.character-card.p2 {grid-row: 1; grid-column: 3;}
.character-card.p3 {grid-row: 3; grid-column: 1;}
.character-card.p4 {grid-row: 3/ span2; grid-column: 3/ span2;}

/* map area style */
.map-area.teleportation {
    position: absolute;
    z-index: 3;

}

.map-area.teleportation .map-square {
    border-color: purple !important;
}

.map-square {
    height: var(--tile-size);
    width: var(--tile-size);
    background-color: var(--map-square-color);
    border: rgb(71, 71, 71) solid 2px;
    align-self: center;
    justify-self: center;
    align-items: center;
    justify-content: center;
    display: flex;
}

.map-square .heal {
    width: var(--item-size);
    height: var(--item-size);
    background-color: rgb(231, 105, 126);
    box-shadow: 4px 4px 5px black;
    border-radius: 40%;
}

.map-square .spikes {
    width: 10px;
    height: var(--item-size);
    background-color: rgb(91, 89, 89);
}

.map-square .energize {
    width: var(--item-size);
    height: var(--item-size);
    background-color: rgb(86, 255, 86);
    box-shadow: 4px 4px 5px black;
}

.map-square .block {
    width: 100%;
    height: 100%;
    background-color: black;
}

.map-square .portal {
    width: 20px;
    height: var(--item-size);
    background-color: purple;
    border-radius: 50%;
}

.map-square .starting {
    background-color: rgba(255, 166, 0, 0.539);
    width: 10px;
    height: 10px;
    border-radius: 50%;
}


/* Action Styles */
.action-area {
    position: fixed;
    right: 0;
    background-color: rgb(96, 66, 66);
    border: 2px solid black;
    padding: 10px;
    top: 20px;
    width: 330px;
}

.action-area.horizontal-mode {
    display: grid;
    width: fit-content;
    grid-template-columns: 250px 250px;
    gap: 5px;
    top: auto;
}

.action-area.horizontal-mode br {
    display: none;
}

.attack-stat {
    display: grid;
    grid-template-columns: 130px 1fr;
    grid-template-rows: repeat(4, 30px);
}

.attack-stat h3{
    grid-column: span 2;
}

.attack-stat span {
    font-weight: bold;
}

#ghost-attack{display: none;}

.handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 25px;
    height: 25px;
    background-color: black;
    cursor: move;
}

.action-holder, .action-indicator {
    display: flex;
    align-items: center;
}

.action-circle {
    border-radius: 50%;
    display: block;
    width: 50px;
    height: 50px;
    border: 3px solid black;
    margin: 5px;
}

.action-circle.full {
    background-color: rgb(17, 142, 17);
}

.action-circle.half {
    background-color: rgb(26, 81, 26);
    width: 25px;
    border-radius: 25px 0 0 25px;
}

.moving {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 5px;
}
.move {position: relative}

.move-up {grid-area: 1/2}
.move-down {grid-area: 2/2}
.move-left {grid-area: 1/1}
.move-right {grid-area: 1/3}

.move-left, .move-right {top: 20px;}

/* Attack Styling */
option.weak { background-color: rgb(112, 112, 112);}

option.powerful { background-color: rgb(148, 7, 7);}

option.heal { background-color: rgb(255, 53, 184);}

option.revive { background-color: orangered}

@media (max-width: 767px) {
    .action-area {
        width: 250px;
    }
    .attack-stat {
        grid-template-rows: auto;
        grid-template-columns: auto;
        font-size: 14px;
    }
    
}



@media (max-width: 500px) {
    .action-area {
        width: 100vw;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        height: 20px;
        position: absolute;
        overflow: hidden;
    }

    .action-area .handle {
        cursor: pointer;
    }

    .action-area.expanded {
        height: auto;
    }

    .action-area.horizontal-mode {
        grid-template-columns: 1fr 1fr;
    }


    .map-area {
        gap: 0px;
    }
    .btn {
        --bs-btn-padding-y: 3px;
    }

    .character-card {
        margin: 5px;
        transition: scale .25s;
    }

    .map-area .character-card:hover {
        scale: 2;
        z-index: 2;
    }
}

/* .modal-character-view .character-stats h3 {
    font-size: 20px;

} */

.modal-character-view {
    --stats-rest-height: 30px;
    --character-head-font: 20px;
    --character-font: 12px;
    --hp-visual-height: 22px;
}