@font-face {
  font-family: MetaPro;
  src: url("../assets/fonts/MetaPro-CondBold.otf");
}
@font-face {
  font-family: MetaProRegular;
  src: url("../assets/fonts/Meta\ Pro-Normal.ttf");
}

* {
  box-sizing: border-box;
}

:root {
  --vh: 100px; /* Fallback value */
  --primary: #ff8c00;
  --text-dark: #001738;
  --bg: url('../assets/bg.jpg');
}

html {
  overflow: hidden;
}

body {
  color: #fff;
  text-align: center;
  overflow: hidden;
  margin: 0;
  padding: 0;
  font-family: MetaPro;
}

.main {
  overflow: hidden;
  position: relative;
}

.game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.40) 0%, rgba(0, 0, 0, 0.00) 50%, rgba(0, 0, 0, 0.40) 100%), var(--bg);
  background-repeat: no-repeat;
  background-position: center;
  background-position-y: top;
  background-size: cover;
  overflow: hidden;
}

.skier {
  position: absolute;
  width: 8vw;
  aspect-ratio: 209.082 / 228.995;
  background-image: url('../assets/skier.png'); /* Add skier asset here */
  background-size: cover;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  transition: top 1s;
}

.skierLeft {
  transform: translateX(-50%) rotate(135deg) !important;
}

.skierRight {
  transform: translateX(-50%) rotate(225deg);
}

.element {
  position: absolute;
  bottom: 0; /* Start from the top */
  transform: translateX(-50%);
}

.obstacles {
  width: 4vw;
  /* height: auto; */
  /* background-image: url('../assets/obstacle.png');  */
}

.points {
  width: 4vw;
  /* background-image: url('../assets/cork.png');  */
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 10vh;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 200px;
  padding: 10px;
}

.score-wrapper {
  opacity: 0;
  border-radius: 4px;
  border: 1px solid #016429;
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(3px);
  gap: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0px 6px 0px 4px;
}

.logo {
  margin-top: 20px;
  max-width: 146px;
  min-width: 60px;
  width: 7.5vw;
}

.points-img {
  width: 45px;
  height: 39px;
}

.lives-img {
  width: 40px;
  height: 38px;
}

.header-text {
  font-size: 25px;
  font-style: normal;
  font-weight: 700;
  color: #016429;
}

.gate {
  position: absolute;
  width: 35vw;
  aspect-ratio: 396 / 270;
  background: url("../assets/gate.png");
  background-size: cover;
  left: 50%;
  transform: translateX(-50%);
  bottom: -90px;
}

.final-gate {
  position: absolute;
  width: 40vw;
  aspect-ratio: 1048 / 608;
  background: url("../assets/finalGate.svg");
  background-size: cover;
  left: 50%;
  transform: translateX(-50%);
  bottom: -138px;
}

.arrow {
  display: none;
  position: absolute;
  bottom: 10%;
  left: 30%;
  width: 7vh;
  height: 7vh;
  cursor: pointer;
  z-index: 1;
}

.right-arrow {
  right: 30%;
  left: auto !important;
  transform: rotate(180deg);
}

.init-modal {
  min-width: 263px;
  min-height: 297px;
  max-width: 775px;
  max-height: 627px;
  height: 80vh;
  aspect-ratio: 627 / 775;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-55%, -50%);
  background: url("../assets/init-modal-bg.png");
  background-size: cover;
  z-index: 1;
  overflow: hidden;
}

.init-modal-header {
  display: block;
  margin: 0 auto 0;
  font-size: 40px;
  font-style: normal;
  line-height: 113.034%;
}

.init-modal-text {
  display: block;
  margin: 7px auto 0;
  font-size: 20px;
  font-style: normal;
  line-height: normal;
  font-family: MetaProRegular;
}

.init-modal-button {
  display: block;
  margin: 17px auto 0;
  border-radius: 6px;
  border: none;
  background: #F4F4F4;
  display: flex;
  /* width: 111px; */
  height: 40px;
  padding: 12px 16px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: #016429;
  font-size: 16px;
  text-align: center;
  line-height: 24px;
  font-family: MetaPro;
  cursor: pointer;  
  z-index: 2;
  position: relative;

}

