: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%);
}

button {
  font: inherit;
}

a {
  color: inherit;
}

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

.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(1.7rem, 5.8vw, 3.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: 9px 13px;
  border-radius: 8px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 900;
}

.home-link {
  flex: 0 0 auto;
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  background: #5f6fb5;
  box-shadow: 0 5px 0 rgba(39, 54, 47, 0.18);
  font-weight: 900;
  text-decoration: none;
}

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

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

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

.message {
  margin: 0;
  font-size: clamp(1rem, 3.2vw, 1.55rem);
  font-weight: 900;
  text-align: right;
}

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

.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;
}

.settings-panel {
  flex: 1 1 100%;
}

.settings-summary {
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--green-dark);
  background: var(--paper);
  box-shadow: 0 5px 0 rgba(47, 127, 104, 0.16);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 900;
  list-style: none;
}

.settings-summary::-webkit-details-marker {
  display: none;
}

.settings-body {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.chip,
.start-button,
.reset-button {
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  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: 104px;
  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: 132px;
}

.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: 10px;
    gap: 8px;
  }

  .top-bar {
    gap: 8px;
  }

  .home-link {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 0.9rem;
  }

  .eyebrow {
    display: none;
  }

  .score {
    min-width: 88px;
    padding: 8px 10px;
    font-size: 1rem;
  }

  .status-panel {
    display: grid;
    grid-template-columns: repeat(3, auto);
    align-items: center;
    min-height: 0;
    padding: 8px 10px;
  }

  .status-panel .message {
    grid-column: 1 / -1;
    text-align: center;
  }

  .label {
    font-size: 0.72rem;
  }

  .big-text {
    font-size: 1.65rem;
  }

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

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

  .control-group {
    gap: 6px;
  }

  .chip,
  .settings-summary,
  .start-button,
  .reset-button {
    min-height: 42px;
    padding: 8px 10px;
    font-size: 0.95rem;
  }

  .chip {
    min-width: 90px;
  }

  .start-button,
  .reset-button {
    flex: 1 1 96px;
    min-width: 96px;
  }
}
