/*
 * Судоку — вид игры. Общий игровой язык (фон, кнопки, меню, окно) — в kit/kit.css;
 * здесь своё: индиговый оттенок, поле из девяти костяных плит, клавиши цифр, жизни, итог.
 */

/* ---------- Оттенок игры ---------- */
/* Верх фона (--bg-top) повторён в <meta name="theme-color">. */
:root {
  --bg-top: #3d55dc;
  --bg-mid: #2f3bb4;
  --bg-bottom: #1b1b70;
  --glow-a: rgba(126, 190, 255, 0.5);
  --glow-b: rgba(158, 96, 255, 0.42);
  --frame: #4c63e8;
  --frame-lip: #131450;
  --pit: #171a62;
  --shade-rgb: 8, 8, 56;
  --deep-rgb: 16, 16, 84;
  --title-hi: #dbe2ff;
  --well-pad: 8px;

  /* Кость: плиты поля, клавиши цифр, плитки уровней. */
  --bone: #fdf8ea;
  --bone-lo: #f1e7cf;
  --groove: #cdbf9d;
  --bone-lip: #ad9c72;
  --ink-given: #1b1a52;
  --ink-user: #2757ea;
  --ink-note: #4d5290;
  --ink-hint: #b56a00;
  --bad: #e3243e;
  --gold: #ffc21f;
  --gold-lip: #c97b00;
}

/* ---------- Фон: костяшки с цифрами ---------- */

.sky i {
  --tile: #f3ecda;
  --tile-hi: #ffffff;
  --tile-lo: #cfc4a6;
  opacity: 0.17;
}

.sky i::after {
  content: attr(data-d);
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-given);
  font-size: calc(var(--s) * 0.62);
  font-weight: 900;
  line-height: 1;
}

/* ---------- Значок в меню: блок 3×3 из костяшек, в середине золотая ---------- */

.logo {
  grid-template-columns: repeat(3, 31px);
  grid-auto-rows: 31px;
  gap: 5px;
}

.logo i {
  --tile: var(--bone);
  --tile-hi: #ffffff;
  --tile-lo: var(--bone-lo);
  position: relative;
  border-radius: 28%;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    0 4px 0 var(--bone-lip),
    0 8px 9px rgba(var(--shade-rgb), 0.45);
}

.logo i::after {
  content: attr(data-d);
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-given);
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.logo i.gold {
  --tile: #ffcb22;
  --tile-hi: #fff0a0;
  --tile-lo: #f5a700;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    0 4px 0 var(--gold-lip),
    0 0 18px 2px rgba(255, 214, 90, 0.65),
    0 8px 9px rgba(var(--shade-rgb), 0.45);
}

.logo i.gold::after {
  color: #5a3100;
}

/* Цифра в золотой клетке время от времени меняется — «ставится». */
.logo i.gold.tick::after {
  animation: sd-pop 0.42s cubic-bezier(0.3, 1.8, 0.5, 1) both;
}

.logo i:nth-child(1) { animation-delay: 0ms; }
.logo i:nth-child(2) { animation-delay: 40ms; }
.logo i:nth-child(3) { animation-delay: 80ms; }
.logo i:nth-child(4) { animation-delay: 60ms; }
.logo i:nth-child(5) { animation-delay: 240ms; }
.logo i:nth-child(6) { animation-delay: 140ms; }
.logo i:nth-child(7) { animation-delay: 120ms; }
.logo i:nth-child(8) { animation-delay: 160ms; }
.logo i:nth-child(9) { animation-delay: 200ms; }

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

.menu-best .ico {
  color: var(--gold);
}

.menu-actions {
  gap: 14px;
  width: min(304px, 100%);
  margin-top: 26px;
}

.menu-actions .btn-two {
  height: 58px;
}

/*
 * Выключатель проверки — второстепенный: включённый остаётся «стеклянным», золотое только гнездо с галочкой
 * (иначе он спорит с золотой кнопкой «Продолжить»).
 */
.menu .toggle[aria-checked="true"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.13) 100%);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.34), 0 4px 0 rgba(var(--deep-rgb), 0.55), 0 9px 14px rgba(var(--shade-rgb), 0.28);
  color: #fff;
  text-shadow: 0 1px 0 rgba(var(--shade-rgb), 0.45);
}

.menu .toggle[aria-checked="true"]:active {
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.34), 0 1px 0 rgba(var(--deep-rgb), 0.55), 0 3px 6px rgba(var(--shade-rgb), 0.28);
}

.menu .toggle[aria-checked="true"] > i {
  background: linear-gradient(180deg, #ffe066 0%, #ffbf1f 100%);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.7), 0 2px 0 var(--gold-lip);
}

.menu .toggle[aria-checked="true"] > i .ico {
  color: #5a3100;
}

/* Уровни: четыре костяные клавиши с кромкой. Точки — сложность. */
.levels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 10px;
}

.lvl {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  height: 56px;
  padding: 0 6px;
  border: 0;
  border-radius: 19px;
  background:
    radial-gradient(120% 100% at 22% 0%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, var(--bone) 0%, var(--bone-lo) 100%);
  box-shadow:
    inset 0 2px 0 #ffffff,
    0 5px 0 var(--bone-lip),
    0 10px 16px rgba(var(--shade-rgb), 0.4);
  color: var(--ink-given);
  font-size: 18px;
  font-weight: 900;
  line-height: 20px;
  letter-spacing: 0.005em;
  transition: transform 0.06s ease-out, box-shadow 0.06s ease-out;
}

