/* Shared chrome for the standalone tool pages (Typing, Sudoku, Toolbox). Wordle keeps its own copy. */
:root { --mute: #605d5d; --c-ok: #538d4e; --c-warn: #b59f3b; --c-bad: #c0392b; --c-fill: #d3d6da; --line: color-mix(in srgb, var(--color-text) 40%, transparent); }
:root[data-theme="dark"] { --mute: #bab6b6; --c-ok: #6aaa64; --c-warn: #c9b458; --c-bad: #ff6b5c; --c-fill: #3a3a3c; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--color-bg); color: var(--color-text); font-family: var(--font-body); -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 980px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 24px) 24px; }
header.top { flex: none; height: 52px; display: flex; align-items: center; gap: 8px; border-bottom: 2px solid var(--color-divider); }
.ib { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; padding: 0; color: var(--color-text); text-decoration: none; }
.ib:hover { color: var(--color-accent); }
h1.t { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; flex: 1; text-align: center; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.b { height: 40px; padding: 0 16px; border: 2px solid var(--color-text); background: transparent; font-weight: 800; font-size: 13px; letter-spacing: .04em; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.b:hover { background: color-mix(in srgb, var(--color-text) 10%, transparent); }
.b[aria-pressed="true"], .b.on { background: var(--color-text); color: var(--color-bg); }
.b.pri { background: var(--color-accent-600); border-color: var(--color-accent-600); color: #fff; }
:root[data-theme="dark"] .b.pri { background: var(--color-accent); border-color: var(--color-accent); color: #201e1d; }
.b.pri:hover { background: var(--color-accent-700); border-color: var(--color-accent-700); }
:root[data-theme="dark"] .b.pri:hover { background: var(--color-accent-400); border-color: var(--color-accent-400); }
.b:disabled { opacity: .45; cursor: not-allowed; }
.seg { display: inline-flex; border: 2px solid var(--color-text); }
.seg button { border: 0; background: none; height: 32px; padding: 0 12px; font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.seg button[aria-pressed="true"] { background: var(--color-text); color: var(--color-bg); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 0; }
.lbl { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.panel { border: 2px solid var(--color-text); padding: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* motion + feel shared by every tool page */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.app > * { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.app > :nth-child(2) { animation-delay: .04s; } .app > :nth-child(3) { animation-delay: .08s; } .app > :nth-child(4) { animation-delay: .12s; }
.b { transition: background-color .15s, transform .12s, color .15s, border-color .15s; }
.b:active:not(:disabled) { transform: translateY(1px) scale(.98); }
#bSnd .mu { display: inline; } #bSnd .wv { display: none; }
#bSnd[aria-pressed="true"] .mu { display: none; } #bSnd[aria-pressed="true"] .wv { display: inline; }
.toastx { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--color-text); color: var(--color-bg); padding: 10px 16px; font-size: 13px; font-weight: 800; letter-spacing: .04em; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 500; }
.toastx.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 380px) { header.top { gap: 2px; } .ib { width: 34px; } h1.t { font-size: 15px; letter-spacing: .08em; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; } }

/* leaderboards (Sudoku daily, Typing Test) */
.lbbox { border: 2px solid var(--color-text); padding: 12px 14px; }
ol.lb { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: none; }
ol.lb li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
ol.lb li:first-child { border-top: 0; }
ol.lb .r { font-weight: 800; color: var(--mute); font-variant-numeric: tabular-nums; }
ol.lb .n { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ol.lb .s { font-weight: 800; font-variant-numeric: tabular-nums; }
ol.lb li.me { background: color-mix(in srgb, var(--color-accent) 14%, transparent); margin: 0 -8px; padding: 6px 8px; }
.lbnote { margin: 8px 0 0; font-size: 13px; color: var(--mute); }
.lbform { display: flex; gap: 6px; margin-top: 10px; }
.lbform input { flex: 1; min-width: 0; height: 40px; border: 2px solid var(--color-text); background: transparent; padding: 0 10px; font-weight: 700; }
