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

body {
  font-family: 'Hiragino Maru Gothic Pro', 'BIZ UDPGothic', sans-serif;
  background: #1a0a2e;
  color: #fff;
  height: 100dvh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.screen.hidden { display: none; }

/* タイトル */
.logo {
  font-size: 2.1rem;
  text-shadow: 0 2px 14px rgba(180, 80, 255, 0.6);
}

.title-rule {
  text-align: center;
  line-height: 1.8;
  opacity: 0.85;
  font-size: 0.9rem;
}

.title-rule small { font-size: 0.78rem; opacity: 0.7; }

.btn-primary {
  padding: 14px 42px;
  font-size: 1.1rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #aa44ff, #6600cc);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(170, 68, 255, 0.5);
  -webkit-tap-highlight-color: transparent;
}

.btn-secondary {
  padding: 10px 28px;
  font-size: 0.95rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ゲーム画面 */
#screen-game { justify-content: flex-start; padding: 0; }

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  z-index: 10;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
}

.score-label {
  font-size: 0.72rem;
  opacity: 0.65;
}

.hearts {
  display: flex;
  gap: 4px;
  font-size: 1.2rem;
}

.round-info {
  font-size: 0.9rem;
  font-weight: bold;
  opacity: 0.9;
  text-align: center;
}

#renderCanvas {
  flex: 1;
  width: 100%;
  touch-action: none;
  display: block;
  outline: none;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 20;
  pointer-events: none;
}

.overlay.hidden { display: none; }

#overlay-text {
  font-size: 3.5rem;
  font-weight: bold;
  text-shadow: 0 0 30px currentColor;
  animation: overlayPop 0.3s ease-out;
}

@keyframes overlayPop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.cooldown-bar {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  overflow: hidden;
  z-index: 15;
}

.cooldown-bar.hidden { display: none; }

#cooldown-fill {
  height: 100%;
  background: linear-gradient(90deg, #aa44ff, #ff44aa);
  border-radius: 3px;
  width: 0%;
  transition: width 0.05s linear;
}

.state-hint {
  position: fixed;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.68rem;
  opacity: 0.45;
  z-index: 10;
  pointer-events: none;
}

/* リザルト */
.result-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.result-emoji { font-size: 3.5rem; }
.result-title { font-size: 2rem; font-weight: bold; }
