:root {
  --bg: #fff8f0;
  --surface: #ffffff;
  --surface-2: #fff1e3;
  --ink: #221c35;
  --muted: #6a6280;
  --line: #eadfd2;
  --accent: #ff5a36;
  --accent-ink: #ffffff;
  --accent-soft: #ffe2d9;
  --blue: #3157e0;
  --good: #1f9d6b;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(34, 28, 53, .06), 0 8px 24px rgba(34, 28, 53, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16131f; --surface: #211c2e; --surface-2: #2a2339; --ink: #f4effa; --muted: #ada4c2;
    --line: #362e47; --accent: #ff7556; --accent-ink: #1a1424; --accent-soft: #3d2530; --blue: #8ea6ff;
    --good: #4fd39d; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16131f; --surface: #211c2e; --surface-2: #2a2339; --ink: #f4effa; --muted: #ada4c2;
  --line: #362e47; --accent: #ff7556; --accent-ink: #1a1424; --accent-soft: #3d2530; --blue: #8ea6ff;
  --good: #4fd39d; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--blue); text-underline-offset: 2px; }
img, svg { max-width: 100%; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* header / footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand svg { width: 28px; height: 28px; }
.nav { display: flex; gap: 4px 16px; flex-wrap: wrap; margin-left: auto; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
.site-footer a { color: var(--muted); }

/* hero */
.hero { padding: 32px 0 8px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.15; margin: 0 0 10px; letter-spacing: -.02em; }
.lede { font-size: 18px; color: var(--muted); margin: 0; max-width: 680px; }

/* tool */
.tool { margin: 24px 0 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 20px; }
.controls { display: grid; gap: 12px; margin-bottom: 16px; }
.control { display: grid; gap: 6px; }
.control-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 15px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  border-radius: 999px; padding: 6px 14px; cursor: pointer; min-height: 38px;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip:focus-visible, .btn:focus-visible, select:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.card {
  position: relative; display: grid; place-items: center; text-align: center; min-height: 220px; padding: 28px 16px;
  border-radius: var(--radius); background: var(--accent-soft); border: 2px dashed var(--accent); cursor: default;
}
.word { font-size: clamp(32px, 7vw, 60px); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; overflow-wrap: anywhere; transition: filter .2s; }
.meta { margin-top: 10px; font-size: 14px; color: var(--muted); text-transform: capitalize; }
.card.hidden-word { cursor: pointer; }
.card.hidden-word .word { filter: blur(18px); user-select: none; }
.card.hidden-word::after { content: "Tap to reveal"; position: absolute; bottom: 14px; font-size: 14px; color: var(--muted); }
.card.pop .word { animation: pop .25s ease-out; }
.card.timeup { border-style: solid; background: var(--accent); }
.card.timeup .word, .card.timeup .meta { color: var(--accent-ink); }
@keyframes pop { from { transform: scale(.92); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .card.pop .word { animation: none; } }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn {
  font: inherit; font-weight: 700; border-radius: 14px; padding: 12px 18px; cursor: pointer; min-height: 48px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
}
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); flex: 1 1 220px; font-size: 19px; }
.count { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.hint { font-size: 13px; color: var(--muted); }
kbd { font: 12px ui-monospace, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: var(--surface-2); }

.extras { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; margin-top: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.panel h2 { font-size: 15px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.timer-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.time { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 84px; }
select { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); min-height: 44px; }
.bar-track { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar { height: 100%; width: 100%; background: var(--good); transition: width .2s linear; }
.bar.low { background: var(--accent); }
.scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.score { text-align: center; background: var(--surface-2); border-radius: 12px; padding: 8px; }
.score span { display: block; font-size: 14px; color: var(--muted); }
.score output { display: block; font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.score .btn { min-height: 40px; padding: 6px 14px; }
.history { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); }
.history:empty { display: none; }
.history li { background: var(--surface-2); border-radius: 99px; padding: 2px 10px; }

/* content */
.content { margin-top: 40px; }
.content h2 { font-size: 26px; line-height: 1.25; margin: 40px 0 10px; letter-spacing: -.01em; }
.content h3 { font-size: 19px; margin: 24px 0 6px; }
.content p, .content li { max-width: 720px; }
.content ol li, .content ul li { margin-bottom: 6px; }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.related a { display: block; height: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 700; }
.related a span { display: block; font-weight: 400; font-size: 14px; color: var(--muted); margin-top: 2px; }
.related a:hover { border-color: var(--accent); }
.wordlist { columns: 4 160px; column-gap: 24px; padding: 0; list-style: none; margin: 0; }
.wordlist li { break-inside: avoid; font-size: 15px; padding: 2px 0; max-width: none; margin: 0; }
.wordlist-group { margin: 18px 0; }
.wordlist-group h3 { margin-bottom: 8px; }
.faq details { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 10px 0; background: var(--surface); max-width: 760px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 8px 0 0; }
.note { font-size: 14px; color: var(--muted); }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .tool { padding: 14px; border-radius: 20px; display: flex; flex-direction: column; margin-top: 16px; }
  .tool .card { order: 1; }
  .tool .actions { order: 2; }
  .tool .count { order: 3; }
  .tool .controls { order: 4; margin: 16px 0 0; }
  .tool .history { order: 5; }
  .tool .extras { order: 6; }
  .tool .hint { display: none; }
  .btn-primary { flex: 1 1 0; }
  .hero { padding-top: 20px; }
  .lede { font-size: 16px; }
  .site-header .wrap { min-height: 52px; gap: 4px 16px; }
  .nav { font-size: 14px; }
  .extras { grid-template-columns: 1fr; }
  .card { min-height: 190px; }
  .nav { margin-left: 0; width: 100%; padding-bottom: 10px; }
}

@media print {
  .site-header, .site-footer, .tool, .faq, .related, .no-print, .hero .lede { display: none !important; }
  body { background: #fff; color: #000; }
  .content { margin: 0; }
  .wordlist { columns: 4; }
}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}
