:root {
  --ink: #164883;
  --sky: #0c91ef;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

body {
  font-family: var(--font);
  background: radial-gradient(ellipse at 50% 40%,#48c8f4,#1264c7 55%,#153f91);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('../img/menu.png') center / cover;
  opacity: .17;
  filter: blur(12px);
  pointer-events: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:focus-visible {
  outline: 4px solid #fff790;
  outline-offset: 3px;
}

button:disabled {
  cursor: default;
  filter: saturate(.35);
  opacity: .7;
}

svg {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.svg-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

#menuIn, .fitwrap {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
}

.menu-art {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  pointer-events: none;
  animation: scene-float 9s ease-in-out infinite;
}
@keyframes scene-float {
  50% { transform: scale(1.025) translateY(-3px); }
}

.menu-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(#0040b025,transparent 38%,transparent 56%,#087fceaa 76%,#0570c1);
  pointer-events: none;
}

.menu-top {
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  display: flex;
  gap: 9px;
  align-items: center;
}

.menu-top > :last-child {
  margin-left: auto;
}

.counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 18px;
  font-weight: 900;
  padding: 5px 11px 5px 6px;
  min-width: 69px;
  height: 38px;
  border: 2px solid #c4f4ff;
  border-radius: 22px;
  background: #0869c1cc;
  box-shadow: 0 3px #06488155,inset 0 2px #ffffff35;
}

.counter svg {
  width: 27px;
  height: 27px;
}

.game-logo {
  position: absolute;
  top: 85px;
  left: 10px;
  right: 10px;
  text-align: center;
  transform: rotate(-3deg);
  pointer-events: none;
}

.game-logo span {
  display: block;
  font-size: 59px;
  line-height: 1;
  font-weight: 1000;
  letter-spacing: -2px;
  color: #ffdd3b;
  -webkit-text-stroke: 2px #fff099;
  text-shadow: 0 5px #ee9116,0 8px #bb5d0d,3px 10px #113f92,-3px 8px #113f92;
}

.game-logo strong {
  display: block;
  font-size: 37px;
  font-weight: 1000;
  line-height: 1.16;
  color: #fff;
  -webkit-text-stroke: 1px #b7f4ff;
  text-shadow: 0 4px #42a4dc,0 7px #154da3,3px 8px #154da3;
}

.game-logo small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.5px;
  margin-top: 13px;
  font-weight: 800;
  text-shadow: 0 1px 4px #0059b9;
}

.menu-bottom {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: 354px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 10px 14px;
  font-weight: 900;
  font-size: 17px;
  line-height: 1.12;
  border-radius: 18px;
  border: 3px solid #ffffffaa;
  background: linear-gradient(#6cd2ff,#218feb);
  box-shadow: inset 0 3px #ffffff65,0 5px #0960b9,0 8px 12px #07458133;
  text-shadow: 0 2px #115a9c88;
  transition: transform .12s, filter .12s;
}

.btn::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 10px;
  right: 10px;
  height: 35%;
  border-radius: 14px 14px 30px 30px;
  background: linear-gradient(#ffffff30,transparent);
  pointer-events: none;
}

.btn:active, .icon-btn:active, .close-btn:active {
  transform: translateY(3px);
}

.btn:hover {
  filter: brightness(1.06);
}

.btn small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  margin-top: 4px;
  opacity: .94;
}

.green, .play-btn {
  background: linear-gradient(#c7f66c,#80ce2e);
  box-shadow: inset 0 3px #efffa4,0 5px #478e13,0 8px 14px #0d507a44;
  border-color: #ecffb0;
  color: #285b13;
  text-shadow: 0 1px #e5ffb3;
}

.play-btn {
  min-height: 73px;
  font-size: 29px;
  border-radius: 23px;
  letter-spacing: 1px;
}

.play-btn svg {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 2px 1px #40822055);
}

.play-btn small {
  font-size: 11px;
  letter-spacing: .2px;
}

.blue {
  background: linear-gradient(#65d5ff,#268ce9);
  box-shadow: inset 0 3px #b1edff,0 5px #0e5bb4;
}

.pink {
  background: linear-gradient(#ff96c7,#ed4e91);
  box-shadow: inset 0 3px #ffd2e7,0 5px #ac296a;
}

.orange {
  background: linear-gradient(#ffd775,#f99d2a);
  box-shadow: inset 0 3px #fff0b7,0 5px #c66a11;
  color: #70400d;
  text-shadow: 0 1px #ffe7b6;
}

.purple {
  background: linear-gradient(#b6a0ff,#8760dc);
  box-shadow: inset 0 3px #e2d9ff,0 5px #5736ac;
}

.menu-row {
  display: flex;
  gap: 9px;
}

.menu-row .btn {
  flex: 1;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  padding: 8px 3px;
  border-radius: 16px;
  min-height: 69px;
}

.menu-row.secondary {
  margin-top: 1px;
}

.menu-row.secondary .btn {
  flex-direction: row;
  min-height: 45px;
  font-size: 14px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 15px;
  border: 2px solid #c9f1ff;
  background: linear-gradient(#41b8fa,#1780cf);
  box-shadow: inset 0 2px #ffffff77,0 4px #0b5097;
}

.sound-button.muted {
  filter: grayscale(.8);
}

#guest-banner {
  font-size: 9px;
  text-align: center;
  color: #d4f4ff;
  line-height: 1.2;
  padding-top: 4px;
}

.page-wrap {
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 40%,#55dcec,#1388df 70%,#1665bd);
}

.page-header, .game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 18px 12px;
}

.page-header > div, .game-header > div {
  flex: 1;
  text-align: center;
}

h1 {
  margin: 4px 0;
  font-size: 23px;
  font-weight: 900;
  text-shadow: 0 3px #15599b77;
}

.page-header small, .game-header small {
  font-size: 8px;
  letter-spacing: 1.3px;
  font-weight: 800;
}

.page-note {
  padding: 0 24px;
  margin: 15px 0 20px;
  text-align: center;
  font-size: 11px;
}

.scroller {
  overflow-y: auto;
  scrollbar-width: none;
}

.scroller::-webkit-scrollbar {
  display: none;
}

.scroller.x {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

#map-list {
  flex: 1;
  min-height: 0;
  padding: 0 20px 20px;
}

.world-section {
  position: relative;
  padding: 15px 14px 18px;
  margin: 12px 0 22px;
  border-radius: 28px;
  border: 3px solid #ffffff77;
  background: linear-gradient(145deg,var(--world-light),var(--world-dark));
  box-shadow: inset 0 2px #ffffff88,0 7px #12589855;
}

.world-section.locked {
  filter: saturate(.5);
}

.world-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 9px;
}

.world-title h2 {
  margin: 0;
  font-size: 19px;
  text-shadow: 0 2px #15569366;
}

.world-title small {
  font-size: 10px;
}

.world-description {
  font-size: 10px;
  margin-bottom: 16px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 14px 10px;
}

.level-button {
  position: relative;
  height: 63px;
  border-radius: 19px;
  background: linear-gradient(#fcffff,#b9eaff);
  border: 3px solid #fff;
  color: #176ca6;
  box-shadow: 0 5px #2185b6, inset 0 -3px #83c9e5;
  font-size: 22px;
  font-weight: 1000;
  padding: 4px 0 13px;
}

.level-button.current {
  background: linear-gradient(#f9ffbb,#bbef51);
  color: #458d17;
  box-shadow: 0 5px #6eab24;
}

.level-button.locked {
  background: #ffffff28;
  border-color: #ffffff33;
  box-shadow: 0 4px #16569b33;
  color: #ffffff88;
}

.level-stars {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.level-stars svg {
  width: 14px;
  height: 14px;
}

.level-stars svg.empty {
  opacity: .2;
}

#game-canvas {
  position: absolute;
  inset: 0;
  touch-action: none;
}

.game-shell {
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.game-shell button {
  pointer-events: auto;
}

.game-header {
  padding-top: 20px;
}

.game-header h1 {
  font-size: 24px;
}

.mission {
  width: 310px;
  margin: 9px auto 0;
  background: #055a9c66;
  border: 2px solid #adf0ff66;
  border-radius: 18px;
  padding: 8px 12px;
}

.mission > div:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
}

.mission svg {
  width: 20px;
  height: 20px;
}

.mission b {
  margin-left: auto;
}

.mission-track {
  height: 8px;
  background: #00467888;
  border-radius: 8px;
  margin-top: 6px;
  overflow: hidden;
}

#mission-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(#f6ff9c,#b3ee4c);
  transition: width .25s;
}

.game-bottom {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 348px;
  transform: translateX(-50%);
  text-align: center;
}

#game-instruction {
  font-weight: 800;
  font-size: 12px;
  margin: 0 0 15px;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  text-shadow: 0 2px #005d99;
}

.game-tools {
  display: flex;
  gap: 12px;
}

.game-tools .btn {
  flex: 1;
  font-size: 14px;
  min-height: 60px;
}

.game-tools .btn svg {
  width: 32px;
  height: 32px;
}

#game-stars-rule {
  margin: 13px 0 0;
  font-size: 9px;
  color: #dcf9ff;
}

.overlay {
  overflow: hidden;
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  background: #073779b8;
  backdrop-filter: blur(6px);
}

.overlay.show {
  display: flex;
}

.panel {
  position: relative;
  width: 356px;
  padding: 25px 22px 22px;
  border: 4px solid #d8f8ff;
  border-radius: 30px;
  background: linear-gradient(#e6fbff,#bbeeff);
  box-shadow: 0 10px #2073bc,0 20px 60px #00295866,inset 0 2px #fff;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  animation: panel-pop .25s ease-out;
}

.panel h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 1000;
  color: #176fb2;
  text-shadow: 0 2px #fff;
}

.panel p {
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
}

.panel-kicker {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.4px;
  color: #478fb9;
  padding-right: 8px;
}

.close-btn {
  position: absolute;
  right: 9px;
  top: 9px;
  width: 40px;
  height: 40px;
  background: linear-gradient(#ffadbd,#eb647c);
  border: 2px solid #fff;
  border-radius: 13px;
  box-shadow: 0 3px #b73564;
  font-size: 30px;
  line-height: 1;
  z-index: 1;
}

.panel-illustration {
  align-self: center;
  width: 105px;
  height: 105px;
  border-radius: 28px;
  background: linear-gradient(#76d9ff,#198ddd);
  box-shadow: inset 0 3px #cff3ff,0 7px #1670b8;
  display: grid;
  place-items: center;
  transform: rotate(-7deg);
  margin: 5px;
}

.panel-illustration svg {
  width: 67px;
  height: 67px;
}

.two-buttons {
  display: flex;
  gap: 12px;
}

.two-buttons .btn {
  flex: 1;
  font-size: 15px;
}

.text-btn {
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 5px;
  min-height: 40px;
  color: #3578a4;
  text-decoration: underline;
}

.danger {
  color: #b2436f;
}

.result-panel {
  gap: 11px;
}

.result-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
}

.result-stars svg {
  width: 53px;
  height: 53px;
  filter: drop-shadow(0 3px 0 #cb801755);
}

.result-stars svg:nth-child(2) {
  width: 65px;
  height: 65px;
  margin-top: -9px;
}

.result-stars svg.empty {
  opacity: .25;
  filter: grayscale(1);
}

#result-animal {
  width: 102px;
  height: 102px;
  object-fit: contain;
  align-self: center;
  animation: happy-hop 1.6s ease-in-out infinite;
}

.result-rewards {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.result-rewards span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 19px;
}

#result-record {
  font-size: 10px;
  color: #5b8cb1;
}

#lb-list {
  max-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border-radius: 14px;
  background: #ffffff77;
  border: 2px solid #c7e9f7;
  font-size: 12px;
}

.lb-medal {
  width: 22px;
  flex-shrink: 0;
  font-weight: 900;
}

.lb-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #76d0f1;
  flex-shrink: 0;
}

.lb-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-score {
  flex-shrink: 0;
  font-weight: 900;
}

.top-1 {
  background: #fff0a4;
  border-color: #f4cd63;
}

.top-2 {
  background: #eef7ff;
  border-color: #b3d0e4;
}

.top-3 {
  background: #ffe0b8;
  border-color: #edbb89;
}

.me {
  outline: 2px solid #54b822;
}

.lb-empty {
  padding: 30px 10px;
  font-size: 13px;
}

.shop-panel {
  width: 370px;
}

.shop-caption {
  padding: 0 15px;
}

.shop-balance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 22px;
}

