body {
  margin: 0;
  padding: 0;
  font-family: 'Arial Rounded MT Bold', 'Segoe UI', sans-serif;
  /*background: #f0f9ff;*/
  background-image: url('bg-tile4.png');
  background-size: 256px 256px; /* или 512px */
  background-repeat: repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  touch-action: manipulation;
  overflow: hidden;
  user-select: none;
}

#game {
  text-align: center;
  max-width: 100%;
  padding: 20px 30px;
  box-sizing: border-box;
  background: #f0f9ff; /* ← ваш прежний фон */
  border-radius: 10px; /* опционально: скругление для красоты */
  box-shadow: 0 4px 16px rgba(0,0,0,0.08); /* опционально: лёгкая тень */
}

#question {
  font-size: 2.8em;
  margin: 20px 0;
  color: #2c3e50;
  font-weight: bold;
}

#options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.option {
  background: #4fc3f7;
  color: white;
  border: none;
  border-radius: 16px;
  padding: 20px 10px;
  font-size: 1.8em;
  cursor: pointer;
  transition: transform 0.15s;
}

.option:active {
  transform: scale(0.95);
}

.option.correct {
  background: #66bb6a;
}

.option.incorrect {
  background: #ef5350;
}

#score {
  font-size: 1.6em;
  color: #1565c0;
  margin-bottom: 10px;
}

#stars {
  font-size: 2.4em;
  min-height: 1.5em;
  margin: 10px 0;
  letter-spacing: 8px;
}

/* Анимации для звёзд */
@keyframes popIn {
      0% { transform: scale(0); opacity: 0; }
      70% { transform: scale(1.2); }
      100% { transform: scale(1); opacity: 1; }
    }
@keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }
.star-animate {
      display: inline-block;
      animation: fadeIn 0.4s ease-out forwards;
      text-shadow: 0 0 8px rgba(4, 0, 255, 0.7);
      color: #ff0000;
    }
.special-star-animate {
      display: inline-block;
      animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
      text-shadow: 0 0 8px rgba(0, 200, 255, 0.7);
    }
.super-star-animate {
      display: inline-block;
      animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
      text-shadow: 0 0 8px rgba(255, 0, 0, 0.7);
    }

/* Кнопка языка */
.lang-toggle {
  margin: 16px 0;
  display: flex;
  justify-content: center;
}

.lang-btn {
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 1.2em;
  cursor: pointer;
  color: #1565c0;
  transition: background 0.2s;
}

.lang-btn:active {
  transform: scale(0.92);
}

/* Кнопка рейтинга */
.rank-btn {
  margin-top: 12px;
  background: #fff8e1;
  border: 1px solid #ffd54f;
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 1.1em;
  color: #e65100;
  cursor: pointer;
}

.rank-btn:hover {
  background: #ffecb3;
}

/* Панель рейтинга */
.leaderboard-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  z-index: 1000;
  text-align: center;
  width: 80%;
  max-width: 300px;
}

.leaderboard-panel.hidden {
  display: none;
}

.lb-header {
  font-size: 1.4em;
  font-weight: bold;
  color: #1565c0;
  margin-bottom: 16px;
}

.lb-content {
  font-size: 1.2em;
  margin: 12px 0;
  line-height: 1.6;
}

.lb-close {
  background: #e0e0e0;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1em;
  cursor: pointer;
  position: absolute;
  top: 12px;
  right: 12px;
}

.lb-close:hover {
  background: #bdbdbd;
}

/* Запрет прокрутки всей страницы */
html, body {
  overflow: hidden;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Контейнер приложения — ровно на весь экран */
#app {
  width: 100vw;
  height: 100vh;
  overflow: hidden; /* 🔑 КЛЮЧЕВОЙ ПАРАМЕТР */
  position: fixed;
  top: 0;
  left: 0;
}

/* Отключаем выделение текста и элементов */
#app,
#game-canvas,
textarea,
button,
.screen {
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* IE10+/Edge */
  user-select: none;         /* Standard */

  -webkit-touch-callout: none; /* Отключает контекстное меню в iOS */
  -webkit-tap-highlight-color: transparent; /* Убирает серый отклик на тап в iOS */
}

/* Отключаем перетаскивание изображений и Canvas */
#game-canvas {
  -webkit-user-drag: none;
  user-drag: none;
}