.lvl:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 2px 0 #ffffff,
    0 1px 0 var(--bone-lip),
    0 3px 6px rgba(var(--shade-rgb), 0.4);
}

.lvl b {
  font-weight: 900;
  white-space: nowrap;
}

.lvl-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 12px;
  color: #6f6a8e;
  font-size: 12px;
  font-weight: 800;
  line-height: 12px;
  font-variant-numeric: tabular-nums;
}

.lvl-sub .ico {
  width: 13px;
  height: 13px;
  margin-right: -3px;
  color: #e09a00;
}

/* Точки сложности: закрашено столько, каков уровень. */
.pips {
  display: flex;
  gap: 3px;
}

.pips i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(27, 26, 82, 0.16);
  box-shadow: inset 0 1px 1px rgba(27, 26, 82, 0.25);
}

.pips.t1 i:nth-child(-n + 1),
.pips.t2 i:nth-child(-n + 2),
.pips.t3 i:nth-child(-n + 3),
.pips.t4 i:nth-child(-n + 4) {
  background: var(--pip, #34c759);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.55), 0 1px 0 rgba(0, 0, 0, 0.22);
}

.pips.t1 { --pip: #2fbf58; }
.pips.t2 { --pip: #2d8cff; }
.pips.t3 { --pip: #ff8a1f; }
.pips.t4 { --pip: #f0364c; }

/* Судоку дня: листок календаря с числом и две строки. */
.btn.daily {
  flex-direction: row;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 16px 0 12px;
  text-align: left;
}

.daily-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.daily-text small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cal {
  position: relative;
  flex: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 38px;
  height: 40px;
  padding-bottom: 4px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ff5d62 0, #f23a4c 11px, #fffaf0 11px, #f1e7cf 100%);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.55), 0 3px 0 #0c62b8, 0 5px 6px rgba(8, 40, 110, 0.4);
  transform: rotate(-5deg);
}

.cal b {
  color: var(--ink-given);
  font-size: 19px;
  font-weight: 900;
  line-height: 22px;
  text-shadow: none;
  font-variant-numeric: tabular-nums;
}

/* Решено сегодня: золотая печать с галочкой на листке. */
.seal {
  position: absolute;
  top: -8px;
  right: -9px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe066, #ffbf1f);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.7), 0 2px 0 var(--gold-lip);
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(0.3, 1.8, 0.5, 1);
}

.seal .ico {
  width: 15px;
  height: 15px;
  color: #5a3100;
  stroke-width: 3.6;
}

.daily.done .seal {
  transform: scale(1) rotate(5deg);
}

/* Высокий экран: значок крупнее — стартовый экран не должен выглядеть пустым. */
@media (min-height: 780px) {
  .logo {
    grid-template-columns: repeat(3, 40px);
    grid-auto-rows: 40px;
    gap: 6px;
  }

  .logo i::after {
    font-size: 27px;
  }

  .logo i {
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.95),
      0 5px 0 var(--bone-lip),
      0 10px 11px rgba(var(--shade-rgb), 0.45);
  }

  .logo i.gold {
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.8),
      0 5px 0 var(--gold-lip),
      0 0 22px 3px rgba(255, 214, 90, 0.65),
      0 10px 11px rgba(var(--shade-rgb), 0.45);
  }

  .menu-actions {
    margin-top: 30px;
  }
}

@media (max-height: 620px) {
  .logo {
    grid-template-columns: repeat(3, 23px);
    grid-auto-rows: 23px;
    gap: 4px;
  }

  .logo i::after {
    font-size: 16px;
  }

  .logo i {
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.95),
      0 3px 0 var(--bone-lip),
      0 6px 7px rgba(var(--shade-rgb), 0.45);
  }

  .title {
    margin-top: 14px;
    font-size: min(50px, 15vw);
  }

  .menu-best {
    height: 30px;
    margin-top: 10px;
    font-size: 16px;
  }

  .menu-actions {
    gap: 11px;
    margin-top: 16px;
  }

  .menu-actions .btn-two {
    height: 52px;
  }

  .levels {
    gap: 11px 10px;
  }

  .lvl {
    height: 48px;
    gap: 3px;
    border-radius: 17px;
    font-size: 16.5px;
    line-height: 18px;
  }

  .cal {
    width: 34px;
    height: 36px;
  }

  .cal b {
    font-size: 17px;
    line-height: 20px;
  }
}

/* ---------- Шапка и строка времени ---------- */

.top .tools {
  flex: 1 1 0;
}

.top .tools:last-child {
  justify-content: flex-end;
}

.top .pill {
  flex: none;
}

/*
 * На невысоком экране время, уровень и жизни стоят в одну строку; на высоком (от 700 px) время — крупно,
 * уровень и жизни — строкой под ним.
 */
.tally {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 34px;
}

.clock {
  flex: none;
  height: 34px;
  font-size: 31px;
  line-height: 34px;
  letter-spacing: 0;
  text-shadow: 0 3px 0 rgba(var(--deep-rgb), 0.6);
}

.level-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 26px;
  padding: 0 10px 0 9px;
  border-radius: 13px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 26px;
}

.level-tag > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tally-side {
  flex: 0 1 auto;
  display: flex;
  min-width: 0;
}

.level-tag .pips {
  flex: none;
  gap: 2px;
}

.level-tag .pips i {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

.lives {
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 26px;
}

.lives .ico {
  width: 23px;
  height: 23px;
  color: #ff4458;
  filter: drop-shadow(0 2px 0 rgba(var(--shade-rgb), 0.6));
  transition: color 0.2s ease-out;
}

.lives .ico.lost {
  color: rgba(255, 255, 255, 0.2);
  filter: none;
}

.lives .ico.lost.now {
  animation: sd-heart 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes sd-heart {
  0% { transform: scale(1); color: #ff4458; }
  35% { transform: scale(1.7) rotate(-12deg); color: #ff4458; }
  100% { transform: scale(1); }
}

/* Без проверки жизней нет — вместо них тихая метка. */
.lives .tag {
  line-height: 26px;
}

@media (min-height: 700px) {
  .tally {
    flex-wrap: wrap;
    align-content: space-between;
    justify-content: center;
    gap: 0 10px;
    height: 78px;
  }

  /* Время — первой строкой во всю ширину, уровень и жизни — парой под ним. */
  .clock {
    order: -1;
    flex: 0 0 100%;
    height: 48px;
    font-size: 48px;
    line-height: 48px;
    text-align: center;
    text-shadow: 0 4px 0 rgba(var(--deep-rgb), 0.6);
  }

  .level-tag .pips {
    gap: 3px;
  }

  .level-tag .pips i {
    width: 7px;
    height: 7px;
  }
}

/* ---------- Поле ---------- */
/*
 * Размеры пишет app.js после kit.fit(): --c — клетка (целые пиксели), --bg — зазор между блоками.
 * Поле — девять костяных плит 3×3 в тёмной рамке; между плитами видно дно.
 */

.well {
  --shard: calc(var(--c, 32px) * 0.26);
  border-radius: calc(var(--c, 32px) * 0.36 + var(--well-pad));
}

.board {
  display: grid;
  grid-template-columns: repeat(3, auto);
  /* По вертикали зазор больше: в него уходит кромка плиты. */
  gap: calc(var(--bg, 6px) + 2px) var(--bg, 6px);
  padding-bottom: 2px;
}

.block {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, var(--c, 32px));
  grid-auto-rows: var(--c, 32px);
  gap: 1px;
  overflow: hidden;
  border-radius: calc(var(--c, 32px) * 0.3);
  background: var(--groove);
  /* Кромка в два тона и тень-касание на дне рамки: плита приподнята. */
  box-shadow:
    0 3px 0 #cdbb8f,
    0 5px 0 #a8946a,
    0 9px 9px rgba(10, 12, 60, 0.5);
}

/* Глянец плиты: блик сверху слева, светлая кромка сверху, тёмная снизу. Лежит поверх клеток, но под цифрами. */
.block::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  border-radius: inherit;
  background:
    radial-gradient(120% 70% at 20% 0%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0) 62%, rgba(150, 120, 60, 0.13) 100%);
  box-shadow: inset 0 2px 0 #ffffff, inset 0 -2px 0 rgba(120, 98, 48, 0.24), inset 2px 0 0 rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.cell {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #fffdf6 0%, #f6eed8 100%);
  /* Линии между клетками — «гравировка»: тёмная борозда (фон плиты) и светлая кромка рядом с ней. */
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.85);
  color: var(--ink-user);
  font: inherit;
  touch-action: none;
  outline-offset: -3px;
}

.cell:focus-visible {
  outline: 3px solid var(--ink-user);
  z-index: 3;
}

/* Данные цифры — тёмные и жирные, на чуть более тёплой клетке. */
.cell.given {
  background: linear-gradient(180deg, #f8f1dd 0%, #efe5cb 100%);
  color: var(--ink-given);
}

.cell.hinted {
  color: var(--ink-hint);
}

/* Подсветка: ряд, столбец и блок выбранной клетки; все такие же цифры; сама клетка — золотая. */
.cell.peer {
  background: linear-gradient(180deg, #e6e9fb 0%, #d9ddf5 100%);
}

.cell.same {
  background: linear-gradient(180deg, #bccaff 0%, #a9b9fa 100%);
}

.cell.sel {
  background: linear-gradient(180deg, #ffe97c 0%, #ffc530 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.75),
    inset 0 -3px 0 rgba(206, 128, 0, 0.6),
    inset 0 0 0 1.5px rgba(214, 138, 0, 0.55);
}

.cell.wrong {
  background: linear-gradient(180deg, #ffe0e3 0%, #ffc9cf 100%);
  color: var(--bad);
}

.cell.wrong.sel {
  background: linear-gradient(180deg, #ffd27a 0%, #ffb056 100%);
}

/* Не только цветом: у ошибочной цифры — красный уголок, у цифры от подсказки — янтарная точка. */
.cell.wrong::before,
.cell.hinted::before {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.cell.wrong::before {
  top: 0;
  right: 0;
  width: 30%;
  height: 30%;
  background: var(--bad);
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.cell.hinted::before {
  top: 9%;
  right: 9%;
  width: 16%;
  height: 16%;
  border-radius: 50%;
  background: #f0a000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.is-paused .cell::before {
  opacity: 0;
}

.cell .d {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--c, 32px) * 0.7);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  /* Цифра чуть «вдавлена» в кость: светлая кромка снизу. */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
  transition: opacity 0.12s ease-out;
}

.cell.given .d {
  font-weight: 900;
}

/* Заметки: сетка 3×3 маленьких цифр. */
.cell .n {
  position: absolute;
  top: 3%;
  right: 3%;
  bottom: 3%;
  left: 3%;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  /* Ряды сжимаемые: три ряда заметок всегда помещаются в клетку. */
  grid-template-rows: repeat(3, minmax(0, 1fr));
  transition: opacity 0.12s ease-out;
}

/* Нижний ряд плиты: заметки не касаются её кромки. */
.block .cell:nth-child(n + 7) .n {
  bottom: calc(3% + 2px);
}

.cell .n i {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-note);
  /* Не меньше 10 px даже на самом маленьком телефоне (клетка 30 px). */
  font-size: max(10px, calc(var(--c, 32px) * 0.31));
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  overflow: visible;
  opacity: 0;
  transform: scale(0.3);
  transition: opacity 0.12s ease-out, transform 0.16s cubic-bezier(0.3, 1.8, 0.5, 1);
}

.cell .n i.on {
  opacity: 1;
  transform: none;
}

/* Заметки с той же цифрой, что и выбранная, — заметнее. */
.board[data-hit="1"] .n i:nth-child(1).on,
.board[data-hit="2"] .n i:nth-child(2).on,
.board[data-hit="3"] .n i:nth-child(3).on,
.board[data-hit="4"] .n i:nth-child(4).on,
.board[data-hit="5"] .n i:nth-child(5).on,
.board[data-hit="6"] .n i:nth-child(6).on,
.board[data-hit="7"] .n i:nth-child(7).on,
.board[data-hit="8"] .n i:nth-child(8).on,
.board[data-hit="9"] .n i:nth-child(9).on {
  border-radius: 28%;
  background: #7f93f5;
  color: #fff;
}

/* Вспышка поверх клетки: волна света, ошибка, «готовим поле». */
.cell::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  background: radial-gradient(circle at 50% 45%, #ffffff 0%, #fff0a6 50%, #ffcf3f 100%);
  opacity: 0;
  pointer-events: none;
}

/* Цифра встала: вскакивает на место. */
.cell.pop .d {
  animation: sd-pop 0.34s cubic-bezier(0.3, 1.8, 0.5, 1) both;
}

.cell.pop::after {
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.95) 0%, rgba(160, 184, 255, 0.7) 60%, rgba(160, 184, 255, 0) 100%);
  animation: sd-flash 0.36s ease-out both;
}

@keyframes sd-pop {
  0% { transform: scale(0.2); opacity: 0; }
  55% { transform: scale(1.22); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes sd-flash {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

/* Ряд, столбец или блок собран: волна света бежит от поставленной цифры. */
/* Золотая заливка лежит ПОД цифрой: цифра остаётся тёмной и читаемой, а сама подпрыгивает. */
.cell.wave::after {
  z-index: 0;
  background: linear-gradient(180deg, #ffe27a 0%, #ffc93c 100%);
  animation: sd-gild 0.6s ease-out var(--d, 0ms) both;
}

.cell.wave .d {
  animation: sd-hop 0.3s cubic-bezier(0.3, 1.6, 0.5, 1) var(--d, 0ms) both;
}

@keyframes sd-gild {
  0% { opacity: 0; }
  25% { opacity: 0.85; }
  55% { opacity: 0.7; }
  100% { opacity: 0; }
}

@keyframes sd-wave {
  0% { opacity: 0; }
  22% { opacity: 0.95; }
  100% { opacity: 0; }
}

@keyframes sd-hop {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

/* Блик бежит по собранному ряду, столбцу или блоку; в конце — золотая обводка. */
.sheen {
  position: absolute;
  z-index: 5;
  overflow: hidden;
  border-radius: calc(var(--c, 32px) * 0.22);
  pointer-events: none;
}

.sheen i {
  position: absolute;
  top: -60%;
  left: -34px;
  width: 12px;
  height: 220%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.95) 45%, rgba(255, 255, 255, 0.95) 55%, rgba(255, 255, 255, 0) 100%);
  opacity: 0;
  transform: rotate(45deg);
  animation: sd-sheen-x 0.38s ease-in-out var(--d, 0ms) both;
}

.sheen.tall i {
  top: -34px;
  left: -60%;
  width: 220%;
  height: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.95) 45%, rgba(255, 255, 255, 0.95) 55%, rgba(255, 255, 255, 0) 100%);
  animation-name: sd-sheen-y;
}

@keyframes sd-sheen-x {
  0% { opacity: 1; transform: translateX(0) rotate(45deg); }
  100% { opacity: 1; transform: translateX(calc(var(--c, 32px) * 10.5)) rotate(45deg); }
}

@keyframes sd-sheen-y {
  0% { opacity: 1; transform: translateY(0) rotate(45deg); }
  100% { opacity: 1; transform: translateY(calc(var(--c, 32px) * 10.5)) rotate(45deg); }
}

.sheen::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2.5px #ffc21f, inset 0 0 10px rgba(255, 214, 90, 0.9);
  opacity: 0;
  animation: sd-ring-out 0.42s ease-out calc(var(--d, 0ms) + 380ms) both;
}

@keyframes sd-ring-out {
  0% { opacity: 0; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}

/* Ошибка: цифра дёргается, спорящие клетки мигают красным. */
.cell.bad .d,
.cell.bad .n {
  animation: sd-bad 0.36s ease-in-out;
}

@keyframes sd-bad {
  20% { transform: translateX(-12%); }
  45% { transform: translateX(10%); }
  70% { transform: translateX(-6%); }
  90% { transform: translateX(3%); }
}

.cell.clash::after {
  background: #ff3148;
  animation: sd-clash 0.8s ease-out both;
}

@keyframes sd-clash {
  0% { opacity: 0; }
  15% { opacity: 0.6; }
  40% { opacity: 0.1; }
  60% { opacity: 0.5; }
  100% { opacity: 0; }
}

/* Подсказка: клетка вспыхивает золотом. */
.cell.spark::after {
  animation: sd-wave 0.9s ease-out both;
}

/* Раздача: данные цифры появляются волной от угла. */
.board.deal .cell .d {
  animation: sd-pop 0.4s cubic-bezier(0.3, 1.7, 0.5, 1) both;
  animation-delay: calc(var(--k) * 26ms);
}

/* «Готовим поле»: по пустым плитам бежит свет. */
.board.gen .cell::after {
  background: #ffffff;
  animation: sd-shimmer 1.05s ease-in-out infinite;
  animation-delay: calc(var(--k) * 60ms);
}

@keyframes sd-shimmer {
  0%, 55%, 100% { opacity: 0; }
  25% { opacity: 0.8; }
}

.gen-note {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 6;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  background: rgba(var(--deep-rgb), 0.92);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.22), 0 4px 0 rgba(var(--shade-rgb), 0.6), 0 12px 20px rgba(var(--shade-rgb), 0.45);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: sd-note-in 0.25s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

@keyframes sd-note-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
}

/* Пауза: цифры и заметки спрятаны. */
.is-paused .cell .d,
.is-paused .cell .n {
  opacity: 0;
}

/* Пока поле готовится или партия окончена, клавиши не нажимаются. */
.is-gen .acts,
.is-gen .pad,
.is-over .acts,
.is-over .pad {
  pointer-events: none;
}

.is-gen .acts,
.is-gen .pad {
  opacity: 0.55;
}

/* ---------- Действия: отмена, стереть, заметки, подсказка ---------- */

.acts {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  max-width: var(--col, 460px);
  height: 46px;
  margin-bottom: 4px;
  transition: opacity 0.15s ease-out;
}

.act {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.14) 100%);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.38), 0 4px 0 rgba(var(--deep-rgb), 0.66), 0 8px 10px rgba(var(--shade-rgb), 0.22);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 13px;
  text-shadow: 0 1px 0 rgba(var(--shade-rgb), 0.45);
  touch-action: none;
  transition: transform 0.06s ease-out, box-shadow 0.06s ease-out;
}

.act > span {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.act .ico {
  width: 21px;
  height: 21px;
}

.act:active,
.act.down {
  transform: translateY(3px);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.36), 0 0 0 rgba(var(--deep-rgb), 0.6);
}

.act:disabled {
  opacity: 0.42;
}

/* Заметки включены — клавиша золотая. */
.act[aria-pressed="true"] {
  background: linear-gradient(180deg, #ffe066 0%, #ffbf1f 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.65), 0 4px 0 var(--gold-lip), 0 8px 10px rgba(var(--shade-rgb), 0.22);
  color: #5a3100;
  text-shadow: none;
}

.act[aria-pressed="true"]:active,
.act[aria-pressed="true"].down {
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.65), 0 0 0 var(--gold-lip);
}

.badge {
  position: absolute;
  top: -6px;
  right: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 11px;
  background: linear-gradient(180deg, #ffe066, #ffbf1f);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.7), 0 2px 0 var(--gold-lip);
  color: #5a3100;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-shadow: none;
}

.badge.none {
  background: linear-gradient(180deg, #8c90c4, #6d71a8);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.3), 0 2px 0 rgba(var(--shade-rgb), 0.6);
  color: #fff;
}

.badge.bump {
  animation: sd-pop 0.36s cubic-bezier(0.3, 1.8, 0.5, 1);
}

/* ---------- Клавиши цифр: костяные, с кромкой снизу ---------- */

.pad {
  flex: none;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
  width: 100%;
  max-width: var(--col, 460px);
  height: calc(48px + var(--grow, 0px));
  margin-bottom: 4px;
  transition: opacity 0.15s ease-out;
}

.key {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background:
    radial-gradient(130% 100% at 22% 0%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, var(--bone) 0%, var(--bone-lo) 100%);
  box-shadow:
    inset 0 2px 0 #ffffff,
    0 4px 0 var(--bone-lip),
    0 7px 8px rgba(var(--shade-rgb), 0.38);
  color: var(--ink-given);
  font-size: 25px;
  font-weight: 900;
  line-height: 25px;
  font-variant-numeric: tabular-nums;
  touch-action: none;
  transition: transform 0.06s ease-out, box-shadow 0.06s ease-out, opacity 0.2s ease-out;
}

/* Зона нажатия шире самой клавиши: между клавишами нет «мёртвых» щелей, и ниже кромки тоже считается. */
.key::before {
  content: "";
  position: absolute;
  top: -4px;
  right: -2px;
  bottom: -9px;
  left: -2px;
}

.key small {
  height: 11px;
  margin-top: 1px;
  color: #8d86a5;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 11px;
}

.key:active,
.key.down {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 0 #ffffff,
    0 1px 0 var(--bone-lip),
    0 2px 3px rgba(var(--shade-rgb), 0.38);
}

/* Цифра выбранной клетки — клавиша с золотой каймой. */
.key.cur {
  box-shadow:
    inset 0 2px 0 #ffffff,
    inset 0 0 0 2.5px var(--gold),
    0 4px 0 var(--gold-lip),
    0 7px 8px rgba(var(--shade-rgb), 0.38);
}

.key.cur.down,
.key.cur:active {
  box-shadow:
    inset 0 2px 0 #ffffff,
    inset 0 0 0 2.5px var(--gold),
    0 1px 0 var(--gold-lip);
}

/* Все девять поставлены — клавиша утоплена и погашена. */
.key.done {
  opacity: 0.3;
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--bone-lip);
}

.key.fin {
  animation: sd-fin 0.5s ease-out;
}

@keyframes sd-fin {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  40% { transform: translateY(-6px) scale(1.12); opacity: 1; }
  100% { transform: translateY(3px) scale(1); opacity: 0.3; }
}

/* В режиме заметок цифры на клавишах — «карандашные». */
.is-notes .key {
  color: var(--ink-user);
}

/*
 * Телефон: клавиши и действия — во всю ширину экрана (шире рамки поля), боковые отступы меньше.
 * Клавиша цифры — главная мишень: промах стоит жизни.
 */
@media (max-width: 520px) {
  .app {
    padding-right: 12px;
    padding-left: 12px;
  }

  .acts,
  .pad {
    max-width: none;
  }

  .key {
    border-radius: 12px;
    box-shadow:
      inset 0 2px 0 #ffffff,
      0 5px 0 var(--bone-lip),
      0 8px 8px rgba(var(--shade-rgb), 0.38);
  }

  .key.cur {
    box-shadow:
      inset 0 2px 0 #ffffff,
      inset 0 0 0 2.5px var(--gold),
      0 5px 0 var(--gold-lip),
      0 8px 8px rgba(var(--shade-rgb), 0.38);
  }

  .pad {
    margin-bottom: 5px;
  }
}

/* Невысокий экран: каждый пиксель — полю (клетка 30 px, цифра не меньше 21 px). */
@media (max-height: 620px) {
  .acts,
  .pad {
    margin-bottom: 0;
  }

  .acts {
    height: 44px;
  }
}

/* ---------- Низ: подсказка первого запуска ---------- */

.foot {
  display: none;
}

@media (min-height: 700px) {
  .acts {
    height: 50px;
  }

  .act {
    font-size: 11.5px;
  }

  .act .ico {
    width: 23px;
    height: 23px;
  }

  .pad {
    height: calc(54px + var(--grow, 0px));
  }

  .key {
    font-size: 27px;
    line-height: 27px;
  }

  .foot {
    display: flex;
    height: 22px;
  }
}

/* Клавиши подросли (см. growPad в app.js) — цифра на них крупнее. */
.is-roomy:not(.is-tall):not(.is-pad2) .key {
  font-size: 29px;
  line-height: 30px;
}

.is-roomy:not(.is-tall):not(.is-pad2) .key small {
  margin-top: 3px;
  font-size: 12px;
}

/*
 * Урок пройден — строка подсказки больше не нужна: её место занимают клавиши и поле (класс ставит app.js).
 * На телефоне за этим следит выбор is-tall / is-pad2; здесь — обычная раскладка (широкий экран).
 */
.no-foot .foot {
  display: none;
}

@media (min-height: 700px) {
  .no-foot:not(.is-tall):not(.is-pad2) .pad {
    height: calc(68px + var(--grow, 0px));
  }

  .no-foot:not(.is-tall):not(.is-pad2) .key {
    font-size: 30px;
    line-height: 31px;
  }

  .no-foot:not(.is-tall):not(.is-pad2) .key small {
    margin-top: 3px;
    font-size: 12px;
  }
}

/*
 * Высокий телефон. Классы ставит app.js по свободной высоте (ширина + запас), а не по одной высоте:
 * is-tall — высокие клавиши в один ряд; is-pad2 — клавиши в два ряда (5 + 4), крупные, как на калькуляторе.
 * Шапка прижата к верху, клавиши — к низу, поле стоит посередине свободного места.
 */
.is-tall .stage,
.is-pad2 .stage {
  max-height: none !important;
}

.is-tall .acts {
  height: 58px;
}

.is-tall .act {
  font-size: 12.5px;
  line-height: 15px;
  gap: 2px;
}

.is-tall .act .ico {
  width: 26px;
  height: 26px;
}

.is-tall .pad {
  height: calc(72px + var(--grow, 0px));
}

.is-tall .key {
  border-radius: 14px;
  font-size: 31px;
  line-height: 32px;
}

.is-tall .key small {
  height: 13px;
  margin-top: 3px;
  font-size: 12px;
  line-height: 13px;
}

.is-pad2 {
  --stack: 16px;
  padding-top: max(18px, env(safe-area-inset-top));
}

.is-pad2 .acts {
  height: 62px;
  gap: 10px;
}

.is-pad2 .act {
  border-radius: 18px;
  font-size: 13px;
  line-height: 16px;
  gap: 2px;
}

.is-pad2 .act .ico {
  width: 27px;
  height: 27px;
}

.is-pad2 .pad {
  grid-template-columns: repeat(10, 1fr);
  grid-auto-rows: 1fr;
  gap: 13px 8px;
  height: 137px;
  margin-bottom: 6px;
}

.is-pad2 .key {
  grid-column: span 2;
  flex-direction: row;
  align-items: baseline;
  gap: 5px;
  padding-top: 2px;
  border-radius: 18px;
  font-size: 34px;
  line-height: 62px;
  box-shadow:
    inset 0 2px 0 #ffffff,
    0 6px 0 var(--bone-lip),
    0 10px 10px rgba(var(--shade-rgb), 0.4);
}

.is-pad2 .key.cur {
  box-shadow:
    inset 0 2px 0 #ffffff,
    inset 0 0 0 3px var(--gold),
    0 6px 0 var(--gold-lip),
    0 10px 10px rgba(var(--shade-rgb), 0.4);
}

/* Второй ряд из четырёх клавиш стоит по центру под первым. */
.is-pad2 .key:nth-child(6) {
  grid-column: 2 / span 2;
}

.is-pad2 .key small {
  height: auto;
  margin: 0;
  font-size: 13px;
  line-height: 13px;
}

.is-pad2 .key::before {
  top: -6px;
  right: -4px;
  bottom: -9px;
  left: -4px;
}

/* ---------- Указатель первого запуска ---------- */

.coach {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 8;
  width: 0;
  height: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.3, 1.2, 0.4, 1);
}

.coach i {
  position: absolute;
  top: -22px;
  left: -22px;
  width: 44px;
  height: 44px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 194, 31, 0.9), 0 0 14px rgba(255, 214, 90, 0.8);
  opacity: 0;
  animation: sd-ring 1.3s ease-out infinite;
}

