@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Press Start 2P", sans-serif;
  color: #fff;
}

body {
  background-color: #291d2c;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2cm 0;
}

section.controls {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  width: 1024px;
  margin-bottom: 1.2cm;
}

section.controls div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  row-gap: 10px;
}

section.controls div h1 {
  margin-bottom: 10px;
  grid-column: span 2;
  text-align: center;
  padding-bottom: 15px;
  border-bottom: 3px solid #a6a2ad;
}

section.controls div p {
  margin-bottom: 10px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

section.controls div p span:nth-child(1) {
  color: #a6a2ad;
}

.container {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.gamestatus {
  display: none;
  position: absolute;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: xx-large;
  background-color: rgb(0, 0, 0, 0.2);
  z-index: 999;
}

.statusbar {
  width: 100%;
  position: absolute;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.statusbar .timer {
  background-color: #199def3f;
  border: 5px solid #199def99;
  backdrop-filter: blur(5px);
  border-radius: 15px;
  width: 100px;
  height: 70px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: xx-large;
  z-index: 99;
}

.statusbar .healthContainer {
  background-color: #199def3f;
  box-shadow: 0 0 0px 6px #199def99;
  backdrop-filter: blur(5px);
  height: 25px;
  width: 100%;
  z-index: 9;
  display: flex;
}

.statusbar .healthContainer:has(.playerHealth) {
  justify-content: start;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.statusbar .healthContainer:has(.enemyHealth) {
  justify-content: end;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.statusbar .playerHealth,
.statusbar .enemyHealth {
  position: relative;
  height: 100%;
  width: 100%;
}

.statusbar .playerHealth {
  background-image: linear-gradient(45deg, #ef3f71, #ef3f3f);
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.statusbar .enemyHealth {
  background-image: linear-gradient(45deg, #ef3f3f, #ef3f71);
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.statusbar .playerHealth::after,
.statusbar .enemyHealth::after {
  content: "";
  position: absolute;
  top: -20px;
  z-index: 1;
  background-image: url("./images/heart.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  height: 60px;
  width: 60px;
}

.statusbar .playerHealth::after {
  left: -16px;
}

.statusbar .enemyHealth::after {
  right: -16px;
}

/* Player Selection */
.playersSecletion {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2cm 1cm;
}

.playersSecletion div.playersSelectedInfo {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.playersSecletion div.playersSelectedInfo > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.playersSecletion div.playersSelectedInfo > div > div {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.playersSecletion div.playersSelectedInfo > div > div span {
  position: relative;
  width: 200px;
  background-color: #ffffff1a;
  border: 2px solid #ffffff88;
  border-radius: 5px;
  height: 20px;
  overflow: hidden;
}

.playersSecletion div.playersSelectedInfo > div > div span::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: var(--percent);
  height: 100%;
  z-index: 1;
  background-color: #ffffffcc;
  transition: width 250ms ease-in;
}

.playersSecletion h2 {
  margin-bottom: 0.2cm;
}

.playersSecletion div.playersSelectionContainer {
  display: flex;
  width: 100%;
  justify-content: space-between;
  margin-bottom: 1cm;
  gap: 1cm;
}

.playersSecletion div.playersSelectionContainer > div {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.playersSecletion div.playersSelectionContainer > div > div {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 15px;
}

.playersSecletion div.playersSelectionContainer > div > div > div {
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.playersSecletion div.playersSelectionContainer > div:nth-of-type(2) > div {
  flex-direction: row-reverse;
}

.playersSecletion div.playersSelectionContainer > div:nth-of-type(2) h3 {
  justify-content: end;
  text-align: end;
}

#player2fighters .players2Select {
  position: relative;
}

#player2fighters .players2Select::before {
  transform: rotateY(180deg);
}

.players2Select {
  position: relative;
  --size: 100px;
  height: var(--size);
  width: var(--size);
  font-size: xx-small;
  text-align: center;
  border-radius: 10px;
  padding: 10px;
}

.players2Select::before {
  content: "";
  z-index: -1;
  position: absolute;
  background-image: var(--fighterViewURL);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
}

.players2Select.active:not(.selected) {
  border: 2px dashed transparent;
  animation: fighterSelectAnimation 1s infinite;
}

.players2Select.selected {
  background-color: #c3ffe431;
  border: 2px dashed #bfffdebf;
}

@keyframes fighterSelectAnimation {
  0%,
  100% {
    background-color: transparent;
    border: 2px dashed transparent;
  }
  50% {
    background-color: #ffffff1a;
    border: 2px dashed #ffffff88;
  }
}

section#bigScreensWarn {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1cm;
}

section#bigScreensWarn a {
  color: rgb(168, 198, 238);
  font-size: small;
}

section#bigScreensWarn * {
  line-height: 1cm;
}

@media (max-width: 1024px) {
  body section {
    display: none !important;
  }
  section#bigScreensWarn {
    display: flex !important;
  }
}
