* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: black;
  color: white;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
}

#gameCanvas {
  position: absolute;
  z-index: 0;
  background: url("../images/background.jpg") center/cover no-repeat;
  display: block;
  width: 100vw;
  height: 100vh;
}

/* 🎯 Базові блоки */
.hud,
.store,
.profile {
  position: absolute;
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 14px;
  overflow-x: auto;
  max-width: 100vw;
  width: 200px;
}

.hud {
  top: 10px;
  left: 10px;
}

.store {
  top: 10px;
  right: 10px;
}

.profile {
  bottom: 10px;
  left: 10px;
}

/* 🏷️ Заголовки */
.hud__title,
.store__title,
.profile__title {
  font-size: 18px;
  color: gold;
  margin-bottom: 10px;
  text-align: left;
}

/* 🔢 Очки, рекорд, зброя */
.hud__highscore {
  color: gold;
  font-weight: bold;
}

.hud__weapon,
.hud__score,
.hud__players,
.hud__lives {
  font-size: 16px;
  color: greenyellow;
  margin-bottom: 5px;
}

.hud__players {
  color: lightblue;
}

.hud__lives {
  color: lightcoral;
}

.hud__btn,
.store__btn,
.profile__btn {
  background: linear-gradient(to right, #1f1f1f, #3a3a3a);
  color: lightcyan;
  border: 1px solid #888;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s ease;
  width: 100%;
}

.hud__btn:hover,
.store__btn:hover,
.profile__btn:hover {
  background: linear-gradient(to right, #2c2c2c, #555);
}

.hud__items,
.store__items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-wrap: wrap;
}

.hud__item,
.store__item {
  display: flex;
  justify-content: flex-start;
}

/* 🔐 Магазин */
.store__coins {
  font-size: 16px;
  color: lightgreen;
  margin-bottom: 10px;
}

.store__btn--owned {
  background-color: #333;
  color: gray;
  border-color: #555;
  cursor: not-allowed;
}

/* ❌ Кнопки закриття */
.store__close,
.profile__close {
  position: absolute;
  top: 5px;
  right: 5px;
  background: transparent;
  border: none;
  font-size: 16px;
  color: #ccc;
  cursor: pointer;
}

.store__close:hover,
.profile__close:hover {
  color: white;
}

.store__close:focus,
.profile__close:focus {
  outline: none;
}

.store__close:active,
.profile__close:active {
  transform: scale(0.95);
}

/* 👤 Профіль */
.profile__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile__label {
  font-size: 14px;
  color: white;
}

.profile__input {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #777;
  background-color: #222;
  color: white;
  font-size: 14px;
}

/* 💥 Вибухи */
.explosion {
  position: absolute;
  width: 50px;
  height: 50px;
  background-image: url("assets/images/explosion.png");
  background-size: cover;
  pointer-events: none;
  animation: explode 0.3s ease-out;
}

@keyframes explode {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ✅ TOAST */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 16px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
  pointer-events: none;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(100%);
}

.toast--error {
  background: rgba(255, 0, 0, 0.85);
}

/* 📱 Медіа-запити */
@media (max-width: 768px) {
  .hud,
  .store,
  .profile {
    position: fixed;
    min-width: 120px;
    max-width: 90vw;
    padding: 8px;
    font-size: 14px;
    overflow-x: auto;
  }

  .hud {
    top: 8px;
    left: 8px;
  }

  .store {
    top: 8px;
    right: 8px;
  }

  .profile {
    bottom: 8px;
    left: 8px;
  }

  .hud__title,
  .store__title,
  .profile__title {
    font-size: 16px;
  }

  .hud__btn,
  .store__btn,
  .profile__btn {
    font-size: 12px;
    padding: 4px;
  }
}

@media (max-width: 480px) {
  .hud,
  .store,
  .profile {
    min-width: 100px;
    max-width: 95vw;
    padding: 6px;
    font-size: 12px;
  }

  .hud__title,
  .store__title,
  .profile__title {
    font-size: 14px;
  }

  .hud__btn,
  .store__btn,
  .profile__btn {
    font-size: 10px;
    padding: 3px;
  }
}

@media (max-width: 320px) {
  .hud,
  .store,
  .profile {
    min-width: 80px;
    padding: 4px;
    font-size: 10px;
  }

  .hud__title,
  .store__title,
  .profile__title {
    font-size: 12px;
  }

  .hud__btn,
  .store__btn,
  .profile__btn {
    font-size: 8px;
    padding: 2px;
  }
}

@media (max-height: 600px) {
  .hud,
  .store,
  .profile {
    height: auto;
    padding: 4px;
    font-size: 10px;
  }
}