.coach i + i {
  animation-delay: 0.45s;
}

.coach svg {
  position: absolute;
  top: 4px;
  left: -6px;
  width: 34px;
  height: 42px;
  filter: drop-shadow(0 3px 0 rgba(var(--shade-rgb), 0.55));
  animation: sd-tap 1.3s ease-in-out infinite;
}

@keyframes sd-ring {
  0% { transform: scale(0.45); opacity: 0.95; }
  100% { transform: scale(1.25); opacity: 0; }
}

@keyframes sd-tap {
  0%, 100% { transform: translate(6px, 10px); }
  35% { transform: translate(0, 0) scale(0.94); }
  55% { transform: translate(0, 0); }
}

/* ---------- Итог: звёзды ---------- */

.stars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  height: 70px;
  margin: 4px 0 0;
}

/* Сама звезда занимает ~73% рамки значка: рамки 60 и 76 px дают звёзды 44 и 56 px. */
.stars .ico {
  width: 60px;
  height: 60px;
  margin: 0 -5px;
  color: var(--gold);
  stroke: #d68a00;
  stroke-width: 1.1;
  stroke-linejoin: round;
  paint-order: stroke;
  filter: drop-shadow(0 3px 0 var(--gold-lip)) drop-shadow(0 0 10px rgba(255, 214, 90, 0.55));
  animation: sd-star 0.55s cubic-bezier(0.3, 1.8, 0.5, 1) both;
  animation-delay: calc(0.3s + var(--i) * 0.24s);
}

