:root {
  --bg: #0a0a0f;
  --surface: #14141f;
  --border: #2a2a3a;
  --pink: #ff2d78;
  --cyan: #00e5ff;
  --gold: #ffd700;
  --text: #e8e8f0;
  --text-dim: #8888aa;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Header */
header {
  text-align: center;
  padding: 24px 16px 8px;
}

.title-gradient {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
}

.title-en {
  font-size: 1.4rem;
}

.subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 8px;
  line-height: 1.5;
}

/* Screens */
main {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
  padding: 0 16px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin: 16px 0;
}

.card h2 {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--cyan);
}

/* Difficulty Buttons */
.difficulty-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 16px 24px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.btn:active {
  transform: scale(0.95);
}

.btn-easy {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #fff;
}

.btn-normal {
  background: linear-gradient(135deg, var(--cyan), #0099cc);
  color: #fff;
}

.btn-hard {
  background: linear-gradient(135deg, var(--pink), #cc0044);
  color: #fff;
}

.diff-label {
  font-size: 1.3rem;
}

.diff-desc {
  font-size: 0.75rem;
  opacity: 0.85;
  font-weight: 400;
}

/* HUD */
.hud {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  gap: 8px;
}

.hud-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  text-align: center;
  flex: 1;
}

.hud-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.hud-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--cyan);
}

.combo-display {
  color: var(--gold);
  transition: transform 0.15s;
}

.combo-display.pulse {
  animation: comboPulse 0.3s ease;
}

@keyframes comboPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); color: var(--pink); }
  100% { transform: scale(1); }
}

/* Game Grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px 0;
  max-width: 360px;
  margin: 0 auto;
}

.hole {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  cursor: pointer;
}

.hole-inner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #1a1a2e 0%, #0d0d1a 70%);
  border: 3px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
}

.hole:active .hole-inner {
  border-color: var(--pink);
}

.hole.whacked .hole-inner {
  animation: holeShake 0.3s ease;
}

@keyframes holeShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

/* Mole / Target */
.mole {
  font-size: 2.5rem;
  position: absolute;
  bottom: -100%;
  left: 50%;
  transform: translateX(-50%);
  transition: bottom 0.15s ease-out;
  pointer-events: none;
  line-height: 1;
}

.hole.active .mole {
  bottom: 15%;
  animation: popUp 0.2s ease-out;
}

@keyframes popUp {
  0% { bottom: -100%; transform: translateX(-50%) scale(0.5); }
  70% { transform: translateX(-50%) scale(1.15); }
  100% { bottom: 15%; transform: translateX(-50%) scale(1); }
}

.hole.hit .mole {
  animation: hitAnim 0.3s ease forwards;
}

@keyframes hitAnim {
  0% { transform: translateX(-50%) scale(1); opacity: 1; }
  50% { transform: translateX(-50%) scale(1.3) rotate(15deg); opacity: 0.7; }
  100% { transform: translateX(-50%) scale(0) rotate(30deg); opacity: 0; bottom: -100%; }
}

/* Score Popup */
.score-popup {
  position: absolute;
  font-size: 1.2rem;
  font-weight: 900;
  pointer-events: none;
  z-index: 10;
  animation: scoreFloat 0.8s ease-out forwards;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

.score-popup.positive {
  color: var(--cyan);
}

.score-popup.negative {
  color: var(--pink);
}

.score-popup.bonus {
  color: var(--gold);
  font-size: 1.5rem;
}

@keyframes scoreFloat {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-60px) scale(1.3); }
}

/* Screen shake */
.shake {
  animation: screenShake 0.3s ease;
}

@keyframes screenShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* Result Screen */
.result-card {
  text-align: center;
}

.result-score {
  margin: 20px 0;
}

.result-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.result-value {
  display: block;
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-stats {
  display: flex;
  justify-content: space-around;
  margin: 20px 0;
  gap: 8px;
}

.stat {
  flex: 1;
  padding: 12px 8px;
  background: var(--bg);
  border-radius: 12px;
}

.stat-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.stat-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
}

.result-buttons {
  display: flex;
  gap: 12px;
  margin: 20px 0 16px;
}

.btn-share {
  flex: 1;
  background: #1da1f2;
  color: #fff;
}

.btn-retry {
  flex: 1;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  color: #fff;
}

/* Patreon CTA */
.patreon-cta {
  margin-top: 16px;
}

.patreon-link {
  display: inline-block;
  background: linear-gradient(135deg, #ff424d, #f96854);
  color: #fff;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.patreon-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(249, 104, 84, 0.4);
}

/* How to Play */
.how-to-play {
  max-width: 500px;
  margin: 24px auto;
  padding: 0 16px;
}

.how-to-play details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.how-to-play summary {
  padding: 16px;
  font-weight: 700;
  cursor: pointer;
  color: var(--cyan);
  font-size: 1rem;
}

.how-to-play summary::-webkit-details-marker {
  color: var(--pink);
}

.how-content {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.how-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.how-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 48px;
  text-align: center;
}

.how-item strong {
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

.how-item p {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Footer */
footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-dim);
  font-size: 0.8rem;
}

footer a {
  color: var(--pink);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Timer warning */
#timer.warning {
  color: var(--pink);
  animation: timerPulse 0.5s ease infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Mobile responsive */
@media (max-width: 400px) {
  .title-gradient {
    font-size: 1.5rem;
  }

  .title-en {
    font-size: 1.1rem;
  }

  .game-grid {
    gap: 8px;
  }

  .mole {
    font-size: 2rem;
  }

  .hud-value {
    font-size: 1.2rem;
  }

  .result-stats {
    flex-direction: column;
  }

  .result-buttons {
    flex-direction: column;
  }
}

@media (min-width: 501px) {
  .game-grid {
    max-width: 400px;
  }
}
