:root {
  --bg: #fff8ee;
  --text: #18354f;
  --muted: #4f6f8e;
  --card: rgba(255, 255, 255, 0.9);
  --line: rgba(62, 132, 200, 0.33);
  --blue: #2f8df6;
  --blue-2: #36c6ff;
  --mint: #d2ffe8;
  --peach: #ffd7b7;
  --sun: #ffe36b;
  --coral: #ff8da0;
  --green: #7ed957;
  --orange: #ff9f32;
  --shadow: 0 18px 45px rgba(37, 91, 143, 0.2);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Onest", "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.45;
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  padding-top: 96px;
}

body.nav-open {
  overflow: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 14%, rgba(255, 227, 107, 0.35), transparent 24%),
    radial-gradient(circle at 85% 22%, rgba(54, 198, 255, 0.28), transparent 28%),
    radial-gradient(circle at 78% 78%, rgba(255, 141, 160, 0.22), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.23)),
    url("images/backgr.png");
  background-size: cover;
  background-position: center;
  z-index: -2;
}

.top-nav {
  position: fixed;
  top: 12px;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.top-nav__inner {
  width: min(1060px, 100%);
  min-height: 68px;
  border-radius: 20px;
  border: 1px solid rgba(62, 132, 200, 0.28);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.94), rgba(225, 248, 255, 0.92), rgba(255, 239, 215, 0.92));
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 28px rgba(51, 78, 108, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 18px;
  pointer-events: auto;
  position: relative;
}

.top-nav__brand {
  text-decoration: none;
  color: #1f71d1;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: clamp(16px, 2.3vw, 24px);
  font-weight: 700;
  white-space: nowrap;
}

.top-nav__menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav__link {
  text-decoration: none;
  color: #21517f;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 14px;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.top-nav__link:hover,
.top-nav__link.is-active {
  background: linear-gradient(120deg, rgba(54, 198, 255, 0.24), rgba(255, 227, 107, 0.28));
  color: #114c92;
  transform: translateY(-1px);
}

.top-nav__burger {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(47, 141, 246, 0.4);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.top-nav__burger span {
  width: 18px;
  height: 2px;
  background: #1e5e9f;
  border-radius: 20px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.top-nav.is-open .top-nav__burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.top-nav.is-open .top-nav__burger span:nth-child(2) {
  opacity: 0;
}

.top-nav.is-open .top-nav__burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.game-page {
  width: min(1100px, calc(100% - 32px));
  margin: 14px auto 42px;
  display: grid;
  gap: 16px;
}

.card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.93), rgba(246, 253, 255, 0.9));
  box-shadow: var(--shadow);
  backdrop-filter: blur(2px);
  padding: clamp(20px, 4vw, 34px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--blue), var(--blue-2), #5ae6c2, var(--orange));
  opacity: 0.9;
}

.game-start {
  min-height: calc(100vh - 180px);
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 16px;
  background:
    radial-gradient(circle at 86% 12%, rgba(255, 227, 107, 0.45), transparent 34%),
    radial-gradient(circle at 12% 86%, rgba(54, 198, 255, 0.28), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(246, 253, 255, 0.9));
}

.game-icon {
  width: min(220px, 48vw);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 28px;
  filter: drop-shadow(0 18px 26px rgba(24, 53, 79, 0.18));
}

.game-label {
  display: inline-block;
  margin: 0;
  margin-bottom: 15px;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--peach), #fff2d5);
  color: #5f5867;
  font-size: 15px;
  font-weight: 700;
}

.game-start h1,
.game-head h1,
.game-result h2 {
  margin: 0;
  font-family: "Comfortaa", "Onest", sans-serif;
  color: #2b6ab8;
  line-height: 1.08;
}

.game-start h1 {
  font-size: clamp(36px, 6vw, 68px);
}

.game-head h1,
.game-result h2 {
  font-size: clamp(30px, 4vw, 48px);
}

.game-lead,
.game-note,
.game-result p {
  max-width: 760px;
  margin: 0;
  color: #365877;
  font-size: clamp(18px, 2.1vw, 23px);
}

.game-note {
  border: 1px solid rgba(47, 141, 246, 0.22);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(225, 248, 255, 0.74));
  padding: 14px 16px;
  font-weight: 600;
}

.btn {
  border: 0;
  border-radius: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  min-height: 50px;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: linear-gradient(130deg, var(--blue), var(--blue-2), #58e4b5);
  color: #fff;
  box-shadow: 0 10px 22px rgba(47, 141, 246, 0.4);
}

.btn--secondary {
  background: linear-gradient(135deg, #fff6d7, #ffe8ca);
  color: #344f70;
  border: 1px solid rgba(255, 187, 90, 0.38);
}

.btn--ghost {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(220, 247, 255, 0.86));
  color: #205992;
  border: 1px solid rgba(47, 141, 246, 0.32);
}

.game-shell {
  display: grid;
  gap: 16px;
}

.game-head,
.game-stats,
.game-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.game-scorebox,
.game-stat {
  border: 1px solid rgba(47, 141, 246, 0.28);
  border-radius: 20px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.92), rgba(228, 247, 255, 0.88));
  padding: 12px 16px;
  box-shadow: 0 10px 22px rgba(37, 91, 143, 0.12);
}

.game-scorebox span,
.game-stat span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.game-scorebox strong {
  display: block;
  color: var(--orange);
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
}

.game-stat strong {
  display: block;
  color: #1f5b96;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: clamp(20px, 2.4vw, 28px);
}

.game-field {
  position: relative;
  overflow: hidden;
  min-height: clamp(380px, 58vw, 620px);
  border-radius: 28px;
  border: 1px solid rgba(47, 141, 246, 0.33);
  background:
    linear-gradient(180deg, rgba(7, 35, 73, 0.04), rgba(8, 48, 86, 0.12)),
    url("images/backgrnorthgame.png");
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 18px 36px rgba(24, 53, 79, 0.2);
  user-select: none;
  touch-action: manipulation;
}

.game-field__hint {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  z-index: 5;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #1f5b96;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(24, 53, 79, 0.12);
  pointer-events: none;
}

.deer {
  position: absolute;
  width: var(--deer-size, 110px);
  height: auto;
  cursor: pointer;
  transform: translate3d(0, 0, 0);
  filter: drop-shadow(0 12px 12px rgba(2, 17, 33, 0.28));
  will-change: left, top, transform;
  transition: opacity 0.18s ease, filter 0.18s ease;
  -webkit-user-drag: none;
  user-select: none;
}

.deer:hover {
  filter: drop-shadow(0 0 14px rgba(255, 227, 107, 0.8)) drop-shadow(0 12px 12px rgba(2, 17, 33, 0.26));
}

.deer.is-caught {
  opacity: 0;
  filter: drop-shadow(0 0 28px rgba(255, 227, 107, 0.95));
  pointer-events: none;
}

.catch-pop {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(255, 227, 107, 0.92);
  box-shadow: 0 0 24px rgba(255, 227, 107, 0.75), inset 0 0 18px rgba(255, 255, 255, 0.55);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.45);
  animation: catch-pop 0.42s ease-out forwards;
  z-index: 4;
}

.game-progress {
  height: 14px;
  border-radius: 999px;
  background: rgba(47, 141, 246, 0.16);
  overflow: hidden;
  border: 1px solid rgba(47, 141, 246, 0.2);
}

.game-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--blue-2), var(--green), var(--sun));
  transition: width 0.2s linear;
}

.game-result {
  min-height: calc(100vh - 180px);
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 16px;
}

.result-score {
  width: min(240px, 62vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.95), transparent 28%),
    linear-gradient(135deg, var(--sun), var(--orange), var(--coral));
  box-shadow: 0 18px 40px rgba(255, 159, 50, 0.28);
  color: #fff;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: clamp(62px, 13vw, 116px);
  font-weight: 700;
  line-height: 1;
}

.game-actions--center {
  justify-content: center;
}

.footer {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto 30px;
  text-align: center;
  color: #446789;
  font-size: 14px;
}

@keyframes catch-pop {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.35);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.45);
  }
}

