@import url("https://fonts.googleapis.com/css2?family=Grechen+Fuemen&family=Roboto:ital,wght@0,100..900;1,100..900&family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&family=WDXL+Lubrifont+SC&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Grechen+Fuemen&family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&family=Roboto:ital,wght@0,100..900;1,100..900&family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&family=WDXL+Lubrifont+SC&display=swap");

:root {
  --card-width: 120px;
  --card-height: 160px;
}

html {
  overflow-y: hidden;
}
body {
  margin: 0;
  user-select: none;
  background-size: cover;
  background-image: url(/img/backgrounds/forest.png);
  background-position-x: 50%;
  background-position-y: -1px;
  background-repeat: repeat-y;
  min-width: 0;
  transform-origin: 50% 0;
  transition: filter 0.5s ease-out;
}
#container {
  width: 100%;
  height: 100%;
}

@keyframes board-cell-bg-hover {
  0% {
    border: 6px solid #bbddbb;
    background-position: 50% 30%;
  }
  100% {
    border: 10px solid #bbddbb;
    background-position: 50% 40%;
  }
}

#board {
  width: calc(var(--card-width) * 7);
  height: calc(var(--card-height) * 4 + 20px + 170px);
  margin: 35px auto;
  line-height: 25%;
  position: relative;
  padding: 20px;
  outline: 5px solid black;
  border-radius: 4px;
  background-color: #eee;
  box-shadow: rgba(0, 0, 0, 0.3) 0px 19px 38px,
    rgba(0, 0, 0, 0.22) 0px 15px 12px;
}
.board-cell-bg {
  box-sizing: border-box;
  width: var(--card-width);
  height: var(--card-height);
  display: inline-block;
  margin: 0;
  transition: background-color 0.3s ease-out;
}
.board-cell-bg-hl-light:hover,
.board-cell-bg-hl-dark:hover {
  cursor: pointer;
  background-image: url("/icons/indicators/arrow.png");
  background-size: 50px;
  background-repeat: no-repeat;
  animation: board-cell-bg-hover 1s ease-in-out 0s infinite alternate;
}
.board-cell-bg-hl-light {
  background-color: #ddffdd !important;
}
.board-cell-bg-hl-dark {
  background-color: #cceecc !important;
}
.board-cell-bg-hl-light-cast {
  background-color: #aaffaa !important;
}
.board-cell-bg-hl-dark-cast {
  background-color: #88dd88 !important;
}
.board-cell-overlay {
  position: absolute;
  width: var(--card-width);
  height: var(--card-height);
  opacity: 0.4;
  transition: opacity 0.4s ease-out;
}

.block {
  box-sizing: border-box;
  position: absolute;
  width: var(--card-width);
  height: calc(var(--card-height));
  opacity: 0;
  cursor: pointer;
  line-height: 4px;
  transition: margin-top 0.1s ease-out, filter 0.3s ease-in;
}
.block-dead {
  filter: grayscale(80%);
}
.block-color-overlay,
.block-image-overlay {
  position: absolute;
  top: 16px;
  left: 12px;
  width: 96px;
  aspect-ratio: 1;
  border-radius: 4px;
}
.block-color-overlay {
  opacity: 0.4;
  transition: opacity 0.4s ease-out;
}
.block-color-overlay > p {
  width: 100%;
  margin: 0;
  margin-top: 40px;
  text-align: center;
  font-family: "Source Code Pro", monospace;
  font-weight: 600;
  font-size: 50px;
  color: white;
}
.block-image-overlay {
  opacity: 0.7;
  background-size: 60%;
  background-position: 50%;
  background-repeat: no-repeat;
  transition: opacity 0.3s ease-out;
}
.block-crown {
  width: 28px;
  height: 27px;
  background-image: url(/icons/flat/crown.png);
  background-size: 100% 75%;
  background-position: 50%;
  background-repeat: no-repeat;
  position: absolute;
  top: -3px;
  left: 48px;
  z-index: 600;
}
.block-stars {
  height: 12px;
  padding: 1px;
  width: 0;
  background: #00000066;
  border-radius: 6px;
  background-image: url(/icons/flat/upgrade-star.png);
  background-size: 12px;
  background-position: 1px;
  position: absolute;
  top: 91px;
  left: 50%;
  transform: translateX(-50%);
}
.block-armor {
  width: 24px;
  height: 24px;
  position: absolute;
  top: 102px;
  left: 48px;
  outline: 3px solid black;
  border-radius: 50% 50% 50% 50% / 12% 12% 88% 88%;
  z-index: 600;
  background-color: #eee;
  text-align: center;
  padding-top: 8px;
  box-sizing: border-box;
  font-family: "Source Code Pro", monospace;
  font-weight: 600;
  transform: scale(0);
  animation: scaleIn 0.2s ease-out forwards 0.5s;
}

