@keyframes squiggly {
  0% {
    filter: url("#squiggly-0");
  }
  25% {
    filter: url("#squiggly-1");
  }
  50% {
    filter: url("#squiggly-3");
  }
  100% {
    filter: url("#squiggly-4");
  }
}
:root {
  /* Один полупрозрачный слой для меню, настроек, итога и таблицы — без наслоения разных opacity */
  --frog-screen-overlay: rgba(255, 255, 255, 0.5);
}
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
  color: #000;
  font-size: 2.5vh;
}
body {
  font-family: Arial, "Roboto", "Noto Sans", "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body.dark {
  color: #fff;
}
.app-main {
  position: relative;
  z-index: 0;
}
/* Экраны внутри main; .player у body — иначе z-index экранов не перекрывает лягушку */
body.frog-behind-ui .app-main {
  z-index: 11000;
}
.card {
  overflow: hidden;
  max-width: 100%;
  width: 100%;
  padding: 1em;
  margin: 0 auto 1em;
  box-sizing: border-box;
  background: #fff;
  color: #000;
  border: 1px solid #000;
  border-radius: 0.25em;
}
.screen:not(.game) .card {
  background: #fff;
  color: #000;
}
.screen.settings.is-active .card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
}
.screen.settings.is-active .settings-inline-options {
  display: flex;
  justify-content: space-evenly;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5em;
  width: 100%;
}
.screen.settings.is-active .settings-inline-options .checkbox {
  flex: 0 1 auto;
}
.settings-section-title {
  margin: 0 0 0.35em;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.95em;
  text-align: center;
  color: #000;
}
/* Меньше заголовка h2.settings-section-title (0.95em), но крупнее прежнего описания */
.settings-section-desc {
  margin: 0 0 1em;
  font-size: 0.85em;
  font-weight: normal;
  text-transform: none;
  text-align: left;
  line-height: 1.45;
  color: #000;
}
.screen:not(.game) .btn,
.screen:not(.game) .checkbox span,
.confirm-actions .frog-interactive,
.leaderboard-more-btn,
.nickname-modal .nickname-modal-btn {
  font-size: 0.9em;
}
button.btn {
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
}
.btn {
  display: block;
  margin: 0 auto 0.5em;
  padding: 1em;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  font-weight: bold;
  letter-spacing: 1px;
  text-decoration: none !important;
  text-transform: uppercase;
  text-shadow: none !important;
  background: #fff;
  transition: all 0.2s;
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  color: #000;
}
.checkbox {
  display: inline-block;
  font-weight: bold;
  text-transform: uppercase;
}
.checkbox input {
  display: none;
}
.checkbox span {
  display: block;
  padding: 1em;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 4px;
  color: #000;
  cursor: pointer;
}
.checkbox input:checked + span {
  border-color: #000;
}
/* Единый ховер/нажатие; выбранный чип — зелёный всегда, не только при :hover */
.frog-interactive {
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.frog-interactive:hover,
.frog-interactive:active {
  background: #a3b89a;
  border-color: rgba(0, 0, 0, 0.42);
  color: #000;
}
.checkbox input:checked + span.frog-interactive {
  background: #8fa886 !important;
  border-color: #000 !important;
  color: #000 !important;
}
.checkbox input:checked + span.frog-interactive:hover,
.checkbox input:checked + span.frog-interactive:active {
  background: #7d9675 !important;
  border-color: #000 !important;
  color: #000 !important;
}
.nickname-modal-btn.frog-interactive:hover,
.nickname-modal-btn.frog-interactive:active {
  background: #a3b89a;
  border-color: rgba(0, 0, 0, 0.55);
  color: #000;
}
.dark .nickname-modal-btn.frog-interactive:hover,
.dark .nickname-modal-btn.frog-interactive:active {
  border-color: rgba(255, 255, 255, 0.65);
  color: #000;
}
.screen:not(.game) .btn--compact {
  display: inline-block;
  width: auto;
  min-width: 10em;
  max-width: calc(100% - 1rem);
  margin-left: auto;
  margin-right: auto;
  padding: 1em 1.25em;
}
.screen:not(.game) .leaderboard-more-btn.btn--compact {
  display: inline-block;
}
.leaderboard-hint-example {
  margin-top: 1em;
  text-align: center;
}
.leaderboard-hint-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
}
.leaderboard-hint-stack--row {
  flex-direction: row;
  justify-content: space-evenly;
  align-items: flex-start;
  align-content: flex-start;
  flex-wrap: nowrap;
  width: 100%;
  box-sizing: border-box;
  gap: 0.2rem;
  padding: 0 0.15em;
}
.leaderboard-hint-seg {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.85em;
  font-weight: normal;
  text-transform: none;
  line-height: 1.45;
  color: #000;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leaderboard-hint-seg.leaderboard-hint-cup {
  flex: 0 0 1.75rem;
  font-size: 1.05em;
  line-height: 1;
}
.leaderboard-hint-line {
  font-size: 0.8em;
  color: #000;
}
.leaderboard-hint-line--outline {
  font-weight: 700;
  -webkit-text-stroke: 0.35px #000;
  text-shadow: 0 0 0.5px #000, 0 0 1px rgba(0, 0, 0, 0.35);
}
.leaderboard-hint-cup {
  font-size: 1.2em;
  line-height: 1;
}
.menu-text-link {
  color: #000;
  font-weight: bold;
  text-decoration: none;
}
.menu-text-link:hover,
.menu-text-link:focus {
  opacity: 0.85;
}
.play .text {
  font-size: 2em;
}
.scoreboard .scoreboard-list {
  display: inline-block;
  padding: 0;
  margin: 0;
  text-align: right;
}
.scoreboard .scoreboard-list a {
  color: inherit;
  text-decoration: underline;
  font-weight: bold;
}
.dark .scoreboard .scoreboard-list a {
  color: #8ec5ff;
}