@media (max-width: 700px) {
  body {
    padding-top: 82px;
  }

  .top-nav {
    top: 8px;
    padding: 0 8px;
  }

  .top-nav__inner {
    min-height: 60px;
    border-radius: 16px;
    padding: 8px 10px 8px 14px;
  }

  .top-nav__brand {
    font-size: 15px;
  }

  .top-nav__burger {
    display: flex;
  }

  .top-nav__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: min(280px, calc(100vw - 16px));
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid rgba(47, 141, 246, 0.26);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(229, 248, 255, 0.95));
    box-shadow: 0 14px 26px rgba(50, 80, 113, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  }

  .top-nav.is-open .top-nav__menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .top-nav__link {
    padding: 11px 12px;
    border-radius: 10px;
  }

  .game-page,
  .footer {
    width: calc(100% - 16px);
    margin-top: 10px;
  }

  .card {
    border-radius: 22px;
    padding: 18px;
  }

  .game-start,
  .game-result {
    min-height: calc(100dvh - 128px);
    align-content: start;
  }

  .game-head,
  .game-stats,
  .game-actions {
    align-items: stretch;
  }

  .game-scorebox,
  .game-stat,
  .game-actions .btn,
  .game-start__btn {
    width: 100%;
  }

  .game-field {
    min-height: min(72dvh, 520px);
    border-radius: 20px;
  }

  .game-field__hint {
    font-size: 14px;
    white-space: nowrap;
  }

  .deer {
    width: var(--deer-size-mobile, 86px);
  }
}

/* ===== Игра «Рюхи» — добавить в конец games.css ===== */

:root {
  --bg: #fff8ee;
  --text: #18354f;
  --muted: #4f6f8e;
  --card: rgba(255, 255, 255, 0.9);
  --line: rgba(62, 132, 200, 0.33);
  --blue: #2f8df6;
  --blue-2: #36c6ff;
  --mint: #d2ffe8;
  --peach: #ffd7b7;
  --sun: #ffe36b;
  --coral: #ff8da0;
  --green: #7ed957;
  --shadow: 0 18px 45px rgba(37, 91, 143, 0.2);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Onest", "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.45;
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  padding-top: 96px;
}

body.nav-open {
  overflow: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 14%, rgba(255, 227, 107, 0.35), transparent 24%),
    radial-gradient(circle at 85% 22%, rgba(54, 198, 255, 0.28), transparent 28%),
    radial-gradient(circle at 78% 78%, rgba(255, 141, 160, 0.22), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.23)),
    url("images/backgr.png");
  background-size: cover;
  background-position: center;
  z-index: -2;
}

.top-nav {
  position: fixed;
  top: 12px;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.top-nav__inner {
  width: min(1060px, 100%);
  min-height: 68px;
  border-radius: 20px;
  border: 1px solid rgba(62, 132, 200, 0.28);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.94), rgba(225, 248, 255, 0.92), rgba(255, 239, 215, 0.92));
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 28px rgba(51, 78, 108, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 18px;
  pointer-events: auto;
  position: relative;
}

.top-nav__brand {
  text-decoration: none;
  color: #1f71d1;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: clamp(16px, 2.3vw, 24px);
  font-weight: 700;
  white-space: nowrap;
}

.top-nav__menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav__link {
  text-decoration: none;
  color: #21517f;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 14px;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.top-nav__link:hover,
.top-nav__link.is-active {
  background: linear-gradient(120deg, rgba(54, 198, 255, 0.24), rgba(255, 227, 107, 0.28));
  color: #114c92;
  transform: translateY(-1px);
}

.top-nav__burger {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(47, 141, 246, 0.4);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.top-nav__burger span {
  width: 18px;
  height: 2px;
  background: #1e5e9f;
  border-radius: 20px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.top-nav.is-open .top-nav__burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.top-nav.is-open .top-nav__burger span:nth-child(2) {
  opacity: 0;
}

.top-nav.is-open .top-nav__burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.btn {
  border: 0;
  border-radius: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  min-height: 50px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: linear-gradient(130deg, var(--blue), var(--blue-2), #58e4b5);
  color: #fff;
  box-shadow: 0 10px 22px rgba(47, 141, 246, 0.4);
}

.btn--ghost {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(220, 247, 255, 0.86));
  color: #205992;
  border: 1px solid rgba(47, 141, 246, 0.32);
}

.card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.93), rgba(246, 253, 255, 0.9));
  box-shadow: var(--shadow);
  backdrop-filter: blur(2px);
  padding: clamp(20px, 4vw, 34px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--blue), var(--sun), var(--coral));
  opacity: 0.85;
}

.footer {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto 30px;
  text-align: center;
  color: #446789;
  font-size: 14px;
}

.game-page {
  width: min(1100px, calc(100% - 32px));
  margin: 14px auto 42px;
}

.game-card::before {
  background: linear-gradient(90deg, #2f8df6, #36c6ff, #ffe36b, #ff8da0);
}

.game-label {
  display: inline-block;
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--peach), #fff2d5);
  color: #5f5867;
  font-size: 15px;
  font-weight: 700;
}

.ruhie-start,
.ruhie-result {
  min-height: calc(100vh - 170px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
  background:
    radial-gradient(circle at 88% 14%, rgba(255, 227, 107, 0.44), transparent 34%),
    radial-gradient(circle at 12% 88%, rgba(54, 198, 255, 0.28), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(246, 253, 255, 0.9));
}

.ruhie-start__icon {
  width: clamp(110px, 20vw, 190px);
  max-height: 190px;
  object-fit: contain;
  filter: drop-shadow(0 16px 20px rgba(24, 53, 79, 0.22));
}

.ruhie-start h1,
.ruhie-result h2 {
  margin: 0;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: clamp(38px, 5vw, 70px);
  line-height: 1.08;
  color: #2b6ab8;
}

.ruhie-start__text,
.ruhie-result__text,
.ruhie-result__score {
  max-width: 760px;
  margin: 0;
  color: #365877;
  font-size: clamp(18px, 2.1vw, 23px);
}

.ruhie-result__score strong {
  color: #ff8a1f;
  font-size: 1.35em;
}

.ruhie-shell {
  display: grid;
  gap: 14px;
}

.ruhie-hud {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 130px;
  gap: 10px;
  align-items: stretch;
}

.ruhie-hud__item {
  border: 1px solid rgba(47, 141, 246, 0.28);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(228, 247, 255, 0.9));
  padding: 12px 14px;
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 68px;
}

.ruhie-hud__item span {
  color: #4f6f8e;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ruhie-hud__item strong {
  font-family: "Comfortaa", "Onest", sans-serif;
  color: #1f5b96;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1;
}

.ruhie-attempts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ruhie-attempt {
  width: clamp(28px, 4.4vw, 44px);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(24, 53, 79, 0.16));
  transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.ruhie-attempt.is-used {
  opacity: 0.28;
  transform: scale(0.82) rotate(-12deg);
  filter: grayscale(1);
}

.ruhie-meter {
  height: 12px;
  border-radius: 999px;
  background: rgba(47, 141, 246, 0.16);
  overflow: hidden;
  border: 1px solid rgba(47, 141, 246, 0.2);
}

.ruhie-meter span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--blue-2), var(--green));
  transition: width 0.32s ease;
}

.ruhie-field {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(47, 141, 246, 0.32);
  background-image: url("images/ruhiebg.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 16px 32px rgba(24, 53, 79, 0.14);
  user-select: none;
  touch-action: none;
}

.ruhie-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 8;
  pointer-events: none;
}

.ruhie-hero {
  position: absolute;
  left: 5.6%;
  bottom: 10.5%;
  width: 17%;
  max-width: 190px;
  min-width: 82px;
  object-fit: contain;
  z-index: 15;
  pointer-events: none;
  filter: drop-shadow(0 14px 14px rgba(20, 35, 54, 0.24));
}

.ruhie-hero.is-aiming {
  filter: drop-shadow(0 14px 14px rgba(20, 35, 54, 0.24)) brightness(1.07);
}

.ruhie-aim-zone {
  position: absolute;
  left: 4%;
  bottom: 8%;
  width: 23%;
  height: 38%;
  z-index: 30;
  cursor: grab;
  border-radius: 50%;
  touch-action: none;
}

.ruhie-aim-zone:active {
  cursor: grabbing;
}

.ruhie-target {
  position: absolute;
  width: var(--target-width);
  left: var(--target-x);
  bottom: var(--target-bottom);
  z-index: 12;
  transform: translateX(-50%);
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 11px 10px rgba(26, 45, 68, 0.24));
  transition: transform 0.18s ease, filter 0.18s ease;
}

.ruhie-target.is-hit {
  animation: ruhie-target-hit 0.32s ease both;
}