#shop-list {
  height: 320px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 2px 4px 8px;
}

.animal-card {
  position: relative;
  border-radius: 19px;
  padding: 9px 6px 12px;
  border: 3px solid #fff;
  background: linear-gradient(#f7ffff,#94d6f2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #246396;
  box-shadow: 0 3px #3188b74a;
}

.animal-card.selected {
  border-color: #8dcc35;
  background: linear-gradient(#f9ffe3,#d3efa6);
}

.animal-card img {
  width: 92px;
  height: 86px;
  pointer-events: none;
}

.animal-card strong {
  font-size: 13px;
}

.animal-card small {
  font-size: 10px;
}

.animal-card .animal-cost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 28px;
  font-size: 11px;
  font-weight: 900;
}

.animal-cost svg {
  width: 20px;
  height: 20px;
}

.setting-row {
  min-height: 50px;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #fff9;
  border-radius: 15px;
  font-size: 15px;
  font-weight: 800;
}

.setting-row b {
  color: #318c33;
}

.settings-version {
  font-size: 9px;
  color: #5992b7;
}

#help-list {
  max-height: 300px;
  text-align: left;
}

.help-row {
  padding: 13px 8px;
  border-bottom: 1px solid #9bcee3;
  display: flex;
  gap: 12px;
  align-items: center;
}

