/* «Английский вперёд» — мини-игры про английские слова.
   Общая рамка (полоска сверху, кнопки, экран «Игра окончена») приходит из
   mini.css, здесь только то, что нужно самим играм. */

body { background: radial-gradient(120% 90% at 50% 0%, #12294a 0%, #070b16 70%); }

/* Экран мини-игры занимает всё окно под полоской */
.screen {
  position: fixed;
  inset: 56px 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  overflow: hidden;
}

.bar .chip.back { pointer-events: auto; }
.bar .chip.back:hover { filter: brightness(1.3); }

/* Выключатель звука */
.bar .chip.snd { pointer-events: auto; font-size: 15px; padding: 6px 10px; }
.bar .chip.snd:hover { filter: brightness(1.3); }
.bar .chip.snd.off { opacity: .5; }

/* Задание в «Смешивании» можно тапнуть и услышать слово */
.mix-task b { cursor: pointer; }

/* --- Меню ------------------------------------------------------------------ */

.hub-title { font-size: 34px; font-weight: 900; letter-spacing: 1px; }
.hub-title span { -webkit-text-fill-color: initial; }
.hub-sub { color: #8b93ad; font-size: 14px; margin-top: -8px; }

.hub-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  width: min(920px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 4px;
}

.hub-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  text-align: left;
  background: rgba(18, 26, 48, .85);
  border: 1px solid #2a3350;
  transition: transform .12s, border-color .12s;
}

.hub-card:hover { transform: translateY(-3px); border-color: #4fc3ff; }
.hub-card i { font-size: 34px; font-style: normal; }
.hub-card .t { flex: 1; min-width: 0; }
.hub-card .t b { display: block; font-size: 16px; font-weight: 800; }
.hub-card .t span { display: block; margin-top: 3px; font-size: 12px; color: #8b93ad; }

/* --- Выбор сложности / вида ------------------------------------------------ */

.pick { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pick h2 { font-size: 24px; font-weight: 900; }
.pick-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.pick-btn {
  width: 200px;
  padding: 16px;
  border-radius: 16px;
  font-weight: 800;
  background: rgba(18, 26, 48, .9);
  border: 1px solid #2a3350;
}

.pick-btn:hover { border-color: #4fc3ff; }
.pick-btn i { display: block; font-size: 30px; font-style: normal; margin-bottom: 6px; }
.pick-btn span { display: block; margin-top: 5px; font-size: 12px; font-weight: 600; color: #8b93ad; }

/* --- Цвета и звери: слева вопрос, справа ответы ---------------------------- */

.split {
  display: flex;
  width: 100%;
  height: 100%;
  gap: 14px;
}

.split > * { flex: 1 1 50%; min-width: 0; }

.swatch {
  border-radius: 22px;
  border: 3px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .25);
  transition: background .25s;
}

.beast {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 22px;
  background: rgba(18, 26, 48, .8);
  border: 1px solid #2a3350;
}

.beast em { font-size: clamp(70px, 22vh, 150px); font-style: normal; line-height: 1; }
.beast b { font-size: 22px; font-weight: 900; }
.beast span { font-size: 13px; color: #8b93ad; }

.answers {
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 10px;
}

.answers.five { grid-template-rows: repeat(5, 1fr); }

.ans {
  border-radius: 16px;
  font-size: clamp(16px, 3.4vh, 26px);
  font-weight: 800;
  letter-spacing: .5px;
  background: rgba(18, 26, 48, .9);
  border: 2px solid #2a3350;
}

.ans:hover { border-color: #4fc3ff; }
.ans.ok { background: rgba(65, 224, 94, .28); border-color: #41e05e; }
.ans.bad { background: rgba(255, 90, 90, .28); border-color: #ff5a5a; }

/* --- Пузыри ---------------------------------------------------------------- */

.field {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #0d1c39, #0a1226);
  border: 1px solid #2a3350;
}

.bubble {
  position: absolute;
  top: 0; left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 900;
  color: #06111f;
  background: radial-gradient(circle at 32% 28%, #ffffff 0%, #9fe4ff 45%, #37a9e0 100%);
  box-shadow: 0 0 18px rgba(79, 195, 255, .5);
  will-change: transform;
}

.bubble.pop { animation: pop .22s ease-out forwards; }
@keyframes pop { to { transform: scale(1.7); opacity: 0; } }

/* Шипы: строка треугольников, текст в неё кладёт JS */
.spikes {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 26px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 22px;
  line-height: 26px;
  letter-spacing: -1px;
  color: #b9c2d6;
  text-shadow: 0 0 8px rgba(255, 120, 120, .5);
  background: linear-gradient(180deg, transparent, rgba(255, 90, 90, .25));
}

.keys {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 4px;
  width: 100%;
  flex: 0 0 auto;
}

.key {
  height: 42px;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 800;
  background: #1b2338;
  border: 1px solid #2a3350;
}

.key:active, .key.hit { background: #4fc3ff; color: #06111f; }

/* --- Пары ------------------------------------------------------------------ */

.board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(5, 1fr);   /* карточки пустые внутри — высоту задаём сеткой */
  gap: 6px;
  width: 100%;
  height: 100%;
  max-width: 1000px;
}

.card {
  position: relative;
  border-radius: 10px;
  background: #1b2338;
  border: 1px solid #2a3350;
  overflow: hidden;
  font-size: clamp(9px, 1.5vw, 14px);
  font-weight: 800;
  transition: transform .14s;
}

.card:hover { transform: scale(1.05); }
.card .face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.card .back { font-size: clamp(14px, 2.2vw, 22px); color: #4fc3ff; }
.card .front { opacity: 0; padding: 2px; text-align: center; word-break: break-word; }
.card.open .back { opacity: 0; }
.card.open .front { opacity: 1; }
.card.done { border-color: #41e05e; box-shadow: 0 0 12px rgba(65, 224, 94, .5); }
.card.done:hover { transform: none; }
.card .front.word { color: #eaf1ff; }

/* --- Смешивание ------------------------------------------------------------ */

.mix-task { font-size: 22px; font-weight: 800; }
.mix-task b { font-size: 30px; color: #4fc3ff; }
.mix-task span { color: #8b93ad; font-size: 15px; }

.jar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(260px, 60vw);
  height: min(180px, 26vh);
  border-radius: 0 0 40px 40px;
  border: 4px solid rgba(255, 255, 255, .3);
  border-top: none;
  background: #131b30;
  font-weight: 800;
  color: rgba(255, 255, 255, .55);
  transition: background .3s;
}

.mix-note { font-size: 13px; color: #8b93ad; text-align: center; }
.paints { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.paint {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .22);
  font-size: 13px;
  font-weight: 800;
  color: rgba(0, 0, 0, .65);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}

.paint:hover { transform: scale(1.06); }
.paint.used { border-color: #fff; }
.mix-btns { display: flex; gap: 12px; }

/* --- Мелочи ---------------------------------------------------------------- */

.toast {
  position: fixed;
  top: 66px; left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  padding: 9px 20px;
  border-radius: 999px;
  font-weight: 800;
  background: rgba(10, 14, 26, .92);
  border: 1px solid #2a3350;
}

.toast.ok { color: #7dff5e; border-color: rgba(125, 255, 94, .5); }
.toast.bad { color: #ff9d9d; border-color: rgba(255, 107, 107, .5); }

.over-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

@media (max-width: 720px) {
  .hub-title { font-size: 26px; }
  .split { flex-direction: column; }
  .split > * { flex: 1 1 50%; }
  .board { grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(10, 1fr); }
  .paint { width: 68px; height: 68px; }
  .key { height: 36px; font-size: 14px; }
}

/* --- Наборы карточек и картинки на них ------------------------------------- */

/* Кнопок выбора теперь много (наборы, пазлы, разделы) — даём списку прокрутку */
.pick { max-height: 100%; overflow-y: auto; padding: 4px; }
.pick-row { width: 100%; }

/* Лицо карточки в «Парах»: у еды, школы и зверей это картинка во всю клетку */
.card .front.pic { font-size: clamp(16px, 3.2vw, 40px); line-height: 1; }
/* Семья: под картинкой подписано русское слово */
.card .front.pic.cap { flex-direction: column; gap: 3px; font-size: clamp(14px, 2.6vw, 32px); }
.card .front.pic.cap small { font-size: clamp(8px, 1.15vw, 12px); font-weight: 700; line-height: 1.05; color: #b9c4e0; }

/* --- Слушай и выбирай, Собери слово, Верю — не верю ------------------------ */

/* Пятно краски вместо смайлика — у слов-цветов */
.beast em.sw {
  width: clamp(90px, 24vh, 170px);
  height: clamp(90px, 24vh, 170px);
  border-radius: 26px;
  border: 3px solid rgba(255, 255, 255, .2);
}

.beast { padding: 10px; text-align: center; }

/* Большой динамик: повторить слово диктора */
.hear {
  width: clamp(90px, 22vh, 150px);
  height: clamp(90px, 22vh, 150px);
  border-radius: 50%;
  font-size: clamp(40px, 10vh, 70px);
  background: rgba(79, 195, 255, .16);
  border: 3px solid #4fc3ff;
  transition: transform .1s, background .12s;
}

.hear:hover { background: rgba(79, 195, 255, .3); }
.hear:active { transform: scale(.93); }

/* Шесть картинок-ответов */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(18, 26, 48, .9);
  border: 2px solid #2a3350;
}

.tile:hover { border-color: #4fc3ff; }
.tile.ok { background: rgba(65, 224, 94, .28); border-color: #41e05e; }
.tile.bad { background: rgba(255, 90, 90, .28); border-color: #ff5a5a; }
.tile em { font-style: normal; font-size: clamp(30px, 8.5vh, 70px); line-height: 1; }
.tile em.sw {
  width: clamp(36px, 9.5vh, 78px);
  height: clamp(36px, 9.5vh, 78px);
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, .2);
}
.tile small { padding: 0 4px; font-size: clamp(10px, 2vh, 15px); font-weight: 700; line-height: 1.1; color: #b9c4e0; text-align: center; }

/* Собери слово: картинка сверху, под ней клетки и буквы */
#g-spell .beast { flex: 1 1 auto; min-height: 0; width: min(560px, 100%); }
#g-spell .beast em { font-size: clamp(50px, 16vh, 120px); }
#g-spell .beast em.sw { width: clamp(60px, 16vh, 120px); height: clamp(60px, 16vh, 120px); }

.slots, .letters { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; }

.slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(22px, 6vw, 46px);
  height: clamp(32px, 7.5vw, 56px);
  border-radius: 10px;
  border-bottom: 3px solid #4fc3ff;
  background: rgba(18, 26, 48, .9);
  font-size: clamp(17px, 4.5vw, 32px);
  font-weight: 900;
}

.slot.full { color: #7dff5e; border-color: #41e05e; }
.slot.miss { color: #ff9d9d; border-color: #ff5a5a; }

.ltr {
  width: clamp(34px, 8vw, 58px);
  height: clamp(34px, 8vw, 58px);
  border-radius: 12px;
  font-size: clamp(19px, 5vw, 34px);
  font-weight: 900;
  background: #1b2338;
  border: 2px solid #2a3350;
}

.ltr:hover { border-color: #4fc3ff; }
.ltr.used { visibility: hidden; }
.ltr.hint { border-color: #ffd93b; box-shadow: 0 0 14px rgba(255, 217, 59, .6); }
.ltr.shake { border-color: #ff5a5a; animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Верю — не верю: слово сверху, две кнопки под ним */
.tf-side { display: flex; flex-direction: column; gap: 12px; }

.tf-word {
  flex: 1 1 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 22px;
  background: rgba(18, 26, 48, .8);
  border: 1px solid #2a3350;
  font-size: clamp(26px, 7vh, 58px);
  font-weight: 900;
  color: #4fc3ff;
  text-align: center;
  word-break: break-word;
  cursor: pointer;
}

.tf-btns { flex: 1 1 55%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tf-yes { border-color: rgba(65, 224, 94, .55); }
.tf-no { border-color: rgba(255, 90, 90, .55); }