.ruhie-projectile {
  position: absolute;
  width: var(--projectile-width, 6%);
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: center center;
  z-index: 20;
  pointer-events: none;
  filter: drop-shadow(0 8px 9px rgba(20, 35, 54, 0.28));
}

.ruhie-help {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 40;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(47, 141, 246, 0.26);
  color: #205992;
  font-weight: 700;
  font-size: clamp(12px, 1.6vw, 15px);
  box-shadow: 0 8px 16px rgba(24, 53, 79, 0.14);
  pointer-events: none;
}

.ruhie-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ruhie-actions--center {
  justify-content: center;
}

@keyframes ruhie-target-hit {
  0% {
    transform: translateX(-50%) scale(1) rotate(0deg);
  }
  45% {
    transform: translateX(-50%) scale(1.12) rotate(-3deg);
    filter: drop-shadow(0 14px 15px rgba(255, 141, 60, 0.35));
  }
  100% {
    transform: translateX(-50%) scale(1) rotate(0deg);
  }
}

@media (max-width: 700px) {
  body {
    padding-top: 82px;
  }

  .top-nav {
    top: 8px;
    padding: 0 8px;
  }

  .top-nav__inner {
    min-height: 60px;
    border-radius: 16px;
    padding: 8px 10px 8px 14px;
  }

  .top-nav__brand {
    font-size: 15px;
  }

  .top-nav__burger {
    display: flex;
  }

  .top-nav__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: min(280px, calc(100vw - 16px));
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid rgba(47, 141, 246, 0.26);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(229, 248, 255, 0.95));
    box-shadow: 0 14px 26px rgba(50, 80, 113, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  }

  .top-nav.is-open .top-nav__menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .top-nav__link {
    padding: 11px 12px;
    border-radius: 10px;
  }

  .game-page,
  .footer {
    width: calc(100% - 16px);
  }

  .card {
    border-radius: 22px;
    padding: 14px;
  }

  .ruhie-start,
  .ruhie-result {
    min-height: calc(100dvh - 128px);
    align-content: center;
  }

  .ruhie-hud {
    grid-template-columns: 1fr 1fr;
  }

  .ruhie-hud__attempts {
    grid-column: 1 / -1;
    order: 3;
  }

  .ruhie-field {
    border-radius: 20px;
    min-height: 310px;
    background-size: 100% 100%;
  }

  .ruhie-hero {
    left: 3.5%;
    bottom: 8.5%;
    width: 20%;
  }

  .ruhie-aim-zone {
    left: 0;
    bottom: 4%;
    width: 34%;
    height: 45%;
  }

  .ruhie-help {
    top: 10px;
    width: calc(100% - 20px);
    text-align: center;
    border-radius: 14px;
  }

  .ruhie-actions .btn,
  .ruhie-btn {
    width: 100%;
  }
}

/* ===== Улучшения «Рюхи»: отскок, частицы, всплывающий счёт ===== */
.ruhie-field.is-impact {
  animation: ruhie-field-impact 0.26s ease both;
}

.ruhie-projectile.is-bounce {
  animation: ruhie-projectile-bounce 0.18s ease both;
}

.ruhie-float-score {
  position: absolute;
  z-index: 45;
  transform: translate(-50%, -50%);
  color: #ff8a1f;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: clamp(22px, 3.6vw, 42px);
  font-weight: 700;
  line-height: 1;
  text-shadow:
    0 2px 0 #ffffff,
    0 6px 16px rgba(65, 41, 16, 0.28);
  pointer-events: none;
  animation: ruhie-float-score 0.76s ease-out both;
}

.ruhie-particle {
  position: absolute;
  z-index: 44;
  width: clamp(5px, 0.8vw, 9px);
  height: clamp(5px, 0.8vw, 9px);
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe36b, #ff8a1f);
  box-shadow: 0 0 10px rgba(255, 195, 80, 0.6);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: ruhie-particle-burst 0.62s ease-out both;
}

.ruhie-particle:nth-of-type(3n) {
  background: linear-gradient(135deg, #ffffff, #ffd7b7);
}

.ruhie-particle:nth-of-type(3n + 1) {
  background: linear-gradient(135deg, #d2ffe8, #36c6ff);
}

@keyframes ruhie-field-impact {
  0%, 100% {
    transform: translateX(0);
  }
  22% {
    transform: translateX(-3px);
  }
  46% {
    transform: translateX(3px);
  }
  68% {
    transform: translateX(-2px);
  }
  84% {
    transform: translateX(1px);
  }
}

@keyframes ruhie-projectile-bounce {
  0% {
    filter: drop-shadow(0 8px 9px rgba(20, 35, 54, 0.28));
  }
  50% {
    filter: drop-shadow(0 4px 4px rgba(20, 35, 54, 0.2)) brightness(1.08);
  }
  100% {
    filter: drop-shadow(0 8px 9px rgba(20, 35, 54, 0.28));
  }
}

@keyframes ruhie-float-score {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.65) rotate(-5deg);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1.18) rotate(2deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -150%) scale(1) rotate(0deg);
  }
}

@keyframes ruhie-particle-burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.4);
  }
  72% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--particle-x)), calc(-50% + var(--particle-y))) scale(0.2);
  }
}
/* Игра Куреш */
.kuresh-page {
  width: min(1100px, calc(100% - 32px));
  margin: 14px auto 42px;
  display: grid;
  gap: 16px;
}

.kuresh-start,
.kuresh-result {
  min-height: calc(100vh - 170px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  text-align: center;
  background:
    radial-gradient(circle at 88% 14%, rgba(255, 227, 107, 0.36), transparent 34%),
    radial-gradient(circle at 12% 88%, rgba(190, 116, 67, 0.22), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 247, 235, 0.92));
}

.kuresh-start::before,
.kuresh-shell::before,
.kuresh-result::before {
  background: linear-gradient(90deg, #9b5e33, #d28745, #2f8df6, #d94c38);
}

.game-start__icon {
  width: clamp(120px, 22vw, 220px);
  max-height: 240px;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px rgba(64, 36, 20, 0.22));
}

.game-start__label {
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffe5c5, #fff6d7);
  color: #69412a;
  font-size: 15px !important;
  font-weight: 700;
}

.kuresh-start h1,
.kuresh-result h2 {
  margin: 0;
  max-width: 820px;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.08;
  color: #8a4b2b;
}

.kuresh-start p:not(.game-start__label),
.kuresh-result p:not(.game-start__label) {
  max-width: 760px;
  margin: 0;
  color: #4f3e35;
  font-size: clamp(18px, 2.1vw, 23px);
}

.kuresh-shell {
  display: grid;
  gap: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 247, 235, 0.92));
}

.kuresh-head {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr)) auto;
  gap: 12px;
  align-items: stretch;
}

.kuresh-stat {
  border: 1px solid rgba(155, 94, 51, 0.24);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 237, 214, 0.88));
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}

.kuresh-stat span,
.kuresh-bar__top span {
  color: #6d5547;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.kuresh-stat strong {
  color: #8a4b2b;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1;
  font-family: "Comfortaa", "Onest", sans-serif;
}

.kuresh-restart {
  align-self: center;
  white-space: nowrap;
}

.kuresh-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.kuresh-bar {
  border: 1px solid rgba(155, 94, 51, 0.24);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.kuresh-bar__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 800;
  color: #653c25;
}

.kuresh-meter {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(104, 67, 42, 0.14);
  border: 1px solid rgba(104, 67, 42, 0.16);
}

.kuresh-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.12s linear;
}

