/* Hallmark · shape: kept · genre: playful · theme: Arcade (deal 2/3, seed japanese-browser-tests-reflexes-27d3·d5f8701d·2026-12-02·r0) · redesign: restyle
 * hero: kept · nav: kept, a wordmark and a row of menu links, the current one lit as the cursor row · footer: kept · imagery: the product (the test screens) · signature: the test screen as a CRT well that turns signal red and green, the score set large in the acid ink · arcade: ember/grille
 * axes: dark/pixel/chromatic-ember · posture: full-palette · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R4 V4 · weakest: S, a dark arcade skin could suit any game site; tied it to the tests: the stage states are the signal lamps, the scores are pixel figures, the menu rows light like a cabinet's */
/* Hallmark · dismissed 23 · the score is a heavy system-face figure in the acid ink, which the Arcade theme sets as its figure colour; accent stays off running text */
/* Hallmark · display face: M PLUS 1 at 700 stands in for Bungee because the headings are Japanese and Bungee has no kana or kanji; a pixel kana face read as blurred and Dela Gothic One as too heavy, and the Silkscreen pixel figures were dropped at the owner's request, so the page carries no pixel type; the body and the scores use the system Japanese face, and M PLUS 1 is loaded only for the characters the headings use (build.py subsets it) */

@import url("./tokens.css");
@import url("./base.css");

:root {
  --text-body: 1.125rem;
  --color-wait: oklch(52% 0.2 25);
  --color-go: oklch(80% 0.2 145);
  --color-go-ink: oklch(14% 0.04 312);
  --color-stim-0: oklch(68% 0.21 27);
  --color-stim-1: oklch(70% 0.15 250);
  --color-stim-2: oklch(76% 0.19 145);
  --color-stim-3: oklch(89% 0.17 100);
}

body { font-size: var(--text-body); line-height: 1.85; }
h1, h2, h3, .stage-big { word-break: auto-phrase; }
a { color: var(--color-ink); text-decoration-color: var(--color-accent-2); text-decoration-thickness: 2px; }
a:hover { color: var(--color-accent-2); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-md); }

/* chrome */
.site-header { background: var(--color-paper-2); border-bottom: var(--rule-bar) solid var(--color-rule); }
.site-header .wrap { display: flex; align-items: center; gap: var(--space-xs) var(--space-lg); padding-block: var(--space-sm); }
.logo { flex: none; font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); color: var(--color-ink); text-decoration: none; }
.logo:hover { color: var(--color-ink); }
.site-header nav { min-width: 0; }
.nav { list-style: none; display: flex; gap: var(--space-2xs); margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.nav a { display: block; white-space: nowrap; color: var(--color-ink-2); text-decoration: none; font-size: var(--text-md); font-weight: 700; padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-card); }
.nav a:hover { background: var(--color-paper-3); color: var(--color-ink); }
.nav a[aria-current="page"] { background: var(--color-accent); color: var(--color-accent-ink); transition: background-color var(--dur-micro) steps(1); }

.breadcrumb { font-size: var(--text-sm); color: var(--color-muted); margin-top: var(--space-md); }
.breadcrumb a { color: var(--color-muted); text-decoration-color: var(--color-rule); }
h1 { max-width: none; font-size: clamp(1.625rem, 1.8vw + 1rem, 2.25rem); line-height: 1.3; margin: var(--space-md) 0 var(--space-xs); }
.lead { margin: 0 0 var(--space-md); color: var(--color-ink-2); font-size: var(--text-body); line-height: 1.8; max-width: 70ch; }

/* the test screen */
.test { margin-bottom: var(--space-2xl); }
.stage { position: relative; isolation: isolate; overflow: hidden; height: 360px; border: var(--rule-bar) solid var(--color-rule); border-radius: var(--radius-card); color: var(--color-ink); cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; display: flex; align-items: center; justify-content: center; text-align: center; outline: none; -webkit-tap-highlight-color: transparent; }
.stage::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    repeating-linear-gradient(to right, color-mix(in oklab, var(--color-crt-r) 5%, transparent) 0 1px, color-mix(in oklab, var(--color-crt-g) 5%, transparent) 1px 2px, color-mix(in oklab, var(--color-crt-b) 5%, transparent) 2px 3px),
    repeating-linear-gradient(to bottom, transparent 0 2px, color-mix(in oklab, var(--color-shade) 16%, transparent) 2px 3px); }
