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

/* ---------- Оттенок игры ---------- */
/* Верх фона (--bg-top) повторён в <meta name="theme-color">. */
:root {
  --bg-top: #e8489f;
  --bg-mid: #b92cab;
  --bg-bottom: #5c1787;
  --glow-a: rgba(255, 196, 150, 0.55);
  --glow-b: rgba(96, 110, 255, 0.45);
  --frame: #d84db6;
  --frame-lip: #4a0f66;
  --pit: #2e0d3d;
  --shade-rgb: 40, 5, 58;
  --deep-rgb: 62, 10, 86;
  --title-hi: #ffe1f3;

  --gold: #ffcb2e;
  --gold-hi: #ffe98a;
  --gold-lo: #c97b00;
  --well-pad: 9px;
  --pad: 24px; /* запас холста вокруг поля: туда вылетают осколки */
}

@media (max-width: 430px) {
  .app {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* ---------- Фон: плывущие камни ---------- */

.sky i {
  width: calc(var(--s) * 1.45);
  height: calc(var(--s) * 1.45);
  border-radius: 0;
  background: none;
  box-shadow: none;
  opacity: 0.42;
}

.sky canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Стартовый экран ---------- */

/* Значок: горсть камней. Каждый покачивается сам по себе, вокруг вспыхивают искры. */
.gem-logo {
  position: relative;
  width: 230px;
  height: 152px;
  flex: none;
}

/* За камнями — мягкое сияние и медленно вращающиеся лучи. */
.gem-logo::before,
.gem-logo::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 330px;
  height: 330px;
  margin: -165px 0 0 -165px;
  border-radius: 50%;
  pointer-events: none;
}

.gem-logo::before {
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.2) 0deg 9deg, rgba(255, 255, 255, 0) 9deg 30deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 18%, rgba(0, 0, 0, 0.5) 50%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 18%, rgba(0, 0, 0, 0.5) 50%, transparent 100%);
  animation: logo-rays 46s linear infinite;
}

.gem-logo::after {
  background: radial-gradient(closest-side, rgba(255, 236, 190, 0.55) 0%, rgba(255, 170, 220, 0.22) 45%, rgba(255, 170, 220, 0) 100%);
}

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

.gem-logo i {
  position: absolute;
  z-index: 1;
  transform: rotate(var(--r));
  animation: logo-in 0.55s cubic-bezier(0.3, 1.7, 0.5, 1) both;
  animation-delay: var(--d);
}

.gem-logo canvas {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 7px 6px rgba(var(--shade-rgb), 0.45));
  animation: logo-float var(--t) ease-in-out infinite alternate;
  animation-delay: var(--d);
}

/* Место, размер и поворот каждого камня ставит app.js: холст рисуется ровно того размера, каким показан. */

@keyframes logo-in {
  from { transform: rotate(var(--r)) scale(0); }
}

@keyframes logo-float {
  from { transform: translateY(-3px) rotate(-2deg); }
  to { transform: translateY(5px) rotate(3deg); }
}

/* Искра: четырёхлучевая звёздочка. */
.gem-logo b {
  position: absolute;
  z-index: 2;
  background: #fff;
  -webkit-clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  opacity: 0;
  animation: logo-spark 2.8s ease-in-out infinite;
  animation-delay: var(--d);
}

@keyframes logo-spark {
  0%, 60%, 100% { opacity: 0; transform: scale(0.2) rotate(0deg); }
  75% { opacity: 1; transform: scale(1) rotate(40deg); }
  90% { opacity: 0; transform: scale(0.4) rotate(80deg); }
}

.title {
  margin-top: 18px;
}