.init-modal-hill {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
}

.init-modal-ski-road {
  position: absolute;
  right: 0;
  bottom: 0;
  width: auto;
  height: 50%;
}

.animation-skier {
  position: absolute;
  top: 147px;
  right: 7.47px;
  width: 61.541px;
  height: 58.385px;
  animation: skierAnimation 2s ease forwards infinite;
  z-index: 1;
}

@keyframes skierAnimation {
  0% {
    top: 45%;
    right: -61.541px;
  }
  100% {
    top: 100%;
    right: 70%;
  }
}

.animation-cork {
  min-width: 20px;
  min-height: 20px;
  max-width: 50px;
  max-height: 50px;
  width: 2vw;
  height: 2vw;
  position: absolute;
  top: 65%;
  left: 80%;
  animation: corkAnimation 2s ease forwards infinite;
}

@keyframes corkAnimation {
  0% {
    display: block;
  }
  30% {
    display: none;
  }
  100% {
    display: none;
  }
}

.animation-check {
  min-width: 20px;
  min-height: 20px;
  max-width: 93px;
  max-height: 93px;
  width: 2.5vw;
  height: 2.5vw;
  position: absolute;
  top: 55%;
  left: 78%;
  animation: checkAnimation 2s ease forwards infinite;
}

@keyframes checkAnimation {
  0% {
    opacity: 0;
    height: 0;
  }
  30% {
    opacity: 0;
    height: 0;
  }
  31% {
    opacity: 1;
    height: auto;
  }
  100% {
    opacity: 1;
    height: auto;
  }
}

.animation-obstacle {
  min-width: 21px;
  min-height: 35px;
  max-width: 50px;
  max-height: 82px;
  height: 2.5vw;
  position: absolute;
  top: 90%;
  left: 30%;
  animation: obstacleAnimation 2s ease forwards infinite;
}

@keyframes obstacleAnimation {
  0% {
    display: block;
  }
  50% {
    display: none;
  }
  100% {
    display: none;
  }
}

.animation-obstacle-catched {
  min-width: 20px;
  min-height: 20px;
  max-width: 93px;
  max-height: 93px;
  width: 2.5vw;
  height: 2.5vw;
  position: absolute;
  top: 80%;
  left: 28%;
  animation: obstacleCatchedAnimation 2s ease forwards infinite;
}

@keyframes obstacleCatchedAnimation {
  0% {
    opacity: 0;
    height: 0;
  }
  50% {
    opacity: 0;
    height: 0;
  }
  51% {
    opacity: 1;
    height: auto;
  }
  100% {
    opacity: 1;
    height: auto;
  }
}

.outcome-modal {
  display: none;
  width: 50vw;
  height: 60vh;
  aspect-ratio: 50 / 60;
  position: absolute;
  top: 140px;
  left: 50%;
  transform: translateX(-50%);
  background: url("../assets/outcome-modal-bg.png");
  background-size: cover;
  z-index: 1;
  overflow: hidden;
}

.outcome-modal-header {
  display: block;
  margin: 39px auto 0;
  font-size: 40px;
  font-style: normal;
  line-height: 113.034%;
}

.outcome-modal-text {
  display: block;
  margin: 7px auto 0;
  font-size: 20px;
  font-style: normal;
  line-height: normal;
  font-family: MetaProRegular;
}

.outcome-modal-button {
  display: block;
  margin: 17px auto 0;
  border-radius: 6px;
  border: none;
  background: #F4F4F4;
  display: flex;
  width: 147px;
  height: 40px;
  padding: 12px 16px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: #016429;
  font-size: 16px;
  text-align: center;
  line-height: 24px;
  font-family: MetaPro;
  cursor: pointer;  
  z-index: 2;
  position: relative;
}

.registry {
    width: 100%;
    height: 100%;
}

