@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Noto+Sans+JP:wght@400;700;900&display=swap');

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

body {
  background: #0a0a0f;
  color: #fff;
  font-family: 'Noto Sans JP', 'Orbitron', sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ========== TITLE SCREEN ========== */
#title-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 10;
  text-align: center;
  padding: 20px;
}

.brand-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  color: #ff2d7b;
  letter-spacing: 6px;
  text-transform: uppercase;
  text-shadow: 0 0 10px #ff2d7b88;
}

.game-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(28px, 6vw, 52px);
  font-weight: 900;
  background: linear-gradient(135deg, #ff2d7b, #00e5ff, #ff2d7b);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
  line-height: 1.2;
}

.game-subtitle {
  font-size: clamp(14px, 3vw, 20px);
  color: #aaa;
  margin-top: -10px;
}

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

.title-preview {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}

.title-preview img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ff2d7b;
  box-shadow: 0 0 15px #ff2d7b55;
  animation: floatItem 2s ease-in-out infinite;
}

.title-preview img:nth-child(2) { animation-delay: 0.3s; }
.title-preview img:nth-child(3) { animation-delay: 0.6s; }

@keyframes floatItem {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.how-to {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 45, 123, 0.3);
  border-radius: 12px;
  padding: 16px 24px;
  font-size: 14px;
  line-height: 1.8;
  text-align: left;
  max-width: 360px;
}

.how-to span.en {
  font-size: 11px;
  color: #888;
}

.how-to .item-good { color: #00e5ff; }
.how-to .item-bonus { color: #ffd700; }
.how-to .item-bad { color: #ff4444; }

.btn-start {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 700;
  padding: 16px 48px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #ff2d7b, #ff6b9d);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 30px #ff2d7b55;
  transition: all 0.3s;
  letter-spacing: 2px;
}

.btn-start:hover {
  transform: scale(1.05);
  box-shadow: 0 0 50px #ff2d7b88;
}

.btn-start:active {
  transform: scale(0.98);
}

/* ========== GAME HUD ========== */
#game-screen {
  display: none;
  width: 100%;
  height: 100%;
  position: relative;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
  z-index: 5;
  pointer-events: none;
}

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

.hud-label {
  font-size: 10px;
  color: #888;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 1px;
}

.hud-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  font-weight: 700;
}

#hud-score .hud-value { color: #00e5ff; text-shadow: 0 0 10px #00e5ff88; }
#hud-combo .hud-value { color: #ffd700; text-shadow: 0 0 10px #ffd70088; }
#hud-timer .hud-value { color: #ff2d7b; text-shadow: 0 0 10px #ff2d7b88; }

.combo-burst {
  animation: comboBurst 0.3s ease;
}

@keyframes comboBurst {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* ========== RESULT SCREEN ========== */
#result-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  text-align: center;
  padding: 20px;
}

.result-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 900;
  color: #00e5ff;
  text-shadow: 0 0 20px #00e5ff88;
}

.result-score {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(48px, 10vw, 80px);
  font-weight: 900;
  background: linear-gradient(135deg, #ff2d7b, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: scorePulse 1.5s ease-in-out infinite;
}

@keyframes scorePulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 320px;
  width: 100%;
}

.stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 45, 123, 0.2);
  border-radius: 10px;
  padding: 12px;
}

.stat-label {
  font-size: 11px;
  color: #888;
}

.stat-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #00e5ff;
}

.result-rank {
  font-size: 18px;
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 700;
}

.rank-s { background: linear-gradient(135deg, #ffd700, #ff8c00); color: #000; }
.rank-a { background: linear-gradient(135deg, #ff2d7b, #ff6b9d); color: #fff; }
.rank-b { background: linear-gradient(135deg, #00e5ff, #0099cc); color: #000; }
.rank-c { background: linear-gradient(135deg, #666, #999); color: #fff; }

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-share {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 50px;
  background: #1da1f2;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-share:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px #1da1f288;
}

.btn-retry {
  padding: 12px 24px;
  border: 2px solid #00e5ff;
  border-radius: 50px;
  background: transparent;
  color: #00e5ff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-retry:hover {
  background: #00e5ff22;
  transform: scale(1.05);
}

.patreon-cta {
  margin-top: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #ff424d, #ff2d7b);
  border: none;
  border-radius: 50px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  box-shadow: 0 0 25px #ff2d7b44;
}

.patreon-cta:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px #ff2d7b88;
}

.patreon-cta .en {
  font-size: 11px;
  opacity: 0.8;
}

.footer-brand {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  color: #555;
  letter-spacing: 3px;
  margin-top: 10px;
}

/* ========== COUNTDOWN OVERLAY ========== */
#countdown-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 20;
  align-items: center;
  justify-content: center;
}

#countdown-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 120px;
  font-weight: 900;
  color: #00e5ff;
  text-shadow: 0 0 40px #00e5ff88;
  animation: countPulse 1s ease-in-out infinite;
}

@keyframes countPulse {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}