.stars .ico:nth-child(2) {
  width: 76px;
  height: 76px;
  margin-bottom: 4px;
}

.stars .ico.off {
  color: rgba(12, 13, 66, 0.72);
  stroke: rgba(255, 255, 255, 0.26);
  filter: none;
}

@keyframes sd-star {
  0% { transform: scale(0) rotate(-40deg); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Заголовки итогов — как название игры: белые, выдавленные. */
.win-card .over-title,
.lose-card .over-title {
  font-size: 30px;
  line-height: 34px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow:
    0 1px 0 var(--title-hi),
    0 2px 0 #aab6ff,
    0 4px 0 rgba(var(--deep-rgb), 0.9),
    0 8px 12px rgba(var(--shade-rgb), 0.5);
}

/* Итог: золотая кнопка во всю ширину, под ней в ряд — голубая «Поделиться» и «В меню». */
.win-card .over-actions .btn-blue {
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
  margin-bottom: 0;
  gap: 6px;
  padding: 0 8px;
  border-radius: 17px;
  font-size: 15.5px;
}

.win-card .over-actions .btn-blue .ico {
  width: 20px;
  height: 20px;
}

.win-card .over-actions .btn-ghost {
  flex: 1 1 0;
  height: 48px;
  border-radius: 17px;
}

/* Второстепенные кнопки окон и кнопка языка — не меньше 44 px под палец. */
.over .btn-ghost {
  height: 46px;
  border-radius: 16px;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.22), 0 3px 0 rgba(var(--shade-rgb), 0.45);
}

.over .btn-ghost:active {
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.22);
}

