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

body {
  font-family: 'Hiragino Maru Gothic Pro', 'BIZ UDPGothic', sans-serif;
  background: #e8f4ff;
  color: #333;
  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: 18px;
}

.screen.hidden { display: none; }

.logo {
  font-size: 2.2rem;
  color: #2244aa;
  text-shadow: 0 2px 8px rgba(34, 68, 170, 0.2);
}

.title-rule {
  text-align: center;
  line-height: 1.8;
  color: #555;
  font-size: 0.92rem;
}

.stage-buttons {
  display: flex;
  gap: 12px;
}

.btn-stage {
  padding: 16px 20px;
  font-size: 0.95rem;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #66aaff, #3366dd);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(51, 102, 221, 0.35);
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  line-height: 1.6;
}

.btn-stage small {
  font-size: 0.72rem;
  font-weight: normal;
  opacity: 0.85;
}

.btn-primary {
  padding: 14px 40px;
  font-size: 1.05rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #66aaff, #3355dd);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-secondary {
  padding: 10px 26px;
  font-size: 0.9rem;
  border: 2px solid rgba(0,0,0,0.15);
  border-radius: 999px;
  background: transparent;
  color: #555;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

.game-header {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  padding: 6px 14px;
  background: rgba(0,0,50,0.35);
  color: #fff;
  flex-shrink: 0;
  z-index: 10;
  font-size: 1rem;
}

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

.label {
  font-size: 0.7rem;
  opacity: 0.65;
  display: block;
}

#timer {
  font-size: 1.4rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

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

.fall-msg {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: bold;
  color: #ff3333;
  background: rgba(255,255,255,0.88);
  padding: 12px 24px;
  border-radius: 12px;
  z-index: 20;
  pointer-events: none;
}

.fall-msg.hidden { display: none; }

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

.result-emoji { font-size: 3.5rem; }
.result-title { font-size: 2rem; font-weight: bold; color: #2244aa; }
.result-score, .result-best { font-size: 1.2rem; color: #444; }
