/**
 * Game Fonts
 */
@font-face {
    font-family: "Battle Beasts";
    font-style: normal;
    font-weight: normal;
    src: local("Battle Beasts"), url("../fonts/battlebeasts.ttf") format("truetype");
}



/**
 * Main Styles
 */
:root {
    font-size: 14px;
}
html, body {
    margin: 0;
    padding: 0;
    border: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: transparent;
    color: white;
}
html, body, button {
    font-family: Verdana, Arial, Helvetica, sans-serif;
}


a {
    color: black;
    text-decoration: none;
    outline: none;
}

button {
    padding: 0;
    display: block;
    border: 1px solid black;
    color: black;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
}

dl {
    margin: 1rem 0;
}
dt, dd {
    display: inline-block;
    margin: 0;
}


#container {
    position: absolute;
    top: 50%;
    bottom: 50%;
    left: 50%;
    right: 50%;
    width: 66rem;
    height: 44rem;
    margin-top: -22rem;
    margin-left: -33rem;
}
h1 {
    position: absolute;
    right: 0;
    top: -4.2rem;
    margin: 0;
    font: 85px "Battle Beasts";
    line-height: 1;
    color: white;
    z-index: 1001;
}



/**
 * Main Content
 */
.main {
    position: absolute;
    top: 0;
    left: 0;
    right: 21rem;
    bottom: 4.5rem;
}
.sell-all {
    display: none;
    position: absolute;
    top: -0.4rem;
    left: 2rem;
    padding: 0.2rem 1rem;
}
.planning .sell-all {
    display: block;
}



/**
 * Board Section
 */
.board {
    box-sizing: border-box;
    position: absolute;
    top: 1.8rem;
    left: 1.3rem;
    width: calc(28 * 15 * 1.4px);
    height: calc(24 * 15 * 1.4px);
    border: 2px solid rgb(18, 18, 18);
    background-color: rgb(244, 244, 244);
    background-image: linear-gradient(90deg,  rgb(207, 207, 207) 1px, transparent 1px),
                      linear-gradient(180deg, rgb(207, 207, 207) 1px, transparent 1px),
                      linear-gradient(135deg, rgb(219, 219, 219) 25%, transparent 25%, transparent 75%, rgb(219, 219, 219) 75%, rgb(219, 219, 219)),
                      linear-gradient(135deg, rgb(219, 219, 219) 25%, transparent 25%, transparent 75%, rgb(219, 219, 219) 75%, rgb(219, 219, 219));
    background-size: 0.6rem 0.6rem, 0.6rem 0.6rem, 1.2rem 1.2rem, 1.2rem 1.2rem;
    background-position: 0 0, 0 0, 0 0, 0.6rem 0.6rem;
}
.players > div {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}
.defenses {
    overflow: visible !important;
}


.walls div {
    position: absolute;
}
.start {
    background: rgba(0,  51, 0, 0.85);
}
.target {
    background: rgba(140, 0, 0, 0.85);
}
.wall {
    background: rgba(0, 0, 0, 0.85);
}


.path div {
    position: absolute;
    width: 0;
    height: 0;
    border-color: transparent transparent transparent rgba(0, 0, 0, 0.3);
    border-style: solid;
    border-width: 0.7rem 1.4rem;
    transform-origin: 23% 52%;
}

.blood .blood {
    position: absolute;
    height: 0;
    width: 0;
    margin-top: 0.8rem;
    margin-left: 0.8rem;
    box-shadow: 0 0 2.5rem 2px rgb(98, 138, 52);
}

.building {
    position: absolute;
    display: none;
    transform: translate(-50%, -50%);
}
.building .tower-range {
    display: block;
}

.building.dim3 .tower-placeholder2,
.building.dim2 .tower-placeholder3 {
    display: none;
}

.valid .tower-placeholder2,
.valid .tower-placeholder3 {
    padding: 0;
    border: 1px solid rgb(0, 204, 0);
    background-color: rgb(0, 255, 0);
    opacity: .6;
}
.invalid .tower-placeholder2,
.invalid .tower-placeholder3 {
    padding: 0;
    border: 1px solid rgb(204, 0, 0);
    background-color: rgb(255, 0, 0);
    opacity: .6;
}

.blocking {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    height: 1.8rem;
    width: 6.2rem;
    margin-top: -2.1rem;
    margin-left: -4.4rem;
    padding: 1rem;
    background-color: rgb(225, 136, 9);
    border: 2px solid black;
    border-radius: 6px;
    color: black;
    font-size: 20px;
    opacity: 0.8;
    z-index: 1;
}



/**
 * Game Menu
 */
.mainScreen     .overlay, .mainScreen     .main-menu,
.selectMap      .overlay, .selectMap      .map-menu,
.selectLevel    .overlay, .selectLevel    .level-menu,
.planningPaused .overlay, .planningPaused .pause-menu,
.playingPaused  .overlay, .playingPaused  .pause-menu,
.gameOver       .overlay, .gameOver       .gameover-menu,
.controls       .overlay, .controls       .controls-menu {
    display: block;
}

