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

:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --bg-dark: #1a0a2e;
  --text: #edf2f4;
  --text-muted: #8d99ae;
}

html, body { height: 100%; overflow: hidden; }

body {
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#app { width: 100%; height: 100%; position: relative; }

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.screen.active { display: flex; }

/* --- Start --- */
.start-content {
  text-align: center;
  padding: 2rem;
  background: radial-gradient(ellipse at center, rgba(255,50,50,0.1), transparent 70%);
}
.start-content h1 {
  font-size: 2.6rem;
  color: #fff;
  text-shadow: 0 0 20px rgba(255,50,50,0.5);
  margin-bottom: 0.4rem;
}
.start-sub { color: var(--text-muted); margin-bottom: 2rem; font-size: 1.1rem; }

.prizes-preview {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.prize-item {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(255,255,255,0.05);
  border: 2px solid;
}
.prize-item.gold { border-color: var(--gold); color: var(--gold); }
.prize-item.silver { border-color: var(--silver); color: var(--silver); }
.prize-item.bronze { border-color: var(--bronze); color: var(--bronze); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
  box-shadow: 0 4px 20px rgba(230,57,70,0.4);
}
.btn-primary:active { transform: scale(0.95); background: var(--primary-dark); }

/* --- Game HUD --- */
.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-around;
  padding: 0.6rem 1rem;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.hud-item { text-align: center; }
.hud-label { display: block; font-size: 0.65rem; color: var(--text-muted); letter-spacing: 0.05em; }
.hud-value { font-size: 1.4rem; font-weight: 800; }

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* --- Effects --- */
.shot-effect {
  position: absolute;
  font-size: 1.5rem;
  pointer-events: none;
  animation: shotPop 0.3s ease-out forwards;
  z-index: 20;
}
@keyframes shotPop {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

.hit-effect {
  position: absolute;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  pointer-events: none;
  animation: hitFloat 0.8s ease-out forwards;
  z-index: 20;
  text-shadow: 0 0 10px rgba(255,200,0,0.8);
  white-space: nowrap;
}
.hit-effect.prize-hit {
  font-size: 1.4rem;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255,215,0,0.9);
}
@keyframes hitFloat {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-50px) scale(1.3); opacity: 0; }
}

.miss-effect {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  pointer-events: none;
  animation: missPop 0.3s ease-out forwards;
  z-index: 20;
}
@keyframes missPop {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* --- Result --- */
.result-content {
  text-align: center;
  padding: 2rem;
  background: radial-gradient(ellipse at center, rgba(255,215,0,0.05), transparent 70%);
}
.result-icon { font-size: 4rem; margin-bottom: 0.5rem; }
.result-content h2 { font-size: 1.8rem; margin-bottom: 0.3rem; }
.result-score { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 1rem; }

.result-prize {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}
.result-prize.gold { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #1a1a2e; }
.result-prize.silver { background: linear-gradient(135deg, #c0c0c0, #e0e0e0); color: #1a1a2e; }
.result-prize.bronze { background: linear-gradient(135deg, #cd7f32, #e8a85c); color: #1a1a2e; }

.result-message {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 1rem 0 1.5rem;
}

.result-actions { display: flex; flex-direction: column; gap: 0.8rem; align-items: center; }

.btn-share {
  background: #1da1f2;
  color: #fff;
  border: none;
  padding: 0.8rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.15s;
}
.btn-share:active { transform: scale(0.95); }

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  border-radius: 50px;
  cursor: pointer;
}

#contact { text-align: center; }
