:root {
  --hot-pink: #ff2d78; --electric-blue: #00c2ff; --sunny: #ffd23f;
  --lime: #7bed4f; --grape: #9b5de5; --tangerine: #ff6b35;
  --cream: #fff8f0; --ink: #1a1a2e; --ink-light: #3d3d5c;
  --muted: #62627b; --card-bg: #fff;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 1rem/1.5 'Outfit', 'Inter', system-ui, sans-serif; }
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
h1, h2, p { margin: 0; }
.fun-font { font-family: 'Titan One', 'Outfit', sans-serif; font-weight: 400; }
.color-bar { display: flex; height: 6px; }
.color-bar span { flex: 1; background: var(--hot-pink); }
.color-bar span:nth-child(2) { background: var(--grape); }
.color-bar span:nth-child(3) { background: var(--lime); }
.color-bar span:nth-child(4) { background: var(--sunny); }
.color-bar span:nth-child(5) { background: var(--electric-blue); }
.reaction-skip { position: fixed; top: 1rem; left: 1rem; z-index: 2000; padding: .75rem; background: var(--card-bg); transform: translateY(-200%); }
.reaction-skip:focus { transform: none; }
.reaction-main { width: min(100%, 600px); margin: auto; padding: 16px 16px 40px; }
.reaction-main:focus { outline: none; }
.reaction-breadcrumb { font-size: .85rem; margin-bottom: 18px; }
.reaction-heading { text-align: center; margin-bottom: 22px; }
.reaction-eyebrow { font-size: .72rem; letter-spacing: .12em; font-weight: 800; margin-bottom: 8px; }
h1 { overflow-wrap: anywhere; font-size: clamp(2.1rem, 9vw, 3.3rem); line-height: 1.12; margin-bottom: 12px; text-decoration: underline; text-decoration-color: var(--sunny); text-decoration-thickness: 7px; text-underline-offset: 4px; }
.reaction-heading > p:last-child { font-size: 1.05rem; }
.game-container { border: 2px solid var(--ink); border-radius: 20px; padding: 20px; background: var(--card-bg); box-shadow: 5px 5px 0 var(--grape); }
.game-container h2 { font-size: 1.25rem; line-height: 1.3; }
#reaction-setup > p { margin-top: 12px; }
.reaction-attempt { width: fit-content; max-width: 100%; margin: 0 auto 16px; padding: 6px 14px; border: 2px solid var(--ink); border-radius: 10px; background: var(--sunny); font-weight: 800; }
.reaction-pad { width: 100%; min-height: 260px; display: grid; justify-items: center; align-content: center; grid-template-rows: 44px minmax(2.4em, auto) minmax(3em, auto); gap: 8px; padding: 16px; border: 3px solid var(--ink); border-radius: 18px; background: #ffd23f; color: var(--ink); scroll-margin-top: 90px; scroll-margin-bottom: 16px; }
.reaction-pad svg { width: 44px; height: 44px; pointer-events: none; }
#reaction-cue { font-size: clamp(1.5rem, 8vw, 2.7rem); line-height: 1.15; min-height: 2.4em; display: grid; place-items: center; overflow-wrap: anywhere; max-width: 100%; }
#reaction-hint { min-height: 3em; line-height: 1.5; display: grid; place-items: center; }
[data-phase="ready"] .reaction-pad { background: #7bed4f; box-shadow: inset 0 0 0 4px #fff; }
[data-phase="feedback"] .reaction-pad, [data-phase="completed"] .reaction-pad { background: #f0e5ff; }
.reaction-pad[data-outcome="early"] { background: #ffd0df; }
.reaction-pad[aria-disabled="true"] { cursor: default; }
.reaction-summary { margin-top: 16px; text-align: center; font-weight: 800; }
.reaction-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.reaction-primary, .reaction-secondary { min-height: 52px; flex: 1; min-width: 110px; border: 2px solid var(--ink); border-radius: 10px; padding: 11px 14px; font-weight: 800; line-height: 1.3; }
.reaction-primary { background: var(--lime); box-shadow: 3px 3px 0 var(--ink); }
.reaction-secondary { background: var(--card-bg); }
.reaction-status { font-size: .9rem; margin-top: 16px; }
.reaction-status:empty { margin: 0; }
.reaction-best { text-align: center; font-size: 1.05rem; font-weight: 800; margin-top: 20px; }
.reaction-small { font-size: .85rem; color: var(--ink-light); }
#reaction-storage { text-align: center; margin-top: 5px; }
.reaction-keyboard { margin: 20px 4px 28px; }
.reaction-about { border-top: 2px solid var(--ink); padding-top: 22px; }
.reaction-about h2 { font-size: 1.3rem; }
.reaction-about p { margin-top: 12px; }
#reaction-share-fallback { margin-top: 18px; }
label { display: block; font-weight: 700; margin-bottom: 8px; }
textarea { width: 100%; border: 2px solid var(--ink); border-radius: 8px; background: var(--card-bg); padding: 10px; resize: vertical; }
[data-theme="pro"] .reaction-primary { background: #0a66c2; color: #fff; box-shadow: none; }
@media (max-width: 359px) {
  .reaction-main { padding-inline: 12px; }
  .reaction-heading { margin-bottom: 14px; }
  .game-container { padding: 14px 12px; }
  .game-container h2 { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

#reaction-play { scroll-margin-top: 90px; }
#reaction-paused { margin: 24px 0; text-align: center; }

.reaction-history { margin-top: 24px; padding: 18px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card-bg); }
.reaction-history h2 { font-size: 1.2rem; }
#reaction-results { padding-left: 24px; margin-bottom: 0; }
#reaction-results li { padding: 6px 0; }
#reaction-results .is-best { font-weight: 800; }
[data-theme="pro"] .reaction-pad { background: #fff1d6; }
[data-theme="pro"] [data-phase="ready"] .reaction-pad { background: #e4f5ed; }
[data-theme="pro"] .reaction-pad[data-outcome="early"] { background: #fce5ea; }