.kuresh-bar--player .kuresh-meter span {
  background: linear-gradient(90deg, #d94c38, #ff9b54);
}

.kuresh-bar--bot .kuresh-meter span {
  background: linear-gradient(90deg, #2f8df6, #36c6ff);
}

.kuresh-field {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 390px;
  border-radius: 26px;
  border: 1px solid rgba(155, 94, 51, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 247, 227, 0.08), rgba(60, 34, 19, 0.15)),
    url("images/fightersbg.png");
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 14px 30px rgba(61, 38, 22, 0.22);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.kuresh-field:focus-visible {
  outline: 4px solid rgba(47, 141, 246, 0.45);
  outline-offset: 4px;
}

.kuresh-tug {
  position: absolute;
  left: 50%;
  bottom: 10%;
  width: 88%;
  height: 56%;
  translate: -50% 0;
  transform: translateX(0);
  transition: transform 0.08s linear;
  will-change: transform;
}

.kuresh-fighter,
.kuresh-rope {
  position: absolute;
  user-select: none;
  pointer-events: none;
}

.kuresh-fighter {
  bottom: 0;
  width: 260px;
  height: 260px;
  object-fit: contain;
  filter: drop-shadow(0 14px 14px rgba(45, 27, 14, 0.3));
  z-index: 3;
}

.kuresh-fighter--left {
  left: 0;
}

.kuresh-fighter--right {
  right: 0;
}

.kuresh-rope {
  display: block;
  left: 50%;
  top: 50%;
  width: calc(100% - 500px);
  height: 260px;
  object-fit: fill;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 5px rgba(45, 27, 14, 0.25));
  z-index: 5;
}

.kuresh-overlay {
  position: absolute;
  z-index: 20;
  left: 50%;
  top: 16%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #8a4b2b;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-weight: 800;
  font-size: clamp(18px, 3vw, 34px);
  box-shadow: 0 12px 24px rgba(57, 34, 18, 0.18);
  pointer-events: none;
}

.kuresh-hint {
  margin: 0;
  color: #5d4a3f;
  font-size: 16px !important;
}

.kuresh-click-pop {
  position: absolute;
  z-index: 25;
  transform: translate(-50%, -50%);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  text-shadow: 0 2px 5px rgba(42, 23, 12, 0.6);
  pointer-events: none;
  animation: kuresh-click-pop 0.44s ease both;
}

.kuresh-field.is-bot-surge {
  animation: kuresh-surge 0.34s ease both;
}

.kuresh-fact {
  margin-top: 6px !important;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(155, 94, 51, 0.24);
  background: rgba(255, 246, 230, 0.86);
}

@keyframes kuresh-click-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -25%) scale(0.8);
  }

  30% {
    opacity: 1;
    transform: translate(-50%, -70%) scale(1.06);
  }

  to {
    opacity: 0;
    transform: translate(-50%, -120%) scale(0.94);
  }
}

@keyframes kuresh-surge {
  0%, 100% {
    transform: translateX(0);
  }

  28% {
    transform: translateX(-4px);
  }

  58% {
    transform: translateX(5px);
  }
}

@media (max-width: 760px) {
  .kuresh-page {
    width: calc(100% - 16px);
    margin-top: 10px;
  }

  .kuresh-start,
  .kuresh-result {
    min-height: calc(100dvh - 128px);
    align-content: start;
  }

  .kuresh-head,
  .kuresh-bars {
    grid-template-columns: 1fr;
  }

  .kuresh-restart,
  .kuresh-start .btn,
  .kuresh-result .btn {
    width: 100%;
  }

  .kuresh-field {
    min-height: 300px;
    border-radius: 20px;
  }

  .kuresh-tug {
    width: 104%;
    height: 54%;
    bottom: 8%;
  }

  .kuresh-fighter {
    width: 160px;
    height: 160px;
  }

  .kuresh-fighter--left {
    left: 0;
  }

  .kuresh-fighter--right {
    right: 0;
  }

  .kuresh-rope {
    width: calc(100% - 305px);
    height: 160px;
    top: 50%;
    z-index: 100;
  }

  .kuresh-overlay {
    top: 12%;
    width: max-content;
    max-width: calc(100% - 24px);
    text-align: center;
  }
}

/* ===== Игра «Кладовая ремёсел» ===== */
.memory-page {
  width: min(1100px, calc(100% - 32px));
  margin: 14px auto 42px;
  display: grid;
  gap: 16px;
}

.memory-start,
.memory-result {
  min-height: calc(100vh - 170px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
  background:
    radial-gradient(circle at 88% 14%, rgba(255, 227, 107, 0.42), transparent 34%),
    radial-gradient(circle at 12% 88%, rgba(255, 159, 50, 0.22), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 248, 235, 0.92));
}

.memory-start::before,
.memory-shell::before,
.memory-result::before {
  background: linear-gradient(90deg, #b46b2f, #ff9f32, #ffe36b, #7ed957);
}

.memory-start__icon {
  width: clamp(120px, 22vw, 210px);
  max-height: 230px;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(89, 52, 24, 0.24));
}

.memory-start h1,
.memory-result h2 {
  margin: 0;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: clamp(36px, 5vw, 66px);
  line-height: 1.08;
  color: #8a4b2b;
}

.memory-start__text,
.memory-result__text,
.memory-result__score,
.memory-fact {
  max-width: 760px;
  margin: 0;
  color: #4f3e35;
  font-size: clamp(18px, 2.1vw, 23px);
}

.memory-result__score strong {
  color: #ff8a1f;
  font-size: 1.35em;
}

.memory-shell {
  display: grid;
  gap: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 248, 235, 0.92));
}

.memory-hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.memory-hud__item {
  border: 1px solid rgba(180, 107, 47, 0.25);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 239, 214, 0.88));
  padding: 12px 14px;
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 68px;
}

.memory-hud__item span {
  color: #715444;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.memory-hud__item strong {
  font-family: "Comfortaa", "Onest", sans-serif;
  color: #8a4b2b;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1;
}

.memory-field-wrap {
  width: min(760px, 100%);
  justify-self: center;
}

.memory-field {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(180, 107, 47, 0.35);
  background-image:
    linear-gradient(180deg, rgba(255, 247, 227, 0.06), rgba(60, 34, 19, 0.1)),
    url("images/memory/membg.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 16px 32px rgba(89, 52, 24, 0.18);
  user-select: none;
  touch-action: manipulation;
}

.memory-field.is-locked {
  cursor: default;
}

.memory-field.is-lost .memory-card {
  filter: grayscale(0.45) brightness(0.72);
}

.memory-grid {
  position: absolute;
  z-index: 10;
  inset: 5%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 3%;
}

.memory-card {
  z-index: 11;
  position: relative;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 16px;
  cursor: pointer;
  perspective: 900px;
  transform: translateY(10px) scale(0.96);
  opacity: 0;
  animation: memory-card-enter 0.42s ease both;
  -webkit-tap-highlight-color: transparent;
}

.memory-card:disabled {
  cursor: default;
}

.memory-card__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.38s cubic-bezier(0.2, 0.72, 0.18, 1);
}

.memory-card.is-open .memory-card__inner,
.memory-card.is-matched .memory-card__inner,
.memory-card.is-preview .memory-card__inner {
  transform: rotateY(180deg);
}

.memory-card__side {
  position: absolute;
  transform-style: preserve-3d;
  display: block;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 10px 18px rgba(63, 40, 20, 0.22);
  border: 2px solid rgba(255, 244, 220, 0.72);
  background: #fff4de;
}

.memory-card__side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}

.memory-card__front {
  transform: rotateY(180deg) translateZ(1px);
}

.memory-card:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.03);
}

.memory-card.is-matched {
  pointer-events: none;
}

.memory-card.is-matched .memory-card__side {
  box-shadow:
    0 0 0 3px rgba(255, 227, 107, 0.7),
    0 0 22px rgba(255, 195, 80, 0.72),
    0 12px 20px rgba(63, 40, 20, 0.18);
}

.memory-card.is-match-pop .memory-card__inner {
  animation: memory-match-pop 0.46s ease both;
}

.memory-card.is-wrong .memory-card__inner {
  animation: memory-wrong-shake 0.48s ease both;
}

.memory-card.is-win-wave .memory-card__inner {
  animation: memory-win-wave 0.72s ease both;
}

.memory-message {
  position: absolute;
  z-index: 40;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(180, 107, 47, 0.25);
  color: #8a4b2b;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-weight: 800;
  font-size: clamp(13px, 2vw, 18px);
  box-shadow: 0 10px 20px rgba(89, 52, 24, 0.16);
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
}

.memory-hint {
  margin: 0;
  color: #5d4a3f;
  font-size: 16px !important;
  text-align: center;
}

.memory-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.memory-actions--center {
  justify-content: center;
}

.memory-fact {
  margin-top: 6px !important;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(180, 107, 47, 0.24);
  background: rgba(255, 246, 230, 0.88);
}

