/* ===========================================================
   Reaction Test — game-specific styles only.
   Chrome (body, h1, button, #status, .hint, .stat) comes from
   shared.css. Colours use the shared tokens so light/dark both work.
   =========================================================== */

/* A touch tighter than the default column gap. */
body { gap: 16px; }

/* ---------- the big target area ---------- */
#target {
  /* Big, finger-friendly target that scales with the viewport but
     never gets silly on large screens or cramped on tiny phones. */
  width: min(86vw, 480px);
  height: min(48vh, 340px);
  min-height: 220px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 6px 20px var(--shadow);
  border: 1px solid var(--border);
  transition: background 0.08s ease, color 0.08s ease;
  outline: none;
}

#target:focus-visible {
  box-shadow: 0 0 0 3px var(--accent), 0 6px 20px var(--shadow);
}

#targetText {
  font-size: clamp(1.4rem, 6vw, 2.6rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.5px;
}

/* The small print under the headline number (e.g. "ms"). */
#targetText small {
  display: block;
  margin-top: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.85;
}

/* ---------- target states ---------- */

/* Idle / ready to begin. */
#target.idle {
  background: var(--surface);
  color: var(--text);
}

/* Armed — waiting for the green flip. Red = "don't click yet". */
#target.waiting {
  background: var(--red);
  color: #fff;
  cursor: progress;
}

/* GO! — the moment to react. */
#target.go {
  background: var(--green);
  color: #fff;
}

/* A result is shown (success or too-soon); tap to go again. */
#target.result {
  background: var(--surface);
  color: var(--text);
}

/* Jumped the gun. */
#target.tooSoon {
  background: var(--red);
  color: #fff;
}

/* ---------- stat row ---------- */
.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- attempt history ---------- */
#history {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 1.6rem;
  max-width: min(86vw, 480px);
}

#history .chip {
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 1px 4px var(--shadow);
}

/* Mark a new best with the gold accent. */
#history .chip.best {
  background: var(--accent);
  color: var(--accent-text);
}

/* ---------- reset button: smaller + quieter than the default ---------- */
#reset {
  padding: 8px 18px;
  font-size: 0.85rem;
  background: var(--surface-3);
  color: var(--text);
}

/* ---------- small screens ---------- */
@media (max-width: 380px) {
  #target { min-height: 200px; }
  .hint { max-width: 90vw; }
}