.is-hidden {
  display: none !important;
}

.leaderboard-card {
  text-align: center;
  max-width: 100%;
}
.leaderboard-board {
  width: 100%;
  text-align: center;
  color: #000;
  background: #fff;
}
.leaderboard-board__header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom: 2px solid #000;
}
.leaderboard-board__row {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45em 0.2em;
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
/* Как у h2.settings-section-title: размер и начертание заголовков колонок */
.leaderboard-board__row--head {
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.95em;
  padding: 0.55em 0.2em;
  border-bottom: none;
  text-align: center;
  color: #000;
}
.leaderboard-board__row--head .leaderboard-board__cell {
  font-size: inherit;
  font-weight: inherit;
  text-transform: inherit;
  line-height: 1.2;
}
.leaderboard-board__cell {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-size: 0.85em;
  font-weight: normal;
  text-transform: none;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leaderboard-board__cell--cup {
  flex: 0 0 2rem;
}
.leaderboard-board--win {
  margin-top: 0.6em;
}
.leaderboard-scroll--win {
  max-height: 14.5em;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.leaderboard-board--win .leaderboard-board__cell {
  flex: 1 1 33.33%;
}
.leaderboard-board--win .leaderboard-board__cell--nick {
  text-align: center;
}
.leaderboard-inline-cup {
  display: inline-block;
  margin-left: 0.35em;
}
.leaderboard-board__row--top3 {
  font-weight: 700;
}
.leaderboard-board__row--top3 .leaderboard-board__cell--rank,
.leaderboard-board__row--top3 .leaderboard-board__cell--result,
.leaderboard-board__row--top3 .leaderboard-board__cell--nick {
  -webkit-text-stroke: 0.3px #000;
  text-shadow: 0 0 0.5px #000;
}
.leaderboard-board__row--empty .leaderboard-board__cell {
  flex: 1 1 100%;
  white-space: normal;
}
.leaderboard-board__error {
  padding: 0.5em 0.35em;
  font-size: 0.75em;
  color: #a00;
  background: #fff5f5;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.leaderboard-board__body .leaderboard-board__row {
  font-size: inherit;
}
.leaderboard-scroll {
  width: 100%;
  margin-bottom: 0.5em;
  -webkit-overflow-scrolling: touch;
}
.leaderboard-scroll.leaderboard-scroll--expanded {
  max-height: min(58vh, 22rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 6px;
}
.leaderboard-cup {
  display: inline-block;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.25));
  font-size: 1.1em;
  line-height: 1;
}
.leaderboard-cup--gold {
  filter: drop-shadow(0 0 2px #b8860b) sepia(0.35) saturate(2);
}
.leaderboard-cup--silver {
  filter: grayscale(0.25) brightness(1.05);
  opacity: 0.95;
}
.leaderboard-cup--bronze {
  filter: sepia(0.5) hue-rotate(-15deg) saturate(1.3);
}
.leaderboard-board a {
  color: #000;
  font-weight: bold;
  text-decoration: none;
}
.leaderboard-more-btn {
  margin: 0.65em auto 0.5em;
  box-sizing: border-box;
  padding: 1em 1.25em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  color: #000;
}

.nickname-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 25000;
  background: rgba(0, 0, 0, 0.65);
  align-items: center;
  justify-content: center;
  padding: 1em;
}
.nickname-modal.is-active {
  display: flex;
}
.nickname-modal-box {
  background: #fff;
  color: #000;
  max-width: 22em;
  padding: 1.25em;
  border-radius: 10px;
  border: 2px solid #000;
  text-align: center;
}
.dark .nickname-modal-box {
  background: #1a1a2e;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}
.nickname-modal-title {
  margin: 0 0 0.5em;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 1em;
}
.nickname-modal-desc {
  margin: 0 0 1em;
  font-size: 0.8em;
  line-height: 1.35;
  text-align: left;
}
.nickname-modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75em;
  margin-bottom: 1em;
  font-size: 1em;
  border: 1px solid #000;
  border-radius: 6px;
  text-transform: none;
}
.nickname-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}
.nickname-modal-btn {
  padding: 0.75em 1em;
  font-weight: bold;
  text-transform: uppercase;
  border: 1px solid #000;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.nickname-modal-btn--secondary {
  background: #eee;
  font-weight: normal;
}
.dark .nickname-modal-btn {
  background: #2a2a40;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}
.dark .nickname-modal-btn--secondary {
  background: #3a3a55;
}
.game .hud {
  padding: 0 1rem;
  font-size: 1.5rem;
  letter-spacing: 1px;
}
.dark .game .hud {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), 0 -1px 0 rgba(0, 0, 0, 0.1), 1px 0 0 rgba(0, 0, 0, 0.1), -1px 0 0 rgba(0, 0, 0, 0.1), 1px 1px 0 rgba(0, 0, 0, 0.1), -1px -1px 0 rgba(0, 0, 0, 0.1), -1px 1px 0 rgba(0, 0, 0, 0.1), 1px -1px 0 rgba(0, 0, 0, 0.1);
}
.game .hud .label {
  display: block;
  font-size: 0.6em;
  font-weight: normal;
  text-transform: uppercase;
}
.game .hud .value {
  font-size: 2em;
  font-weight: bold;
  line-height: 1;
}
.game .time {
  float: left;
}
.game .score {
  float: right;
}
.dark .win {
  text-shadow: 0 1px 0 black, 0 -1px 0 black, 1px 0 0 black, -1px 0 0 black, 1px 1px 0 black, -1px -1px 0 black, -1px 1px 0 black, 1px -1px 0 black;
}
.win .score {
  float: left;
}
.win .best {
  float: right;
}
.win .label {
  display: block;
  font-size: 0.6em;
  font-weight: normal;
  text-transform: uppercase;
}
.win .value {
  font-size: 2em;
  font-weight: bold;
  line-height: 1;
}
.win .highscore {
  display: block;
  clear: both;
}
.win .highscore.is-hidden {
  display: none;
}
.screen {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 5%;
  right: 5%;
  width: auto;
  bottom: 0;
  height: 100%;
  padding: 1em 0;
  box-sizing: border-box;
  overflow: hidden;
  overflow-y: auto;
  text-align: center;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-1em);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}
