.logo {
  width: min(220px, 100%);
  margin: 0 auto 12px;
  filter: drop-shadow(0 8px 8px rgba(73, 45, 20, 0.25));
}

.screen-v2 .logo {
  width: min(240px, 100%);
  margin: 0;
}

.top-menu-trigger {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  padding: 0;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: grid;
  place-items: center;
  transition: transform 140ms ease, filter 140ms ease;
}

.top-menu-trigger:hover {
  transform: translateY(calc(-50% - 2px)) scale(1.03);
  filter: brightness(1.05);
}

.top-menu-trigger:active,
.top-menu-trigger[aria-expanded="true"] {
  transform: translateY(-50%) scale(0.97);
  filter: brightness(0.96);
}

.top-menu-trigger img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.top-noads-button {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  padding: 0;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: grid;
  place-items: center;
  transition: transform 180ms ease, filter 180ms ease, opacity 180ms ease;
}

/* Атрибут [hidden] сам по себе не перебивает author display:grid — кнопка оставалась видимой и «мёртвой» при uiState.noAds */
.top-noads-button[hidden] {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

.top-noads-button:hover {
  transform: translateY(calc(-50% - 2px)) scale(1.03);
  filter: brightness(1.08);
}

.top-noads-button:active {
  transform: translateY(-50%) scale(0.97);
  filter: brightness(0.95);
}

.top-noads-button:disabled {
  opacity: 0.72;
  filter: grayscale(0.35);
}

.top-noads-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.top-noads-button.is-attention-blink {
  animation: noads-blink 820ms ease-in-out infinite;
}

@keyframes noads-blink {
  0% {
    transform: translateY(-50%) scale(1);
    filter: brightness(1);
  }
  35% {
    transform: translateY(-50%) scale(1.08) rotate(-4deg);
    filter: brightness(1.16);
  }
  65% {
    transform: translateY(-50%) scale(1.03) rotate(4deg);
    filter: brightness(1.1);
  }
  100% {
    transform: translateY(-50%) scale(1);
    filter: brightness(1);
  }
}

.card {
  border: 3px solid rgba(140, 88, 45, 0.36);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 8px 0 rgba(93, 57, 27, 0.12), 0 14px 30px rgba(80, 58, 38, 0.16);
  backdrop-filter: blur(3px);
}

.score-chip {
  position: relative;
  z-index: 5;
  min-width: 210px;
  min-height: 64px;
  padding: 8px 22px 12px;
  margin: 0 0 -18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background-image: url("../../assets/sprites/ui/wood_background.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 5px 8px rgba(63, 39, 21, 0.3));
}

.score-chip .label {
  font-size: calc(13px * var(--ui-text-scale));
  font-weight: 900;
  text-transform: uppercase;
  color: #f9f2dc;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 0 rgba(77, 46, 24, 0.5);
}

.score-chip .value {
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: calc(clamp(24px, 4vw, 32px) * var(--ui-text-scale));
  font-weight: 700;
  color: #fff7e5;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(77, 46, 24, 0.55);
}

.top-menu-button {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  transition: transform 140ms ease, filter 140ms ease;
}

.top-menu-button:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.05);
}

.top-menu-button:active {
  transform: translateY(0) scale(0.97);
  filter: brightness(0.95);
}

.top-menu-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.icon-button,
.new-game-button,
.overlay-button {
  border: 3px solid rgba(130, 79, 38, 0.32);
  border-radius: 13px;
  background: #fff4dc;
  box-shadow: 0 6px 0 rgba(104, 62, 30, 0.16);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.icon-button:hover,
.new-game-button:hover,
.overlay-button:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 0 rgba(104, 62, 30, 0.16), 0 12px 22px rgba(83, 50, 23, 0.16);
}

.icon-button.is-off {
  filter: grayscale(0.95);
  opacity: 0.62;
}

.icon-button {
  height: 54px;
  display: grid;
  place-items: center;
}

.icon-button img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.settings-grid .icon-button {
  min-height: 56px;
}

.settings-grid .icon-button img {
  width: 30px;
  height: 30px;
}

.language-block {
  margin: 0 0 12px;
}