@keyframes memory-card-enter {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes memory-match-pop {
  0% {
    transform: rotateY(180deg) scale(1);
  }

  42% {
    transform: rotateY(180deg) scale(1.08);
  }

  100% {
    transform: rotateY(180deg) scale(1);
  }
}

@keyframes memory-wrong-shake {
  0%, 100% {
    transform: rotateY(180deg) translateX(0) rotate(0);
  }

  18% {
    transform: rotateY(180deg) translateX(-7px) rotate(-2deg);
  }

  38% {
    transform: rotateY(180deg) translateX(7px) rotate(2deg);
  }

  58% {
    transform: rotateY(180deg) translateX(-5px) rotate(-1deg);
  }

  78% {
    transform: rotateY(180deg) translateX(5px) rotate(1deg);
  }
}

@keyframes memory-win-wave {
  0%, 100% {
    transform: rotateY(180deg) translateY(0) scale(1);
    filter: none;
  }

  45% {
    transform: rotateY(180deg) translateY(-8px) scale(1.06);
    filter: drop-shadow(0 0 16px rgba(255, 227, 107, 0.9));
  }
}

@media (max-width: 700px) {
  .memory-page,
  .footer {
    width: calc(100% - 16px);
  }

  .memory-start,
  .memory-result {
    min-height: calc(100dvh - 128px);
    align-content: center;
  }

  .memory-hud {
    grid-template-columns: 1fr;
  }

  .memory-field {
    border-radius: 20px;
  }

  .memory-grid {
    gap: 2.4%;
  }

  .memory-card,
  .memory-card__side {
    border-radius: 12px;
  }

  .memory-card__side {
    border-width: 1px;
  }

  .memory-message {
    top: 10px;
    width: max-content;
    max-width: calc(100% - 20px);
    white-space: normal;
  }

  .memory-actions .btn,
  .memory-btn {
    width: 100%;
  }
}
/* ===== Игра «Сабантуй» ===== */
.runner-page {
  width: min(1100px, calc(100% - 32px));
  margin: 14px auto 42px;
  display: grid;
  gap: 16px;
}

.runner-start,
.runner-result {
  min-height: calc(100vh - 170px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
  background:
    radial-gradient(circle at 88% 14%, rgba(255, 227, 107, 0.42), transparent 34%),
    radial-gradient(circle at 12% 88%, rgba(126, 217, 87, 0.18), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 250, 232, 0.92));
}

.runner-start::before,
.runner-shell::before,
.runner-result::before {
  background: linear-gradient(90deg, #7ed957, #ffe36b, #ff9f32, #36c6ff);
}

.runner-start__icon {
  width: clamp(130px, 23vw, 230px);
  max-height: 250px;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(62, 94, 35, 0.22));
}

.runner-start h1,
.runner-result h2 {
  margin: 0;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: clamp(38px, 5.4vw, 68px);
  line-height: 1.08;
  color: #2d7c45;
}

.runner-start__text,
.runner-result__text,
.runner-fact {
  max-width: 780px;
  margin: 0;
  color: #3f5b3d;
  font-size: clamp(18px, 2.1vw, 23px);
}

.runner-shell {
  display: grid;
  gap: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 255, 238, 0.92));
}

.runner-hud {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: stretch;
}

.runner-hud__item {
  border: 1px solid rgba(126, 170, 62, 0.28);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(240, 255, 218, 0.88));
  padding: 12px 14px;
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 68px;
}

.runner-hud__item span {
  color: #5c7445;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.runner-hud__item strong {
  font-family: "Comfortaa", "Onest", sans-serif;
  color: #2d7c45;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1;
}

.runner-restart {
  align-self: center;
  white-space: nowrap;
}

.runner-field {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 390px;
  border-radius: 26px;
  border: 1px solid rgba(126, 170, 62, 0.35);
  background: #bfefff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 16px 32px rgba(63, 95, 35, 0.18);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.runner-field:focus-visible {
  outline: 4px solid rgba(54, 198, 255, 0.42);
  outline-offset: 4px;
}

.runner-bg {
  position: absolute;
  inset: 0;
  background-repeat: repeat-x;
  background-size: auto 100%;
  background-position: 0 0;
  pointer-events: none;
  will-change: background-position;
}

.runner-bg--one {
  z-index: 1;
  background-image: url("images/runner/bg1.png");
}

.runner-bg--two {
  z-index: 2;
  background-image: url("images/runner/bg2.png");
}

.runner-bg--road {
  z-index: 3;
  background-image: url("images/runner/bg3.png");
}

.runner-objects {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.runner-hero {
  position: absolute;
  z-index: 10;
  left: var(--runner-hero-left, 9%);
  bottom: var(--runner-ground-bottom, 13%);
  width: var(--runner-hero-width, 13.5%);
  height: auto;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 12px 13px rgba(35, 62, 20, 0.24));
  transform: translateY(0);
  will-change: transform;
}

.runner-obstacle {
  position: absolute;
  z-index: 9;
  bottom: var(--runner-ground-bottom, 13%);
  width: var(--obstacle-width, 8%);
  height: auto;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 8px 10px rgba(35, 62, 20, 0.18));
  transform: translateX(0);
  will-change: transform;
}

.runner-overlay {
  position: absolute;
  z-index: 30;
  left: 50%;
  top: 16%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(126, 170, 62, 0.24);
  color: #2d7c45;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-weight: 800;
  font-size: clamp(18px, 3vw, 34px);
  box-shadow: 0 12px 24px rgba(63, 95, 35, 0.16);
  pointer-events: none;
  text-align: center;
}

.runner-progress {
  height: 13px;
  border-radius: 999px;
  background: rgba(126, 170, 62, 0.17);
  overflow: hidden;
  border: 1px solid rgba(126, 170, 62, 0.22);
}

.runner-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7ed957, #ffe36b, #ff9f32);
  transition: width 0.18s linear;
}

.runner-hint {
  margin: 0;
  color: #557247;
  font-size: 16px !important;
  text-align: center;
}

.runner-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.runner-actions--center {
  justify-content: center;
}

.runner-fact {
  margin-top: 6px !important;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(126, 170, 62, 0.24);
  background: rgba(248, 255, 238, 0.88);
}

.runner-field.is-shake {
  animation: runner-shake 0.32s ease both;
}

.runner-field.is-win .runner-hero {
  animation: runner-win-pop 0.7s ease both;
}

@keyframes runner-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes runner-win-pop {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-8px) scale(1.04); }
}

@media (max-width: 760px) {
  .runner-page,
  .footer {
    width: calc(100% - 16px);
  }

  .runner-start,
  .runner-result {
    min-height: calc(100dvh - 128px);
    align-content: center;
  }

  .runner-hud {
    grid-template-columns: 1fr 1fr;
  }

  .runner-restart {
    grid-column: 1 / -1;
    width: 100%;
  }

  .runner-field {
    min-height: 300px;
    border-radius: 20px;
  }

  .runner-hero {
    left: var(--runner-hero-left-mobile, 7%);
    width: var(--runner-hero-width-mobile, 20%);
  }

  .runner-obstacle {
    width: calc(var(--obstacle-width, 8%) * 1.28);
  }

  .runner-overlay {
    top: 12%;
    max-width: calc(100% - 24px);
  }

  .runner-actions .btn,
  .runner-btn {
    width: 100%;
  }
}
/* ===== Игра «Полёт горного орла» ===== */
.eagle-page {
  width: min(1100px, calc(100% - 32px));
  margin: 14px auto 42px;
  display: grid;
  gap: 16px;
}

.eagle-start,
.eagle-result {
  min-height: calc(100vh - 170px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
  background:
    radial-gradient(circle at 88% 14%, rgba(255, 227, 107, 0.34), transparent 34%),
    radial-gradient(circle at 12% 88%, rgba(54, 198, 255, 0.22), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(238, 250, 255, 0.92));
}

.eagle-start::before,
.eagle-shell::before,
.eagle-result::before {
  background: linear-gradient(90deg, #2f8df6, #36c6ff, #7ed957, #b58a4b);
}

.eagle-start__icon {
  width: clamp(150px, 26vw, 260px);
  max-height: 250px;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(29, 58, 89, 0.25));
}

.eagle-start h1,
.eagle-result h2 {
  margin: 0;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.08;
  color: #1f5b96;
}

.eagle-start__text,
.eagle-result__text,
.eagle-fact {
  max-width: 780px;
  margin: 0;
  color: #365877;
  font-size: clamp(18px, 2.1vw, 23px);
}

.eagle-shell {
  display: grid;
  gap: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(238, 250, 255, 0.92));
}

.eagle-hud {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr)) auto;
  gap: 12px;
  align-items: stretch;
}