.screen.is-active {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
}
.screen.menu.is-active,
.screen.settings.is-active,
.screen.win.is-active,
.screen.scoreboard.is-active {
  z-index: 20000;
  background: var(--frog-screen-overlay);
  color: #000;
}
body.dark .screen.menu.is-active,
body.dark .screen.settings.is-active,
body.dark .screen.win.is-active,
body.dark .screen.scoreboard.is-active {
  background: var(--frog-screen-overlay);
  color: #000;
}
body.dark .screen.menu.is-active h1,
body.dark .screen.settings.is-active h1,
body.dark .screen.win.is-active h1,
body.dark .screen.scoreboard.is-active h1 {
  color: #000;
}
.screen.game {
  left: 0;
  right: 0;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
  padding-top: 1em;
  background: none;
}
.screen.game.is-active {
  z-index: 9000;
}
.screen h1 {
  text-transform: uppercase;
}
.sky {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transition: all 0.5s;
  background: #fff;
  cursor: pointer;
}
.outlines .sky {
  background: #fff;
}
.light .sky {
  background: #aedef7;
}
.dark .sky {
  background: #002;
}
.sky:before {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.0001), #fff);
  opacity: 0.5;
  content: "";
  transition: all 0.2s;
}
.dark .sky:before {
  opacity: 0.3;
}
@keyframes twinkle {
  0% {
    border-left-color: white;
    border-right-color: rgba(255, 255, 255, 0);
  }
  33.3334% {
    border-left-color: rgba(255, 255, 255, 0);
    border-right-color: white;
  }
  66.6667% {
    border-left-color: rgba(255, 255, 255, 0);
    border-right-color: white;
  }
  100% {
    border-left-color: white;
    border-right-color: rgba(255, 255, 255, 0);
  }
}
.stars {
  position: fixed;
  left: 2em;
  right: 2em;
  top: 4em;
  height: 2px;
  transform: rotate(40deg);
  border-width: 0 2px;
  border-style: solid;
  border-color: #fff;
  opacity: 0;
  transform: translateY(-5em);
  transition: all 0.5s;
  will-change: opacity;
  animation: twinkle 6s infinite alternate;
}
.dark .stars {
  opacity: 1;
  transform: translateY(0);
}
.stars:before, .stars:after {
  position: fixed;
  top: 6em;
  left: 2em;
  right: 0em;
  height: inherit;
  border: inherit;
  transform: rotate(-15deg);
  opacity: 0.5;
  content: "";
  will-change: opacity;
}
.stars:before {
  animation: twinkle 3s infinite alternate-reverse;
}
.stars:after {
  top: 0.5em;
  left: 3em;
  right: 6em;
  opacity: 1;
  transform: rotate(-30deg);
  animation: twinkle 6s infinite alternate;
}
.moon {
  position: fixed;
  bottom: 20em;
  left: 50%;
  width: 10em;
  height: 10em;
  background: #fff;
  border-radius: 50%;
  transition: all 0.5s ease-in-out;
  transform: translateY(2em);
  box-shadow: 0 0 4em #fff, 0 0 12em #fff, 0 0 0 6em rgba(211, 230, 235, 0.025), 0 0 0 12em rgba(211, 230, 235, 0.025), 0 0 0 18em rgba(211, 230, 235, 0.025);
  opacity: 0;
}
.moon:before, .moon:after {
  position: absolute;
  top: 20%;
  left: 10%;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 0 1em rgba(0, 0, 0, 0.1);
  content: "";
  opacity: 0.1;
}
.moon:after {
  top: auto;
  left: auto;
  bottom: 10%;
  right: 10%;
  width: 50%;
  height: 50%;
  opacity: 0.1;
}
.dark .moon {
  transform: translateY(0);
  opacity: 1;
}
.mountains {
  opacity: 0.3;
}
.dark .mountains {
  opacity: 0.9;
}
.mountain {
  position: fixed;
  left: -100%;
  bottom: -3em;
  width: 200%;
  height: 14em;
  background: #fff;
  border-radius: 0 100% 0 0;
  transition: all 0.5s ease-in-out;
}
.light .mountain {
  background: #a4c18b;
}
.dark .mountain {
  background: #0a0a2a;
}
.mountain--2 {
  left: auto;
  right: -10%;
  height: 10em;
  border-radius: 100% 0 0 0;
}
.grass {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8em;
  background: #fff;
  transition: all 0.5s ease-in-out;
}
.light .grass {
  background: #a7cc67;
}
.dark .grass {
  background: #0f0f2f;
}
.tree {
  position: absolute;
  z-index: 3;
  right: 38%;
  top: -6.8em;
  width: 1.5em;
  height: 10em;
  transition: all 0.5s;
  background: #fff;
  transform: scale(0.2, 0.2);
  transform-origin: 50% 100%;
}
.light .tree {
  background: #6f4817;
}
.dark .tree {
  background: #0a0a2a;
}
.tree:before, .tree:after {
  position: absolute;
  left: 50%;
  bottom: 2em;
  display: inline-block;
  width: 0;
  transform: translateX(-50%);
  transition: all 0.5s ease-in-out;
  border-width: 0 6em 12em;
  border-style: solid;
  border-color: transparent;
  border-radius: 0 0 100% 100%/0 0 1em 1em;
  border-bottom-color: #fff;
  content: "";
}
.light .tree:before, .light .tree:after {
  border-bottom-color: #2d5e3b;
}
.dark .tree:before, .dark .tree:after {
  border-bottom-color: #0a0a2a;
}
.tree:after {
  width: 0;
  bottom: 9em;
  border-width: 0 3em 6em;
}
.tree--2 {
  left: auto;
  right: 1.5em;
  top: -5.9em;
  transform: scale(0.2, 0.2);
}
.tree--3 {
  top: -5.5em;
  right: 47%;
  transform: scale(0.4, 0.4);
}
.lily {
  @extends .shadow;
  position: fixed;
  z-index: 3;
  left: 50%;
  bottom: 0.5em;
  height: 1.5em;
  width: 12em;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #000;
  border-bottom: 0;
  border-radius: 50% 50% 0 0/100% 100% 0 0;
}
.light .lily {
  background: #777;
}
.dark .lily {
  background: #223;
}
.lily--2 {
  left: -9em;
  bottom: 5em;
  border: none;
  animation-delay: 2s;
  opacity: 0.6;
  transform: scale(0.5, 0.3);
}
.lily--3 {
  right: -7em;
  left: auto;
  bottom: 6em;
  border: none;
  animation-delay: -2s;
  opacity: 0.4;
  transform: scale(0.2, 0.15);
}
.shadow, .player .tongue-inner, .player .eyes .eye, .player .legs .leg, .player .arms .arm, .player .belly, .player .body, .fly:before, .fly:after, .fly {
  box-shadow: none;
}
.flies {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  overflow: hidden;
}
.flies .path {
  flex: 1 1 50%;
  padding: 1em 0;
  text-align: center;
  transition: transform 0.2s;
  will-change: transform;
}
.flies .path:nth-child(odd) {
  transform: translateX(-100%);
}
.flies .path:nth-child(even) {
  transform: translateX(100%);
}
.flies .path.is-active:nth-child(odd) {
  transform: translateX(-20%);
}
.flies .path.is-active:nth-child(even) {
  transform: translateX(20%);
}
.flies .path.is-hidden {
  visibility: hidden;
}
.target {
  display: inline-block;
  width: 4em;
  height: 4em;
  line-height: 4em;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}
