/* Freestyle v3. Plain CSS, no framework.
 * Theme: follows the device unless the player picks one in Settings, which sets
 * <html data-theme="light|dark">. High contrast sets <html data-contrast="high">.
 * index.html applies both before first paint. Order matters: later blocks win ties. */
:root {
  --display: "Zilla Slab", Rockwell, Georgia, serif;
  --body: "Libre Franklin", "Franklin Gothic Medium", "Helvetica Neue", Arial, sans-serif;
  --paper: #ffffff;
  --panel: #f6f7f7;
  --ink: #121213;
  --muted: #5f6566;
  --faint: #9aa0a1;
  --rule: #dcdfdf;
  --sig: #8ed3d3;
  --sig-strong: #137c86;
  --sig-ink: #0b3f44;
  --toast: #121213;
  --toast-ink: #ffffff;
  --bad: #b3412c;
  --on-sig: #121213;
  --chip-bg: var(--sig);
  --chip-ink: #121213;
  --chip-border: transparent;
  --cta: #121213;
  --cta-ink: #ffffff;
  --stop-off: #dcdfdf;
  color-scheme: light;
}
:root[data-contrast="high"] {
  --paper: #ffffff;
  --panel: #ededed;
  --ink: #000000;
  --muted: #222222;
  --faint: #555555;
  --rule: #000000;
  --sig: #8ed3d3;
  --sig-strong: #00545b;
  --sig-ink: #002a2e;
  --toast: #000000;
  --toast-ink: #ffffff;
  --bad: #8f1d0a;
  --on-sig: #000000;
  --chip-bg: #000000;
  --chip-ink: #ffffff;
  --chip-border: #000000;
  --cta: #000000;
  --cta-ink: #ffffff;
  --stop-off: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121314;
    --panel: #1c1e1f;
    --ink: #eef0f0;
    --muted: #a4abac;
    --faint: #6f7778;
    --rule: #33383a;
    --sig: #6cc3c6;
    --sig-strong: #7fd6dc;
    --sig-ink: #dff6f7;
    --toast: #eef0f0;
    --toast-ink: #121213;
    --bad: #f0907a;
    --on-sig: #121213;
    --chip-bg: var(--sig);
    --chip-ink: #121213;
    --chip-border: transparent;
    --cta: #121213;
    --cta-ink: #ffffff;
    --stop-off: #33383a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121314;
  --panel: #1c1e1f;
  --ink: #eef0f0;
  --muted: #a4abac;
  --faint: #6f7778;
  --rule: #33383a;
  --sig: #6cc3c6;
  --sig-strong: #7fd6dc;
  --sig-ink: #dff6f7;
  --toast: #eef0f0;
  --toast-ink: #121213;
  --bad: #f0907a;
  --on-sig: #121213;
  --chip-bg: var(--sig);
  --chip-ink: #121213;
  --chip-border: transparent;
  --cta: #121213;
  --cta-ink: #ffffff;
  --stop-off: #33383a;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-contrast="high"]:not([data-theme="light"]) {
    --paper: #000000;
    --panel: #161616;
    --ink: #ffffff;
    --muted: #e3e3e3;
    --faint: #b3b3b3;
    --rule: #ffffff;
    --sig: #8ee6e9;
    --sig-strong: #9ff3f7;
    --sig-ink: #ffffff;
    --toast: #ffffff;
    --toast-ink: #000000;
    --bad: #ffab99;
    --on-sig: #000000;
    --chip-bg: #ffffff;
    --chip-ink: #000000;
    --chip-border: #ffffff;
    --cta: #000000;
    --cta-ink: #ffffff;
    --stop-off: #000000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"][data-contrast="high"] {
  --paper: #000000;
  --panel: #161616;
  --ink: #ffffff;
  --muted: #e3e3e3;
  --faint: #b3b3b3;
  --rule: #ffffff;
  --sig: #8ee6e9;
  --sig-strong: #9ff3f7;
  --sig-ink: #ffffff;
  --toast: #ffffff;
  --toast-ink: #000000;
  --bad: #ffab99;
  --on-sig: #000000;
  --chip-bg: #ffffff;
  --chip-ink: #000000;
  --chip-border: #ffffff;
  --cta: #000000;
  --cta-ink: #ffffff;
  --stop-off: #000000;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-variant-numeric: lining-nums; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; }
a { color: var(--sig-strong); }
:focus-visible { outline: 3px solid var(--sig-strong); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#root { min-height: 100%; }
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.boot { display: grid; place-items: center; min-height: 100vh; font-family: var(--display); font-size: 28px; font-weight: 700; }

/* ---------- buttons ---------- */
.btn { height: 46px; padding: 0 24px; border-radius: 999px; border: 1px solid var(--ink); background: transparent; font-weight: 600; font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink); }
.btn.fill { background: var(--ink); color: var(--paper); }
.btn.small { height: 38px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: default; }
.linkbtn { background: none; border: 0; padding: 6px; text-decoration: underline; cursor: pointer; font-weight: 600; font-size: 14px; }
.iconbtn { -webkit-tap-highlight-color: transparent; width: 40px; height: 40px; border: 0; background: none; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.iconbtn svg { width: 22px; height: 22px; }

/* ---------- splash ---------- */
.splash { flex: 1; background: var(--sig); color: var(--on-sig); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 32px 20px calc(32px + env(safe-area-inset-bottom, 0px)); }
.splash .btn { border-color: var(--on-sig); color: var(--on-sig); }
.splash .btn.fill { background: var(--cta); color: var(--cta-ink); border-color: var(--cta); }
.logo { width: 68px; height: 68px; border-radius: 14px; background: #fff; border: 2px solid var(--on-sig); display: flex; align-items: center; justify-content: center; }
.logo svg { width: 40px; height: 40px; }
.splash h1 { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1; margin: 0; letter-spacing: -.01em; }
.promise { font-family: var(--display); font-weight: 500; font-size: 24px; line-height: 1.2; max-width: 300px; margin: 0; text-wrap: balance; }
.splash .actions { display: flex; flex-direction: column; gap: 10px; width: 220px; margin-top: 4px; }
.meta { font-size: 14px; line-height: 1.5; margin: 6px 0 0; }
.meta b { display: block; }
.splash-stat { margin: 0; min-height: 1.45em; font-size: 15px; opacity: 0; transition: opacity .3s; }  /* space reserved, so nothing shifts when it loads */
.splash-stat.in { opacity: 1; }
.splash-stat b { font-weight: 700; }
.pill { font-size: 14px; font-weight: 600; background: rgba(255, 255, 255, .65); border-radius: 999px; padding: 5px 14px; }

/* ---------- top bar ---------- */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--paper); border-bottom: 1px solid var(--rule); height: 52px; display: grid; grid-template-columns: 88px 1fr 88px; align-items: center; padding: 0 8px; }
.bar .title { text-align: center; font-family: var(--display); font-weight: 700; font-size: 22px; }
.bar .right { display: flex; justify-content: flex-end; }

.main { width: 100%; max-width: 520px; margin: 0 auto; padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; flex: 1; }

/* ---------- progress ---------- */
.progress { padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.progress .top { display: flex; justify-content: space-between; align-items: baseline; }
.progress .rank { font-weight: 800; font-size: 15px; }
.progress .pts { font-size: 14px; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.track { position: relative; height: 20px; display: flex; align-items: center; }
.track .line { position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; margin-top: -1px; background: var(--rule); }
.track .fill { position: absolute; left: 6px; top: 50%; height: 2px; margin-top: -1px; background: var(--ink); transition: width .35s ease; }
.track .stops { position: relative; display: flex; justify-content: space-between; align-items: center; width: 100%; height: 100%; }  /* dots centered on the line */
.track .stop { width: 12px; height: 12px; border-radius: 50%; background: var(--stop-off); border: 2px solid var(--stop-off); transition: background .25s; }
.track .stop.on { background: var(--ink); border-color: var(--ink); }
.track .stop.cur { width: 28px; height: 20px; border-radius: 10px; background: var(--sig); border: 1.5px solid var(--ink); font-size: 11px; font-weight: 800; line-height: 17px; text-align: center; color: var(--on-sig); }
.progress .next { font-size: 12.5px; color: var(--muted); }

/* ---------- target + entry ---------- */
.target { text-align: center; padding: 6px 0 0; }
.target small { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.target .word { font-family: var(--display); font-weight: 700; font-size: clamp(40px, 12vw, 54px); letter-spacing: .03em; line-height: 1.05; word-break: break-word; }
.archive-note { text-align: center; font-size: 13px; color: var(--muted); }

.entry { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.entry input { width: 100%; max-width: 360px; height: 52px; border: 0; border-bottom: 2px solid var(--ink); background: transparent; color: var(--ink); text-align: center; font: 700 26px var(--body); letter-spacing: .08em; text-transform: uppercase; border-radius: 0; outline: none; }
.entry input::placeholder { color: var(--faint); font-weight: 600; font-size: 17px; letter-spacing: .01em; text-transform: none; }
.entry-hint { font-size: 13.5px; color: var(--muted); margin-top: -4px; transition: opacity .15s; }  /* replaces a placeholder: a centered caret would sit on top of it */
.entry-hint.gone { opacity: 0; }
.entry-wrap { position: relative; }
.target { scroll-margin-top: calc(60px + env(safe-area-inset-top, 0px)); }
.entry .row { display: flex; gap: 8px; }
.shake { animation: shake .35s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

/* ---------- intro / hints / banners ---------- */
.card { border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); }
.card h2 { margin: 0; font-size: 15px; font-weight: 700; }
.card p { margin: 0; font-size: 14px; }
.card .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card .note { font-size: 13px; color: var(--muted); }
.banner { background: var(--sig); color: var(--on-sig); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.banner b { display: block; }
.banner span { font-size: 14px; }
.banner > div { min-width: 0; }
.banner .btn { flex-shrink: 0; white-space: nowrap; background: var(--cta); color: var(--cta-ink); border-color: var(--cta); }
.hints { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 6px; }
.hints b { display: block; font-family: var(--display); font-size: 26px; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.hints span { font-size: 12.5px; color: var(--muted); }

/* ---------- chips ---------- */
.found { border: 1px solid var(--rule); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.found .head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; padding: 4px 9px; font-weight: 700; font-size: 13.5px; letter-spacing: .04em; text-transform: uppercase; background: var(--chip-bg); color: var(--chip-ink); border: 1.5px solid var(--chip-border); }
.chip.extra { background: var(--panel); color: var(--muted); }
.chip.miss { background: var(--panel); color: var(--muted); text-decoration: line-through; }
.chip.pop { animation: pop .3s ease-out; }
@keyframes pop { 0% { transform: scale(.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.dots { display: inline-flex; gap: 2px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.empty { font-size: 14px; color: var(--faint); }

.footer-row { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--muted); padding-top: 2px; }
.confirm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- exact mode: target header, preview, locked slots ---------- */
.xhead { padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.xhead .top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.xhead .total { font-family: var(--display); font-size: 18px; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; line-height: 1; }
.xhead .total b { font-size: 36px; color: var(--ink); font-weight: 700; }
.xhead .goal-label { display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.xhead .goal-label b { font-size: 15px; font-weight: 800; color: var(--ink); }
.xcells { display: flex; gap: 3px; }
.xcells i { flex: 1; height: 10px; border-radius: 3px; background: var(--stop-off); }
.xcells i.on { background: var(--ink); }
.xcells i.over { background: var(--bad); }
.xcells i.goal { box-shadow: inset 0 0 0 2px var(--ink); }
.xcells i.goal.on { box-shadow: 0 0 0 2px var(--sig); }
.xneed { text-align: center; font-weight: 700; font-size: 15px; margin-top: -6px; min-height: 1.45em; }
.xneed.hit { color: var(--sig-strong); }
.xneed.over { color: var(--bad); }
.entry input.ok { border-bottom-color: var(--sig-strong); }  /* exact mode: this rhyme counts, waiting for Lock / Skip */
.xtip { margin: 0; display: flex; gap: 10px; align-items: baseline; font-size: 14.5px; line-height: 1.45; color: var(--muted); background: var(--panel); border-radius: 10px; padding: 10px 12px; }
.xtip b { flex-shrink: 0; font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); background: var(--sig); border-radius: 6px; padding: 2px 7px; }
.xtip .mask { font-weight: 800; color: var(--ink); letter-spacing: .02em; white-space: nowrap; }
.entry-hint.xinfo { color: var(--ink); font-size: 15px; display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: center; }
.entry-hint.xinfo b { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.entry-hint.xinfo span { font-weight: 600; }
/* The waiting rhyme would hit the target exactly: say so like it's good news. */
.entry-hint.xinfo .xhit { font-weight: 800; background: var(--sig); color: var(--on-sig); border-radius: 999px; padding: 3px 12px; animation: pop .25s ease-out; }
.xrow .btn { min-width: 104px; }
.xrow .btn.xlock { min-width: 148px; position: relative; overflow: hidden; }
/* Lock arms over LOCK_ARM_MS (game.jsx): a light overlay slides away as it becomes tappable. */
.xlock::after { content: ""; position: absolute; inset: 0; background: var(--paper); opacity: .5; transform-origin: right center; transform: scaleX(0); animation: arm .4s linear; pointer-events: none; }
@keyframes arm { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.xrow.pulse { animation: pulse .35s ease-out; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.07); } }
.confetti-canvas { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.xslots { display: flex; flex-direction: column; gap: 6px; }
.xslot { min-height: 44px; border-radius: 10px; border: 1.5px dashed var(--rule); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; font-size: 13.5px; color: var(--faint); }
.xslot .k { font-weight: 700; font-variant-numeric: tabular-nums; }
.xslot.next { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.xslot.full { border: 1.5px solid var(--chip-border); background: var(--chip-bg); color: var(--chip-ink); font-weight: 700; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.xslot.pop { animation: pop .3s ease-out; }
.xpaths { display: flex; flex-direction: column; gap: 8px; }
.xpath { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.xpath .sum { font-weight: 700; font-size: 13.5px; min-width: 76px; font-variant-numeric: lining-nums tabular-nums; }
.lb .r.xr { grid-template-columns: 96px 1fr 44px; }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 0; right: 0; top: calc(64px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 20; padding: 0 16px; }
.toasts.inline { position: absolute; top: calc(100% + 8px); left: 0; right: 0; padding: 0; }
.toast { pointer-events: auto; background: var(--toast); color: var(--toast-ink); border-radius: 8px; padding: 10px 14px; font-weight: 600; font-size: 15px; max-width: 420px; display: flex; gap: 12px; align-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.toast button { background: none; border: 0; color: inherit; text-decoration: underline; font-weight: 600; font-size: 14px; cursor: pointer; padding: 2px; white-space: nowrap; }

/* ---------- results ---------- */
.results { display: flex; flex-direction: column; gap: 18px; padding-top: 18px; }
.results h1 { font-family: var(--display); font-size: 38px; font-weight: 700; margin: 0; text-align: center; line-height: 1.05; }
.results .sub { text-align: center; font-size: 15px; margin: -8px 0 0; }
.section { border-top: 1px solid var(--rule); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.section h2 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; gap: 4px; }
.stats b { display: block; font-family: var(--display); font-size: 30px; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; line-height: 1.1; }
.stats span { font-size: 12px; line-height: 1.2; display: block; }
.sharebox { background: var(--panel); border-radius: 10px; padding: 12px 14px; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; font-variant-numeric: lining-nums tabular-nums; }
.share-key { margin: -2px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.countdown { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.countdown strong { font-family: var(--display); font-size: 34px; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.countdown .aside { text-align: right; font-size: 13.5px; }
.remind { background: var(--panel); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.remind .row { display: flex; gap: 8px; flex-wrap: wrap; }
.remind p { margin: 0; font-size: 14px; }

.lb { display: flex; flex-direction: column; gap: 4px; }
.lb .r { display: grid; grid-template-columns: 58px 1fr 44px; gap: 8px; align-items: center; font-size: 13.5px; font-variant-numeric: lining-nums tabular-nums; }
.lb .bar2 { height: 16px; border-radius: 3px; background: var(--rule); min-width: 3px; }
.lb .r.me .bar2 { background: var(--sig-strong); }
.lb .r.me { font-weight: 700; }
.lb .n { text-align: right; color: var(--muted); }
.lb .gap { font-size: 12px; color: var(--faint); padding-left: 66px; }

.tabs { display: flex; gap: 6px; }
.tab { border: 1px solid var(--rule); background: transparent; border-radius: 999px; padding: 5px 12px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.wordlist { display: flex; flex-wrap: wrap; gap: 6px; }
.wordlist a { text-decoration: none; }
.wordlist .chip small { font-weight: 600; opacity: .7; letter-spacing: 0; }

.archive { display: flex; flex-wrap: wrap; gap: 6px; }
.archive a { border: 1px solid var(--rule); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; text-decoration: none; color: var(--ink); }
.archive a.done { background: var(--panel); }
.more { display: flex; flex-direction: column; gap: 6px; }
.more a { display: flex; justify-content: space-between; border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14.5px; }
.fine { font-size: 12.5px; color: var(--faint); text-align: center; }

/* ---------- modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); color: var(--ink); width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 18px calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 640px) { .scrim { align-items: center; } .sheet { border-radius: 18px; } }
.sheet .top { display: flex; justify-content: space-between; align-items: center; }
.sheet h2 { font-family: var(--display); font-size: 28px; margin: 0; }
.sheet ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.sheet p { margin: 0; }
.xdialog { outline: none; }
.xdialog .xd-syl { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.xdialog .note { font-size: 14px; color: var(--muted); }
.xdialog .acts { display: flex; gap: 10px; margin-top: 4px; }
.xdialog .acts .btn { flex: 1; padding: 0 12px; }
.xslot:not(.full) { cursor: text; }
.found .empty { cursor: text; }

@media (prefers-reduced-motion: reduce) {
  .shake, .chip.pop, .xslot.pop, .xrow.pulse, .xlock::after, .entry-hint.xinfo .xhit { animation: none; }
  .track .fill, .track .stop { transition: none; }
}

/* Phone keyboard open (set by game.jsx from visualViewport): keep the word and the box together. */
body.kb-open .progress { padding-top: 8px; gap: 4px; }
body.kb-open .progress .next { display: none; }
body.kb-open .target { padding-top: 0; }
body.kb-open .target .word { font-size: 38px; }
body.kb-open .target small { display: none; }
body.kb-open .main { gap: 8px; }
body.kb-open .xhead { padding-top: 8px; gap: 4px; }
body.kb-open .xhead .total b { font-size: 28px; }

/* High contrast: heavier outlines. Off stops on the progress track are hollow rings. */
:root[data-contrast="high"] .btn, :root[data-contrast="high"] .card, :root[data-contrast="high"] .found, :root[data-contrast="high"] .tab { border-width: 2px; }
:root[data-contrast="high"] .track .line { background: var(--ink); }
:root[data-contrast="high"] .track .stop { border-color: var(--ink); }

/* Settings sheet */
.setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.setting:last-child { border-bottom: 0; }
.setting b { display: block; font-size: 16px; }
.setting span { font-size: 13.5px; color: var(--muted); }
.segmented { display: inline-flex; border: 1px solid var(--ink); border-radius: 999px; padding: 2px; flex-shrink: 0; }
.segmented button { border: 0; background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink); }
.segmented button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.switch { width: 50px; height: 30px; border-radius: 15px; border: 0; background: var(--stop-off); position: relative; cursor: pointer; flex-shrink: 0; }
:root[data-contrast="high"] .switch { border: 2px solid var(--ink); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: left .2s; }
.switch[aria-checked="true"] { background: var(--sig-strong); }
.switch[aria-checked="true"]::after { left: 23px; }
@media (prefers-reduced-motion: reduce) { .switch::after { transition: none; } }

/* ---------- desktop and tablet: scale up so it doesn't read as a phone page ---------- */
@media (min-width: 760px) {
  body { font-size: 17px; }
  .bar { height: 64px; grid-template-columns: 112px 1fr 112px; padding: 0 16px; }
  .bar .title { font-size: 28px; }
  .iconbtn { width: 46px; height: 46px; }
  .iconbtn svg { width: 26px; height: 26px; }
  .main { max-width: 620px; gap: 18px; padding-top: 3vh; }
  .progress .rank { font-size: 17px; }
  .progress .pts, .progress .next { font-size: 15px; }
  .track { height: 24px; }
  .track .stop { width: 14px; height: 14px; }
  .track .stop.cur { width: 32px; height: 24px; border-radius: 12px; line-height: 21px; font-size: 12.5px; }
  .track .line, .track .fill { left: 7px; }
  .track .line { right: 7px; }
  .target small { font-size: 13px; }
  .target .word { font-size: 80px; }
  .entry input { max-width: 440px; height: 54px; font-size: 32px; }
  .target { padding-top: 0; }
  .entry-wrap { margin-top: -6px; }
  .entry-hint { font-size: 14.5px; }
  .btn { height: 50px; font-size: 17px; }
  .btn.small { height: 44px; padding: 0 20px; font-size: 16px; }
  .chip { font-size: 15.5px; padding: 6px 11px; }
  .dots i { width: 6px; height: 6px; }
  .found { padding: 14px 16px; }
  .found .head, .footer-row { font-size: 15px; }
  .card p, .card .note { font-size: 15px; }
  .card h2 { font-size: 17px; }
  .toast { font-size: 16px; }
  .banner b { font-size: 18px; }
  .banner span { font-size: 15.5px; }
  .splash { gap: 20px; }
  .logo { width: 88px; height: 88px; border-radius: 18px; }
  .logo svg { width: 52px; height: 52px; }
  .splash h1 { font-size: 64px; }
  .promise { font-size: 32px; max-width: 440px; }
  .splash .actions { width: 280px; }
  .meta { font-size: 16px; }
  .splash-stat { font-size: 17px; }
  .results h1 { font-size: 52px; }
  .results .sub { font-size: 17px; }
  .section h2 { font-size: 13px; }
  .stats b { font-size: 38px; }
  .stats span { font-size: 13.5px; }
  .sharebox { font-size: 16px; }
  .countdown strong { font-size: 42px; }
  .lb .r { font-size: 15px; grid-template-columns: 70px 1fr 48px; }
  .lb .bar2 { height: 18px; }
  .sheet { max-width: 560px; padding: 24px; }
  .sheet h2 { font-size: 32px; }
  .xhead .total b { font-size: 44px; }
  .xhead .total { font-size: 22px; }
  .xhead .goal-label { font-size: 14px; }
  .xhead .goal-label b { font-size: 17px; }
  .xcells i { height: 12px; }
  .xneed { font-size: 17px; }
  .entry-hint.xinfo { font-size: 17px; }
  .xrow .btn { min-width: 120px; }
  .xrow .btn.xlock { min-width: 170px; }
  .xslot { min-height: 50px; font-size: 15px; }
  .xslot.full { font-size: 17px; }
  .lb .r.xr { grid-template-columns: 112px 1fr 48px; }
}

/* Share dare banner (exact-mode results, target hits only) */
.dare { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--ink); color: var(--paper); border-radius: 12px;
  padding: 12px 16px; margin: 14px 0 4px; cursor: pointer;
  font-size: 15px; font-weight: 600; }
.dare .dare-arrow { font-weight: 700; }
.dare small { display: block; font-weight: 400; opacity: .75; font-size: 13px; }