.eagle-hud__item {
  border: 1px solid rgba(47, 141, 246, 0.24);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(225, 248, 255, 0.88));
  padding: 12px 14px;
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 68px;
}

.eagle-hud__item span {
  color: #4f6f8e;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.eagle-hud__item strong {
  font-family: "Comfortaa", "Onest", sans-serif;
  color: #1f5b96;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1;
}

.eagle-restart {
  align-self: center;
  white-space: nowrap;
}

.eagle-progress {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(47, 141, 246, 0.16);
  border: 1px solid rgba(47, 141, 246, 0.2);
}

.eagle-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f8df6, #36c6ff, #7ed957);
  transition: width 0.12s linear;
}

.eagle-field {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 390px;
  border-radius: 26px;
  border: 1px solid rgba(47, 141, 246, 0.35);
  background: #bfe9ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 14px 30px rgba(29, 73, 117, 0.2);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.eagle-field:focus-visible {
  outline: 4px solid rgba(47, 141, 246, 0.45);
  outline-offset: 4px;
}

.eagle-bg {
  position: absolute;
  inset: 0;
  background-repeat: repeat-x;
  background-size: auto 100%;
  background-position-y: center;
  pointer-events: none;
}

.eagle-bg--one {
  z-index: 1;
  background-image: url("images/eagle/bg1.png");
}

.eagle-bg--two {
  z-index: 2;
  background-image: url("images/eagle/bg2.png");
}

.eagle-bg--three {
  z-index: 3;
  background-image: url("images/eagle/bg3.png");
}

.eagle-gates {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.eagle-gate {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--gate-width);
  height: 100%;
  will-change: transform;
}

.eagle-rock {
  position: absolute;
  left: 0;
  width: 100%;
  object-fit: fill;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 8px 10px rgba(24, 44, 62, 0.22));
}

.eagle-rock--top {
  top: 0;
  object-position: bottom center;
}

.eagle-rock--bottom {
  bottom: 0;
  object-position: top center;
}

.eagle-bird {
  position: absolute;
  z-index: 14;
  left: 22%;
  top: 45%;
  width: 10.5%;
  min-width: 70px;
  max-width: 150px;
  object-fit: contain;
  transform: translate(-50%, -50%);
  transform-origin: 52% 50%;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 9px 10px rgba(17, 42, 67, 0.24));
  will-change: transform, top;
}

.eagle-overlay {
  position: absolute;
  z-index: 30;
  left: 50%;
  top: 16%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(47, 141, 246, 0.24);
  color: #1f5b96;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-weight: 800;
  font-size: clamp(18px, 3vw, 34px);
  box-shadow: 0 12px 24px rgba(29, 73, 117, 0.18);
  pointer-events: none;
  text-align: center;
}

.eagle-hint {
  margin: 0;
  color: #365877;
  font-size: 16px !important;
  text-align: center;
}

.eagle-field.is-shake {
  animation: eagle-field-shake 0.34s ease both;
}

.eagle-field.is-win .eagle-bird {
  filter: drop-shadow(0 0 18px rgba(255, 227, 107, 0.95)) drop-shadow(0 9px 10px rgba(17, 42, 67, 0.24));
}

.eagle-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.eagle-actions--center {
  justify-content: center;
}

.eagle-fact {
  margin-top: 6px !important;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(47, 141, 246, 0.24);
  background: rgba(236, 250, 255, 0.86);
}

@keyframes eagle-field-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

@media (max-width: 760px) {
  .eagle-page,
  .footer {
    width: calc(100% - 16px);
  }

  .eagle-start,
  .eagle-result {
    min-height: calc(100dvh - 128px);
    align-content: center;
  }

  .eagle-hud {
    grid-template-columns: 1fr;
  }

  .eagle-restart,
  .eagle-start .btn,
  .eagle-result .btn {
    width: 100%;
  }

  .eagle-field {
    min-height: 300px;
    border-radius: 20px;
  }

  .eagle-bird {
    left: 22%;
    width: 14%;
    min-width: 58px;
  }

  .eagle-overlay {
    top: 12%;
    width: max-content;
    max-width: calc(100% - 24px);
  }
}
/* ===== Игра «Таёжный мост» ===== */
.taiga-page {
  width: min(1100px, calc(100% - 32px));
  margin: 14px auto 42px;
  display: grid;
  gap: 16px;
}

.taiga-start,
.taiga-result {
  min-height: calc(100vh - 170px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
  background:
    radial-gradient(circle at 88% 14%, rgba(255, 227, 107, 0.32), transparent 34%),
    radial-gradient(circle at 12% 88%, rgba(126, 217, 87, 0.22), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(242, 255, 244, 0.92));
}

.taiga-start::before,
.taiga-shell::before,
.taiga-result::before {
  background: linear-gradient(90deg, #4f8f45, #8bbd5d, #b88952, #36c6ff);
}

.taiga-start__icon {
  width: clamp(130px, 24vw, 235px);
  max-height: 250px;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(43, 78, 38, 0.24));
}

.taiga-start h1,
.taiga-result h2 {
  margin: 0;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.08;
  color: #3f7738;
}

.taiga-start__text,
.taiga-result__text,
.taiga-fact {
  max-width: 780px;
  margin: 0;
  color: #365a3b;
  font-size: clamp(18px, 2.1vw, 23px);
}

.taiga-shell {
  display: grid;
  gap: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(242, 255, 244, 0.92));
}

.taiga-hud {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr)) auto;
  gap: 12px;
  align-items: stretch;
}

.taiga-hud__item {
  border: 1px solid rgba(79, 143, 69, 0.25);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(233, 255, 229, 0.88));
  padding: 12px 14px;
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 68px;
}

.taiga-hud__item span {
  color: #55745b;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.taiga-hud__item strong {
  font-family: "Comfortaa", "Onest", sans-serif;
  color: #3f7738;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1;
}

.taiga-restart {
  align-self: center;
  white-space: nowrap;
}

.taiga-field-wrap {
  width: min(760px, 100%);
  justify-self: center;
}