.fly {
  z-index: 99;
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  background: #000;
  border: 1px solid #000;
  will-change: transform;
  transform: translateY(50%);
}
.fly:before, .fly:after {
  position: absolute;
  z-index: -1;
  bottom: 50%;
  width: 0.8em;
  height: 0.5em;
  border-radius: 60%;
  background: #fff;
  border: 1px solid #000;
  will-change: transform;
  content: "";
}
.fly:before {
  right: 60%;
  transform: rotate(15deg);
  transform-origin: 100% 50%;
  animation: flapLeft 0.08s infinite;
}
.fly:after {
  left: 60%;
  transform: rotate(-15deg);
  transform-origin: 0% 50%;
  animation: flapRight 0.08s infinite;
}
.fly--dead {
  animation: none;
}

@keyframes fly {
  from {
    transform: translateX(-30em);
  }
  to {
    transform: translateX(30em);
  }
}
@keyframes flapLeft {
  from {
    transform: rotate(-15deg);
  }
  to {
    transform: rotate(25deg);
  }
}
@keyframes flapRight {
  from {
    transform: rotate(25deg);
  }
  to {
    transform: rotate(-15deg);
  }
}
@keyframes float {
  0% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(0.2em);
  }
  100% {
    transform: translateX(-50%) translateY(0);
  }
}
.player {
  z-index: 10000;
  position: absolute;
  left: 50%;
  bottom: 2em;
  display: inline-block;
  font-size: 0.9rem;
  transform: translateX(-50%);
}
.player .body {
  position: relative;
  width: 6.5em;
  height: 9.75em;
  transform: translateY(0);
  transition: all 0.2s;
  background: #fff;
  border-radius: 4em 4em 4em 4em/3em 3em 2em 2em;
  border: 1px solid black;
  will-change: transform;
}
.light .player .body {
  background: #9fb761;
}
.dark .player .body {
  background: #7f9761;
}
.player.is-active .body {
  animation: body 0.25s;
}
.player .belly {
  position: absolute;
  z-index: 1;
  left: 50%;
  height: 50%;
  bottom: -0.5em;
  left: 0.25em;
  right: 0.25em;
  background: #fff;
  border-bottom: 1px solid #000;
  border-radius: 0 0 50% 50%/0 0 1em 1em;
}
.light .player .belly {
  background: #f8efdf;
}
.dark .player .belly {
  background: #f8efdf;
}
.player .crown {
  display: none;
  z-index: -10;
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-bottom: 1px;
  border-width: 2em 1.5em 0;
  border-style: solid;
  border-color: transparent gold gold;
  transform: translateX(-50%);
}
.player .crown:before {
  position: absolute;
  bottom: 0;
  left: -1em;
  border-width: 0 1em 2em;
  border-style: solid;
  border-color: gold transparent;
  content: "";
}
.player .arms {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: -0.5em;
  will-change: transform;
}
.player .arms .arm {
  position: absolute;
  bottom: 0em;
  width: 2.5em;
  height: 4em;
  background: #fff;
  border: 1px solid black;
}
.light .player .arms .arm {
  background: #9fb761;
}
.dark .player .arms .arm {
  background: #7f9761;
}
.player .arms .arm:before {
  position: absolute;
  top: -2.5em;
  width: 1em;
  height: 2.75em;
  background: #fff;
  border: 1px solid black;
  border-bottom: none;
  content: "";
}
.light .player .arms .arm:before {
  background: #9fb761;
}
.dark .player .arms .arm:before {
  background: #7f9761;
}
.player .arms .arm .hand {
  position: absolute;
  bottom: -0.25em;
  width: 2em;
  height: 0.5em;
  font-size: 1.25em;
  background: #fff;
  border: 1px solid black;
  border-radius: 50% 50% 0 0/100% 100% 0 0 !important;
}
.light .player .arms .arm .hand {
  background: #9fb761;
}
.dark .player .arms .arm .hand {
  background: #7f9761;
}
.player .arms .arm .hand .toe {
  position: absolute;
  bottom: -0.25em;
  width: 0.5em;
  height: 0.5em;
  background: #fff;
  border: 1px solid black;
  border-radius: 50%;
}
.light .player .arms .arm .hand .toe {
  background: #9fb761;
}
.dark .player .arms .arm .hand .toe {
  background: #7f9761;
}
.player .arms .arm .hand .toe:first-child {
  left: -0.25em;
}
.player .arms .arm .hand .toe:nth-child(2n) {
  z-index: 2;
  left: 50%;
  transform: translateX(-50%);
}
.player .arms .arm .hand .toe:last-child {
  right: -0.25em;
}
.player .arms .arm--left {
  left: -1em;
  margin-left: -2px;
  border-radius: 0 100% 0 70%;
}
.player .arms .arm--left:before {
  left: -1px;
  border-right: none;
  border-radius: 100% 0 0 0;
}
.player .arms .arm--left .hand {
  left: 0.5em;
  border-left: 0;
  border-radius: 0 100% 0 0;
}
.player .arms .arm--right {
  right: -1em;
  margin-right: -2px;
  border-radius: 100% 0 70% 0;
}
.player .arms .arm--right:before {
  right: -1px;
  border-left: none;
  border-radius: 0 100% 0 0;
}
.player .arms .arm--right .hand {
  right: 0.5em;
  border-right: 0;
  border-radius: 100% 0 0 0;
}
.player.is-active .arms {
  animation: arms 0.25s;
}
.player .legs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.5em;
}
.player .legs .leg {
  position: absolute;
  z-index: -1;
  bottom: 0;
  width: 6em;
  height: 5em;
  transform: rotate(0);
  transform-origin: 50% 100%;
  transition: all 0.2s;
  background: #fff;
  border: 1px solid black;
  will-change: transform;
}
.light .player .legs .leg {
  background: #718644;
}
.dark .player .legs .leg {
  background: #516644;
}
.player .legs .leg--left {
  left: -2.5em;
  border-radius: 25% 75% 25% 75%;
}
.player .legs .leg--right {
  right: -2.5em;
  border-radius: 75% 25% 75% 25%;
}
.player.is-active .leg--left {
  animation: leftLeg 0.25s;
}
.player.is-active .leg--right {
  animation: rightLeg 0.25s;
}
.player .eyes {
  position: absolute;
  z-index: -5;
  top: 0em;
  left: 0em;
  right: 0em;
}
.player .eyes .eye {
  position: absolute;
  top: 0em;
  display: inline-block;
  width: 2.3em;
  height: 2.3em;
  background: #fff;
  border: 1px solid black;
  border-radius: 50%;
  overflow: hidden;
}
.player .eyes .eye--left {
  left: 0em;
}
.player .eyes .eye--right {
  right: 0em;
}
.player .eyes .eye:before, .player .eyes .eye:after {
  position: absolute;
  z-index: 6;
  left: 0;
  width: 100%;
  height: 50%;
  transform: translateY(1px);
  transition: all 0.2s;
  background: #fff;
  border-top: 1px solid #000;
  content: "";
  will-change: transform;
}
.light .player .eyes .eye:before, .light .player .eyes .eye:after {
  background: #718644;
}
.dark .player .eyes .eye:before, .dark .player .eyes .eye:after {
  background: #516644;
}
.player .eyes .eye:before {
  bottom: 100%;
  margin-bottom: 1px;
}
.player .eyes .eye:after {
  top: 100%;
}
.player .eyes .eye:hover:after {
  transform: translateY(-98%);
}
.player .eyes .pupil {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.4rem;
  height: 0.4rem;
  margin: -0.2em 0 0 -0.2em;
  transform: translate(0, 0);
  transition: all 0.2s;
  background: #000;
  border-radius: 4em;
  will-change: transform;
  overflow: hidden;
}
.player .mouth {
  position: absolute;
  z-index: 6;
  top: 3.25em;
  left: 0.5em;
  right: 0.5em;
  height: 2.25em;
  background: #000;
  border-radius: 0;
  border: 1px solid black;
  border-top: 0;
  border-bottom: 0;
}
.player .mouth:before {
  position: absolute;
  top: 1em;
  left: 0.5em;
  right: 0.5em;
  bottom: 0;
  border-radius: 50% 50% 0 0/100% 100% 0 0;
  background: #fff;
  content: "";
}
.light .player .mouth:before {
  background: #c8725b;
}
.dark .player .mouth:before {
  background: #a8525b;
}
.player .mouth .top-lip {
  position: absolute;
  left: -0.25em;
  right: -0.25em;
  bottom: 100%;
  height: 0;
  background: #fff;
  border-bottom: 1px solid #000;
}
.light .player .mouth .top-lip {
  background: #9fb761;
}
.dark .player .mouth .top-lip {
  background: #7f9761;
}
.player .mouth .bottom-lip {
  position: absolute;
  z-index: 10;
  top: -1px;
  left: -0.25em;
  right: -0.25em;
  height: 2.5em;
  margin-left: -1px;
  margin-right: -1px;
  transform: translateY(0);
  transition: all 0.25s;
  background: #fff;
  border-top: 1px solid #000;
  will-change: transform;
  border-radius: 0;
  content: "";
}
.light .player .mouth .bottom-lip {
  background: #f8efdf;
}
.dark .player .mouth .bottom-lip {
  background: #f8efdf;
}
.player .mouth .bottom-lip:after {
  display: none;
  position: absolute;
  top: 0.5em;
  left: 1.5em;
  right: 1.5em;
  height: 0.25em;
  border-bottom: 1px solid #000;
  opacity: 0.1;
  content: "";
}
.player .tongue {
  pointer-events: none;
  position: absolute;
  z-index: 8;
  bottom: 0.5em;
  left: 50%;
  width: 4em;
  height: 0;
  margin-left: -2em;
  overflow: hidden;
  transform: rotate(0);
  transform-origin: 50% 100%;
  will-change: transform;
  border-radius: 4em 4em 4em 4em;
}
.player .tongue-inner {
  position: absolute;
  left: 1.25em;
  right: 1.25em;
  top: 0;
  bottom: 0;
  transform: translateY(100%);
  transition: all 0.1s ease-in-out;
  background: #fff;
  border: 1px solid black;
  border-bottom: 0;
  border-radius: 4em 4em 4em 4em;
  box-sizing: border-box;
  text-align: center;
  content: "";
  will-change: transform;
}
.light .player .tongue-inner {
  background: #c8725b;
}
.dark .player .tongue-inner {
  background: #a8525b;
}
.player .tongue-inner:before {
  position: absolute;
  top: -0.5em;
  left: -0.5em;
  right: -0.5em;
  min-height: 3em;
  max-height: 6em;
  height: 50%;
  background: #fff;
  border-radius: 50%;
  border: 1px solid black;
  border-bottom: none;
}
.light .player .tongue-inner:before {
  background: #c8725b;
}
.dark .player .tongue-inner:before {
  background: #a8525b;
}
.player .tongue .fly {
  visibility: hidden;
  margin-top: -1em;
  font-size: 1.1rem;
}
.player .tongue .fly.is-active {
  animation: dead-fly 0.25s;
}
.player .tongue .fly.is-active2 {
  animation: dead-fly2 0.25s;
}
.player .tongue .fly:before, .player .tongue .fly:after {
  top: 0em;
}
.player.is-shooting-down .eyes {
  z-index: 8;
}
.player.is-shooting-down .mouth {
  z-index: 6;
}
.player.is-shooting-down .tongue {
  z-index: 6;
  bottom: 1.5em;
}
.player.is-shooting-down .top-lip {
  z-index: 8;
  height: 1em;
}
.player.is-active .tongue-inner {
  animation: shoot 0.25s;
}
.player.is-active .mouth .bottom-lip {
  animation: mouth 0.25s;
}
@keyframes dead-fly {
  0% {
    visibility: hidden;
  }
  49% {
    visibility: hidden;
  }
  50% {
    visibility: visible;
  }
  99% {
    visibility: visible;
  }
  100% {
    visibility: hidden;
  }
}
@keyframes dead-fly2 {
  0% {
    visibility: hidden;
  }
  49% {
    visibility: hidden;
  }
  50% {
    visibility: visible;
  }
  99% {
    visibility: visible;
  }
  100% {
    visibility: hidden;
  }
}
@keyframes shoot {
  0% {
    transform: translateY(105%);
  }
  50% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(105%);
  }
}
@keyframes body {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1em);
  }
  100% {
    transform: translateY(0);
  }
}
@keyframes leftLeg {
  0% {
    transform: rotate(0);
  }
  50% {
    transform: rotate(-10deg);
  }
  100% {
    transform: rotate(0);
  }
}
@keyframes rightLeg {
  0% {
    transform: rotate(0);
  }
  50% {
    transform: rotate(10deg);
  }
  100% {
    transform: rotate(0);
  }
}
@keyframes arms {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(1em);
  }
  100% {
    transform: translateY(0);
  }
}
@keyframes mouth {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(1.9em);
  }
  100% {
    transform: translateY(0);
  }
}
.game-menu {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  gap: 10px;
}
.game-menu button {
  background: rgba(255,255,255,0.9);
  border: 1px solid #000;
  padding: 0.5em 1em;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}