#game-left {
  right: calc(50% + var(--card-width) * 4 + 20px);
}
.card-info {
  position: absolute;
  height: calc(var(--card-height) * 2);
  aspect-ratio: 1;
  box-sizing: border-box;
}
.card-info-avatar {
  background-color: #666;
  background-size: contain;
  width: 100%;
  height: calc(var(--card-height) * 2);
  border-radius: 4px;
  outline: 3px solid black;
}
.card-info-stars {
  height: 24px;
  padding: 2px;
  width: 0;
  background: #00000066;
  border-radius: 14px;
  background-image: url(/icons/flat/upgrade-star.png);
  background-size: 24px;
  background-position: 2px;
  position: relative;
  top: 285px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
}
.card-info-cost {
  box-sizing: border-box;
  height: 28px;
  left: 40px !important;
  top: 262px !important;
  padding-top: 4px !important;
  border-radius: 15px !important;
  transform: translateX(-50%) translateY(23px);
  background-color: #00000066 !important;
  color: white;
}
.card-info-desc {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  height: var(--card-height);
  background-color: white;
  margin-top: 20px;
  border-radius: 4px;
  padding: 10px;
  outline: 3px solid black;
  font-family: "Roboto";
  display: flex;
  flex-direction: column;
  font-size: 15px;
}
.card-info-divider {
  flex: 1;
}
.card-info-name {
  font-size: 24px;
  font-weight: 600;
  border-bottom: 3px solid black;
}
.card-info-text {
  margin-top: 6px;
  padding: 0 30px;
}
.card-info-text-explanation {
  font-size: 15px;
}
.card-info-text > b,
.card-info-text-explanation > b {
  font-weight: 600;
  color: #800000;
}
.card-info-text > i {
  color: #666;
}
.card-info-stats {
  font-family: "Source Code Pro", monospace;
  font-weight: 600;
  background-color: #00000011;
  width: 50%;
  margin: 0 auto;
  border-radius: 12px;
}
.card-info-stats-icon {
  height: 10px;
  display: inline-block;
  margin-right: 2px;
}
.card-info-text-explanation {
  width: 100%;
  box-sizing: border-box;
  margin-top: 20px;
  border-radius: 4px;
  padding: 10px;
  background-color: white;
  outline: 3px solid black;
  font-family: "Roboto";
}

#game-top-right {
  position: absolute;
  left: calc(50% + var(--card-width) * 4 + 20px);
  top: 0;
}
.ui-section-header {
  width: 200px;
  margin: 0 auto;
  text-align: center;
  background-color: #00000033;
  color: #ffffffdd;
  font-family: "Roboto";
  font-size: 12px;
  font-weight: 600;
  padding: 4px;
  border-radius: 4px 4px 0 0;
}
#game-enemy-next-move {
  z-index: -1;
  box-sizing: border-box;
  width: 320px;
  height: calc(var(--card-height) - 40px);
  outline: 3px solid black;
  background-color: white;
  border-radius: 4px;
  display: flex;
}
#game-enemy-next-act {
  transition: opacity 0.3s ease-out;
  margin-top: -3px;
}
#game-enemy-next-attack {
  width: 65%;
  margin-left: 35%;
  box-sizing: border-box;
  padding: 10px;
  font-family: "Roboto";
  font-size: 15px;
  height: 100%;
  background-size: 100px;
  background-position: 50%;
  background-repeat: no-repeat;
  background-color: #ffffffe0;
  background-blend-mode: lighten;
  transition: opacity 0.3s ease-in-out;
  opacity: 0;
}
#game-enemy-next-attack > b {
  color: #800000;
}

