:root {
  --sky-top: #a9d6ef;
  --sky-bottom: #dff1fb;
  --hill-back: #bed86b;
  --hill-mid: #c3da66;
  --hill-front: #b4cc58;
  --card-white: #fffdf3;
  --orange: #ffa321;
  --orange-deep: #cf7200;
  --mole-dark: #2c2421;
  --mole-body: #615046;
  --mole-belly: #8a7368;
  --mole-face: #d7b39f;
  --mole-pink: #d99891;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, #dbe9f3 0%, #bfd2e0 100%);
  font-family: "Baloo 2", system-ui, sans-serif;
  color: #513001;
}

.app {
  width: min(94vw, 1080px);
  aspect-ratio: 16 / 10;
  min-height: 620px;
  max-height: 90vh;
  position: relative;
}

.screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: none;
  border-radius: 32px;
  border: 5px solid rgba(255, 255, 255, 0.78);
  background:
    radial-gradient(circle at 62% 16%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.04) 14%, transparent 24%),
    linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
  box-shadow:
    0 24px 70px rgba(61, 89, 110, 0.28),
    inset 0 -18px 0 rgba(255, 255, 255, 0.18);
  cursor: default;
}

.screen.active {
  display: block;
}

.screen::before,
.screen::after {
  content: "";
  position: absolute;
  left: 0;
}

.screen::before {
  left: -5%;
  bottom: 27%;
  width: 110%;
  height: 18%;
  border-radius: 50%;
  background: linear-gradient(180deg, #c8df74 0%, var(--hill-back) 100%);
}

.screen::after {
  left: -8%;
  bottom: 2%;
  width: 116%;
  height: 26%;
  border-radius: 50%;
  background: linear-gradient(180deg, #c3da66 0%, var(--hill-front) 100%);
}

.screen--game {
  user-select: none;
  cursor: none;
}

.sky-decor,
.start-title,
.hero,
.hud,
.playfield,
.overlay {
  position: relative;
  z-index: 2;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  opacity: 0.82;
  filter: none;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 50%;
}

.cloud--one {
  width: 104px;
  height: 40px;
  top: 88px;
  left: 110px;
}

.cloud--two {
  width: 108px;
  height: 42px;
  top: 74px;
  right: 108px;
}

.cloud--three {
  width: 72px;
  height: 28px;
  top: 124px;
  left: 50%;
  margin-left: -36px;
}

.cloud--four {
  display: none;
}

.cloud::before {
  width: 46px;
  height: 46px;
  left: 16px;
  top: -18px;
}

.cloud::after {
  width: 52px;
  height: 52px;
  right: 14px;
  top: -21px;
}

.start-ground-decor {
  display: none;
}

.start-title {
  text-align: center;
  padding-top: 24px;
  z-index: 4;
}

.start-title h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 0.84;
  color: #ffe132;
  text-shadow:
    -4px -4px 0 #8b4d00,
    4px -4px 0 #8b4d00,
    -4px 4px 0 #8b4d00,
    4px 4px 0 #8b4d00,
    0 8px 0 rgba(133, 75, 2, 0.8);
  letter-spacing: 1px;
}

.start-title span {
  font-size: 0.56em;
}

.hero {
  display: grid;
  place-items: center;
  margin-top: 92px;
  z-index: 4;
}

.hero-mound {
  position: relative;
  width: 240px;
  height: 220px;
}

.dirt {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  width: 190px;
  height: 44px;
  background:
    radial-gradient(circle at 16% 40%, #99601b 0 14px, transparent 15px),
    radial-gradient(circle at 31% 20%, #855113 0 14px, transparent 15px),
    radial-gradient(circle at 51% 40%, #935919 0 16px, transparent 17px),
    radial-gradient(circle at 70% 18%, #7a450e 0 14px, transparent 15px),
    radial-gradient(circle at 84% 40%, #90581a 0 14px, transparent 15px),
    linear-gradient(180deg, #8b5717 0%, #6a3d0d 100%);
  border-radius: 36px;
  box-shadow:
    inset 0 -8px 0 rgba(69, 36, 6, 0.45),
    0 3px 0 rgba(94, 51, 9, 0.28);
}

.dirt::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 72%;
  height: 20px;
  border-radius: 50%;
  background: #3b2209;
  box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.15);
  z-index: 2;
}

.dirt::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: 58%;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, #975f1d 0%, #6b3d0d 100%);
  z-index: 3;
}

.mole {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 50px;
  width: 126px;
  height: 162px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.16) 0 16px, transparent 17px),
    linear-gradient(180deg, #77635a 0%, var(--mole-body) 34%, #473733 100%);
  border: 6px solid #2c221e;
  border-radius: 46% 46% 42% 42%;
  box-shadow:
    inset 0 -14px 16px rgba(40, 25, 20, 0.34),
    0 8px 12px rgba(49, 32, 20, 0.12);
}

.mole::before {
  content: "";
  position: absolute;
  inset: 16px 17px 58px;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 243, 232, 0.9) 0 10px, transparent 11px),
    linear-gradient(180deg, #edd4c0 0%, #d7b39f 100%);
  border-radius: 42px 42px 30px 30px;
}

.mole::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: 54px;
  height: 86px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0.08) 100%),
    var(--mole-belly);
  border-radius: 50%;
}