.stage:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.stage-idle { background: var(--color-paper-2); }
.stage-wait { background: var(--color-wait); border-color: var(--color-wait); }
.stage-go { background: var(--color-go); border-color: var(--color-go); color: var(--color-go-ink); }
.stage-early { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.stage-light { background: var(--color-paper-3); }
.stage-light.stage-idle { background: var(--color-paper-2); }
.stage-inner { padding: var(--space-lg); pointer-events: none; }
.stage-big { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.75rem, 5vw, 3rem); margin: 0; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stage-small { margin: var(--space-xs) 0 0; font-size: var(--text-md); font-weight: 700; }
.stage-idle .stage-small, .stage-light .stage-small { color: var(--color-ink-2); }

.progress { display: flex; gap: var(--space-xs); justify-content: center; margin: var(--space-sm) 0 0; min-height: 8px; }
.progress i { width: 32px; height: 8px; background: var(--color-paper-3); }
.progress i.done { background: var(--color-accent-2); }

.status { display: flex; gap: var(--space-lg); justify-content: center; color: var(--color-ink-2); font-size: var(--text-md); font-weight: 700; margin-top: var(--space-xs); font-variant-numeric: tabular-nums; }
.status b { color: var(--color-ink); }
.lives { display: inline-flex; gap: var(--space-3xs); vertical-align: -2px; }
.lives svg { width: 16px; height: 16px; fill: var(--color-accent); }
.lives svg.lost { fill: none; stroke: var(--color-rule); stroke-width: 2; }

/* the score */
.result { background: var(--color-paper-2); border: var(--rule-bar) solid var(--color-rule); border-radius: var(--radius-card); padding: var(--space-lg); margin-top: var(--space-md); text-align: center; }
.result-label { margin: 0; color: var(--color-ink-2); font-weight: 700; }
.result-score { margin: var(--space-xs) 0 0; font-family: var(--font-body); font-weight: 900; letter-spacing: -0.02em; font-size: clamp(3rem, 8vw, 4.5rem); line-height: 1.1; color: var(--color-accent-2); font-variant-numeric: tabular-nums; }
.result-score small { font-family: var(--font-body); font-size: var(--text-md); margin-left: var(--space-xs); color: var(--color-ink-2); font-weight: 700; }
.result-rank { font-size: var(--text-lg); font-weight: 900; margin: var(--space-2xs) 0 var(--space-xs); color: var(--color-accent); }
.result-sub { margin: 0 0 var(--space-xs); color: var(--color-ink-2); }
.result-sub b { color: var(--color-ink); }
.result-list { list-style: none; padding: 0; margin: var(--space-xs) 0; display: flex; flex-wrap: wrap; gap: var(--space-xs); justify-content: center; font-variant-numeric: tabular-nums; }
.result-list li { border: var(--rule-hair) solid var(--color-rule); padding: var(--space-3xs) var(--space-sm); font-size: var(--text-md); }
.best { color: var(--color-ink-2); font-size: var(--text-md); margin: var(--space-xs) 0; }
.compare { max-width: 560px; margin: var(--space-md) auto; text-align: left; font-variant-numeric: tabular-nums; }
.bar { display: grid; grid-template-columns: 12.5em minmax(0, 1fr) 4.5em; gap: var(--space-xs); align-items: center; font-size: var(--text-md); margin: var(--space-2xs) 0; color: var(--color-ink-2); }
.bar span.track { height: 12px; background: var(--color-paper-3); overflow: hidden; }
.bar span.track i { display: block; height: 100%; background: var(--color-muted); }
.bar.you { font-weight: 700; color: var(--color-ink); }
.bar.you span.track i { background: var(--color-accent); }
.compare-source { font-size: var(--text-sm); color: var(--color-muted); margin: var(--space-xs) 0 0; text-align: right; }

/* controls: the press surface */
.actions { display: flex; flex-wrap: wrap; gap: var(--space-md); justify-content: center; align-items: center; margin-top: var(--space-md); }
.btn, .share a, .choice { font-weight: 700; border: var(--rule-bar) solid var(--color-ink); border-radius: var(--radius-card); box-shadow: var(--shadow-card); cursor: pointer; text-decoration: none;
  transition: translate var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out); }
