/* ——— Reset ——— */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ——— Page baseline ——— */
body {
  margin: 0;
  background: #050608;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* ——— Game container ——— */
.game {
  width: 320px;
  height: 560px;
  background: #111;
  border-radius: 14px;
  position: relative;
  overflow: hidden;

  box-shadow: inset 0 0 0 rgba(0,0,0,0);
  transition: box-shadow 0ms ease-out, background 0.25s ease;
}

/* ——— HUD ——— */
.hud {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
}

#reaction {
  font-size: 32px;
  color: #e8e8e8;
  margin-bottom: 4px;
  transition: transform 0.15s ease-out, opacity 0.15s ease-out, color 0.15s ease-out;
}

#best {
  font-size: 18px;
  color: #a0a0a0;
}

/* False start flash */
#reaction.false {
  color: #ff6b6b;
}

/* ——— Start screen ——— */
.start-screen {
  position: absolute;
  inset: 0;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: opacity 0.3s ease-out;
}

.start-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.start-text {
  color: #e8e8e8;
  font-size: 24px;
}

/* ——— Moving dot ——— */
.moving-dot {
  width: 26px;
  height: 26px;
  background: #7cffb4;
  border-radius: 50%;
  position: absolute;
  left: calc(50% - 13px);
  top: -50px;
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

/* ——— Fast reaction tint (<250ms) ——— */
.game.fast-reaction {
  background: #1f2a1f;
}

/* ——— Perfect reaction glow (<200ms) ——— */
.game.perfect-reaction {
  box-shadow: 0 0 18px rgba(120, 255, 180, 0.35);
}

/* ——— Anticipation glow (bloom + fade) ——— */
.game.anticipation {
  box-shadow: inset 0 0 18px rgba(120, 255, 180, 0.35);
}