#game-bottom-right {
  position: absolute;
  left: calc(50% + var(--card-width) * 4 + 20px);
  top: calc(var(--card-height) * 2 + 20px);
}
#resources {
  width: 320px;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
  padding: 10px;
  background-color: #eee;
  outline: 3px solid black;
  border-radius: 3px;
  height: 43px;
}
.resources-section {
  flex: 0.27;
  display: flex;
  gap: 6px;
  justify-content: center;
}
.resources-icon {
  display: inline;
  width: 24px;
  height: 24px;
}
.resources-value {
  font-family: "Source Code Pro", monospace;
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  line-height: 20px;
}
.game-button {
  font-family: "Source Code Pro", monospace;
  font-size: 16px;
  padding: 4px;
  cursor: pointer;
  box-sizing: border-box;
  border-radius: 4px;
  border: 3px solid black;
  transition: box-shadow 0.3s ease-out, opacity 0.3s ease-out;
}
#button-end-turn:not(:disabled) {
  box-shadow: 0px 0px 0px 3px lime;
}

.divided-row-50 {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}
.divided-row-50 > button {
  flex: 0.5;
}

#game-deck-wrapper {
  margin-top: 33px;
}
#game-deck {
  width: var(--card-width);
  height: 170px;
  outline: 3px solid black;
  border-radius: 4px 4px 0 0;
  background-color: #8b9ff7;
  border-bottom: 10px solid black;
  cursor: pointer;
  font-family: "Source Code Pro", monospace;
  font-size: 70px;
  font-weight: 600;
  text-align: center;
  color: #cad1f7;
  padding-top: 30px;
  box-sizing: border-box;
  transition: filter 0.3s ease-out, box-shadow 0.3s ease-out;
}
.draw-card-cost {
  position: absolute;
  width: var(--card-width);
  bottom: -30px;
  font-size: 18px;
}

#hand {
  position: absolute;
  top: calc(40px + var(--card-height) * 4 + 25px);
  left: calc(50%);
  transform: translate(-50%);
  height: calc(var(--card-height));
  width: calc(var(--card-width) * 7 + 40px);
  z-index: 1000;
  background-color: #eee;
}
.hand-block {
  cursor: pointer;
  position: absolute;
  width: 120px;
  height: 160px;
  transition: margin-top 0.1s ease-out, left 0.2s ease-in-out;
  left: calc(var(--card-width) * 6 + 60px);
}
.hand-block-selected {
  margin-top: -6px;
}
.hand-block-selected .block-avatar {
  box-shadow: 0 0 0 3px white inset;
}
.hand-block-selected .block-content {
  border-bottom: 6px solid black;
}
.hand-block-selected .block-info-wrapper {
  border-radius: 0;
}
.hand-block-cost {
  font-family: "Source Code Pro", monospace;
  font-size: 16px;
  position: absolute;
  text-align: center;
  width: 60px;
  top: -6px;
  left: 27px;
  background-color: #00000011;
  padding: 2px;
  border-radius: 6px;
  font-weight: 600;
}
.hand-block-cost-icon {
  display: inline-block;
  height: 11px;
}

.particle-shadow {
  width: 96px;
  height: 133px;
  border-radius: 4px;
  background-color: black;
  position: absolute;
  z-index: 1;
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shadowAppear {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 0.4;
  }
}

