/* Tests: one test at a time, a big arena to act in, then the familiar result block. */
.tests-head { margin-top: 10px; max-width: 640px; }
.tests-head h1 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 7vw, 52px); letter-spacing: -0.03em; line-height: 1; margin: 0; }
.tests-head p { margin: 8px 0 0; color: var(--muted); font-size: 17px; max-width: 48ch; }
.tab-emoji { font-size: 18px; }
.test { margin-top: 18px; }
.test-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.test h2 { font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: -0.02em; margin: 0; }
.best { font-size: 13px; font-weight: 600; color: var(--accent); }
.best:empty { display: none; }
.test .how { color: var(--muted); margin: 6px 0 14px; max-width: 56ch; }
.jumps { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

/* arenas */
.arena {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 260px; border: 3px solid var(--ink); border-radius: 20px;
  background: var(--surface); color: var(--ink); box-shadow: 5px 5px 0 var(--shadow); cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; transition: background-color .08s, color .08s; overflow: hidden; padding: 16px; font: inherit;
}
.arena-big { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 7vw, 56px); letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; text-align: center; }
.arena-sub { font-size: 14px; font-weight: 600; opacity: .75; min-height: 18px; text-align: center; }
.arena .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: color-mix(in oklch, var(--line), transparent 40%); }
.arena .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .05s linear; }
.arena.rt.wait { background: #e85d4a; color: #fff; }
.arena.rt.go { background: #2fb36a; color: #fff; }
.arena.rt.early { background: #e0a010; color: #1b1b1b; }
.dots { display: flex; gap: 8px; margin-top: 12px; }
.dots i { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 28px; padding: 0 8px; border-radius: 999px; border: 2px solid var(--line); font-size: 12px; font-weight: 700; font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.dots i.on { background: var(--accent); border-color: var(--ink); color: var(--accent-ink); }
.arena.digits { cursor: default; }
.arena.digits .arena-big { font-size: clamp(40px, 10vw, 72px); letter-spacing: 0.08em; }
.arena.digits.recall .arena-big { color: var(--accent); }
.ds-form { display: flex; gap: 8px; margin-top: 12px; }
.ds-form input { flex: 1; min-width: 0; font: inherit; font-size: 24px; letter-spacing: 0.08em; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--surface); color: var(--ink); font-variant-numeric: tabular-nums; }
.arena.cps.running { background: var(--accent); color: var(--accent-ink); }
.arena.cps.running .arena-big { font-size: clamp(56px, 14vw, 96px); }
.arena.timing.running { background: var(--ink); color: var(--bg); }
.arena.breath { min-height: 300px; }
.arena.breath .bubble { position: absolute; width: 60px; height: 60px; border-radius: 50%; background: var(--accent-soft); transition: transform .12s linear; pointer-events: none; }
.arena.breath.running { color: var(--ink); }
.arena.breath .arena-big, .arena.breath .arena-sub { position: relative; }
.arena.verbal { min-height: 220px; }
.arena.verbal.strike { background: #e85d4a; color: #fff; }
#vbButtons { gap: 10px; }
#vbButtons .btn { flex: 1; min-height: 52px; font-size: 18px; }

/* typing, monkeytype-style: words on screen, caret moves over them, upcoming words grey */
.typing-box { position: relative; border: 3px solid var(--ink); border-radius: 20px; background: var(--surface); padding: 16px 18px 18px; box-shadow: 5px 5px 0 var(--shadow); cursor: text; outline: none; }
.typing-box.focus { border-color: var(--accent); }
.typing-stats { display: flex; justify-content: space-between; font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--accent); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.words-clip { height: calc(3 * 1.75em); overflow: hidden; font-size: clamp(18px, 2.6vw, 24px); line-height: 1.75; }
.words { font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; font-size: inherit; line-height: inherit; user-select: none; -webkit-user-select: none; color: var(--muted); opacity: .75; transition: transform .12s; }
.words .word { display: inline-block; margin-right: .6em; white-space: nowrap; position: relative; }
.words .ch { position: relative; }
.words .ch.ok { color: var(--ink); }
.words .ch.bad { color: #e85d4a; text-decoration: underline; text-decoration-thickness: 2px; }
.words .ch.extra { color: #e85d4a; opacity: .7; }
.words .word.done .ch.ok { color: var(--ink); }
.words .word.missed .ch:not(.ok):not(.bad) { text-decoration: underline; text-decoration-color: #e85d4a; }
.words .ch.cur::before, .words .word.end::after { content: ""; position: absolute; width: 2px; height: 1.15em; background: var(--accent); border-radius: 1px; animation: blink 1s steps(2) infinite; }
.words .ch.cur::before { left: -1px; top: .12em; }
.words .word.end::after { right: -3px; top: .3em; }
.typing-box.active .words { opacity: 1; }
.typing-box.active .words .ch.cur::before, .typing-box.active .words .word.end::after { animation: none; }
@keyframes blink { 50% { opacity: 0; } }
.typing-hint { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.typing-box.active .typing-hint, .typing-box.done .typing-hint { visibility: hidden; }
.typing-box.done .words { opacity: .5; }
.ghost-input { position: absolute; opacity: 0; width: 1px; height: 1px; left: 0; top: 0; pointer-events: none; }

/* grids: sequence, visual, chimp */
.grid-arena { cursor: default; min-height: 300px; padding: 18px; }
.level, .lives { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lives { color: #e85d4a; letter-spacing: .1em; }
.corsi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(100%, 320px); }
.corsi button, .vgrid button { aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 12px; background: var(--surface); box-shadow: 3px 3px 0 var(--shadow); cursor: pointer; transition: background-color .08s, transform .08s; padding: 0; }
.corsi button.lit, .vgrid button.lit { background: var(--accent); }
.corsi button.hit, .vgrid button.hit { background: var(--accent); transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--shadow); }
.corsi button.wrong, .vgrid button.wrong { background: #e85d4a; }
.corsi button:disabled, .vgrid button:disabled { cursor: default; }
.vgrid { display: grid; gap: 6px; width: min(100%, 360px); }
.vgrid button { border-width: 2px; border-radius: 8px; box-shadow: 2px 2px 0 var(--shadow); }
.chimp-arena { min-height: 320px; }
.chimp { display: grid; gap: 6px; width: 100%; max-width: 560px; }
.chimp button { aspect-ratio: 1; border-radius: 8px; padding: 0; font: inherit; font-family: var(--display); font-weight: 700; font-size: clamp(14px, 3vw, 22px); }
.chimp button.blank { border: 0; background: transparent; }
.chimp button.num { border: 2px solid var(--ink); background: var(--surface); color: var(--ink); box-shadow: 2px 2px 0 var(--shadow); cursor: pointer; }
.chimp.hide button.num { color: transparent; background: var(--accent-soft); }
.chimp button.num.gone { visibility: hidden; }

/* aim */
.arena.aim { min-height: 340px; cursor: crosshair; }
.aim-text { pointer-events: none; }
.aim-count { position: absolute; right: 14px; top: 10px; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--muted); font-variant-numeric: tabular-nums; }
.target { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--ink); background: var(--accent); box-shadow: 2px 2px 0 var(--shadow); cursor: pointer; padding: 0; transform: translate(-50%, -50%); touch-action: manipulation; }
.target::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--surface); }
.target::before { content: ""; position: absolute; inset: 19px; border-radius: 50%; background: var(--accent); z-index: 1; }

/* result + scorecard */
.result { margin-top: 26px; border-top: 2px solid var(--line); padding-top: 18px; }
.your-value { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(32px, 8vw, 56px); letter-spacing: -0.02em; line-height: 1; }
.your-value small { font-size: .45em; color: var(--muted); font-family: var(--body); font-weight: 500; margin-left: .2em; }
.science { margin-top: 18px; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); font-size: 14px; line-height: 1.5; }
.science h3 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.science p { margin: 4px 0; }
.scorecard { margin-top: 32px; border-top: 2px solid var(--line); padding-top: 16px; }
.scorecard h2 { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -0.02em; margin: 0; }
.scorecard table { border-collapse: collapse; width: 100%; max-width: 560px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.scorecard th, .scorecard td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 15px; }
.scorecard th { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.scorecard td.pctcell { font-family: var(--display); font-weight: 700; color: var(--accent); }
.scorecard td.empty { color: var(--muted); }