.lang-btn {
  min-width: 54px;
  height: 44px;
  border-radius: 15px;
}

.win-card .over-score {
  font-size: min(64px, 17vw);
}

.win-card .over-text {
  margin-top: 2px;
  margin-bottom: 8px;
}

/* Лучи за звёздами: медленно вращаются. */
.win-card {
  position: relative;
  overflow: hidden;
}

.win-card > * {
  position: relative;
}

.win-card .rays {
  position: absolute;
  top: -150px;
  left: 50%;
  width: 520px;
  height: 520px;
  margin-left: -260px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 214, 90, 0.38) 0%, rgba(255, 214, 90, 0) 26%),
    repeating-conic-gradient(from 0deg, rgba(132, 160, 255, 0.24) 0deg 10deg, rgba(132, 160, 255, 0) 10deg 20deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.75) 28%, transparent 64%);
  mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.75) 28%, transparent 64%);
  pointer-events: none;
  animation: sd-rays 24s linear infinite;
}

@keyframes sd-rays {
  to { transform: rotate(360deg); }
}

/* ---------- Проигрыш: три разбитых сердца ---------- */

.lose-card {
  position: relative;
  overflow: hidden;
}

.lose-card > * {
  position: relative;
}

.lose-card .gloom {
  position: absolute;
  top: -40px;
  right: 0;
  left: 0;
  height: 300px;
  background: radial-gradient(60% 56% at 50% 42%, rgba(232, 76, 80, 0.3) 0%, rgba(232, 76, 80, 0.1) 55%, rgba(232, 76, 80, 0) 100%);
  pointer-events: none;
}