.fade-in {
  animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
  0% {
    display: none;
  }
  100% {
    display: block;
  }
}

.error {
  display: none;
  margin: 3px auto 18px; 
  color: red;
  font-size: 15px;
}

.nickname-input {
  border-radius: 4px;
  border: none;
  background: #F8F8F8;
  color: #016429;
  font-size: 22px;
  text-align: center;
  font-family: MetaPro;
  padding: 15px 10px;
  margin-top: 18px;
  line-height: 113.034%;
  width: 90%;
}

.loader {
  display: none;
  border: 5px solid #f3f3f3; /* Light grey */
  border-top: 5px solid #3498db; /* Blue */
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 18px auto 18px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.leaderboard {
  display: none;
  width: 50vw;
  height: 80vh;
  aspect-ratio: 50 / 60;
  position: absolute;
  top: 10vh;
  left: 25vw;
  /*transform: translate(-50%, -50%);*/
  background: url("../assets/outcome-modal-bg.png");
  background-size: cover;
  z-index: 1;
  overflow: hidden;
}

.list-wrapper {
  display: flex;
  justify-content: center;
  gap: 50px;
}

ul {
    list-style-type: none;
    padding: 0;
    width: 80%;
    min-width: 250px;
}

ul li:nth-child(odd) {
  background-color: rgba(255, 255, 255, 0.10);
}

.leaderboard-list-item {
  width: 100%;
  padding: 5px 10px;
  display: flex;
  justify-content: center;
}

.leaderboard-position {
  color: #FFF;
  font-size: 15px;
  width: 10%;
  text-align: center;
  margin: 0;
  margin-right: 15px;
  font-family: MetaProRegular;
  background: url("../assets/position-bg.png");
  background-size: cover;
  aspect-ratio: 1 / 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.leaderboard-nickname {
  color: #FFF;
  font-size: 15px;
  width: 70%;
  text-align: left;
  font-family: MetaProRegular;
  margin: 0;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.leaderboard-score {
  color: #FFF;
  font-size: 15px;
  width: 10%;
  text-align: right;
  font-family: MetaProRegular;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.current-player {
  color: #FFF !important;
  font-family: MetaPro !important;
}

.leaderboard-header {
  margin: 0px auto 0px;
  color: #FFF;
  font-size: 25px;
  text-align: center;
}

.play-again {
  display: block;
  margin: 10px auto 0;
  border-radius: 6px;
  border: none;
  background: #F4F4F4;
  display: flex;
  width: 147px;
  height: 40px;
  padding: 12px 16px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: #016429;
  font-size: 16px;
  text-align: center;
  line-height: 24px;
  font-family: MetaPro;
  cursor: pointer;  
  z-index: 2;
  position: relative;
}

@media screen and (max-width: 1500px) {
  .outcome-modal-header,
  .init-modal-header {
    font-size: 25px;
  }
  .outcome-modal-text,
  .init-modal-text {
    font-size: 16px;
  }
  .leaderboard-header {
    font-size: 15px;
  }
  .leaderboard-score {
    font-size: 10px;
  }
  .leaderboard-position {
    font-size: 10px;
  }
  .leaderboard-nickname {
    font-size: 10px;
  }
}


@media screen and (max-width: 500px) {
  .init-modal {
    height: 60vh;
    transform: translate(-50%, -50%);
  }
  .outcome-modal {
    width: 100vw;
    height: 55vh;
  }
  .leaderboard {
    width: 100vw;
    height: 70vh;
    left: 0;
    transform: translate(0);
  }
  .outcome-modal-header,
  .init-modal-header {
    font-size: 20px;
    margin: 0px auto 0;
  }
  .outcome-modal-text,
  .init-modal-text {
    font-size: 16px;
  }
  .header {
    gap: 50px
  }
  .skier {
    width: 15vw;
  }
  .obstacles {
    width: 7vw;
  }
  .points {
    width: 7vw;
  }
  .arrow {
    left: 10%;
  }
  .right-arrow {
    right: 10%;
  }
}