:root {
  color-scheme: light;
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  --green: #72c6a1;
  --green-dark: #2f7f68;
  --yellow: #ffd66b;
  --orange: #f59a4a;
  --soil: #8b5a38;
  --ink: #27362f;
  --paper: #fffaf0;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 214, 107, 0.42), transparent 28%),
    linear-gradient(180deg, #dff7ee 0%, #f8f1d8 58%, #dcb47a 100%);
}

body[data-stage="forest"] {
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 214, 107, 0.38), transparent 26%),
    linear-gradient(180deg, #cfeee1 0%, #9fd0a8 55%, #6f9a59 100%);
}

body[data-stage="night"] {
  color: #f7f3dc;
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 238, 171, 0.68), transparent 9%),
    linear-gradient(180deg, #24324f 0%, #425c72 56%, #6f7159 100%);
}

button {
  font: inherit;
}

.app {
  width: min(940px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
}

.top-bar,
.status-panel,
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--green-dark);
  font-size: 0.88rem;
  font-weight: 800;
}

h1 {
  margin: 2px 0 0;
  font-size: clamp(2rem, 7vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.score,
.status-panel {
  border: 3px solid rgba(47, 127, 104, 0.28);
  background: rgba(255, 250, 240, 0.88);
  box-shadow: 0 8px 0 rgba(47, 127, 104, 0.16);
}

.score {
  min-width: 116px;
  padding: 12px 16px;
  border-radius: 8px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 900;
}

.status-panel {
  min-height: 92px;
  padding: 14px 18px;
  border-radius: 8px;
}

.big-text {
  margin: 0;
  font-size: 2.7rem;
  font-weight: 900;
  line-height: 1;
}

.small-text {
  font-size: 2rem;
}

.message {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 2.1rem);
  font-weight: 900;
  text-align: right;
}

.field {
  align-self: center;
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: clamp(10px, 3vw, 22px);
}

.hole {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.hole::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 7%;
  height: 30%;
  border-radius: 50%;
  background: #5b3928;
  box-shadow: inset 0 9px 0 rgba(0, 0, 0, 0.2);
}

.mole {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 70%;
  aspect-ratio: 1;
  translate: -50% 30%;
  border-radius: 48% 48% 42% 42%;
  background: #a96a45;
  opacity: 0;
  transform: scale(0.78);
  transition: opacity 120ms ease, transform 120ms ease, translate 120ms ease;
  box-shadow: inset 0 -10px 0 rgba(91, 57, 40, 0.2);
}

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

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

.hole.is-gold .mole {
  background: linear-gradient(160deg, #ffe98a 0%, #f8b92e 58%, #c97812 100%);
  box-shadow:
    0 0 0 5px rgba(255, 232, 138, 0.52),
    inset 0 -10px 0 rgba(154, 92, 8, 0.2);
}

.hole.is-poison .mole {
  background: linear-gradient(160deg, #8b78d6 0%, #5a4aa0 62%, #342a64 100%);
  box-shadow:
    0 0 0 5px rgba(139, 120, 214, 0.36),
    inset 0 -10px 0 rgba(29, 22, 64, 0.24);
}

.hole.is-poison .nose {
  background: #f7f3dc;
}

.mole::before,
.mole::after {
  content: "";
  position: absolute;
  top: 29%;
  width: 10%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #1f1a17;
  box-shadow: 0 16px 0 -2px #f8d7ba;
}

.nose {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 16%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: #3a2219;
}

.hole.is-active .mole {
  opacity: 1;
  translate: -50% 0;
  transform: scale(1);
}

.hole.is-hit .mole {
  background: var(--orange);
  transform: scale(0.9) rotate(-5deg);
}

.controls {
  justify-content: center;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.chip,
.start-button,
.reset-button {
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
  box-shadow: 0 6px 0 rgba(39, 54, 47, 0.2);
  cursor: pointer;
}

.chip {
  min-width: 112px;
  color: var(--green-dark);
  background: var(--paper);
  box-shadow: 0 5px 0 rgba(47, 127, 104, 0.16);
}

.chip.is-active {
  color: #fff;
  background: var(--green-dark);
}

.start-button,
.reset-button {
  min-width: 148px;
}

.start-button {
  background: var(--green-dark);
}

.reset-button {
  background: var(--orange);
}

.sound-button {
  background: #5f6fb5;
}

.start-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 560px) {
  .app {
    padding: 14px;
    gap: 12px;
  }

  .top-bar,
  .status-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .score,
  .message {
    text-align: left;
  }

  .field {
    grid-template-columns: repeat(3, minmax(72px, 1fr));
  }

  .start-button,
  .reset-button {
    flex: 1 1 140px;
  }
}