.menu-stats {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.menu-stats .menu-best {
  margin: 0;
}

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

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

/* Язык и плоские кнопки окон — не меньше 44 px под палец. */
.lang-btn {
  min-width: 56px;
  height: 44px;
}

.over .btn-ghost {
  min-width: 96px;
  height: 46px;
  padding: 0 18px;
}

/* Объёмная кнопка в цвет окна: «Переиграть», «Поделиться», «К уровню N». */
.btn-plum,
.over .btn-plum {
  background: linear-gradient(180deg, #7d35a0 0%, #561c78 100%);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.28), 0 4px 0 #2c0b3e, 0 8px 12px rgba(var(--shade-rgb), 0.4);
  text-shadow: 0 1px 0 rgba(30, 5, 45, 0.6);
}

.btn-plum:active,
.over .btn-plum:active {
  transform: translateY(3px);
  background: linear-gradient(180deg, #7d35a0 0%, #561c78 100%);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.28), 0 1px 0 #2c0b3e;
}

.result .over-actions {
  gap: 14px 10px;
}

/* Итог: «Переиграть» и «Поделиться» — рядом, поровну; «В меню» — отдельной строкой под ними. */
.result .over-actions .btn-plum {
  flex: 1 1 40%;
  min-width: 0;
  padding: 0 8px;
}

.result .over-actions .btn-ghost:last-child {
  flex: 0 0 100%;
}

/* «К уровню N» под главными кнопками — только пока идёт переигровка. */
.skip-btn {
  height: 46px;
  min-width: 0;
  padding: 0 20px;
  font-size: 16px;
}

.skip-btn > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skip-btn .ico {
  width: 18px;
  height: 18px;
}

.skip-btn[hidden] {
  display: none;
}

.with-skip .menu-actions {
  margin-top: 24px;
}

@media (max-height: 620px) {
  .with-skip .title {
    margin-top: 4px;
  }

  .with-skip .menu-stats {
    margin-top: 8px;
  }

  .with-skip .menu-actions {
    margin-top: 12px;
    gap: 10px;
  }

  .with-skip .play-btn {
    height: 62px;
  }

  .skip-btn {
    height: 44px;
  }
}

/* Главная кнопка: действие и уровень под ним. */
.play-btn {
  height: 76px;
  gap: 0;
}

.play-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 25px;
  line-height: 30px;
}

.play-btn small {
  font-size: 13.5px;
  font-weight: 800;
  opacity: 0.8;
}

@media (max-height: 620px) {
  .title {
    margin-top: 10px;
  }

  .menu-stats {
    margin-top: 12px;
  }

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

  .play-btn {
    height: 68px;
  }
}

/* ---------- Раскладка партии ---------- */
/* Шапка прижата к верху экрана; ходы, поле и табличка под ним стоят одной группой в оставшемся месте. */

.app {
  justify-content: flex-start;
}

.hud {
  margin-top: auto;
}

.foot {
  margin-bottom: auto;
}

/* ---------- Шапка партии: уровень ---------- */

.level-pill {
  padding: 0 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* ---------- Ходы и цель ---------- */

.hud {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: var(--col, 460px);
  height: 70px;
}

/* Счётчик ходов — медальон в золотой оправе, как рама поля. */
.moves {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  margin-bottom: 4px;
  border-radius: 50%;
  background:
    radial-gradient(90% 70% at 30% 12%, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, #6a1f86 0%, #3a1050 100%);
  box-shadow:
    inset 0 3px 6px rgba(var(--shade-rgb), 0.6),
    0 0 0 3.5px var(--gold),
    0 -1px 0 4px var(--gold-hi),
    0 4px 0 3.5px var(--gold-lo),
    0 9px 12px rgba(var(--shade-rgb), 0.45);
}

.moves b {
  font-size: 30px;
  font-weight: 900;
  line-height: 30px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2.5px 0 rgba(var(--shade-rgb), 0.7);
}

.moves span {
  margin-top: 1px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 12px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.78);
}

.moves.tick b {
  animation: moves-tick 0.3s cubic-bezier(0.3, 1.8, 0.5, 1);
}

@keyframes moves-tick {
  from { transform: scale(1.45); }
}

/* Ходов мало: медальон краснеет и бьётся, как сердце. */
.moves.low {
  background:
    radial-gradient(90% 70% at 30% 12%, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, #ff5a6e 0%, #c41238 100%);
  animation: moves-low 0.9s ease-in-out infinite;
}

@keyframes moves-low {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.12); }
  28% { transform: scale(1); }
  42% { transform: scale(1.08); }
  56% { transform: scale(1); }
}

.goal {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.goal-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  height: 38px;
}

.goal .score {
  height: 38px;
  font-size: 38px;
  line-height: 38px;
  transform-origin: left center;
}

/* Счёт подпрыгивает скромнее, чем в наборе: рядом стоит цель. */
.goal .score.k-bump {
  animation-name: score-bump;
}

@keyframes score-bump {
  40% { transform: scale(1.05, 1.18); }
}

.goal-target {
  display: flex;
  align-items: center;
  gap: 4px;
  align-self: center;
  margin-top: 8px;
  font-size: 17px;
  font-weight: 900;
  line-height: 20px;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(var(--deep-rgb), 0.6);
}

.goal-target .ico {
  flex: none;
  width: 19px;
  height: 19px;
  color: var(--gold);
  filter: drop-shadow(0 1.5px 0 rgba(var(--deep-rgb), 0.6));
}

.goal-word {
  white-space: pre;
}

.goal-target.tight .goal-word {
  display: none;
}

/* Цель взята: надпись золотая, с галочкой. */
.goal-target.done {
  color: var(--gold-hi);
}

.goal-target.done .ico {
  color: var(--gold-hi);
}

.goal-target.pop {
  animation: goal-pop 0.45s cubic-bezier(0.3, 1.8, 0.5, 1);
}

@keyframes goal-pop {
  from { transform: scale(1.5); }
}

/* Звезда на полосе зажглась: кольцо вспышки и золотые искры. */
.star-ring,
.star-spark {
  position: absolute;
  z-index: 5;
  pointer-events: none;
}

.star-ring {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.6) 55%, rgba(255, 233, 138, 0) 100%);
  animation: star-ring 0.45s ease-out both;
}