.overlay {
    display: none;
    position: absolute;
    top: -1rem;
    left: 0;
    bottom: 0;
    right: 0;
    background-color: black;
    opacity: 0.6;
    z-index: 1000;
}

.menu {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 0.5rem solid rgba(0, 0, 0, 0.4);
    box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.8);
    z-index: 1001;
}
.main-menu,
.pause-menu,
.level-menu {
    width: 19rem;
}
.map-menu {
    width: 24.6rem;
}
.gameover-menu {
    width: 24rem;
}
.controls-menu {
    width: 31rem;
}

.menu button {
    font-size: 18px;
    line-height: 2;
    margin-bottom: 0.8rem;
}


.maps button {
    position: relative;
    display: inline-block;
    width: 3.9rem;
    margin: 0.3rem;
}
.maps button:hover::before {
    content: attr(data-name) '\A' attr(data-score);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: -3.7rem;
    left: -2.2rem;
    width: 8rem;
    height: 3.3rem;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid black;
    border-radius: 0.3rem;
    background: rgb(233, 209, 0);
    white-space: pre;
    z-index: 2;
    pointer-events: none;
}
.maps button:hover::after {
    content: "";
    position: absolute;
    top: -1px;
    left: 1.4rem;
    width: 0;
    height: 0;
    border-color: black transparent transparent transparent;
    border-style: solid;
    border-width: 0.4rem 0.5rem;
}

.map-menu > div > button {
    display: inline-block;
    width: auto;
    padding: 0 1rem;
    margin-top: 1.8rem;
    margin-bottom: 0;
}
.total-score {
    display: inline-block;
    width: 15rem;
    text-align: right;
    font-size: 20px;
    color: rgb(1, 255, 1);
}


.final-score {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 0.3rem 1rem;
    font-size: 17px;
    color: rgb(255, 0, 0);
}
.final-score dt {
    text-align: right;
}
.final-score dd {
    font-weight: bold;
}
.final-score dt:nth-of-type(3),
.final-score dd:nth-of-type(3) {
    color: rgb(235, 95, 2);
}
.final-score dt:last-of-type,
.final-score dd:last-of-type {
    padding-top: 1.5rem;
    color: rgb(1, 255, 1);
}


.controls dt {
    width: 10rem;
    padding-right: 0.5rem;
    text-align: right;
    line-height: 1.4rem;
    color: yellow;
}
.controls dt:after {
    content: " :";
    color: white;
}
.controls dd {
    width: 18rem;
}



/**
 * Bottom Bar
 */
.bottombar {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    height: 4rem;
    border: 1px solid black;
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.4);
}
.waves-count {
    position: absolute;
    top: 50%;
    left: 1rem;
    width: 4rem;
    text-align: right;
    font-size: 13px;
    font-weight: bold;
    transform: translateY(-41%);
}

.waves {
    position: absolute;
    top: 0.5rem;
    bottom: 0.5rem;
    left: 6rem;
    right: 9rem;
    border: 1px solid black;
    background-color: rgb(102, 102, 102);
    overflow: hidden;
}
.waves:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1.3rem;
    opacity: 0.8;
    background: linear-gradient(to bottom, black, transparent);
}
.waves-content {
    display: flex;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
}

.wave {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 8rem;
    padding: 0 0.5rem;
    border-right: 1px solid black;
    color: black;
    font-family: Arial, Helvetica, sans-serif;
}
.wave h3 {
    margin: 0;
    font-size: 15px;
    text-transform: uppercase;
}
.wave p {
    margin: 0;
    font-size: 12px;
    line-height: 1em;
}

.start-button,
.next-button {
    position: absolute;
    top: 0.3rem;
    bottom: 0.3rem;
    right: 0.5rem;
    width: 8rem;
    padding: 0.3rem;
    font-size: 1.8rem;
}
.next-button {
    display: none;
}

.playing       .start-button,
.playingPaused .start-button {
    display: none;
}
.playing       .next-button,
.playingPaused .next-button {
    display: block;
}



/**
 * General Classes
 */
h2 {
    height: 1.3rem;
    margin: 0;
    padding: 0.5rem;
    font-size: 14px;
    color: black;
    font-weight: bold;
    background: linear-gradient(to bottom, rgb(252, 213, 36), rgb(249, 187, 33));
}
.content {
    position: relative;
    margin-left: 1rem;
    margin-right: 1rem;
    margin-bottom: 1rem;
}

.nav-button {
    background: linear-gradient(to bottom, rgb(252, 213, 36), rgb(249, 187, 33));
}
.nav-button:hover {
    background: linear-gradient(to bottom, rgb(250, 199, 34), rgb(215, 158, 27));
}
.nav-button:focus {
    outline: none;
}

.menu-button {
    width: 100%;
    background: linear-gradient(to bottom, rgb(134, 132, 130), rgb(107, 106, 105));
}
.menu-button:hover {
    background: linear-gradient(to bottom, rgb(204, 202, 202), rgb(134, 132, 130));
}