.taiga-field {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(79, 143, 69, 0.35);
  background-image:
    linear-gradient(180deg, rgba(255, 247, 227, 0.05), rgba(21, 57, 31, 0.08)),
    url("images/taiga/bg.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 16px 32px rgba(43, 78, 38, 0.18);
  user-select: none;
  touch-action: manipulation;
}

.taiga-grid {
  position: absolute;
  inset: 5%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 1.4%;
}

.taiga-cell {
  position: relative;
  border: 0;
  padding: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.taiga-cell:hover:not(:disabled) {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 14px rgba(43, 78, 38, 0.16);
}

.taiga-cell:disabled {
  cursor: default;
}

.taiga-cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: rotate(var(--cell-rotation, 0deg));
  transition: transform 0.22s cubic-bezier(0.24, 0.76, 0.28, 1.18), filter 0.2s ease;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.taiga-cell.is-decorative img,
.taiga-cell--start img,
.taiga-cell--finish img {
  transform: rotate(0deg);
}

.taiga-cell--finish img {
  transform: rotate(var(--cell-rotation, 0deg));
}

.taiga-cell.is-connected:not(.is-decorative) {
  background: rgba(255, 227, 107, 0.22);
  box-shadow: inset 0 0 0 2px rgba(255, 227, 107, 0.38);
}

.taiga-cell.is-final-path:not(.is-decorative) {
  animation: taiga-path-glow 0.62s ease both;
}

.taiga-cell.is-final-path:not(.is-decorative) img {
  filter: drop-shadow(0 0 12px rgba(255, 227, 107, 0.95));
}

.taiga-cell.is-rotate-pop img {
  animation: taiga-rotate-pop 0.28s ease both;
}

.taiga-message {
  position: absolute;
  z-index: 40;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(79, 143, 69, 0.25);
  color: #3f7738;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-weight: 800;
  font-size: clamp(13px, 2vw, 18px);
  box-shadow: 0 10px 20px rgba(43, 78, 38, 0.16);
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
}

.taiga-walker {
  position: absolute;
  z-index: 35;
  left: 0;
  top: 0;
  width: 11%;
  opacity: 0;
  transition: left 0.24s ease, top 0.24s ease, opacity 0.2s ease;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 8px 10px rgba(40, 60, 35, 0.25));
}

.taiga-hint {
  margin: 0;
  color: #365a3b;
  font-size: 16px !important;
  text-align: center;
}

.taiga-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.taiga-actions--center {
  justify-content: center;
}

.taiga-fact {
  margin-top: 6px !important;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(79, 143, 69, 0.24);
  background: rgba(242, 255, 244, 0.86);
}

@keyframes taiga-rotate-pop {
  0% { scale: 1; }
  50% { scale: 1.08; }
  100% { scale: 1; }
}

@keyframes taiga-path-glow {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  45% {
    transform: translateY(-5px) scale(1.05);
  }
}

@media (max-width: 760px) {
  .taiga-page,
  .footer {
    width: calc(100% - 16px);
  }

  .taiga-start,
  .taiga-result {
    min-height: calc(100dvh - 128px);
    align-content: center;
  }

  .taiga-hud {
    grid-template-columns: 1fr;
  }

  .taiga-restart,
  .taiga-start .btn,
  .taiga-result .btn {
    width: 100%;
  }

  .taiga-field {
    border-radius: 20px;
  }

  .taiga-grid {
    gap: 1%;
  }

  .taiga-cell {
    border-radius: 10px;
  }

  .taiga-message {
    top: 10px;
    width: max-content;
    max-width: calc(100% - 20px);
    white-space: normal;
  }
}
.taiga-cell--start img,
.taiga-cell--finish img {
  transform: rotate(var(--cell-rotation)) !important;
}

/* ===== Игра «Кладовая стойбища» ===== */
.kladovka-page {
  width: min(1120px, calc(100% - 32px));
  margin: 14px auto 42px;
  display: grid;
  gap: 16px;
}

.kladovka-start,
.kladovka-result {
  min-height: calc(100vh - 170px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
  background:
    radial-gradient(circle at 88% 14%, rgba(199, 146, 83, 0.22), transparent 34%),
    radial-gradient(circle at 12% 88%, rgba(105, 139, 112, 0.18), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(251, 244, 230, 0.92));
}

.kladovka-start::before,
.kladovka-shell::before,
.kladovka-result::before {
  background: linear-gradient(90deg, #a96f3c, #e4b56f, #7fa36f, #5faec0);
}

.kladovka-start__icon {
  width: clamp(120px, 21vw, 220px);
  max-height: 230px;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(89, 58, 31, 0.2));
}

.kladovka-start h1,
.kladovka-result h2 {
  margin: 0;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.08;
  color: #7a4a25;
}

.kladovka-start__text,
.kladovka-result__text,
.kladovka-fact {
  max-width: 780px;
  margin: 0;
  color: #574431;
  font-size: clamp(18px, 2.1vw, 22px);
}

.kladovka-shell {
  display: grid;
  gap: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(253, 247, 235, 0.92));
}

.kladovka-hud {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: stretch;
}

.kladovka-hud__item {
  border: 1px solid rgba(151, 103, 58, 0.24);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(252, 238, 211, 0.82));
  padding: 12px 14px;
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 68px;
}

.kladovka-hud__item span {
  color: #72563d;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kladovka-hud__item strong {
  font-family: "Comfortaa", "Onest", sans-serif;
  color: #7a4a25;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1;
}

.kladovka-check {
  align-self: center;
  white-space: nowrap;
}

.kladovka-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 280px);
  gap: 14px;
  align-items: start;
}

.kladovka-field-wrap {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.kladovka-field {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: min(74vh, 720px);
  border-radius: 26px;
  border: 1px solid rgba(151, 103, 58, 0.35);
  background: #e8c894;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 16px 32px rgba(89, 58, 31, 0.16);
  user-select: none;
  touch-action: none;
}

.kladovka-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.kladovka-grid {
  position: absolute;
  z-index: 4;
  left: var(--kladovka-grid-left, 12%);
  top: var(--kladovka-grid-top, 16%);
  width: var(--kladovka-grid-size, 76%);
  height: var(--kladovka-grid-size, 76%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 2.2%;
}

.kladovka-cell {
  position: relative;
  border-radius: 17px;
  border: 1px dashed rgba(103, 72, 43, 0.22);
  background: rgba(255, 248, 227, 0.16);
  transition: background 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.kladovka-cell.is-over {
  background: rgba(255, 239, 179, 0.34);
  border-color: rgba(122, 74, 37, 0.58);
  transform: scale(1.02);
}

.kladovka-cell.is-wrong {
  animation: kladovka-cell-wrong 0.42s ease both;
}

.kladovka-tray {
  min-height: 112px;
  padding: 10px;
  border-radius: 22px;
  border: 1px solid rgba(151, 103, 58, 0.24);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(252, 238, 211, 0.86));
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.kladovka-piece {
  width: var(--kladovka-piece-size, 72px);
  height: var(--kladovka-piece-size, 72px);
  border: 0;
  padding: 7px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 16px rgba(89, 58, 31, 0.14);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.kladovka-piece img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  display: block;
}

.kladovka-piece:active,
.kladovka-piece.is-dragging {
  cursor: grabbing;
  transform: scale(1.06);
  box-shadow: 0 14px 24px rgba(89, 58, 31, 0.2);
}

.kladovka-piece.is-dragging {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  margin: 0;
}

.kladovka-piece.is-placed:not(.is-dragging) {
  position: absolute;
  inset: 5%;
  width: 90%;
  height: 90%;
  padding: 8%;
  border-radius: 16px;
}

.kladovka-piece.is-returning {
  animation: kladovka-piece-return 0.22s ease both;
}

.kladovka-rules {
  position: sticky;
  top: 88px;
  z-index: 25;
  align-self: start;
  opacity: 0.58;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.kladovka-rules:hover,
.kladovka-rules:focus-within {
  opacity: 1;
}

.kladovka-rules.is-collapsed {
  transform: translateX(calc(100% - 48px));
  opacity: 0.42;
}

.kladovka-rules__toggle {
  position: absolute;
  left: -10px;
  top: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(151, 103, 58, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #7a4a25;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: 0;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(89, 58, 31, 0.12);
}

.kladovka-rules__toggle::before {
  content: "?";
  font-size: 22px;
  font-weight: 800;
}

.kladovka-rules__content {
  padding: 18px 18px 18px 24px;
  border-radius: 22px;
  border: 1px solid rgba(151, 103, 58, 0.26);
  background: rgba(255, 250, 240, 0.96);
  box-shadow: 0 14px 28px rgba(89, 58, 31, 0.14);
}

.kladovka-rules.is-collapsed .kladovka-rules__content {
  visibility: hidden;
}

.kladovka-rules h2 {
  margin: 0 0 10px;
  color: #7a4a25;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: 21px;
}

.kladovka-rules ol {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 9px;
  color: #574431;
  font-size: 15px;
  line-height: 1.3;
}

.kladovka-rule {
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(151, 103, 58, 0.14);
}

.kladovka-rule.is-failed {
  background: rgba(255, 224, 216, 0.9);
  border-color: rgba(194, 73, 55, 0.34);
  color: #9a2f22;
}

.kladovka-message {
  position: absolute;
  z-index: 50;
  left: 50%;
  top: 10%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(151, 103, 58, 0.24);
  color: #7a4a25;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-weight: 800;
  font-size: clamp(17px, 2.5vw, 28px);
  box-shadow: 0 12px 24px rgba(89, 58, 31, 0.16);
  pointer-events: none;
  text-align: center;
}

.kladovka-hint {
  margin: 0;
  color: #6d553d;
  font-size: 16px !important;
  text-align: center;
}

.kladovka-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.kladovka-actions--center {
  justify-content: center;
}

.kladovka-fact {
  margin-top: 6px !important;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(151, 103, 58, 0.24);
  background: rgba(253, 247, 235, 0.88);
}

@keyframes kladovka-cell-wrong {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-3px); }
}

@keyframes kladovka-piece-return {
  0% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@media (max-width: 900px) {
  .kladovka-layout {
    grid-template-columns: 1fr;
  }

  .kladovka-rules {
    position: static;
    opacity: 1;
    transform: none !important;
    order: 2;
  }

  .kladovka-rules__toggle {
    display: none;
  }

  .kladovka-rules.is-collapsed .kladovka-rules__content {
    visibility: visible;
  }
}

@media (max-width: 760px) {
  .kladovka-page,
  .footer {
    width: calc(100% - 16px);
  }

  .kladovka-start,
  .kladovka-result {
    min-height: calc(100dvh - 128px);
    align-content: center;
  }

  .kladovka-hud {
    grid-template-columns: 1fr 1fr;
  }

  .kladovka-check {
    grid-column: 1 / -1;
    width: 100%;
  }

  .kladovka-field {
    border-radius: 20px;
  }

  .kladovka-grid {
    left: var(--kladovka-grid-left-mobile, 10%);
    top: var(--kladovka-grid-top-mobile, 15%);
    width: var(--kladovka-grid-size-mobile, 80%);
    height: var(--kladovka-grid-size-mobile, 80%);
    gap: 1.8%;
  }

  .kladovka-cell {
    border-radius: 12px;
  }

  .kladovka-tray {
    min-height: 96px;
    gap: 8px;
  }

  .kladovka-piece {
    width: var(--kladovka-piece-size-mobile, 60px);
    height: var(--kladovka-piece-size-mobile, 60px);
    border-radius: 14px;
  }

  .kladovka-rules__content {
    padding: 16px;
  }

  .kladovka-actions .btn,
  .kladovka-btn {
    width: 100%;
  }
}
/* ===== Игра «Большой улов» ===== */
.farfish-page {
  width: min(1100px, calc(100% - 32px));
  margin: 14px auto 42px;
  display: grid;
  gap: 16px;
}

.farfish-start,
.farfish-result {
  min-height: calc(100vh - 170px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
  background:
    radial-gradient(circle at 85% 12%, rgba(54, 198, 255, 0.22), transparent 34%),
    radial-gradient(circle at 12% 88%, rgba(126, 217, 87, 0.14), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(236, 249, 255, 0.92));
}

.farfish-start::before,
.farfish-shell::before,
.farfish-result::before {
  background: linear-gradient(90deg, #36c6ff, #7ed957, #ffe36b, #2f8ccc);
}

.farfish-start__icon {
  width: clamp(130px, 23vw, 230px);
  max-height: 250px;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(31, 82, 102, 0.22));
}

.farfish-start h1,
.farfish-result h2 {
  margin: 0;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-size: clamp(38px, 5.4vw, 68px);
  line-height: 1.08;
  color: #1d7899;
}

.farfish-start__text,
.farfish-result__text,
.farfish-fact {
  max-width: 780px;
  margin: 0;
  color: #375b63;
  font-size: clamp(18px, 2.1vw, 23px);
}

.farfish-shell {
  display: grid;
  gap: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(235, 250, 255, 0.92));
}

.farfish-hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.farfish-hud__item {
  border: 1px solid rgba(54, 140, 180, 0.24);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(225, 247, 255, 0.88));
  padding: 12px 14px;
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 68px;
}

.farfish-hud__item span {
  color: #55727a;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.farfish-hud__item strong {
  font-family: "Comfortaa", "Onest", sans-serif;
  color: #1d7899;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1;
}

.farfish-field {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 390px;
  border-radius: 26px;
  border: 1px solid rgba(54, 140, 180, 0.32);
  background: #c9f1ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 16px 32px rgba(31, 82, 102, 0.18);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.farfish-field:focus-visible {
  outline: 4px solid rgba(54, 198, 255, 0.42);
  outline-offset: 4px;
}

.farfish-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.farfish-nets,
.farfish-fishes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.farfish-nets {
  z-index: 8;
}

.farfish-fishes {
  z-index: 21;
}

.farfish-net {
  position: absolute;
  top: var(--net-top, 5%);
  left: var(--net-left, 0%);
  width: var(--net-width, 9%);
  height: auto;
  transform: translateX(-50%);
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 10px 12px rgba(19, 55, 70, 0.16));
}

.farfish-net.is-ready {
  animation: farfish-net-ready 0.48s ease both;
}

.farfish-fish {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--fish-width, 7%);
  height: auto;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  transform: translate(0, 0) rotate(0deg);
  filter: drop-shadow(0 8px 10px rgba(19, 55, 70, 0.18));
  will-change: transform;
}

.farfish-player {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: var(--farfish-ground-bottom, 2.5%);
  width: var(--farfish-player-width, 13.5%);
  height: auto;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  transform: translateX(-50%);
  filter: drop-shadow(0 14px 14px rgba(19, 55, 70, 0.22));
  will-change: transform;
}

.farfish-overlay {
  position: absolute;
  z-index: 32;
  left: 50%;
  top: 16%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(54, 140, 180, 0.24);
  color: #1d7899;
  font-family: "Comfortaa", "Onest", sans-serif;
  font-weight: 800;
  font-size: clamp(18px, 3vw, 34px);
  box-shadow: 0 12px 24px rgba(31, 82, 102, 0.16);
  pointer-events: none;
  text-align: center;
}

.farfish-progress {
  height: 13px;
  border-radius: 999px;
  background: rgba(54, 140, 180, 0.14);
  overflow: hidden;
  border: 1px solid rgba(54, 140, 180, 0.22);
}

.farfish-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #36c6ff, #7ed957, #ffe36b);
  transition: width 0.18s linear;
}

