* {
  user-select: none; /* Désactive la sélection */
  -webkit-user-select: none;
  --touch-action: none; /* Désactive les gestes de base */
  -webkit-touch-callout: none; /* Désactive les menus contextuels */
}

@font-face {
  font-family: "SnowForSanta";
  src: url(./font/SnowForSanta.ttf) format("truetype");
}

.christmas-font {
  font-family: "SnowForSanta";
}

html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Arial", sans-serif;
  /* background: linear-gradient(to bottom, #87CEEB, #fff); */
  overflow: hidden;
  background: url("./sprites/BG.png");
}

@supports (-webkit-touch-callout: none) {
  body {
    height: -webkit-fill-available; /* Plein écran spécifique à iOS */
  }
}

body {
  font-family: "Arial", "Helvetica", sans-serif;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#controll-area-left {
  position: absolute;
  width: 20%;
  height: 100%;
  left: 0;
  z-index: 4;
}

#controll-area-right {
  position: absolute;
  width: 20%;
  height: 100%;
  right: 0;
  z-index: 4;
}

#arrow-left {
  position: absolute;
  top: 40%;
  left: 75px;
  font-size: 75px;
  transform: translate(-50%, -50%);
  z-index: 4;
  color: white;
  opacity: 0.7;
  width: 75px;
  height: 75px;
  background-size: cover;
  background-image: url("/sprites/arrow-down.png");
}

#arrow-right {
  position: absolute;
  top: 40%;
  right: 75px;
  transform: translate(50%, -50%);
  font-size: 75px;
  z-index: 4;
  /* transparent */
  color: white;
  opacity: 0.7;
  width: 75px;
  height: 75px;
  background-size: cover;
  background-image: url("/sprites/arrow.png");
}

#title-div {
  position: absolute;
  top: 30%;
  left: 50%;
  text-align: center;
  transform: translate(-50%, -50%);
  z-index: 4;
}

#title-div .title {
  margin-bottom: 10px;
  color: #9e0202;
}

#title-div p {
  font-size: 3rem;
}

#title-div small {
  font-weight: bold;
}

#game {
  /* position: relative; */
  width: 100vw;
  height: 100vh;

  border-bottom: 3px solid #ffffff;
  overflow: hidden;
  position: absolute;
  /* margin-bottom: 50px; */
}

#player {
  position: absolute;
  bottom: 35px;
  left: 1%;
  width: 200px;
  /* min-width: 0px; */
  /* background: url('sprites/Walk\ \(1\).png') no-repeat center; */
  z-index: 3;
}

#player img {
  width: 100%;
}

#player #player-bounding-box {
  position: absolute;
  width: 30%;
  height: 85%;
  left: 25%;
  top: 2%;
  /* border: 1px solid blue; */
}

.obstacle {
  position: absolute;
  bottom: 30px;
}

.obstacle div {
  position: absolute;
  color: black;
  font-weight: bold;
}

.obstacle img {
  width: calc(
    var(--player-size) / 2.5
  ); /* Exemple : 2 fois la taille du joueur */
  height: calc(var(--player-size) / 2.5);
}

.background-object {
  position: absolute;
  bottom: 50px;
  height: calc(var(--player-size) * 1.2);
  animation: moveBackgroundObstacle 8s linear forwards;
  z-index: -1;
}

#play-btn {
  margin-top: 25px;
  width: 200px;
  height: 50px;
  background-color: #9e0202;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: bold;
  border-radius: 10px;
  z-index: 2;
  font-size: 30px;
  cursor: pointer;
}

#restart-btn {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #9e0202;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding-left: 10px;
  padding-right: 10px;
  padding-top: 5px;
  padding-bottom: 5px;
  font-weight: bold;
  font-size: 30px;
  cursor: pointer;
}

#play-btn:hover {
  cursor: pointer;
}

#score {
  position: absolute;
  text-align: center;
  margin-top: 20px;
  font-size: 2rem;
  color: #ffffff;
  left: 50%;
  transform: translateX(-50%);
}

#ground {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background-color: #ececec;
  z-index: -3;
}

#final-score-div {
  text-align: center;
  margin-top: 20px;
  font-size: 2.5rem;
  color: #9e0202;
  position: absolute;
  top: 20;
  left: 70%;
  transform: translateX(-50%);
}

#final-score-div span {
  font-size: 2.5rem;
}

#final-score {
  text-align: center;
  margin-top: 20px;
  font-size: 2rem;
  color: #9e0202;
}

.game-over-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 5;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
}

.game-over-modal-content {
  background-color: white;
  position: relative;
  padding: 20px;
  max-width: 260px;
  width: 320px;
  border-radius: 10px;
  height: 300px;
  text-align: center;
}

.game-over-modal-content h2 {
  font-size: 35px;
  margin-top: 0px;
  margin-bottom: 10px;
}

.game-over-modal-content div {
  display: flex;
}

#player-over {
  width: 300px;
  position: absolute;
  left: -35px;
  bottom: 60px;
}

@keyframes jump {
  0% {
    bottom: 35px;
  }
  50% {
    bottom: calc(var(--player-size) * 2);
  }
  100% {
    bottom: 35px;
  }
}

@keyframes moveObstacle {
  0% {
    right: -100px;
  }
  100% {
    right: 120vw;
  }
}

@keyframes moveBackgroundObstacle {
  0% {
    right: -300px;
  }
  100% {
    right: 120vw;
  }
}
