:root {
    --tile-size: 64px;
    --num-cols: 6;      /* this is the default / fallback */
    --num-rows: 10;     /* this is the default / fallback */
    --hud-height: 150px;
    --hud-margin: 24px;
    --btn-border-radius: 8px;
}

body {
    width: 100vw;
    height: 100vh;
    background: black;
    display: flex;
    align-items: center;
    justify-content: center;
}

#game {
    position: relative;
    width: calc(var(--tile-size) * var(--num-cols));
    /* height: calc(var(--tile-size) * var(--num-rows) + 150px); */
    height: calc(var(--tile-size) * 8 + var(--hud-height));
    overflow: hidden;
    background: white;
    cursor: url('assets/cursors/cursor.svg'), auto;
}

#frame {
    height: calc(var(--tile-size) * var(--num-rows));
    position: absolute;
    bottom: var(--hud-height);

    /* https://stackoverflow.com/questions/3540194/how-to-make-a-grid-like-graph-paper-grid-with-just-css */
    /* background-size: 25px 25px; */
    /* background-image: linear-gradient(to right, #cbcbcb 1px, transparent 1px), linear-gradient(to bottom, #cbcbcb 1px, transparent 1px); */
}

.grid-row {
    width: 100%;
    height: var(--tile-size);
    display: flex;
}

.cell {
    width: var(--tile-size);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-img {
    width: var(--tile-size);
    height: 100%;
}

.cell.edge {
    filter: brightness(70%) saturate(100%);
    background-image: url('assets/tree.svg');
    background-size: contain;
}

/* https://codepen.io/sosuke/pen/Pjoqqp */
.cell:hover.interactable > .cell-img {
    animation: pulse 1.25s infinite ease-in-out;
    filter: brightness(0) saturate(100%) invert(92%) sepia(14%) saturate(3069%) hue-rotate(337deg) brightness(93%) contrast(88%);
}


@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}


#hud {
    background: #686767;
    height: calc(var(--hud-height) - var(--hud-margin));
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    position: absolute;
    bottom: 0;
}

#hud-margin {
    height: var(--hud-margin);
    width: 100%;
    position: absolute;
    bottom: calc(var(--hud-height) - var(--hud-margin));
    background: white;
}

.pulse {
    animation: pulse 1.25s infinite ease-in-out;
}


.element {
    width: var(--tile-size);    /* 64px; */
    height: var(--tile-size);   /* 64px; */
    background: #302e2e;        /*#D9D9D9;*/

    border-radius: var(--btn-border-radius);
    overflow: hidden;

    display: flex;
    flex-wrap: wrap;
    align-content: center;
    align-items: flex-end;
    justify-content: center;

    position: relative;
}

.cover {
    background: black;
    width: 100%;
    height: 0%;
    position: absolute;
    opacity: 0.5;
}

.cover-text {
    position: absolute;
    top: 33%;
    color: #d9d9d9;
}



/* https://enjeck.com/btns/ */
.flash-slide {}

.flash-slide::before {
  content: "";
  position: absolute;
  top: -30px;
  left: -85px;
  height: 120px;
  width: 70px;
  background: rgba(255, 255, 255, 0.45);
  transform: rotate(20deg);
}

.ready.flash-slide:hover::before {
  left: 190px;
  transition: all 1s ease 0s;
}

.flash-slide--black {
  background: rgb(51, 51, 51);
}

.element-img {
    position: absolute;
    transform: scale(0.6);
    pointer-events: none;
    z-index: 1;
}


.enemy {
    width: var(--tile-size);
    position: absolute;
    top: 0;
    left: 64px;
    pointer-events: none;

}

.health-container {
    position: absolute;
    top: 8px;

    width: 100%;
    height: 6px;

    display: flex;
    justify-content: center;
}

.health-max {
    position: relative;
    background: black;
    border-radius: 4px;
    width: calc(var(--tile-size) - 12px);       /* gives a little spacing on the sides */
    height: 100%;
}

.health-current {
    /* https://css-tricks.com/stripes-css/ */
    background: repeating-linear-gradient(
        310deg,
        #ff3838,
        #ff3838 7px,
        #eb0f0f 7px,
        #eb0f0f 14px
    );
    border-radius: 4px;
    height:100%;
    width: 100%;
}

/* .health-damage {
    background: orange;
    border-radius: 4px;
    position: absolute;
    top: 10px;
    height: 100%;
    width: 25%;
} */
