:root {
  color-scheme: dark;
  --bg: #0c1015;
  --panel: #151c23;
  --line: #35414b;
  --text: #f2f3f7;
  --muted: #acb8c2;
  --lime: #d2fa75;
  --purple: #b9a6ff;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 95% 0, #20333455, transparent 45%), var(--bg); color: var(--text); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, select, input { font: inherit; color: inherit; }
button, select, summary { min-height: 44px; }
button, summary { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:where(button, input, select, summary, a):focus-visible { outline: 3px solid var(--purple); outline-offset: 4px; }
[hidden], .hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shell { max-width: 1240px; padding: 0 36px; margin: auto; }
header { height: 80px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand svg { width: 190px; max-width: 48vw; height: auto; display: block; }
.motion { border: 1px solid var(--line); border-radius: 24px; padding: 8px 16px; background: transparent; color: var(--muted); font-size: 14px; }
main { padding: 24px 0; }
.page-intro { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; gap: 20px; }
.eyebrow { font: 12px/1.5 ui-monospace, monospace; letter-spacing: 1.5px; color: var(--lime); margin: 0 0 8px; }
.page-intro h1 { font-size: clamp(32px, 3.5vw, 46px); line-height: 1.08; letter-spacing: -1.7px; margin: 0; }
.page-intro h1 em { color: var(--lime); font-style: normal; }
.page-intro p:last-child { color: var(--muted); margin: 12px 0 0; }
.intro-badge { width: 100px; height: 100px; flex-shrink: 0; display: flex; flex-direction: column; justify-content: center; border: 1px solid #687848; border-radius: 50%; text-align: center; transform: rotate(9deg); color: var(--muted); font: 12px/1.8 ui-monospace, monospace; }
.intro-badge b { color: var(--lime); }
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 28px; }
.games-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.games-heading h2, .check-panel h2 { font-size: 20px; letter-spacing: -.5px; margin: 0; }
.games-heading > span { color: var(--muted); font-size: 12px; }
.step-number { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 6px; border: 1px solid #526046; border-radius: 8px; color: var(--lime); font: 12px ui-monospace, monospace; }
.search-label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 5px; }
.search { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #121a21; margin-bottom: 14px; }
.search::placeholder { color: var(--muted); }
.games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.game { position: relative; min-height: 108px; padding: 14px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #1b232c, #131a21); transition: transform .2s, border-color .2s; }
.game:hover { transform: translateY(-2px); border-color: #8b9aab; }
.game b { display: block; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.game-monogram { display: grid; place-items: center; width: 36px; height: 32px; border-radius: 8px; background: color-mix(in srgb, var(--game-color) 12%, transparent); color: var(--game-color); font-size: 14px; font-weight: 800; margin-bottom: 10px; }
.game[aria-pressed=true] { border: 2px solid var(--lime); padding: 13px; background: linear-gradient(145deg, #283428, #19251f); box-shadow: 0 0 0 3px #d2fa7518, 0 10px 24px #0003; }
.game[aria-pressed=true]:focus-visible { outline: 0; }
.game::before { content: none; }
.game-check { position: absolute; top: 12px; right: 14px; z-index: 2; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #1a281d; color: var(--lime); font-size: 17px; line-height: 1; font-weight: 800; opacity: 0; transform: scale(.75); transition: opacity .16s ease, transform .16s ease; pointer-events: none; }
.game[aria-pressed=true] .game-check { opacity: 1; transform: scale(1); }
.secondary { border: 1px solid var(--line); border-radius: 10px; background: #141c23; padding: 10px 16px; }
.browse { width: 100%; margin-top: 12px; color: var(--muted); }
.caption, .micro { font-size: 13px; color: var(--muted); margin: 12px 0; }
.check-panel { position: sticky; top: 20px; padding: 22px; border: 1px solid #526046; border-radius: 20px; background: linear-gradient(155deg, #232e26, #141d22 70%); }
.selection-label { font-size: 13px; color: var(--muted); margin: 14px 0; }
.selection-label strong { display: block; color: var(--text); font-size: 22px; margin-top: 2px; }
.setup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.setup-row label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.setup-row select { width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #141d23; font-size: 14px; }
.test-modes { border: 0; padding: 0; margin: 16px 0; display: grid; gap: 8px; }
.test-modes legend { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.test-modes label { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 4px 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #10181c; cursor: pointer; }
.test-modes label:has(input:checked) { border-color: var(--lime); background: #d2fa750b; }
.test-modes input { margin: 0; accent-color: var(--lime); }
.test-modes strong { font-size: 14px; }
.test-modes b { font: 12px ui-monospace, monospace; color: var(--lime); }
.test-modes span { grid-column: 2 / 4; color: var(--muted); font-size: 13px; }
.launch { min-height: 50px; border: 0; border-radius: 11px; background: var(--lime); color: #17210c; padding: 12px 20px; font-weight: 750; transition: transform .2s; }
.launch:hover { transform: translateY(-2px); }
.check-panel .launch { width: 100%; display: flex; justify-content: space-between; }
.micro { text-align: center; }
.test-info { border-top: 1px solid var(--line); padding-top: 8px; font-size: 13px; color: var(--muted); }
summary { display: list-item; align-content: center; color: var(--text); }
.metrics-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.metrics-preview b { font-size: 15px; }
.metrics-preview p { color: var(--muted); font-size: 14px; margin: 5px 0; }
.number { color: var(--purple); margin-right: 8px; font: 12px ui-monospace, monospace; }
.details { text-align: left; margin-top: 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #131b22; color: var(--muted); font-size: 14px; }
.details dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.details dd { text-align: right; margin: 0; overflow-wrap: anywhere; }
.details h3 { color: var(--text); font-size: 16px; }
.details a { color: var(--lime); }
.details li { margin: 10px 0; }
.history-row { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.result-warning { margin: 16px 0 0; padding: 12px 14px; border: 1px solid #ff777f; border-radius: 12px; color: #ffb0b5; background: rgba(255,119,127,.1); font-weight: 650; }
.result-compare { margin: 14px 0 0; color: var(--muted); font-size: .92rem; }
footer { display: flex; justify-content: space-between; gap: 12px; padding: 20px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.mobile-dock { display: none; }
/* Measurement dialog */
dialog { padding: 0; width: min(650px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; border: 1px solid #526046; border-radius: 22px; background: #10191e; color: var(--text); box-shadow: 0 40px 100px #000a; }
dialog::backdrop { background: #05070dc9; backdrop-filter: blur(8px); }
.test-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.test-head > span { font: 12px/1.5 ui-monospace, monospace; color: var(--lime); }
.close { width: 44px; flex-shrink: 0; border: 0; background: transparent; font-size: 26px; color: var(--muted); }
.test-body { padding: 22px; text-align: center; background: radial-gradient(ellipse at 50% 25%, #d2fa7510, transparent 65%); }
.test-body h2 { font-size: 28px; line-height: 1.15; letter-spacing: -.8px; margin: 6px 0; }
.sub, .tip { font-size: 14px; color: var(--muted); }
.sub { margin: 8px 0; }
.scan { width: 176px; height: 176px; margin: 20px auto; position: relative; display: grid; place-items: center; }
.scan svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.track, .arc { fill: none; stroke-width: 7; }
.track { stroke: #25332e; }
.arc { stroke: var(--lime); stroke-linecap: round; stroke-dasharray: 628; stroke-dashoffset: 628; transition: stroke-dashoffset .4s; }
.scan::before { content: ""; position: absolute; inset: 14px; border: 1px dashed #d2fa7544; border-radius: 50%; animation: spin 14s linear infinite; }
.scan-value strong { display: block; font: 650 40px ui-monospace, monospace; letter-spacing: -2px; }
.scan-value small { font: 11px ui-monospace, monospace; letter-spacing: 2px; color: var(--lime); }
.wave { display: flex; justify-content: center; align-items: center; gap: 4px; height: 25px; margin-top: 6px; }
.wave i { width: 3px; height: 10px; border-radius: 3px; background: var(--lime); animation: wave .8s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.11s); }
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 18px 0; }
.stage { font-size: 12px; color: var(--muted); background: #1a2429; border: 1px solid var(--line); padding: 8px 3px; border-radius: 8px; }
.stage.active { color: var(--lime); border-color: #8ca65b; }
.live-values { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.metric { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #0e171c; }
.metric span, .metric small { display: block; font-size: 13px; color: var(--muted); }
.metric strong { font: 600 25px ui-monospace, monospace; display: block; margin: 4px 0; }
.result-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 4px auto 14px; border: 1px solid currentColor; border-radius: 20px; color: var(--lime); font-size: 36px; transform: rotate(-6deg); }
.result-scope { font-size: 11px; color: var(--muted); }
.test-body .result-label { font-size: 38px; }
.result-health { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; text-align: left; }
.result-health > div { border-left: 2px solid var(--line); padding-left: 10px; }
.result-health span { display: block; color: var(--muted); font-size: 12px; }
.result-health strong { font-size: 14px; }
.tip { margin: 16px 0; }
.actions { position: sticky; bottom: -22px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; background: #10191ef5; padding: 12px 0; margin-top: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wave { to { height: 22px; opacity: .4; } }
body.no-motion *, body.no-motion *::before { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
@media (max-width: 1000px) { .shell { padding: 0 24px; } .play-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; } .games-heading > span { display: none; } .game { padding: 12px; } }
@media (max-width: 760px) {
  .shell { padding: 0 20px; }
  header { height: 70px; }
  .brand svg { width: 170px; }
  .page-intro h1 { font-size: 34px; }
  .intro-badge { width: 80px; height: 80px; font-size: 10px; }
  .play-layout { grid-template-columns: 1fr; }
  .games { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game { min-height: 100px; }
  .game b { font-size: 14px; }
  .check-panel { position: static; scroll-margin-top: 16px; }
  .mobile-dock { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; gap: 14px; align-items: center; justify-content: space-between; padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); background: #111a21f5; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px #0003; }
  .mobile-dock > span { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-dock .launch { flex-shrink: 0; min-height: 44px; padding: 10px 16px; font-size: 14px; }
  body { padding-bottom: 90px; }
  .metrics-preview { gap: 14px; }
  .metrics-preview b { font-size: 14px; }
  .metrics-preview p { font-size: 13px; }
  .number { display: none; }
}
@media (max-width: 420px) {
  .shell { padding: 0 16px; }
  .intro-badge { display: none; }
  .page-intro h1 { font-size: 32px; }
  .page-intro p:last-child { font-size: 14px; }
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game { min-height: 90px; display: flex; align-items: center; gap: 10px; }
  .game-monogram { flex-shrink: 0; width: 28px; height: 30px; font-size: 11px; margin: 0; }
  .game[aria-pressed=true] { padding: 11px; }
  .game-check { top: 10px; right: 10px; width: 22px; height: 22px; font-size: 15px; }
  .check-panel { padding: 18px; }
  .test-body { padding: 16px; }
  .test-body h2 { font-size: 25px; }
  .stage { font-size: 11px; }
  .metric strong { font-size: 18px; white-space: nowrap; }
  .result-health { gap: 4px; }
  .result-health > div { padding-left: 6px; }
  .result-health strong { font-size: 12px; }
  .metrics-preview { grid-template-columns: 1fr; gap: 10px; }
  footer { flex-direction: column; }
}

/* Readable sharing fallback and wrapping navigation on narrow screens. */
#shareFallback{width:100%;padding:14px;background:#121a21;color:var(--text);border:1px solid var(--line);border-radius:10px;font:inherit;resize:vertical}footer nav{display:flex;gap:12px;flex-wrap:wrap}footer a{color:var(--lime)}@media(max-width:760px){footer{flex-direction:column}.actions button{flex:1 1 130px}.live-values,.result-health{min-width:0}.metric strong{overflow-wrap:anywhere}}