.btn { min-height: 48px; padding: var(--space-xs) var(--space-lg); background: var(--color-accent); color: var(--color-accent-ink); }
.btn:hover, .share a:hover, .choice:hover { translate: -1px -1px; box-shadow: 7px 7px 0 var(--color-accent-2); }
.btn:active, .share a:active, .choice:active { translate: 3px 3px; box-shadow: 2px 2px 0 var(--color-accent-2); }
.btn:disabled, .choice:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; translate: none; }
.share { display: flex; gap: var(--space-md); }
.share a { display: inline-flex; align-items: center; min-height: 48px; padding: var(--space-xs) var(--space-md); font-size: var(--text-md); background: transparent; color: var(--color-ink); }
.share a:hover { color: var(--color-ink); }

/* answer form */
.answer { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-md); justify-content: center; align-items: center; margin-top: var(--space-md); }
.answer label { width: 100%; text-align: center; color: var(--color-ink-2); font-size: var(--text-md); font-weight: 700; }
.answer input { height: 52px; width: min(320px, 70vw); padding: 0 var(--space-sm); font-family: var(--font-body); font-size: var(--text-xl); font-weight: 700; letter-spacing: .15em; text-align: center; color: var(--color-ink); background: var(--color-paper); border: var(--rule-bar) solid var(--color-muted); border-radius: 0; font-variant-numeric: tabular-nums; }
.answer input:hover { border-color: var(--color-ink-2); }
.answer input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; border-color: var(--color-ink); }
.answer input:disabled { opacity: .5; cursor: not-allowed; }
.answer .btn { height: 52px; }

/* 動体視力: the moving number */
.mover { visibility: hidden; position: absolute; left: 0; top: 50%; font-family: var(--font-body); font-size: 2.75rem; font-weight: 900; letter-spacing: .08em; white-space: nowrap; will-change: transform; font-variant-numeric: tabular-nums; }

/* 記憶力: the digits and their timer */
.digits { font-family: var(--font-body); font-size: clamp(2rem, 7vw, 3.5rem); font-weight: 900; letter-spacing: .12em; word-break: break-all; padding: 0 var(--space-md); font-variant-numeric: tabular-nums; }
.timebar { position: absolute; left: 0; bottom: 0; width: 100%; height: 8px; background: var(--color-paper-3); }
.timebar span { display: block; height: 100%; width: 100%; background: var(--color-accent-2); transform-origin: left; }

/* エイム: the target */
.stage-aim { cursor: crosshair; }
.target { position: absolute; width: 60px; height: 60px; translate: -50% -50%; border: var(--rule-bar) solid var(--color-ink); border-radius: 50%; padding: 0; cursor: crosshair; touch-action: manipulation;
  background: radial-gradient(circle, var(--color-ink) 0 16%, var(--color-accent) 17% 40%, var(--color-accent-ink) 41% 56%, var(--color-accent) 57%); }

/* 脳年齢: the coloured word and the four answers */
.word { font-family: var(--font-body); font-size: clamp(3rem, 12vw, 5rem); font-weight: 900; margin: 0; }
.ink-0 { color: var(--color-stim-0); } .ink-1 { color: var(--color-stim-1); } .ink-2 { color: var(--color-stim-2); } .ink-3 { color: var(--color-stim-3); }
.choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-md); margin-top: var(--space-md); }
.choice { min-height: 52px; font-size: var(--text-lg); padding: var(--space-sm) var(--space-2xs); background: var(--color-paper-2); color: var(--color-ink); touch-action: manipulation; }
.choice kbd { display: inline-block; font-family: var(--font-body); font-size: var(--text-xs); color: var(--color-muted); border: var(--rule-hair) solid var(--color-rule); padding: 0 var(--space-2xs); margin-right: var(--space-xs); vertical-align: middle; }

