/* Styles globaux */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Press Start 2P', system-ui;
}

body {
  margin: 0;
  cursor: url("img/cursor/cursor.png"), auto;
  font-family: Arial, sans-serif;
  background-color: #1a1a1a;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}

/* Conteneur du Menu du Jeu */
#game-menu {
  display: block;
}

.menu-container {
  text-align: center;
  background-color: #2c2c2c;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

#title-game {
  margin-bottom: 40px;
}

/* Styles des boutons */
.btn {
  cursor: pointer;
  display: block;
  width: 200px;
  padding: 15px;
  margin: 10px auto;
  font-size: 20px;
  border: 2px solid transparent;
  border-radius: 5px;
}

.btn:hover {
  border: 2px solid white;
}

.btn.jouer {
  background-color: #4caf50;
}

.btn.options {
  background-color: #2196f3;
}

/* Message d'erreur pour les petits écrans */
.error-message {
  display: none;
  text-align: center;
  color: red;
  margin: 40px;
}

.error-message h1 {
  font-size: 40px;
  margin-bottom: 40px;
}

.error-message p {
  font-size: 20px;
}

/* Menu Responsive uniquement pour les écrans de PC */
@media (min-width: 1024px) {
  .menu-container {
    width: 400px;
  }
}

@media (max-width: 1024px) {
  /* Cache le menu sur les petits écrans */
  .menu-container {
    display: none;
  }
  /* Affiche le message d'erreur sur les petits écrans */
  .error-message {
    display: block;
  }
}
/* Fin Menu du Jeu*/

/* Start Box Modal */

#modal {
  display: block;
  position: fixed;
  z-index: 9999;
  left: calc(50% - 150px - 20px);
  top: calc(50% - 145px);
  width: 300px;
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#modal_header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

#modal_header_title {
  font-size: 16px;
  color: black;
  margin-left: 10px;
}

#modal_close {
  width: 30px;
  height: 30px;
  padding: 5px;
  transition: all 0.2s ease-in-out;
}

#modal_close:hover {
  filter: invert(100%);
  background-color: cyan;
  border-radius: 5px;
}

#modal_content {
  display: flex;
  flex-direction: column;
}

.modal_screen_size_button {
  cursor: pointer;
  display: block;
  width: 200px;
  padding: 15px;
  margin: 10px auto;
  font-size: 14px;
  border: 2px solid black;
  border-radius: 5px;
}

.modal_screen_size_button:hover {
  background-color: #4caf50;
}

.modal_screen_size_button:focus {
  background-color: #4caf50;
}

#overlay {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

/* End Box Modal */

/* Conteneur du Menu du Jeu */
#start-game {
  display: none;
}

#frames-counter {
  position: absolute;
  color: white;
  top: 10px;
  left: 10px;
  z-index: 9998;
}

#player-hp {
  position: absolute;
  color: white;
  top: 10px;
  right: 10px;
  z-index: 9998;
}

#hud {
  position: absolute;
  color: white;
  top: 35px;
  left: 10px;
  z-index: 9998;
}

#tutorial {
  display: none;
}

#game {
  display: inline-block;
  position: relative;
}

#inventory {
  display: none;
  position: absolute;
  width: 90%;
  height: 80%;
  top: 10%;
  left: 5%;
  bottom: 10%;
  right: 5%;
  z-index: 9999;
}

#player {
  display: flex;
  height: 60%;
}

#equipment {
  display: flex;
  width: calc((100% / 3));
}

#armor, #jewelry {
  display: flex;
  flex-direction: column;
  width: 20%;
}

#weapon-player {
  display: flex;
  flex-direction: column;
  width: 60%;
}

#player-image {
  width: 100%;
  height: 100%;
  align-self: center;
  margin-top: 5px;
}

#weapon {
  display: flex;
  flex-direction: row;
  height: calc(100% / 3);
}

.equipment-item {
  align-self: center;
  aspect-ratio: 1 / 1;
  background-color: gray;
  color: white;
  border: 4px solid black;
}

.armor-item {
  height: 100%;
  margin: 10px;
}

.weapon-item {
  width: 100%;
  margin: 5px;
}

#quest-quideline {
  width: calc(100% / 3);
  height: calc(100% - 20px);
  margin: 10px;
  border-radius: 10%;
}

#quest {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: calc((100% / 3) - 20px);
  background-color: brown;
  color: white;
  margin: 10px 10px 0px 10px;
  border-radius: 50%;
}

#quest-info {
  display: flex;
  justify-content: center;
  text-align: center;
  overflow-wrap: anywhere;
  height: calc(((100% / 3) * 2) - 40px);
  background-color: white;
  color: black;
  margin: 20px 10px 10px 10px;
  padding: 10px;
  border-radius: 10px;
}

#stats {
  background-color: darkslategray;
  width: calc(100% / 3);
  border-radius: 10%;
  margin: 10px;
}

#player-name {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 20%;
  margin: 0;
  color: black;
}

#player-stats {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  height: 80%;
  color: white;
}

.stat {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.stat-name {
  padding-left: 15px;
}

.stat-number {
  padding-right: 15px;
}

#backpack {
  background-color: brown;
  height: 40%;
}

.inventory-line {
  display: flex;
  flex-direction: row;
  height: calc(100% / 3);
}

.inventory-slot-container {
  display: flex;
  position: relative;
}

.inventory-slot {
  height: calc(100% - 20px);
  align-self: center;
  aspect-ratio: 1 / 1;
  background-color: gray;
  color: white;
  margin: 6px;
  border: 4px solid black;
}

.quantity-display {
  position: absolute;
  bottom: 2px;
  right: 2px; 
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 12px;
  display: none;
}

.quantity-display.show {
  display: inline;
}
