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

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

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

/* Header */
.header {
  width: 100%;
  text-align: center;
  padding: 1.2rem 1rem 0.8rem;
  background: linear-gradient(135deg, var(--pink), #8b00ff, var(--cyan));
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.title {
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
  letter-spacing: 2px;
  line-height: 1.3;
}

.title-en {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 3px;
  opacity: 0.9;
}

.subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.3rem;
}

.subtitle-en {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Game Container */
.game-container {
  width: 100%;
  max-width: 600px;
  padding: 0.5rem 1rem 1rem;
  flex: 1;
}

/* HUD */
.hud {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hud-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  font-weight: 700;
}

.hud-value {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--cyan);
  font-family: 'Courier New', monospace;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

#lives-display {
  font-size: 1rem;
  letter-spacing: 2px;
}

/* Canvas */
.canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  z-index: 2;
}

/* Touch Controls */
.touch-controls {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0;
  margin-top: 0.5rem;
}

.touch-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.touch-btn:active {
  transform: scale(0.9);
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.touch-fire {
  width: 80px;
  height: 80px;
  font-size: 2rem;
  border-color: var(--pink);
  background: linear-gradient(135deg, rgba(255, 45, 120, 0.2), rgba(255, 45, 120, 0.05));
}

.touch-fire:active {
  border-color: var(--pink);
  box-shadow: 0 0 16px rgba(255, 45, 120, 0.5);
}

/* High Score */
.high-score-bar {
  text-align: center;
  padding: 0.5rem;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
}

/* CTA */
.cta-section {
  text-align: center;
  padding: 0.8rem 0;
}

.patreon-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--pink), #ff6b35);
  color: #fff;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(255, 45, 120, 0.3);
}

.patreon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 45, 120, 0.5);
}

/* How to Play */
.how-to-play {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 1rem;
  overflow: hidden;
}

.how-to-play summary {
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--cyan);
  list-style: none;
}

.how-to-play summary::-webkit-details-marker {
  display: none;
}

.how-to-play summary::before {
  content: '▶ ';
  font-size: 0.7rem;
}

.how-to-play[open] summary::before {
  content: '▼ ';
}

.how-to-play-content {
  padding: 0 1rem 1rem;
}

.how-to-play-content h3 {
  color: var(--pink);
  font-size: 0.9rem;
  margin: 0.8rem 0 0.4rem;
}

.how-to-play-content ul {
  list-style: none;
  padding: 0;
}

.how-to-play-content li {
  padding: 0.2rem 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.how-to-play-content li::before {
  content: '• ';
  color: var(--cyan);
}

/* Footer */
.footer {
  width: 100%;
  text-align: center;
  padding: 1rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
}

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

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

/* Mobile */
@media (pointer: coarse) {
  .touch-controls {
    display: flex;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 1.4rem;
  }

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

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

  .touch-btn {
    width: 56px;
    height: 56px;
    font-size: 1.3rem;
  }

  .touch-fire {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
  }

  .patreon-btn {
    font-size: 0.8rem;
    padding: 0.6rem 1.2rem;
  }
}