/* あなたの記録: history chart under the test */
.history { border-top: var(--rule-bar) solid var(--color-rule); padding: var(--space-lg) 0 var(--space-xl); }
.history h2 { max-width: none; font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); line-height: 1.25; margin: var(--space-sm) 0 var(--space-xs); }
.history-note { font-size: var(--text-lg); font-weight: 700; color: var(--color-ink); margin: 0 0 var(--space-2xs); }
.history-sub { color: var(--color-ink-2); font-size: var(--text-md); margin: 0 0 var(--space-sm); }
.chart { position: relative; background: var(--color-paper-2); border: var(--rule-bar) solid var(--color-rule); border-radius: var(--radius-card); padding: var(--space-xs) 0; }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart svg:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.chart-grid { stroke: var(--color-rule); stroke-width: 1; }
.chart-axis { fill: var(--color-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: var(--color-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--color-accent); stroke: var(--color-paper-2); stroke-width: 2; }
.chart-label { fill: var(--color-ink); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-cross { stroke: var(--color-muted); stroke-width: 1; }
.chart-focus { fill: none; stroke: var(--color-accent-2); stroke-width: 2; }
.chart-tip { position: absolute; pointer-events: none; white-space: nowrap; background: var(--color-paper); color: var(--color-ink); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-card); padding: var(--space-2xs) var(--space-xs); font-size: var(--text-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.history-table { margin-top: var(--space-sm); }
.history-table summary { cursor: pointer; font-weight: 700; color: var(--color-ink-2); }
.history-table summary:hover { color: var(--color-accent-2); }
.history-table .table { margin-top: var(--space-xs); }
.history-privacy { color: var(--color-muted); font-size: var(--text-sm); margin-top: var(--space-sm); display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); align-items: center; }
.history-clear { font: inherit; font-size: var(--text-sm); font-weight: 700; color: var(--color-ink-2); background: transparent; border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-card); padding: var(--space-2xs) var(--space-sm); cursor: pointer; }
.history-clear:hover { color: var(--color-ink); border-color: var(--color-ink-2); }
.history-clear:active { background: var(--color-paper-3); }

/* the reference text below the test */
.content, .faq, .related { border-top: var(--rule-bar) solid var(--color-rule); padding: var(--space-lg) 0 var(--space-xl); }
.content h2, .faq h2, .related h2 { max-width: none; font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); letter-spacing: 0; line-height: 1.25; margin: var(--space-xl) 0 var(--space-sm); }
.content h2:first-child, .faq h2:first-child, .related h2:first-child { margin-top: var(--space-sm); }
.content p, .content li { color: var(--color-ink-2); max-width: 70ch; }
.content p { margin: 0 0 var(--space-sm); }
.content strong { color: var(--color-ink); }
.content ol, .content ul { padding-left: var(--space-lg); margin: 0 0 var(--space-sm); }
.content li { margin: var(--space-2xs) 0; font-size: var(--text-body); }
.content li::marker { color: var(--color-accent); font-weight: 700; }
.table { border-collapse: collapse; width: 100%; max-width: 560px; font-size: var(--text-body); margin: var(--space-xs) 0 var(--space-md); font-variant-numeric: tabular-nums; }
.table th, .table td { border-bottom: var(--rule-hair) solid var(--color-rule); padding: var(--space-xs) var(--space-sm) var(--space-xs) 0; text-align: left; }
.table th { color: var(--color-ink-2); font-size: var(--text-md); font-weight: 700; border-bottom: var(--rule-bar) solid var(--color-rule); }
.table td { color: var(--color-ink); }
.table td:first-child { font-weight: 700; }
.faq details { border-bottom: var(--rule-hair) solid var(--color-rule); padding: var(--space-sm) 0; }
.faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; gap: var(--space-sm); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; flex: none; width: 1ch; color: var(--color-accent-2); font-weight: 900; }
.faq details[open] summary::before { content: "-"; }
.faq summary:hover { color: var(--color-accent-2); }
.faq p { margin: var(--space-xs) 0 0 calc(1ch + var(--space-sm)); color: var(--color-ink-2); max-width: 70ch; }
.cards { list-style: none; padding: 0; margin: 0; border-top: var(--rule-hair) solid var(--color-rule); }
.cards a { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: var(--space-md); align-items: baseline; padding: var(--space-sm); border-bottom: var(--rule-hair) solid var(--color-rule); text-decoration: none; color: var(--color-ink); }
.cards a:hover { background: var(--color-accent); color: var(--color-accent-ink); transition: background-color var(--dur-micro) steps(1); }
.cards a:hover span { color: var(--color-accent-ink); }
.cards a:active { background: var(--color-accent-2); }
.cards strong { font-weight: 900; }
.cards span { font-size: var(--text-md); color: var(--color-ink-2); }