.mole .ear,
.mole .face,
.mole .eye,
.mole .nose,
.mole .tooth,
.mole .arm,
.mole .claw {
  position: absolute;
}

.ear {
  width: 22px;
  height: 34px;
  background: linear-gradient(180deg, #5f4e45 0%, var(--mole-dark) 100%);
  top: -12px;
  border: 2px solid #2f2521;
  border-radius: 18px 18px 10px 10px;
}

.ear::after {
  content: "";
  position: absolute;
  inset: 5px;
  background: var(--mole-pink);
  border-radius: 16px 16px 8px 8px;
}

.ear--left {
  left: 12px;
  transform: rotate(-20deg);
}

.ear--right {
  right: 12px;
  transform: rotate(20deg);
}

.face {
  left: 50%;
  top: 62px;
  transform: translateX(-50%);
  width: 58px;
  height: 34px;
  background: linear-gradient(180deg, #e6c9b6 0%, var(--mole-face) 100%);
  border-radius: 30px;
}

.eye {
  width: 15px;
  height: 18px;
  background: #1a1412;
  border: 4px solid rgba(247, 232, 218, 0.85);
  border-radius: 50%;
  top: 37px;
}

.eye::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
}

.eye--left {
  left: 28px;
}

.eye--right {
  right: 28px;
}

.nose {
  left: 50%;
  top: 68px;
  transform: translateX(-50%);
  width: 20px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, #3f2c28 0%, #181111 100%);
}

.nose::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -26px;
  transform: translateX(-50%);
  width: 54px;
  height: 18px;
  border-bottom: 6px solid #211919;
  border-radius: 0 0 30px 30px;
}