.broken {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 58px;
  margin-bottom: 6px;
}

.bh {
  position: relative;
  width: 50px;
  height: 50px;
  animation: sd-bh-drop 0.42s cubic-bezier(0.3, 1.5, 0.5, 1) both;
  animation-delay: calc(0.12s + var(--i) * 0.12s);
}

.bh-half {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  filter: drop-shadow(0 3px 0 #33356f);
}

.bh-half .ico {
  display: block;
  width: 100%;
  height: 100%;
  color: #7377bd;
}

.bh-l .ico {
  -webkit-clip-path: polygon(0 0, 51% 0, 44% 39%, 56% 50%, 46% 63%, 51% 100%, 0 100%);
  clip-path: polygon(0 0, 51% 0, 44% 39%, 56% 50%, 46% 63%, 51% 100%, 0 100%);
}

.bh-r .ico {
  color: #6468ad;
  -webkit-clip-path: polygon(51% 0, 100% 0, 100% 100%, 51% 100%, 46% 63%, 56% 50%, 44% 39%);
  clip-path: polygon(51% 0, 100% 0, 100% 100%, 51% 100%, 46% 63%, 56% 50%, 44% 39%);
}

.bh-crack {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #1d1e58;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Последнее сердце раскалывается: половинки расходятся. */
.bh.split .bh-crack {
  animation: sd-bh-fade 0.2s ease-out 0.72s both;
}

.bh.split .bh-l {
  transform-origin: 50% 90%;
  animation: sd-bh-left 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) 0.72s both;
}

.bh.split .bh-r {
  transform-origin: 50% 90%;
  animation: sd-bh-right 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) 0.72s both;
}

