/* Уникальные стили только для блока .game-scope */
.game-wrap { width: 100%; float: none; display: block; margin: 0; padding: 0; }
.game-scope {
  font-family: Arial, sans-serif;
  background: #fdf6e3;
  /* Let the container height be defined by its content */
  min-height: auto;
  display: flex;
  flex-direction: column;
  /* Изолируем слой, чтобы внешние эффекты (з-index, mix-blend-mode) не пересекались */
  isolation: isolate;
}
.game-scope * { box-sizing: border-box; }
.game-scope a,
.game-scope button,
.game-scope input,
.game-scope select,
.game-scope textarea { font: inherit; }
.game-scope #result,
.game-scope #explanation,
.game-scope .stat-list {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.game-scope header {
  background: #413831;
  color: #fff;
  padding: 8px 10px;
  text-align: center;
  letter-spacing: 1px;
}
.game-scope header p {
  margin: 0;
  color: #fff;
  font-size: 1.15em;
  line-height: 1.2;
}
.game-scope .game-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 30px 0 20px 0;
}
.game-scope .game-card {
  background: #fff;
  border: 1.5px solid #bbb;
  box-shadow: 0 2px 8px #0001;
  padding: 24px 30px;
  border-radius: 0;
  /* Ensure identical width for all cards on desktop */
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  /* Make card content layout consistent */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s;
}
.game-scope .game-card:hover, .game-scope .game-card.active {
  background: #716457;
  color: #fff;
  box-shadow: 0 4px 16px #0002;
}
.game-scope .game-card h2 {
  margin: 0 0 10px 0;
  font-size: 1.3em;
  line-height: 1.25;
  /* Reserve 2 lines to keep all cards same height even if text wraps */
  min-height: 2.5em;
}
.game-scope .game-card p {
  margin: 0;
  font-size: 1em;
  color: inherit;
  line-height: 1.3;
  /* Reserve at least one line */
  min-height: 1.3em;
}
.game-scope #game-container {
  max-width: 900px;
  margin: 0 auto 40px auto;
  /* Remove forced height to avoid long empty space */
  min-height: 0;
  padding: 0 10px;
}
.game-scope .game-section { display: none; }
.game-scope .game-section.active { display: block; }
.game-scope .game-food {
  font-family: Arial, sans-serif;
  background: #fdf6e3;
  text-align: center;
  /* Reduce extra top padding so the box looks more compact */
  padding: 16px 0 0 0;
}
.game-scope .game-food h1 { margin-bottom: 10px; }
.game-scope .game-food .score { font-size: 22px; margin-bottom: 10px; color: #333; }
.game-scope .game-food .highscore { font-size: 18px; margin-bottom: 20px; color: #888; }
.game-scope .game-food .food { font-size: 24px; margin-bottom: 20px; }
.game-scope .game-food .buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 20px; }
.game-scope .game-food button { padding: 10px 20px; font-size: 18px; border-radius: 0 !important; border: none; background-color: #413831; color: #fff; cursor: pointer; transition: background 0.2s, transform 0.1s; box-shadow: 0 2px 6px #0001; }
.game-scope .game-food button:hover { background-color: #716457; transform: scale(1.05); }
.game-scope .game-food #result { margin-top: 10px; font-size: 16px; font-weight: normal; min-height: 24px; }

/* Приводим размер и насыщенность текста результата к одному виду во всех играх */
.game-scope .game-food #result,
.game-scope #history-result,
.game-scope #hebrew-result {
  font-size: 14px !important;
  line-height: 1.3 !important;
  font-weight: normal !important;
}
.game-scope .game-food #explanation { margin-top: 10px; font-size: 16px; color: #555; min-height: 24px; }
.game-scope .game-food .progress-bar { width: 100%; background: #eee; border-radius: 0 !important; margin: 20px 0 10px 0; height: 18px; overflow: hidden; }
.game-scope .game-food .progress { height: 100%; background: #716457; width: 0%; transition: width 0.3s; }
.game-scope .game-food .timer { font-size: 18px; color: #b71c1c; margin-bottom: 10px; }
.game-scope .game-food .difficulty { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 20px; }
.game-scope .game-food .difficulty label { display: flex; flex-direction: column; align-items: flex-start; min-width: 140px; margin-bottom: 0; }
.game-scope .game-food #start-btn { margin-top: 10px; border: none; box-shadow: none; border-radius: 0; }
.game-scope .game-food .difficulty select { border: 1.5px solid #bbb; box-shadow: none; background: #fff; padding: 6px 10px; border-radius: 0; font-size: 16px; }
.game-scope .game-food button, .game-scope .game-food .music-toggle { border-radius: 0 !important; }
.game-scope .game-food .progress-bar, .game-scope .game-food .progress { border-radius: 0 !important; }
.game-scope .game-food .stat-list, .game-scope .game-food .food, .game-scope .game-food .score, .game-scope .game-food .highscore, .game-scope .game-food .timer, .game-scope .game-food .confetti, .game-scope .game-food .medal { border-radius: 0 !important; }
.game-scope .game-food .hidden { display: none; }
@media (max-width: 600px) {
  .game-scope .game-list { gap: 10px; }
  .game-scope .game-card {
    width: 100%;
    min-width: unset;
    max-width: unset;
    padding: 18px 8px;
  }
  .game-scope .game-food { padding: 10px 0 0 0; }
  .game-scope .game-food .food, .game-scope .game-food .score, .game-scope .game-food .highscore, .game-scope .game-food .timer { font-size: 18px; }
  /* Use grid so все кнопки одинаковой ширины на мобильных */
  #hebrew-options, .game-scope .game-food .buttons {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    justify-items: stretch;
  }
  #hebrew-options button, .game-scope .game-food .buttons button {
    width: 100%;
    font-size: 16px;
    padding: 12px 8px;
  }
  .game-scope .game-food .progress-bar { height: 12px; }
  .game-scope .game-food .difficulty { flex-direction: column; align-items: center; gap: 8px; }
  .game-scope .game-food .difficulty label { width: 100%; align-items: center; }
  .game-scope .game-food #start-btn { width: 100%; max-width: 300px; margin-top: 0; }
}
.game-scope .game-food .confetti { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9999; }
.game-scope .game-food .medal { display: inline-block; width: 40px; height: 40px; background: url('https://cdn.pixabay.com/photo/2013/07/13/12/46/medal-146944_1280.png') no-repeat center/contain; vertical-align: middle; margin-left: 10px; }
.game-scope .game-food .music-toggle { margin-top: 10px; font-size: 18px; padding: 10px 20px; border: none; border-radius: 0 !important; background-color: #413831; color: #fff; cursor: pointer; transition: background 0.2s, transform 0.1s; box-shadow: 0 2px 6px #0001; }
.game-scope .game-food .music-toggle:hover { background-color: #716457; transform: scale(1.05); }
.game-scope .game-food .stat-list { margin: 10px auto; max-width: 350px; text-align: left; font-size: 15px; color: #444; }
.game-scope .back-btn {
  margin: 20px auto 0 auto;
  display: block;
  padding: 10px 24px;
  font-size: 18px;
  background: #413831;
  color: #fff;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.2s;
}
.game-scope .back-btn:hover { background: #716457; }
.game-scope .game-food .progress-bar, .game-scope .game-food .progress {
  height: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
}
