/* СБРОС ОТСТУПОВ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Базовые стили */
body {
  font-family: sans-serif;
  background: #fff;
  color: #000;
}

/* Класс для скрытия */
.hidden {
  display: none !important;
}

/* --- СТАРТОВЫЙ ЭКРАН --- */
.start-screen {
  width: 400px;
  max-width: 90%;
  margin: 100px auto;
  padding: 20px;
  text-align: center;
  border: 2px solid #ccc;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.start-screen h2 {
  font-size: 24px;
  margin-bottom: 20px;
}

.avatar-selection {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
}

.avatar-option {
  text-align: center;
}

/* Скрываем радио, используем label */
.avatar-option input[type="radio"] {
  display: none;
}

.avatar-option label {
  cursor: pointer;
  display: inline-block;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 5px;
  transition: border-color 0.3s;
}

.avatar-option input[type="radio"]:checked + label {
  border-color: #c22767;
}

.avatar-option img {
  width: 100px;
  height: auto;
  display: block;
}

.nickname-field {
  margin-bottom: 20px;
}

.nickname-field label {
  margin-right: 5px;
}

.nickname-field input {
  padding: 5px 10px;
  font-size: 16px;
  width: 200px;
}

#startGameBtn {
  background: #c22767;
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

#startGameBtn:hover {
  background: #a02053;
}

/* --- ШАПКА (top-bar) --- */
.top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;

  padding: 10px 20px;
  border-bottom: 2px solid #eee;
}

.left-box .logo-img {
  height: 50px;
}

.center-box {
  flex: 1;
  display: flex;
  justify-content: center;
}

.center-inner {
  border: 2px solid #000;
  border-radius: 10px;
  padding: 5px 15px;
}

.center-inner h1 {
  font-size: 32px;
  color: #c22767;
}

.right-box {
  display: flex;
  align-items: center;
  border: 2px solid #000;
  border-radius: 10px;
  padding: 5px 15px;
  gap: 15px;
}

.avatar-img {
  width: 70px;
  border-radius: 8px;
}

.score-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.score-info .nickname {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 5px;
}

.score-info .puan {
  font-size: 18px;
  font-weight: 400;
}

/* --- ИГРОВАЯ ЗОНА (main.game-area) --- */
.game-area {
  width: 100%;
  max-width: 1200px;
  margin: 20px auto;
  padding: 20px;
}

.drag-drop-container {
  background: #f0f0f0;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.drag-drop-container .instructions {
  font-size: 20px;
  margin-bottom: 20px;
  color: #c22767;
  font-weight: bold;
}

/* Корзины */
.baskets {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 30px;
}

.basket {
  width: 150px;
  height: 150px;
  border: 2px dashed #333;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #fff;
}

.basket h3 {
  margin: 0;
  font-size: 16px;
  padding: 4px;
}

/* Подсветка при правильном / неправильном drop */
.correct-basket {
  background-color: #e1ffe1 !important; /* светло-зелёный */
  border-color: #49b249 !important;     /* более тёмная зелёная рамка */
}

.wrong-basket {
  background-color: #ffe1e1 !important; /* светло-красный */
  border-color: #c44c4c !important;     /* более тёмная красная рамка */
}

/* Предметы */
.items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
}

.item {
  font-size: 40px;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  border: 2px solid transparent;
  border-radius: 8px;
  background-color: #fff;
  user-select: none;
}

.item:active {
  opacity: 0.6;
  cursor: grabbing;
}

/* Сообщение о результате */
#message {
  margin-top: 20px;
  font-size: 18px;
  font-weight: bold;
  min-height: 24px;
  text-align: center;
}

/* Скрытое поле для мобильного ввода */
#mobileInput {
  position: absolute;
  opacity: 0;
  height: 1px;
  width: 1px;
  top: -9999px;
}

/* --- АДАПТАЦИЯ ПОД МОБИЛЬНЫЕ (до 600px) --- */
@media (max-width: 600px) {
  .center-inner h1 {
    font-size: 18px;
  }

  .start-screen {
    max-width: 320px;
    margin-top: 50px;
    padding: 15px;
  }

  .avatar-option img {
    width: 60px;
  }

  #startGameBtn {
    font-size: 16px;
    padding: 8px 16px;
  }

  .drag-drop-container .instructions {
    font-size: 12px;
  }

  .basket {
    width: 90px;
    height: 70px;
  }

  .items {
    max-width: 300px;
  }

  .item {
    font-size: 30px;
    width: 60px;
    height: 60px;
  }
}