:root {
  --bg-top: #f7f1e1;
  --bg-bottom: #ead8ba;
  --card: rgba(255, 249, 237, 0.86);
  --ink: #2b241b;
  --accent: #d65a31;
  --accent-strong: #b83f18;
  --board: #6f8fa7;
  --hole: #273247;
  --glow: rgba(214, 90, 49, 0.2);
  --shadow: 0 18px 40px rgba(77, 56, 29, 0.18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  overflow: hidden;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.7), transparent 35%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

button {
  font: inherit;
}

.app {
  width: min(100%, 390px);
  margin: 0 auto;
  padding: 10px 10px 16px;
}

.hero {
  text-align: center;
  margin-bottom: 10px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin-bottom: 6px;
  font-size: clamp(24px, 6.4vw, 32px);
  line-height: 1.05;
  color: #cb3a22;
  text-shadow: 0 3px 10px rgba(255, 255, 255, 0.7);
}

.subtitle {
  max-width: 24ch;
  margin: 0 auto;
  color: rgba(43, 36, 27, 0.78);
  font-size: 13px;
  line-height: 1.35;
}

.panel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.stat {
  display: grid;
  gap: 6px;
}

.label {
  font-size: 12px;
  color: rgba(43, 36, 27, 0.66);
}

.stat strong {
  font-size: clamp(20px, 5.6vw, 26px);
}

.game-shell {
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 252, 244, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), var(--shadow);
}

.game-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 12px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #87a8c0 0%, var(--board) 100%);
}

.hole {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.08), transparent 40%),
    linear-gradient(180deg, #2f3c55 0%, var(--hole) 100%);
  box-shadow: inset 0 10px 18px rgba(0, 0, 0, 0.26);
  cursor: pointer;
  touch-action: manipulation;
}

.hole:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.mole {
  position: absolute;
  left: 12%;
  bottom: -96%;
  width: 76%;
  height: 80%;
  border-radius: 48% 48% 38% 38%;
  background:
    radial-gradient(circle at 30% 35%, rgba(255, 255, 255, 0.5), transparent 20%),
    linear-gradient(180deg, #ffae42 0%, #e76f51 100%);
  box-shadow: 0 10px 16px rgba(78, 29, 5, 0.2);
  transition: bottom 180ms ease, transform 120ms ease, filter 120ms ease;
  pointer-events: none;
}

.mole::before,
.mole::after {
  content: "";
  position: absolute;
  top: 24%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1f1610;
}

.mole::before {
  left: 24%;
}

.mole::after {
  right: 24%;
}

.mole.show {
  bottom: 4%;
}

.mole.hit {
  transform: scale(0.9);
  filter: saturate(1.2) brightness(0.92);
}

.controls {
  margin-top: 12px;
  text-align: center;
}

.action {
  min-width: 140px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff9f2;
  font-weight: 700;
  box-shadow: 0 14px 26px var(--glow);
  cursor: pointer;
}

.action:active {
  transform: translateY(1px);
}

.status {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.35;
  color: rgba(43, 36, 27, 0.78);
}

.result-dialog {
  margin: auto;
  border: 0;
  background: transparent;
}

.result-dialog::backdrop {
  background: rgba(29, 22, 13, 0.44);
}

.dialog-card {
  width: min(90vw, 320px);
  padding: 20px 18px;
  border-radius: 20px;
  background: #fff8ed;
  text-align: center;
  box-shadow: 0 18px 40px rgba(43, 36, 27, 0.26);
}

.dialog-title {
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 22px;
  font-weight: 700;
}

.dialog-score {
  margin-bottom: 16px;
  font-size: 17px;
}

@media (max-width: 420px) {
  .app {
    padding-inline: 8px;
  }

  .panel {
    padding: 9px 12px;
  }

  .game-box {
    gap: 7px;
    padding: 10px;
  }
}