.language-title {
  margin: 0 0 8px;
  color: #6a482a;
  font-weight: 800;
  font-size: calc(16px * var(--ui-text-scale));
  text-align: left;
}

.language-radio-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.language-radio {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 2px solid rgba(130, 79, 38, 0.32);
  border-radius: 12px;
  background: #fff4dc;
  box-shadow: 0 5px 0 rgba(104, 62, 30, 0.12);
  font-weight: 800;
  font-size: calc(16px * var(--ui-text-scale));
  color: #7b4b24;
  cursor: pointer;
}

.language-radio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.language-radio input:checked + span {
  color: #5c3518;
}

.language-radio:has(input:checked) {
  transform: translateY(-1px);
  border-color: rgba(130, 79, 38, 0.68);
  box-shadow: 0 6px 0 rgba(104, 62, 30, 0.16), 0 10px 18px rgba(83, 50, 23, 0.12);
}

.language-radio:has(input:focus-visible) {
  outline: 2px solid rgba(73, 117, 215, 0.7);
  outline-offset: 2px;
}

.modal-list {
  margin: 0 0 14px;
  padding: 0 0 0 18px;
  text-align: left;
  color: #6a482a;
  font-weight: 700;
  line-height: 1.4;
  font-size: calc(16px * var(--ui-text-scale));
}

.modal-list li + li {
  margin-top: 6px;
}

.arrows {
  display: grid;
  grid-template-columns: repeat(3, 34px);
  grid-template-rows: repeat(2, 34px);
  justify-content: center;
  gap: 6px;
  margin: 20px 0 14px;
}

.arrow-key {
  display: grid;
  place-items: center;
  border: 2px solid rgba(139, 82, 38, 0.35);
  border-radius: 8px;
  background: #fff3db;
  font-weight: 900;
  font-size: calc(16px * var(--ui-text-scale));
  color: #7b4b24;
  box-shadow: inset 0 -2px rgba(130, 80, 35, 0.12);
}

.arrow-key.up {
  grid-column: 2;
}

.arrow-key.left {
  grid-column: 1;
  grid-row: 2;
}

.arrow-key.down {
  grid-column: 2;
  grid-row: 2;
}

.arrow-key.right {
  grid-column: 3;
  grid-row: 2;
}

.evolution-item {
  min-width: 0;
  text-align: center;
  color: #fff5d6;
  font-weight: 900;
  font-size: calc(12px * var(--ui-text-scale));
  position: relative;
}

.evolution-item:not(:last-child)::after {
  content: "›";
  position: absolute;
  right: -7px;
  top: 19px;
  color: rgba(255, 245, 214, 0.55);
  font-size: calc(18px * var(--ui-text-scale));
}

.evolution-item img {
  display: block;
  width: min(48px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  margin: 0 auto 4px;
  filter: drop-shadow(0 5px 3px rgba(0, 0, 0, 0.18));
}

.evolution-item.is-locked {
  opacity: 0.42;
}

.toast {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 35;
  padding: 10px 18px;
  border-radius: 20px;
  background: rgba(255, 248, 231, 0.97);
  color: var(--dark-brown);
  box-shadow: 0 12px 26px rgba(67, 43, 23, 0.24);
  font-weight: 900;
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  transition: transform 240ms ease, opacity 240ms ease;
  pointer-events: none;
  text-align: center;
  min-width: 210px;
}

.toast.is-visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.toast.is-reward {
  min-width: 260px;
  max-width: min(82%, 320px);
  padding: 14px 16px 16px;
}

.toast-title {
  font-size: calc(16px * var(--ui-text-scale));
  letter-spacing: 0.01em;
}

.toast-animal {
  width: 68px;
  height: 68px;
  display: block;
  margin: 8px auto 6px;
  object-fit: contain;
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.2));
}

.toast-name {
  font-size: calc(18px * var(--ui-text-scale));
  color: #6d431d;
}

.toast-bonus {
  margin-top: 4px;
  font-size: calc(15px * var(--ui-text-scale));
  color: #935315;
}

.overlay-leaderboard {
  margin-top: 8px;
  font-size: calc(13px * var(--ui-text-scale));
  font-weight: 700;
  color: #6b4322;
  text-align: center;
}
