/* Whack-a-Mole — Playnesta original (MIT). Lawn, holes, moles, buttons. */
:root {
  --pn-vh: 1vh;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  background: radial-gradient(circle at 50% 10%, #1d5a2e, #12331c 75%);
  color: #f2fbe9;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: calc(var(--pn-vh, 1vh) * 100);
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  gap: 8px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.brand small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.65;
  margin-left: 6px;
  text-transform: lowercase;
}
.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hud {
  font-size: 13px;
  opacity: 0.95;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  padding: 4px 10px;
}
.hud b {
  color: #ffe066;
}
.lawn {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  padding: 8px;
  border-radius: 18px;
  background: linear-gradient(180deg, #2c7a41, #1f5c2f);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08), inset 0 14px 40px rgba(0, 0, 0, 0.25);
}
.hole {
  position: relative;
  overflow: hidden;
  border-radius: 50% / 42%;
  background: radial-gradient(ellipse at 50% 70%, #4a3220, #2d1d0f 70%);
  box-shadow: inset 0 10px 18px rgba(0, 0, 0, 0.65), 0 2px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
  touch-action: manipulation;
}
.hole .rim {
  position: absolute;
  inset: 0;
  border-radius: 50% / 42%;
  box-shadow: inset 0 4px 10px rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.mole {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: 78%;
  height: 74%;
  transform: translate(-50%, 115%);
  transition: transform 130ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
  pointer-events: none;
}
.hole.up .mole {
  transform: translate(-50%, 0);
}
.mole svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35));
}
.hole.whacked .mole {
  transform: translate(-50%, 35%) scale(1.06, 0.86);
  transition: transform 90ms ease-out;
}
.hole.whacked {
  animation: thud 180ms ease-out;
}
@keyframes thud {
  0% { box-shadow: inset 0 10px 18px rgba(0, 0, 0, 0.65), 0 2px 0 rgba(255, 255, 255, 0.06), 0 0 0 0 rgba(255, 224, 102, 0.8); }
  100% { box-shadow: inset 0 10px 18px rgba(0, 0, 0, 0.65), 0 2px 0 rgba(255, 255, 255, 0.06), 0 0 0 18px rgba(255, 224, 102, 0); }
}
.burst {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 22px;
  font-weight: 800;
  pointer-events: none;
  animation: burst 600ms ease-out forwards;
}
@keyframes burst {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 1; }
  100% { transform: translate(-50%, -160%) scale(1.25); opacity: 0; }
}
.msg {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  min-height: 22px;
}
.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.btn {
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid #68b04a;
  background: #27532f;
  color: #f2fbe9;
  cursor: pointer;
}
.btn.primary {
  background: #ffe066;
  color: #3a2c05;
  border-color: #fff3b0;
}
.btn:active {
  transform: scale(0.97);
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 22, 12, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.overlay.hidden {
  display: none;
}
.panel {
  background: #14301c;
  border: 1px solid #68b04a;
  border-radius: 16px;
  padding: 18px;
  max-width: 420px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
}
.panel h2 {
  margin: 0 0 10px;
  font-size: 20px;
}
.panel p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.5;
}
.panel-wide {
  max-width: 520px;
}
.rules-list {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.55;
}
.rules-list li {
  margin-bottom: 8px;
}
.rules-list b {
  color: #ffe066;
}
@media (max-height: 560px) {
  .brand {
    font-size: 17px;
  }
  .lawn {
    gap: 8px;
  }
}