@keyframes sd-bh-drop {
  0% { transform: translateY(-26px) scale(1.3) rotate(-6deg); opacity: 0; }
  60% { transform: translateY(0) scale(1) rotate(6deg); opacity: 1; }
  100% { transform: none; opacity: 1; }
}

@keyframes sd-bh-left {
  to { transform: translate(-5px, 1px) rotate(-14deg); }
}

@keyframes sd-bh-right {
  to { transform: translate(5px, 1px) rotate(14deg); }
}

@keyframes sd-bh-fade {
  to { opacity: 0; }
}

/* Итог, показанный снова после перезагрузки: без падения, сразу в конечном виде. */
.lose-card.still .bh,
.lose-card.still .bh-half,
.lose-card.still .bh-crack {
  animation-duration: 0.01s !important;
  animation-delay: 0s !important;
}

.lose-card .over-text {
  margin-top: 4px;
}

.lose-card .over-note {
  margin-top: 10px;
}

/* ---------- Правила: три строки с картинками ---------- */

.help-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
}

.help-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 6px 12px 6px 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.14), 0 3px 0 rgba(var(--shade-rgb), 0.4);
  text-align: left;
  animation: sd-help-in 0.36s cubic-bezier(0.3, 1.4, 0.5, 1) both;
  animation-delay: calc(var(--i) * 70ms + 80ms);
}

