* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

/* Once the game starts, the mouse becomes a scope */
body.playing #stage {
  cursor: url("../assets/scope.svg") 24 24, crosshair;
}

#holes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hole {
  position: absolute;
  width: 40px;
  height: 40px;
  pointer-events: none;
  -webkit-user-drag: none;
}

#start-btn {
  padding: 18px 56px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: #22a447;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 0 #17803a;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}
#start-btn:hover { background: #1f9640; }
#start-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #17803a; }
body.playing #start-btn { display: none; }

/* Screen shake (subtle) */
@keyframes shake {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2px, 1px); }
  50%  { transform: translate(2px, -2px); }
  75%  { transform: translate(-1px, 1px); }
  100% { transform: translate(0, 0); }
}
#stage.shake { animation: shake 0.12s ease-out; }

/* Explosion effect at the impact point */
#fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.blast {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

.blast-flash {
  position: absolute;
  left: -40px;
  top: -40px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffbe6 0%, #ffd54a 25%, #ff8a1f 50%, rgba(255, 80, 0, 0) 72%);
  animation: blast-flash 0.28s ease-out forwards;
}
@keyframes blast-flash {
  0%   { transform: scale(0.2); opacity: 1; }
  40%  { transform: scale(1);   opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}

.blast-smoke {
  position: absolute;
  left: -30px;
  top: -30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90, 90, 90, 0.35) 0%, rgba(90, 90, 90, 0) 70%);
  animation: blast-smoke 0.6s ease-out forwards;
}
@keyframes blast-smoke {
  0%   { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(1.8) translateY(-10px); opacity: 0; }
}

.spark {
  position: absolute;
  left: -1.5px;
  top: -8px;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(to top, rgba(255, 140, 0, 0), #ffcc33 60%, #fff6cc);
  transform: rotate(var(--angle)) translateY(0);
  animation: spark 0.32s ease-out forwards;
}
@keyframes spark {
  0%   { transform: rotate(var(--angle)) translateY(-6px) scaleY(0.6); opacity: 1; }
  100% { transform: rotate(var(--angle)) translateY(calc(-1 * var(--dist))) scaleY(1); opacity: 0; }
}

#login-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  padding: 8px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #222;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
}
#login-btn:hover { background: #f3f3f3; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
}
.modal[hidden] { display: none; }

.modal-card {
  width: min(340px, calc(100vw - 32px));
  padding: 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-card h2 { margin: 0 0 6px; font-size: 1.3rem; }

.auth-option, .auth-input, .modal-close {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
}
.auth-option:disabled, .auth-input:disabled { opacity: 0.5; cursor: not-allowed; }
.modal-note { margin: 4px 0; font-size: 0.85rem; color: #666; text-align: center; }
.modal-close { cursor: pointer; background: #f3f3f3; }