.site-footer { color: var(--color-ink-2); font-size: var(--text-sm); border-top: var(--rule-bar) solid var(--color-rule); padding: var(--space-md) 0 var(--space-xl); margin-top: var(--space-xl); }
.site-footer p { margin: 0 0 var(--space-xs); max-width: 70ch; }
.refs { padding-left: var(--space-lg); }
.refs li { font-size: var(--text-md); line-height: 1.7; margin: var(--space-xs) 0; overflow-wrap: break-word; scroll-margin-top: var(--space-xl); }
.refs li:target { background: var(--color-paper-3); outline: var(--rule-hair) solid var(--color-accent-2); }
.content sup, .content a[href^="#ref-"] { font-size: var(--text-sm); font-weight: 700; text-decoration-thickness: 1px; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); padding: 0; margin: 0 0 var(--space-sm); }
.footer-links a { color: var(--color-ink-2); }
.info-table th { width: 9em; color: var(--color-ink-2); font-size: var(--text-md); border-bottom: var(--rule-hair) solid var(--color-rule); }
.info-table td { font-weight: 400; }
.table-wide { max-width: none; }
.table-wide td { font-size: var(--text-md); vertical-align: top; }
.table-wide td:first-child { white-space: nowrap; }
@media (max-width: 40rem) { .table-wide td:first-child { white-space: normal; } }

@media (max-width: 40rem) {
  .site-header .wrap { flex-wrap: wrap; gap: var(--space-xs); }
  .site-header nav { width: 100%; }
  .stage { height: 300px; }
  .content h2, .faq h2, .related h2 { font-size: var(--text-xl); }
  .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice kbd { display: none; }
  .bar { grid-template-columns: 9.5em minmax(0, 1fr) 4em; font-size: var(--text-sm); }
  .cards a { grid-template-columns: minmax(0, 1fr); gap: var(--space-3xs); }
}

/* スペースキー連打: duration picker */
.durations { display: flex; flex-wrap: wrap; gap: var(--space-xs); justify-content: center; margin-bottom: var(--space-sm); }
.dur, .btnsel { min-height: 44px; min-width: 4.5em; padding: var(--space-2xs) var(--space-md); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--color-ink-2); background: var(--color-paper-2); border: var(--rule-bar) solid var(--color-rule); border-radius: var(--radius-card); cursor: pointer; touch-action: manipulation; }
.dur:hover, .btnsel:hover { color: var(--color-ink); border-color: var(--color-muted); }
.dur[aria-pressed="true"], .btnsel[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.compare-rate .bar { grid-template-columns: 12.5em minmax(0, 1fr) 6.5em; }
@media (max-width: 40rem) { .compare-rate .bar { grid-template-columns: 9.5em minmax(0, 1fr) 5.5em; } }
.durations-sub { margin-top: calc(-1 * var(--space-2xs)); }
@media (max-width: 40rem) { .durations .dur { flex: 1 1 0; min-width: 0; padding-inline: var(--space-2xs); } }
@media (hover: none) and (pointer: coarse) { .durations-sub { display: none; } }

/* desktop: wrap the menu onto a second row instead of a sideways scroller with a hidden scrollbar */
@media (min-width: 40.01rem) { .site-header .wrap { gap: var(--space-xs) var(--space-md); } .nav a { padding-inline: 8px; }
  .site-header nav { flex: 1 1 auto; } .nav { flex-wrap: wrap; overflow-x: visible; gap: 2px; } }