@keyframes sd-help-in {
  from { opacity: 0; transform: translateX(-14px); }
}

.help-row p {
  flex: 1 1 0;
  min-width: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
  text-wrap: pretty;
}

.help-art {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 48px;
}

.help-block {
  display: grid;
  grid-template-columns: repeat(3, 14px);
  grid-auto-rows: 14px;
  gap: 2px;
  align-content: center;
  justify-content: center;
}

.help-block i {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: linear-gradient(180deg, #ffffff 0%, var(--bone-lo) 100%);
  box-shadow: 0 2px 0 var(--bone-lip);
  color: var(--ink-given);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.help-block i.gold {
  background: linear-gradient(180deg, #ffe066 0%, #ffbf1f 100%);
  box-shadow: 0 2px 0 var(--gold-lip);
  color: #5a3100;
}

.help-note {
  position: relative;
}

.help-cell {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 38px;
  height: 38px;
  padding: 3px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, var(--bone-lo) 100%);
  box-shadow: 0 3px 0 var(--bone-lip);
}

.help-cell i {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-note);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.help-note .ico {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 26px;
  height: 26px;
  color: #ffc21f;
  filter: drop-shadow(0 2px 0 rgba(var(--shade-rgb), 0.7));
}

.help-lives {
  flex-direction: column;
  gap: 1px;
}

.help-hearts {
  display: flex;
  gap: 0;
}

.help-hearts .ico {
  width: 17px;
  height: 17px;
  color: #ff4458;
  filter: drop-shadow(0 1.5px 0 rgba(var(--shade-rgb), 0.6));
}

.help-bulb {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  color: #ffd65a;
}

.help-bulb .ico {
  width: 24px;
  height: 24px;
}

.help-bulb b {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffe066, #ffbf1f);
  box-shadow: 0 2px 0 var(--gold-lip);
  color: #5a3100;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

/* Меньше движения: бесконечные анимации остановлены, игра остаётся играбельной. */
@media (prefers-reduced-motion: reduce) {
  .board.gen .cell::after,
  .win-card .rays,
  .coach svg {
    animation: none !important;
  }

  .bh,
  .bh-half,
  .bh-crack,
  .help-row {
    animation-duration: 0.01s !important;
    animation-delay: 0s !important;
  }

  .coach i {
    animation: none !important;
    opacity: 0.9;
  }

  .coach i + i {
    display: none;
  }

  .key.done {
    opacity: 0.3;
  }
}
