* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, #3a0000, #120000 70%);
  color: #f5e6d8;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  text-align: center;
  cursor: crosshair;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 24px 16px 60px; position: relative; }

h1 {
  font-size: 2rem;
  margin-bottom: 4px;
  text-shadow: 0 0 12px #ff2b2b, 0 0 2px #000;
  letter-spacing: 1px;
}
.tagline { color: #d8b8a8; margin-top: 0; font-size: 0.9rem; }

.hud {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 16px 0;
}
.stat {
  background: #2a0808;
  border: 1px solid #6b1414;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 0.8rem;
  color: #e6a;
  min-width: 70px;
}
.stat span { font-size: 1.4rem; color: #fff; font-weight: bold; }

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: #1a0505;
  border: 2px solid #6b1414;
  border-radius: 16px;
  padding: 16px;
  position: relative;
  z-index: 1;
}

.hole {
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 60%, #000 40%, #3a0f0f 100%);
  border-radius: 50%;
  border: 3px solid #4a0e0e;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.critter {
  font-size: 2.4rem;
  transform: translateY(100%);
  transition: transform 0.15s ease-out;
  user-select: none;
  -webkit-user-select: none;
}
.critter.up { transform: translateY(10%); }
.critter.stabbed { transform: translateY(10%) scale(1.3) rotate(15deg); filter: brightness(1.5); }

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 0, 0, 0.92);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  z-index: 5;
}
.overlay.hidden { display: none; }
.overlay p { max-width: 400px; line-height: 1.6; color: #e0c8c0; }

.miniLeaderboard {
  background: #1a0505;
  border: 1px solid #6b1414;
  border-radius: 12px;
  padding: 10px 16px;
  width: 220px;
}
.miniLeaderboard h3 { margin: 4px 0 8px; font-size: 0.95rem; color: #ff8a8a; }
.miniLeaderboard ol { list-style: none; padding: 0; margin: 0; text-align: left; }
.miniLeaderboard li {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid #3a0f0f;
}
.miniLeaderboard li:last-child { border-bottom: none; }
.miniLeaderboard .empty { justify-content: center; color: #a88; }
.miniLeaderboard .lbScore { font-weight: bold; color: #ff8a8a; }

#nameInput {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #6b1414;
  background: #250808;
  color: #fff;
  font-size: 1rem;
  width: 220px;
  text-align: center;
}

button {
  padding: 12px 28px;
  font-size: 1.1rem;
  font-weight: bold;
  border: none;
  border-radius: 30px;
  background: linear-gradient(180deg, #ff3b3b, #a40000);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 0 #6b0000;
  transition: transform 0.05s;
}
button:active { transform: translateY(3px); box-shadow: 0 1px 0 #6b0000; }

.leaderboardTitle { margin-top: 32px; }
.leaderboard {
  list-style: none;
  padding: 0;
  max-width: 300px;
  margin: 0 auto;
  background: #1a0505;
  border: 1px solid #6b1414;
  border-radius: 12px;
  overflow: hidden;
}
.leaderboard li {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid #3a0f0f;
  font-size: 0.95rem;
}
.leaderboard li:last-child { border-bottom: none; }
.leaderboard .empty { justify-content: center; color: #a88; }
.lbScore { font-weight: bold; color: #ff8a8a; }