.music-toggle {
  position: absolute;
  right: 5%;
  bottom: 10%;
  z-index: 9999;
  background: rgba(255,255,255,0.9);
  border: 1px solid #000;
  padding: 0.6em;
  border-radius: 50%;
  font-size: 1.2em;
  cursor: pointer;
}
.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 25000;
}
.confirm-modal.active {
  display: flex;
}
.confirm-box {
  background: #fff;
  padding: 1.5em;
  border-radius: 10px;
  max-width: 22em;
  text-align: center;
  font-size: 1em;
  border: 2px solid #000;
}
.confirm-actions {
  margin-top: 1em;
  display: flex;
  justify-content: space-around;
  gap: 1em;
}
.confirm-actions button {
  flex: 1;
  padding: 0.6em 1em;
  border: 1px solid #000;
  background: #fff;
  cursor: pointer;
  font-weight: bold;
  border-radius: 6px;
}

/* Мобильные клиенты ВК: safe-area, компактная сетка, без обрезания HUD */
@supports (padding: max(0px)) {
  .screen {
    padding-left: max(1em, env(safe-area-inset-left, 0px));
    padding-right: max(1em, env(safe-area-inset-right, 0px));
    padding-bottom: max(1em, env(safe-area-inset-bottom, 0px));
  }
  .game-menu {
    top: max(10px, env(safe-area-inset-top, 0px));
  }
}