@keyframes star-ring {
  from { transform: scale(0.3); opacity: 1; }
  to { transform: scale(2.1); opacity: 0; }
}

.star-spark {
  background: var(--gold-hi);
  -webkit-clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  transform: translate(-50%, -50%);
  animation: star-spark 0.45s cubic-bezier(0.15, 0.7, 0.3, 1) both;
}

@keyframes star-spark {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 1; }
  60% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(90deg) scale(1); opacity: 0; }
}

/* Полоса цели с тремя звёздами. */
.bar {
  position: relative;
  height: 26px;
  margin-right: 16px;
}

.bar-track {
  position: absolute;
  top: 5px;
  right: -6px;
  left: 0;
  height: 16px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(var(--shade-rgb), 0.62);
  box-shadow: inset 0 2px 3px rgba(var(--shade-rgb), 0.85), 0 1px 0 rgba(255, 255, 255, 0.28);
}

.bar-track i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0) 46%),
    linear-gradient(90deg, #ff9f1c 0%, #ffd53a 100%);
  transform: translateX(calc((var(--p, 0) - 1) * 100%));
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.bar-star {
  position: absolute;
  top: 50%;
  left: var(--at, 50%);
  width: 31px;
  height: 31px;
  margin: -16px 0 0 -15.5px;
}

/* Звезда: тёмное гнездо и золотая звезда, которая «вскакивает» в него. */
.gold-star {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gold-star path {
  stroke-linejoin: round;
  stroke-width: 4;
}

.gs-back {
  fill: #3a0f52;
  stroke: #3a0f52;
  stroke-width: 7.5 !important;
}

.gs-rim {
  fill: #4b1766;
  stroke: #4b1766;
  stroke-width: 2.5 !important;
}

.gs-on {
  transform-origin: 24px 25px;
  transform: scale(0);
  opacity: 0;
}

.gs-lip {
  fill: var(--gold-lo);
  stroke: var(--gold-lo);
}

.gs-face {
  fill: var(--gold);
  stroke: var(--gold);
}

.gs-inner {
  fill: var(--gold-hi);
  stroke: var(--gold-hi);
  stroke-width: 1.5 !important;
}

.gs-shine {
  fill: rgba(255, 255, 255, 0.85);
}

.on > .gold-star .gs-on {
  transform: none;
  opacity: 1;
}

.on.pop > .gold-star .gs-on {
  animation: star-pop 0.5s cubic-bezier(0.3, 1.8, 0.5, 1) both;
}

@keyframes star-pop {
  0% { transform: scale(0) rotate(-70deg); opacity: 0; }
  60% { transform: scale(1.5) rotate(8deg); opacity: 1; }
  100% { transform: none; opacity: 1; }
}

/* Высокий экран: ходы и цель крупнее. */
@media (min-height: 760px) {
  .hud {
    height: 92px;
    gap: 14px;
  }

  .moves {
    width: 84px;
    height: 84px;
  }

  .moves b {
    font-size: 38px;
    line-height: 38px;
  }

  .moves span {
    font-size: 12.5px;
    line-height: 14px;
  }

  .goal {
    gap: 8px;
  }

  .goal-line {
    height: 48px;
  }

  .goal .score {
    height: 48px;
    font-size: 48px;
    line-height: 48px;
  }

  .goal-target {
    margin-top: 12px;
    font-size: 19px;
  }

  .bar {
    height: 30px;
  }

  .bar-track {
    height: 20px;
    border-radius: 10px;
  }

  .bar-star {
    width: 36px;
    height: 36px;
    margin: -18.5px 0 0 -18px;
  }
}

@media (max-height: 620px) {
  .hud {
    height: 60px;
  }

  .goal-target {
    margin-top: 6px;
    font-size: 15.5px;
  }

  .moves {
    width: 56px;
    height: 56px;
  }

  .moves b {
    font-size: 25px;
    line-height: 25px;
  }

  .moves span {
    font-size: 9.5px;
    line-height: 11px;
  }

  .goal {
    gap: 3px;
  }

  .goal-line {
    height: 31px;
  }

  .goal .score {
    height: 31px;
    font-size: 31px;
    line-height: 31px;
  }

  .foot {
    height: 36px;
  }

  .foot-plate {
    height: 32px;
  }
}

/* ---------- Поле: шкатулка ---------- */
/* Золотая рама, сливовый бархат. Клетки-гнёзда и камни рисуются на холсте. */

.well {
  --shard: 10px;
  background: radial-gradient(120% 80% at 50% 0%, #4d1763 0%, #2e0d3d 58%, #240a31 100%);
  box-shadow:
    inset 0 4px 10px rgba(20, 2, 30, 0.8),
    inset 0 0 0 1.5px rgba(20, 2, 30, 0.55),
    0 0 0 5px var(--gold),
    0 -1.5px 0 5.5px var(--gold-hi),
    0 9px 0 5px var(--gold-lo),
    0 9px 0 6.5px rgba(var(--shade-rgb), 0.35),
    0 22px 30px rgba(var(--shade-rgb), 0.55);
  margin: 6px 6px 14px;
}

.board {
  width: var(--fit-w, 304px);
  height: var(--fit-h, 304px);
}

#canvas {
  position: absolute;
  top: calc(-1 * var(--pad));
  left: calc(-1 * var(--pad));
  display: block;
  touch-action: none;
  outline: none;
}

/* Похвала растёт с цепочкой — размер ставит app.js; очки вылетают золотом. */
.well .gain {
  color: #fff6c9;
  font-size: 26px;
  text-shadow:
    0 2px 0 #a35a00,
    0 0 10px rgba(var(--shade-rgb), 0.8);
}

/* Слово похвалы встаёт на верхнюю кромку рамы: поле под ним остаётся видно. */
.well .praise {
  top: 0;
}

/* ---------- Под полем ---------- */

.foot {
  height: 44px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 0 rgba(var(--deep-rgb), 0.5);
}

/* Табличка уровня: лучший счёт и взятые звёзды — в той же золотой оправе, что и медальон ходов. */
.foot-plate {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px 0 14px;
  border-radius: 19px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #6a1f86 0%, #3a1050 100%);
  box-shadow:
    inset 0 2px 4px rgba(var(--shade-rgb), 0.5),
    0 0 0 2.5px var(--gold),
    0 -1px 0 3px var(--gold-hi),
    0 3px 0 2.5px var(--gold-lo),
    0 7px 10px rgba(var(--shade-rgb), 0.4);
  text-shadow: 0 2px 0 rgba(var(--shade-rgb), 0.7);
}

.foot-plate .ico {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--gold);
  filter: drop-shadow(0 1.5px 0 rgba(var(--shade-rgb), 0.7));
}

.foot-plate b {
  min-width: 18px;
  font-size: 18px;
  font-weight: 900;
  line-height: 22px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.foot-stars {
  display: flex;
  gap: 1px;
  margin-left: 3px;
}

.foot-stars span {
  width: 24px;
  height: 24px;
}

.foot-tip {
  display: block;
  max-width: 320px;
}

/* Памятка на высоком экране: какая фигура какой особый камень даёт. */
.recipes {
  display: none;
}

@media (min-height: 860px) {
  .foot {
    margin-bottom: 0;
  }

  .recipes {
    margin-top: 6px;
    margin-bottom: auto;
    flex: none;
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: var(--col, 460px);
    height: 58px;
  }
}

.recipe {
  flex: 1 1 0;
  max-width: 124px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 54px;
  border-radius: 18px;
  background: rgba(var(--shade-rgb), 0.42);
  box-shadow: inset 0 2px 4px rgba(var(--shade-rgb), 0.5), 0 1px 0 rgba(255, 255, 255, 0.22);
}

.recipe-dots {
  display: grid;
  grid-template-columns: repeat(5, 6px);
  grid-template-rows: repeat(3, 6px);
  gap: 2px;
}

.recipe-dots i {
  border-radius: 2px;
  background: linear-gradient(180deg, #fff 0%, var(--dot, #ffd53a) 60%);
  box-shadow: 0 1px 0 rgba(var(--shade-rgb), 0.6);
}

.recipe-arrow {
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-left: 7px solid rgba(255, 255, 255, 0.75);
  border-right: 0;
}

.recipe canvas {
  flex: none;
}

/* ---------- Итог уровня ---------- */

.result .card {
  position: relative;
  padding-top: 30px;
}

.res-level {
  position: absolute;
  top: -19px;
  left: 50%;
  height: 38px;
  padding: 0 22px;
  border-radius: 19px;
  background: linear-gradient(180deg, #ff7ac6 0%, #d92e9d 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 4px 0 #8a1466, 0 9px 14px rgba(var(--shade-rgb), 0.5);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  line-height: 38px;
  white-space: nowrap;
  text-shadow: 0 1.5px 0 rgba(120, 10, 80, 0.7);
  transform: translateX(-50%);
}

.result-lose .res-level {
  background: linear-gradient(180deg, #a892c4 0%, #6d5590 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 4px 0 #43305f, 0 9px 14px rgba(var(--shade-rgb), 0.5);
  text-shadow: 0 1.5px 0 rgba(50, 30, 80, 0.7);
}

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

.res-stars span {
  width: 62px;
  height: 62px;
  filter: drop-shadow(0 5px 5px rgba(20, 2, 30, 0.5));
}

.res-stars span:nth-child(1) { transform: rotate(-12deg); }
.res-stars span:nth-child(3) { transform: rotate(12deg); }

.res-stars span:nth-child(2) {
  width: 80px;
  height: 80px;
  margin-bottom: 6px;
}

.result .over-title {
  font-size: 22px;
  line-height: 27px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2.5px 0 rgba(20, 2, 30, 0.55);
}

.result .over-score {
  font-size: min(60px, 16vw);
  color: #fff6c9;
  text-shadow: 0 4px 0 #a35a00, 0 9px 14px rgba(20, 2, 30, 0.5);
}

.result .over-score.res-bump {
  animation: res-bump 0.3s cubic-bezier(0.3, 1.7, 0.5, 1);
}

@keyframes res-bump {
  40% { transform: scale(1.14); }
}

.result-lose .over-score {
  color: #fff;
  text-shadow: 0 4px 0 rgba(20, 2, 30, 0.6);
}

.result .over-note {
  margin-top: 8px;
}

/* Окна на весь экран — в той же золотой раме, что и поле. */
.over-full .card {
  background: radial-gradient(120% 70% at 50% 0%, #54196c 0%, #2e0d3d 62%, #260a33 100%);
  box-shadow:
    inset 0 4px 10px rgba(20, 2, 30, 0.7),
    0 0 0 5px var(--gold),
    0 -1.5px 0 5.5px var(--gold-hi),
    0 9px 0 5px var(--gold-lo),
    0 26px 40px rgba(var(--shade-rgb), 0.65);
}

@media (max-height: 620px) {
  .res-stars {
    height: 68px;
  }

  .res-stars span {
    width: 50px;
    height: 50px;
  }

  .res-stars span:nth-child(2) {
    width: 64px;
    height: 64px;
  }

  .result .over-score {
    font-size: 46px;
  }

  .result.over-full .over-actions {
    margin-top: 14px;
  }
}

/* ---------- Справка ---------- */

.help .over-text {
  max-width: none;
}

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

.help-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 4px 12px 4px 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  text-align: left;
  color: rgba(255, 255, 255, 0.92);
}

.help-row canvas {
  flex: none;
}

.help-row .pair {
  flex: none;
  display: flex;
  width: 44px;
}

.help-row .pair canvas + canvas {
  margin-left: -16px;
}

@media (max-height: 620px) {
  .help.over-full .card {
    padding-top: 16px;
    padding-bottom: 18px;
  }

  .help-list {
    gap: 5px;
    margin-top: 9px;
  }

  .help-row {
    min-height: 44px;
    font-size: 13px;
    line-height: 16px;
  }

  .help .over-text {
    font-size: 14px;
    line-height: 18px;
  }

  .help.over-full .over-actions {
    margin-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .moves.low,
  .gem-logo::before {
    animation: none !important;
  }

  .gem-logo b {
    opacity: 0.9;
  }
}