.block-content {
  width: 96px;
  margin: 16px 12px 0 12px;
  border-radius: 4px;
  transition: box-shadow 0.3s ease-out, border-bottom 0.1s ease-out;
}
.block-content:hover > .block-avatar {
  filter: brightness(110%);
}
.block-avatar {
  box-sizing: border-box;
  width: 96px;
  aspect-ratio: 1;
  background-size: 100%;
  border: 3px solid black;
  border-radius: 4px 4px 0 0;
  transition: filter 0.2s ease-out, box-shadow 0.2s ease-out;
}
.block-info-wrapper {
  display: flex;
  justify-content: space-between;
  width: 96px;
  margin: 0 auto;
  box-sizing: border-box;
  border: 3px solid black;
  border-top: none;
  border-radius: 0 0 4px 4px;
  margin-top: 0;
  background-color: white;
}
.block-atk,
.block-hp {
  font-family: "Source Code Pro", monospace;
  font-size: 22px;
  flex: 0.4;
  height: 30px;
  font-weight: 600;
  text-align: center;
  line-height: 30px;
  padding: 2px;
  background-repeat: no-repeat;
  background-position: 50% 90%;
  background-size: 0;
  transition: line-height 0.3s ease-out 0.2s, background-size 0.3s ease-out 0.2s;
}
.block-atk {
  left: 20px;
  background-image: url(/icons/flat/tiny/static.png);
}
.block-hp {
  right: 20px;
  background-image: url(/icons/flat/tiny/heart.png);
}
.block:hover .block-atk,
.block:hover .block-hp {
  line-height: 19px;
  background-size: 10px;
}
.block-order {
  flex: 1;
  height: 30px;
  line-height: 30px;
  padding: 2px;
  background-image: url(/icons/flat/order-dark.png);
  background-size: 24px;
  background-repeat: no-repeat;
  background-position: 50%;
  background-color: #cccffc;
}

.board-proj {
  position: absolute;
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  border-radius: 50%;
  outline: 3px solid black;
  background-color: gray;
  z-index: 10003;
  transition: left 0.2s ease-out, top 0.2s ease-out;
}

@keyframes disappearReappear {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  20% {
    transform: scale(0.95);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes recoilDown {
  0% {
    margin-top: 0;
  }
  50% {
    margin-top: 12px;
  }
  100% {
    margin-top: 0;
  }
}
@keyframes recoilUp {
  0% {
    margin-top: 0;
  }
  50% {
    margin-top: -12px;
  }
  100% {
    margin-top: 0;
  }
}

@keyframes recoilDownSmall {
  0% {
    margin-top: 0;
  }
  50% {
    margin-top: 6px;
  }
  100% {
    margin-top: 0;
  }
}
@keyframes recoilUpSmall {
  0% {
    margin-top: 0;
  }
  50% {
    margin-top: -6px;
  }
  100% {
    margin-top: 0;
  }
}

.banner-text-passing {
  box-sizing: border-box;
  width: calc(var(--card-width) * 2.5);
  position: relative;
  height: 40px;
  bottom: calc(var(--card-height) * 2 + 35px);
  z-index: 10004;
  text-align: center;
  background-color: white;
  border: 3px solid black;
  border-radius: 20px;
  padding: 15px;
  font-family: "Roboto";
  font-weight: 600;
  font-size: 24px;
  line-height: 6px;
  box-shadow: rgb(38, 57, 77) 0px 20px 30px -10px;
  animation: bannerTextPass 1.4s ease-in-out forwards;
}

@keyframes bannerTextPass {
  0% {
    opacity: 0;
    left: calc(var(--card-width) * 2);
  }
  20% {
    opacity: 1;
    left: calc(var(--card-width) * 2.25);
  }
  80% {
    opacity: 1;
    left: calc(var(--card-width) * 2.25);
  }
  100% {
    opacity: 0;
    left: calc(var(--card-width) * 2.5);
  }
}

@keyframes tiltShake {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(5deg);
  }
  50% {
    transform: rotate(0eg);
  }
  75% {
    transform: rotate(-5deg);
  }
  100% {
    transform: rotate(0deg);
  }
}