html {
  min-height: 100%;
  min-height: -webkit-fill-available;
}

@media screen and (max-width: 520px), screen and (max-height: 700px) {
  html,
  body {
    font-size: clamp(14px, 2.1vh, 2.5vh);
  }
  .screen.menu h1 {
    font-size: 1.15em;
    line-height: 1.2;
    margin: 0.35em 0;
  }
  .btn {
    padding: 0.75em 1em;
    margin-bottom: 0.4em;
  }
  .play .text {
    font-size: 1.5em;
  }
  .player {
    font-size: 0.72rem;
    bottom: max(0.75em, env(safe-area-inset-bottom, 0px));
    z-index: 10000;
  }
  .flies .path {
    padding: 0.25em 0;
    flex: 1 1 50%;
    min-height: 0;
  }
  .game-menu {
    top: max(8px, env(safe-area-inset-top, 0px));
    left: auto;
    right: max(8px, env(safe-area-inset-right, 0px));
    transform: none;
    gap: 0.45em;
  }
  .game-menu button {
    padding: 0.45em 0.7em;
    font-size: 0.85em;
  }
  .game .hud {
    font-size: 1.05rem;
    padding: 0.35rem 0.75rem 0;
    padding-top: max(4.2rem, calc(env(safe-area-inset-top, 0px) + 2.1rem));
    clear: both;
  }
  .game .hud:after {
    content: "";
    display: table;
    clear: both;
  }
  .music-toggle {
    bottom: max(12%, env(safe-area-inset-bottom, 8px));
    right: max(4%, env(safe-area-inset-right, 0px));
  }
}

/* Android WebView/VK: более плотная компоновка HUD и управляющих кнопок */
@supports (-webkit-touch-callout: none) {
  @media screen and (max-width: 520px) and (max-height: 920px) and (pointer: coarse) {
    .game .hud {
      font-size: 0.98rem;
      letter-spacing: 0.4px;
      padding: 0.25rem 0.6rem 0;
      padding-top: max(4.5rem, calc(env(safe-area-inset-top, 0px) + 2.3rem));
    }
    .game .hud .label {
      font-size: 0.55em;
      line-height: 1.15;
    }
    .game .hud .value {
      font-size: 1.75em;
    }
    .game-menu {
      top: max(6px, env(safe-area-inset-top, 0px));
      right: max(6px, env(safe-area-inset-right, 0px));
      gap: 0.35em;
    }
    .game-menu button {
      padding: 0.35em 0.55em;
      font-size: 0.8em;
    }
    .music-toggle {
      font-size: 1.05em;
      padding: 0.5em;
      right: max(3%, env(safe-area-inset-right, 0px));
      bottom: max(10%, env(safe-area-inset-bottom, 8px));
    }
  }
}