.help-row img {
  width: 61px;
  height: 61px;
  flex-shrink: 0;
}

.help-row .help-badge {
  width: 55px;
  height: 55px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 16px;
  background: #3aa4df;
  font-size: 26px;
  font-weight: 900;
  color: #fff;
}

.help-row strong {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
}

.help-row p {
  font-size: 11px;
}

#achievement-list {
  max-height: 345px;
}

.achievement-row {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  padding: 12px 5px;
  border-bottom: 1px solid #9bcee3;
}

.achievement-row > svg {
  width: 40px;
  height: 40px;
  opacity: .35;
}

.achievement-row.completed > svg {
  opacity: 1;
}

.achievement-row > div {
  flex: 1;
}

.achievement-row strong {
  font-size: 13px;
}

.achievement-row p {
  font-size: 10px;
  margin: 3px 0;
}

.achievement-row .btn {
  font-size: 11px;
  min-height: 40px;
  padding: 7px;
  border-radius: 12px;
}

.achievement-row small {
  font-size: 10px;
}

.daily-coin svg {
  width: 110px;
  height: 110px;
  animation: happy-hop 2s ease-in-out infinite;
}

#toast {
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: 88%;
  max-width: 340px;
  transform: translate(-50%,8px);
  padding: 11px 15px;
  background: #123963ed;
  border: 2px solid #a0d7e5;
  color: #fff;
  border-radius: 17px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s,transform .2s;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%,0);
}

@keyframes panel-pop {
  from {
  transform: translateY(15px);
  opacity: 0;
}
 to {
  transform: translateY(0);
  opacity: 1;
}

}

@keyframes happy-hop {
  50% {
  transform: translateY(-5px) rotate(4deg);
}

}

@media (prefers-reduced-motion: reduce) {
  *, *::before {
  animation: none !important;
  transition: none !important;
}

}

