@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;800&display=swap");

:root {
  --pink: #ea5fa4;
  --purple: #9b6df3;
  --text: #4a365f;
  --muted: #8a769f;
  --bg: #f4eef8;
  --card: #fffdfd;
  --border: #eed8e8;
  --shadow: 0 14px 34px rgba(126, 93, 158, 0.12);
  --ground1: #e6b486;
  --ground2: #c98550;
  --mole1: #8b5a3c;
  --mole2: #6f432b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 10px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cairo", sans-serif;
  background: linear-gradient(135deg, #faf7fc, var(--bg));
  color: var(--text);
}

.page {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.back-link,
.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: 800;
}

.back-link {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--border);
}

.brand {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
}

.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 28px 18px 22px;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: clamp(3.2rem, 6vw, 5.2rem);
  line-height: 1.1;
  color: var(--pink);
}

.subtitle {
  margin: 8px 0 16px;
  font-size: 1.7rem;
  color: var(--muted);
}

.stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.stat-box {
  min-width: 98px;
  padding: 10px 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--border);
}

.label {
  display: block;
  font-size: 1.3rem;
  color: var(--muted);
}

.value {
  display: block;
  font-size: 3rem;
  line-height: 1.1;
  font-weight: 800;
}

.start-btn {
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  font-family: inherit;
  font-size: 2.1rem;
  font-weight: 800;
  padding: 10px 24px;
  cursor: pointer;
}

.start-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.status {
  min-height: 32px;
  margin: 12px 0 8px;
  font-size: 1.7rem;
  font-weight: 700;
  color: #65452f;
}

.game {
  width: min(620px, 100%);
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 12px;
  padding: 8px 0;
}

.hole {
  position: relative;
  height: 150px;
  overflow: hidden;
  cursor: pointer;
}

.hole::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 92%;
  height: 54px;
  border-radius: 50% 50% 18px 18px;
  background: linear-gradient(180deg, var(--ground1), var(--ground2));
  z-index: 3;
}

.hole::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  width: 64%;
  height: 32px;
  border-radius: 50%;
  background: rgba(120, 64, 30, 0.18);
  z-index: 2;
}

.mole {
  position: absolute;
  left: 50%;
  bottom: -110px;
  transform: translateX(-50%);
  width: 92px;
  height: 110px;
  transition: bottom 0.18s ease;
  z-index: 1;
}

.mole::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 44px 44px 30px 30px;
  background: linear-gradient(180deg, var(--mole1), var(--mole2));
}

.mole::after {
  content: "🐹";
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  font-size: 6.2rem;
  line-height: 1;
}

.hole.up .mole {
  bottom: 22px;
}

.hole.hit .mole::after {
  content: "💥";
}

@media (max-width: 640px) {
  .game {
    gap: 14px 8px;
  }

  .hole {
    height: 122px;
  }

  .mole {
    width: 76px;
    height: 90px;
    bottom: -92px;
  }

  .mole::after {
    font-size: 5rem;
  }

  .hole.up .mole {
    bottom: 18px;
  }
}

@media (max-width: 420px) {
  .page {
    padding: 16px 12px 28px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .game {
    grid-template-columns: repeat(2, 1fr);
  }

  .start-btn {
    width: 100%;
  }
}