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

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

.screen.hidden {
  display: none;
}

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

.title-scores {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 1.3rem;
}

.label {
  opacity: 0.6;
  font-size: 0.72rem;
  display: block;
}

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

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

.btn-primary {
  padding: 14px 40px;
  font-size: 1.1rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #0099dd, #0055bb);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 153, 221, 0.45);
  -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-around;
  align-items: center;
  width: 100%;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 1.1rem;
  flex-shrink: 0;
  z-index: 10;
}

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

.timer-group #timer {
  font-size: 1.4rem;
  font-weight: bold;
  color: #55ddff;
}

.timer-group #timer.urgent {
  color: #ff5555;
  animation: blink 0.5s infinite alternate;
}

@keyframes blink {
  from { opacity: 1; }
  to   { opacity: 0.3; }
}

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

.atari-mark {
  position: fixed;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  font-weight: bold;
  color: #ff4444;
  text-shadow: 0 0 20px #ff0000;
  pointer-events: none;
  z-index: 20;
  animation: atariPop 0.3s ease-out;
}

.atari-mark.hidden {
  display: none;
}

@keyframes atariPop {
  from { transform: translate(-50%, -50%) scale(0.3); }
  to   { transform: translate(-50%, -50%) scale(1); }
}

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

.catch-popup {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.6rem;
  font-weight: bold;
  text-align: center;
  pointer-events: none;
  z-index: 25;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  animation: catchPop 0.4s ease-out;
}

.catch-popup.hidden {
  display: none;
}

@keyframes catchPop {
  from { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

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

.result-emoji { font-size: 3.5rem; }
.result-title { font-size: 1.9rem; font-weight: bold; }
.result-score, .result-best { font-size: 1.25rem; }