.farfish-controls {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.farfish-hint {
  margin: 0;
  color: #55727a;
  font-size: 16px !important;
  text-align: center;
}

.farfish-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.farfish-actions--center {
  justify-content: center;
}

.farfish-fact {
  margin-top: 6px !important;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(54, 140, 180, 0.24);
  background: rgba(235, 250, 255, 0.88);
}

.farfish-result__hero {
  width: clamp(110px, 18vw, 190px);
  max-height: 250px;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(31, 82, 102, 0.22));
}

.farfish-field.is-shake {
  animation: farfish-shake 0.32s ease both;
}

.farfish-field.is-catch .farfish-player {
  animation: farfish-catch-pop 0.28s ease both;
}

@keyframes farfish-net-ready {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(0deg); }
  45% { transform: translateX(-50%) translateY(5px) rotate(-2deg); }
}

@keyframes farfish-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes farfish-catch-pop {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1); }
  50% { transform: translateX(-50%) translateY(-7px) scale(1.04); }
}

@media (max-width: 760px) {
  .farfish-page,
  .footer {
    width: calc(100% - 16px);
  }

  .farfish-start,
  .farfish-result {
    min-height: calc(100dvh - 128px);
    align-content: center;
  }

  .farfish-hud {
    grid-template-columns: 1fr;
  }

  .farfish-field {
    min-height: 300px;
    border-radius: 20px;
  }

  .farfish-net {
    width: var(--net-width-mobile, 15%);
  }

  .farfish-player {
    width: var(--farfish-player-width-mobile, 19%);
  }

  .farfish-fish {
    width: var(--fish-width-mobile, 14%);
  }

  .farfish-overlay {
    top: 12%;
    max-width: calc(100% - 24px);
  }

  .farfish-controls {
    display: grid;
  }

  .farfish-actions .btn,
  .farfish-btn,
  .farfish-control {
    width: 100%;
  }
}


/* ===== Общий попап «Как играть» ===== */
.game-modal-open {
  overflow: hidden;
}

.game-help-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.game-help-modal[hidden] {
  display: none;
}

.game-help-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 42, 52, 0.5);
  backdrop-filter: blur(5px);
}

.game-help-modal__window {
  position: relative;
  z-index: 1;
  width: min(580px, 100%);
  max-height: min(680px, calc(100dvh - 40px));
  overflow: auto;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(245, 252, 255, 0.96));
  border: 1px solid rgba(54, 140, 180, 0.22);
  box-shadow: 0 24px 60px rgba(31, 82, 102, 0.28);
  text-align: left;
}

.game-help-modal__window h2 {
  margin: 0 44px 14px 0;
  font-family: "Comfortaa", "Onest", sans-serif;
  color: #1d7899;
  font-size: clamp(28px, 4vw, 42px);
}

.game-help-modal__content {
  color: #375b63;
  font-size: 17px;
  line-height: 1.55;
}

.game-help-modal__content p {
  margin: 0 0 12px;
}

.game-help-modal__content ul {
  margin: 0 0 18px;
  padding-left: 22px;
}

.game-help-modal__content li + li {
  margin-top: 6px;
}

.game-help-modal__close {
  position: absolute;
  right: 18px;
  top: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(54, 140, 180, 0.12);
  color: #1d7899;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.game-help-modal__close:hover {
  background: rgba(54, 140, 180, 0.22);
}

.game-help-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .game-help-modal {
    padding: 12px;
  }

  .game-help-modal__window {
    padding: 24px 20px;
    border-radius: 22px;
  }

  .game-help-actions .btn {
    width: 100%;
  }
}