.tooth {
  width: 10px;
  height: 24px;
  background: linear-gradient(180deg, #fffef9 0%, #ece4d7 100%);
  top: 97px;
  border-radius: 4px;
}

.tooth--left {
  left: 49px;
}

.tooth--right {
  right: 49px;
}

.arm {
  width: 26px;
  height: 56px;
  background: linear-gradient(180deg, #756159 0%, var(--mole-body) 100%);
  border: 5px solid #2c221e;
  top: 70px;
  border-radius: 20px;
}

.arm--left {
  left: -4px;
  transform: rotate(26deg);
}

.arm--right {
  right: -4px;
  transform: rotate(-26deg);
}

.claw {
  width: 22px;
  height: 22px;
  background: var(--mole-pink);
  border-radius: 16px;
  top: 112px;
}

.claw--left {
  left: -2px;
}

.claw--right {
  right: -2px;
}

.mole--hero {
  width: 112px;
  height: 146px;
  bottom: 34px;
}

.mole--hero::before {
  inset: 14px 15px 52px;
}

.mole--hero::after {
  width: 48px;
  height: 78px;
}

.mole--hero .face {
  top: 56px;
  width: 52px;
  height: 30px;
}

.mole--hero .eye {
  width: 13px;
  height: 16px;
  top: 32px;
  border-width: 4px;
}

.mole--hero .eye--left {
  left: 24px;
}

.mole--hero .eye--right {
  right: 24px;
}

.mole--hero .nose {
  top: 60px;
  width: 18px;
  height: 14px;
}

.mole--hero .nose::after {
  bottom: -22px;
  width: 48px;
  height: 16px;
  border-bottom-width: 5px;
}

.mole--hero .tooth {
  width: 9px;
  height: 20px;
  top: 87px;
}

.mole--hero .tooth--left {
  left: 43px;
}

.mole--hero .tooth--right {
  right: 43px;
}

.mole--hero .arm {
  width: 22px;
  height: 50px;
  top: 62px;
}

.mole--hero .claw {
  width: 18px;
  height: 18px;
  top: 98px;
}

.cta-button,
.ghost-button,
.hole {
  font: inherit;
  border: 0;
}

.cta-button,
.ghost-button {
  cursor: pointer;
}

.cta-button {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  min-width: 220px;
  padding: 14px 30px;
  border-radius: 26px;
  background: linear-gradient(180deg, #ffb836 0%, var(--orange) 100%);
  color: white;
  font-size: 1.9rem;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow:
    0 10px 0 #ab5b00,
    0 18px 25px rgba(170, 92, 0, 0.25);
  text-shadow: 0 3px 0 rgba(80, 42, 0, 0.7);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  z-index: 4;
}

.cta-button:hover {
  transform: translateX(-50%) translateY(-2px);
  filter: brightness(1.04);
}

.cta-button:active {
  transform: translateX(-50%) translateY(6px);
  box-shadow: 0 4px 0 #ab5b00;
}

.screen--game .cta-button,
.screen--game .ghost-button {
  position: static;
  transform: none;
}

.hud {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 22px 0;
}

.stat-card {
  width: 150px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 16px 0 12px;
  border-radius: 24px;
  background: var(--card-white);
  border: 4px solid var(--orange);
  box-shadow: 0 8px 0 rgba(171, 91, 0, 0.45);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: white;
  font-size: 1.6rem;
  font-weight: 800;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.status-text {
  flex: 1;
  text-align: center;
  padding-top: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #8a4b00;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.45);
}

.playfield {
  width: min(82%, 760px);
  margin: 52px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 26px;
}

.hole {
  position: relative;
  min-height: 154px;
  background: none;
  padding: 0;
  cursor: none;
}

.hole::before,
.hole::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.hole::before {
  bottom: 14px;
  width: 82%;
  height: 16px;
  background: rgba(58, 167, 191, 0.55);
  border-radius: 50%;
  z-index: 0;
}

.hole::after {
  bottom: 18px;
  width: 86%;
  height: 38px;
  border-radius: 36px;
  background:
    radial-gradient(circle at 16% 40%, #99601b 0 14px, transparent 15px),
    radial-gradient(circle at 31% 20%, #855113 0 14px, transparent 15px),
    radial-gradient(circle at 51% 40%, #935919 0 16px, transparent 17px),
    radial-gradient(circle at 70% 18%, #7a450e 0 14px, transparent 15px),
    radial-gradient(circle at 84% 40%, #90581a 0 14px, transparent 15px),
    linear-gradient(180deg, #8b5717 0%, #6a3d0d 100%);
  box-shadow:
    inset 0 -8px 0 rgba(69, 36, 6, 0.45),
    0 3px 0 rgba(94, 51, 9, 0.28);
  z-index: 1;
}

.hole-inner {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  width: 72%;
  height: 20px;
  border-radius: 50%;
  background: #3b2209;
  box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.15);
  z-index: 2;
}

.character-wrap {
  position: absolute;
  left: 50%;
  bottom: 38px;
  transform: translateX(-50%) scale(0.68) translateY(20px);
  transform-origin: bottom center;
  opacity: 0;
  transition: transform 170ms ease, opacity 140ms ease;
  pointer-events: none;
  z-index: 2;
}

.character-wrap .mole {
  bottom: -16px;
}

.character-wrap .bomb {
  transform: scale(0.92);
  transform-origin: bottom center;
}

.hole.active .character-wrap {
  opacity: 1;
  transform: translateX(-50%) scale(0.68) translateY(0);
}

.hole.hit .character-wrap {
  animation: hit-pop 220ms ease;
}

.bomb {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, #767b86 0 10px, #26282f 11px 100%);
  border: 5px solid #16181d;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.2);
}

.bomb::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 26px;
  border: 6px solid #495260;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  left: 50%;
  top: -22px;
  transform: translateX(-50%) rotate(-14deg);
}

.bomb::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe27a 0 36%, #ff7d36 37% 70%, #ff3d00 71% 100%);
  right: -8px;
  top: -22px;
  box-shadow: 0 0 0 8px rgba(255, 173, 63, 0.18);
  animation: spark 700ms infinite ease-in-out;
}

.bomb-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  font-size: 2rem;
  font-weight: 800;
}

.hammer-cursor {
  position: absolute;
  width: 110px;
  height: 110px;
  left: 0;
  top: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 5;
}

.hammer-head,
.hammer-handle {
  position: absolute;
  display: block;
}

.hammer-head {
  width: 46px;
  height: 22px;
  background: linear-gradient(180deg, #cfd8df 0%, #919ca9 100%);
  border-radius: 10px;
  left: 14px;
  top: 18px;
  box-shadow: inset 0 -5px 0 rgba(54, 67, 79, 0.28);
}

.hammer-head::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 14px;
  right: -8px;
  top: 6px;
  border-radius: 8px;
  background: #8a95a5;
}

.hammer-handle {
  width: 14px;
  height: 60px;
  background: linear-gradient(180deg, #9c6937 0%, #6e441d 100%);
  border-radius: 12px;
  left: 34px;
  top: 34px;
  transform: rotate(18deg);
}

.hammer-cursor.down {
  transform: translate(-50%, -50%) rotate(-24deg) scale(0.96);
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(21, 66, 92, 0.34);
  cursor: default;
  z-index: 8;
}

.overlay.show {
  display: flex;
}

.overlay.show ~ .hammer-cursor {
  display: none;
}

.overlay-card {
  width: min(84%, 420px);
  padding: 30px 28px;
  border-radius: 30px;
  background: linear-gradient(180deg, #fffef5 0%, #fff0bf 100%);
  border: 4px solid var(--orange);
  box-shadow: 0 18px 40px rgba(82, 53, 0, 0.25);
  text-align: center;
}

.overlay-card h2 {
  margin: 0 0 8px;
  font-size: 2.4rem;
  color: #8b4d00;
}

.overlay-card p {
  margin: 0 0 20px;
  font-size: 1.3rem;
}

.ghost-button {
  margin-top: 14px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.75);
  border: 3px solid rgba(207, 114, 0, 0.35);
  font-size: 1.2rem;
  font-weight: 700;
  color: #8b4d00;
}

@keyframes hit-pop {
  0% {
    transform: translateX(-50%) scale(0.68) translateY(0);
  }
  50% {
    transform: translateX(-50%) scale(0.76) translateY(-8px);
  }
  100% {
    transform: translateX(-50%) scale(0.68) translateY(0);
  }
}

@keyframes spark {
  0%,
  100% {
    transform: scale(0.8);
    opacity: 0.65;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .app {
    width: 100vw;
    height: 100vh;
    max-height: none;
    min-height: 100vh;
  }

  .screen {
    border-radius: 0;
    border: 0;
  }

  .playfield {
    width: 88%;
    margin-top: 38px;
    gap: 20px 12px;
  }

  .stat-card {
    width: 124px;
  }

  .status-text {
    font-size: 1rem;
  }

  .hole {
    min-height: 118px;
  }

  .character-wrap {
    bottom: 30px;
    transform: translateX(-50%) scale(0.56) translateY(18px);
  }

  .hole.active .character-wrap {
    transform: translateX(-50%) scale(0.56) translateY(0);
  }
}
