/* ============================================================================
   REACTION SNAP — game styles
   Layered on the shared halftone design system (/assets/style.css).
   Colours are token-driven where possible; the red/green trigger states are
   game-local accents (per-game palettes are an accepted pattern on Josh-Fun).
   ========================================================================== */

.rs-page {
  --rs-wait: #B23A48;   /* newsprint red  — "wait"  */
  --rs-go:   #2F8F57;   /* signal green   — "tap!"  */
  --rs-early:#8A6D1E;    /* amber          — false start */
}

.rs-main {
  width: 92%;
  max-width: 620px;
  margin: 0 auto;
  padding: 28px 0 56px;
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 58px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.rs-screen { display: none; }
.rs-screen.active { display: block; animation: rs-fade .25s ease; }
@keyframes rs-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── INTRO ─────────────────────────────────────────── */
.rs-main h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  color: var(--ht-ink);
  margin: 8px 0 14px;
}

.rs-lede {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ht-ink-mid);
  margin: 0 0 22px;
}
.rs-lede strong { color: var(--rs-go); }

.rs-hiw {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.rs-hiw li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ht-ink);
  background: rgba(var(--ht-ink-raw), 0.04);
  border: 1.5px solid rgba(var(--ht-ink-raw), 0.16);
  border-radius: 6px;
  padding: 10px 14px;
}
.rs-hiw li span {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--ht-ink);
  color: var(--ht-bg);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
}

.rs-challenge-note {
  border: 2px solid var(--ht-accent);
  background: rgba(52, 84, 209, 0.08);
  color: var(--ht-ink);
  font-weight: 600;
  padding: 12px 16px;
  margin: 0 0 18px;
  font-size: 0.95rem;
}

.rs-yesterday {
  margin: 14px 0 0;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ht-ink-mid);
}

/* ── BUTTONS ───────────────────────────────────────── */
.rs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 28px;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--ht-ink);
  background: var(--ht-bg);
  color: var(--ht-ink);
  cursor: pointer;
  transition: background 0.14s, color 0.14s, transform 0.14s;
}
.rs-btn:hover { background: var(--ht-ink); color: var(--ht-bg); }
.rs-btn:active { transform: translateY(1px); }
.rs-btn:focus-visible { outline: 3px solid var(--ht-accent); outline-offset: 2px; }

.rs-btn-primary {
  background: var(--ht-accent);
  color: #fff;
  border-color: var(--ht-accent);
  width: 100%;
  max-width: 320px;
}
.rs-btn-primary:hover { background: var(--ht-ink); border-color: var(--ht-ink); color: var(--ht-bg); }

.rs-btn-ghost { background: transparent; }

/* ── PLAY ──────────────────────────────────────────── */
.rs-progress {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 16px;
}
.rs-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--ht-ink);
  background: transparent;
  transition: background 0.15s;
}
.rs-dot.is-done { background: var(--ht-ink); }
.rs-dot.is-current { background: var(--ht-accent); border-color: var(--ht-accent); }

.rs-pad {
  width: 100%;
  min-height: 46vh;
  border: 3px solid var(--ht-ink);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  cursor: pointer;
  font-family: var(--font-display);
  padding: 24px;
  transition: background 0.06s linear, color 0.06s linear;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.rs-pad:focus-visible { outline: 4px solid var(--ht-accent); outline-offset: 3px; }

.rs-pad-big {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 3rem);
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.05;
}
.rs-pad-sub {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.85;
}

.rs-pad--idle  { background: var(--ht-bg);   color: var(--ht-ink); }
.rs-pad--wait  { background: var(--rs-wait); color: #fff; border-color: var(--rs-wait); }
.rs-pad--go    { background: var(--rs-go);   color: #fff; border-color: var(--rs-go); }
.rs-pad--early { background: var(--rs-early);color: #fff; border-color: var(--rs-early); }
.rs-pad--shown { background: var(--ht-bg);   color: var(--ht-ink); }

.rs-rounds-line {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  letter-spacing: 1px;
  color: var(--ht-ink-mid);
  min-height: 1.4em;
  margin: 14px 0;
}

#rs-abort { display: block; margin: 0 auto; }

/* ── RESULT ────────────────────────────────────────── */
.rs-result-card {
  border: 2px solid var(--ht-ink);
  background: var(--ht-bg);
  box-shadow: 6px 6px 0 rgba(var(--ht-ink-raw), 0.15);
  padding: 28px 22px 26px;
  text-align: center;
}
.rs-result-over {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--ht-ink-mid);
}
.rs-result-big {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 15vw, 5.5rem);
  line-height: 1;
  color: var(--ht-ink);
  margin: 6px 0 2px;
}
.rs-result-big small { font-size: 0.32em; margin-left: 4px; }
.rs-result-label {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ht-ink-mid);
}
.rs-result-msg {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ht-ink);
  margin: 16px auto 4px;
  max-width: 34ch;
}

.rs-stats {
  list-style: none;
  margin: 22px 0 4px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(var(--ht-ink-raw), 0.16);
  border: 1.5px solid rgba(var(--ht-ink-raw), 0.2);
}
.rs-stats li {
  background: var(--ht-bg);
  padding: 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rs-stats strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ht-ink);
}
.rs-stats span {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ht-ink-mid);
}

.rs-result-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}
.rs-result-cta .rs-btn { flex: 1 1 auto; min-width: 150px; max-width: 220px; }

@media (max-width: 420px) {
  .rs-result-cta { flex-direction: column; }
  .rs-result-cta .rs-btn { max-width: none; }

  /* keep the whole result screen close to one mobile viewport */
  .rs-result-card { padding: 22px 15px 18px; }
  .rs-result-big { font-size: clamp(3rem, 16vw, 4rem); }
  .rs-result-msg { margin: 12px auto 2px; font-size: 0.98rem; }
  .rs-stats { margin: 16px 0 2px; }
  .rs-stats strong { font-size: 1.3rem; }
  .rs-result-cta { margin-top: 12px; }
  .rs-page .jf-share { margin-top: 14px; }
}

/* On this game keep the three share buttons wrapping side-by-side rather
   than stacking into three tall rows — the results screen stays compact. */
.rs-page .jf-share-row { flex-direction: row; flex-wrap: wrap; }
.rs-page .jf-share-btn { flex: 1 1 44%; min-width: 128px; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .rs-screen.active { animation: none; }
}
