/* Hondenschool: phone-first, dyslexia-friendly. Font, size and theme are set on <html> via data attributes. */
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap;
  src: url(/static/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap;
  src: url(/static/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap;
  src: url(/static/fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap;
  src: url(/static/fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Lexend"; font-weight: 400; font-display: swap;
  src: url(/static/fonts/lexend-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lexend"; font-weight: 700; font-display: swap;
  src: url(/static/fonts/lexend-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lexend"; font-weight: 400; font-display: swap;
  src: url(/static/fonts/lexend-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Lexend"; font-weight: 700; font-display: swap;
  src: url(/static/fonts/lexend-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #faf6ee;          /* warm off-white: less glare than pure white */
  --bg-2: #f1ebdf;
  --card: #ffffff;
  --fg: #22262b;
  --muted: #5d646d;
  --line: #e2dccf;
  --accent: #0f8f7e;
  --accent-fg: #ffffff;
  --accent-soft: #d9f1ec;
  --warm: #e38b1a;
  --warm-soft: #fbe9cf;
  --ok: #2f9e5b;
  --ok-soft: #dcf3e4;
  --bad: #d14545;
  --bad-soft: #f8dcdc;
  --sel: #2b6cb0;
  --sel-soft: #dbe8f8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --font: "Atkinson Hyperlegible", system-ui, sans-serif;
  --fs: 18px;
  --nav-h: 64px;
  color-scheme: light dark;   /* tells Chrome's auto-dark to leave the page alone: it has its own dark theme */
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-font="lexend"] { --font: "Lexend", system-ui, sans-serif; }
:root[data-font="system"] { --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
:root[data-size="large"] { --fs: 20px; }
:root[data-size="xl"] { --fs: 22px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a; --bg-2: #1d2024; --card: #23272c; --fg: #ebe7df; --muted: #a8aeb6; --line: #343a41;
    --accent: #3cc2ae; --accent-fg: #0f1a18; --accent-soft: #1b3a36; --warm: #f0a23c; --warm-soft: #3d2d14;
    --ok: #4cc27a; --ok-soft: #1c3526; --bad: #ef6b6b; --bad-soft: #42201f; --sel: #6ea6e8; --sel-soft: #1f2f44;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  --bg: #15171a; --bg-2: #1d2024; --card: #23272c; --fg: #ebe7df; --muted: #a8aeb6; --line: #343a41;
  --accent: #3cc2ae; --accent-fg: #0f1a18; --accent-soft: #1b3a36; --warm: #f0a23c; --warm-soft: #3d2d14;
  --ok: #4cc27a; --ok-soft: #1c3526; --bad: #ef6b6b; --bad-soft: #42201f; --sel: #6ea6e8; --sel-soft: #1f2f44;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font);
  line-height: 1.6; letter-spacing: 0.012em; word-spacing: 0.06em;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5rem; font-weight: 700; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; max-width: 36em; }
em, i { font-style: normal; font-weight: 700; }   /* never italics: hard to read with dyslexia */
a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; letter-spacing: inherit; color: inherit; }
img { display: block; max-width: 100%; }
ul { padding-left: 1.2em; margin: 0 0 .75rem; }
li { margin-bottom: .25rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }

#app { max-width: 520px; margin: 0 auto; padding: 12px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); min-height: 100vh; }
#app.no-nav { padding-bottom: 24px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; min-height: 48px; margin-bottom: 8px; }
.topbar .back { background: none; border: 0; font-size: 1.4rem; padding: 6px 10px 6px 0; cursor: pointer; }
.topbar h1 { flex: 1; font-size: 1.25rem; margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: .95rem; white-space: nowrap; }
.pill.warm { background: var(--warm-soft); border-color: transparent; color: var(--fg); }
.pill.zero { opacity: .55; }

/* ---------- buttons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px;
  padding: 12px 18px; border-radius: var(--radius); border: 2px solid transparent; background: var(--accent);
  color: var(--accent-fg); font-weight: 700; font-size: 1.05rem; cursor: pointer; text-align: center;
  box-shadow: 0 3px 0 rgba(0,0,0,.18); transition: transform .06s, filter .15s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.btn.secondary { background: var(--card); color: var(--fg); border-color: var(--line); box-shadow: 0 3px 0 var(--line); }
.btn.warm { background: var(--warm); color: #fff; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.bad { background: var(--bad); color: #fff; }
.btn.slim { min-height: 44px; font-size: .95rem; width: auto; padding: 8px 16px; }
.btn.ghost { background: none; border: 0; box-shadow: none; color: var(--accent); min-height: 44px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .btn { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card.link { cursor: pointer; display: flex; align-items: center; gap: 12px; }
.card.link:active { background: var(--bg-2); }
.card .grow { flex: 1; min-width: 0; }
.chip { display: inline-block; background: var(--bg-2); border-radius: 8px; padding: 2px 10px; font-size: .85rem; font-weight: 700; margin: 0 6px 6px 0; }
.chip.accent { background: var(--accent-soft); }
.progress { height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.progress.warm > div { background: var(--warm); }
.thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--bg-2); flex: none; }
.thumb.sm { width: 48px; height: 48px; border-radius: 10px; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.thumbs img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--bg-2); }
.boxes { display: inline-flex; gap: 3px; vertical-align: middle; }
.boxes i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: inline-block; }
.boxes i.on { background: var(--accent); }

/* ---------- home ---------- */
.hero { background: linear-gradient(135deg, var(--accent) 0%, #117f93 100%); color: #fff; border-radius: 20px; padding: 18px; margin-bottom: 14px; }
.hero h2 { color: #fff; margin-bottom: 4px; }
.hero .btn { background: #fff; color: #0b5c52; margin-top: 12px; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.hero .btn:disabled { opacity: .7; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font-size: 1.3rem; line-height: 1.2; }
.stat span { font-size: .8rem; color: var(--muted); }
.unit { display: flex; align-items: center; gap: 12px; }
.unit .emoji { font-size: 1.8rem; width: 44px; text-align: center; flex: none; }
.unit .progress { margin-top: 6px; }

/* ---------- bottom nav ---------- */
nav.bottom { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; z-index: 20; }
nav.bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: .8rem; font-weight: 700; }
nav.bottom a .ico { font-size: 1.5rem; line-height: 1; }
nav.bottom a.active { color: var(--accent); }
#app.no-nav + nav.bottom { display: none; }

/* ---------- session ---------- */
.session-top { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.session-top .quit { background: none; border: 0; font-size: 1.5rem; padding: 4px 8px 4px 0; cursor: pointer; color: var(--muted); }
.session-top .progress { flex: 1; height: 14px; }
.session-top .count { font-weight: 700; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.prompt { font-size: 1.3rem; font-weight: 700; line-height: 1.35; margin: 0 0 12px; }
.qimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--bg-2); margin-bottom: 14px; box-shadow: var(--shadow); }
.qimg.sm { aspect-ratio: 16 / 9; }
.options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.options.grid { display: grid; grid-template-columns: 1fr 1fr; }
.opt { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 14px; border-radius: 14px;
  background: var(--card); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); text-align: left;
  cursor: pointer; font-weight: 700; font-size: 1.02rem; line-height: 1.35; -webkit-tap-highlight-color: transparent; }
.opt.img { flex-direction: column; align-items: stretch; padding: 8px; gap: 6px; }
.opt.img img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; background: var(--bg-2); }
.opt.img span { text-align: center; font-size: .95rem; }
.opt.img.tall img { aspect-ratio: 4 / 3; }
.opt:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.opt.selected { border-color: var(--sel); background: var(--sel-soft); box-shadow: 0 3px 0 var(--sel); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); box-shadow: 0 3px 0 var(--ok); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); box-shadow: 0 3px 0 var(--bad); }
.opt:disabled { cursor: default; }
.opt .key { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-2); display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; flex: none; color: var(--muted); }
input.answer { width: 100%; min-height: 56px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card);
  color: var(--fg); font: inherit; font-size: 1.1rem; letter-spacing: .02em; margin-bottom: 14px; }
input.answer:focus { outline: none; border-color: var(--sel); }

.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 6px solid var(--line); box-shadow: 0 -8px 30px rgba(0,0,0,.18);
  transform: translateY(100%); transition: transform .22s ease-out; max-height: 78vh; overflow-y: auto; }
.sheet.show { transform: translateY(0); }
.sheet.ok { border-top-color: var(--ok); background: var(--ok-soft); }
.sheet.bad { border-top-color: var(--bad); background: var(--bad-soft); }
.sheet .inner { max-width: 520px; margin: 0 auto; }
.sheet .sheet-foot { position: sticky; bottom: 0; padding-top: 8px; margin-top: 4px; background: inherit; }
.sheet h2 { display: flex; align-items: center; gap: 8px; font-size: 1.3rem; }
.sheet .ok-t { color: var(--ok); } .sheet .bad-t { color: var(--bad); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.compare > div { background: var(--card); border-radius: 12px; padding: 8px; border: 1px solid var(--line); }
.compare img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; margin-bottom: 6px; background: var(--bg-2); }
.compare b { display: block; font-size: .95rem; margin-bottom: 4px; }
.compare ul { font-size: .85rem; padding-left: 1em; margin: 0; }
.compare .tag { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: none; }
.compare .is-right { border-color: var(--ok); } .compare .is-wrong { border-color: var(--bad); }

/* ---------- teach cards ---------- */
.teach .qimg { margin-bottom: 10px; }
.teach h2 { font-size: 1.4rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0; font-size: .95rem; }
.facts dt { color: var(--muted); font-weight: 700; } .facts dd { margin: 0; }
.dots { display: flex; justify-content: center; gap: 6px; margin: 8px 0 12px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); } .dots i.on { background: var(--accent); }

/* ---------- result ---------- */
.result { text-align: center; padding-top: 24px; }
.result .big { font-size: 4rem; line-height: 1; margin-bottom: 8px; }
.result .xp { font-size: 2rem; font-weight: 700; color: var(--warm); }
.badge { display: flex; gap: 12px; align-items: center; background: var(--warm-soft); border-radius: 14px; padding: 10px 14px; text-align: left; margin: 8px 0; }
.badge .emoji { font-size: 2rem; }
canvas.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

/* ---------- hondenboek ---------- */
input.search { width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--fg); font: inherit; margin-bottom: 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.chips button.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.breed-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.breed-row b { display: block; line-height: 1.3; }
.breed-row .sub { font-size: .85rem; color: var(--muted); }
.detail .qimg { aspect-ratio: 4 / 3; }
.credit { font-size: .75rem; color: var(--muted); margin-top: -8px; margin-bottom: 12px; }
.lookalike { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.lookalike img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; background: var(--bg-2); }

/* ---------- profile / settings ---------- */
.avatars { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.avatars button { font-size: 1.6rem; width: 52px; height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); cursor: pointer; }
.avatars button.on { border-color: var(--accent); background: var(--accent-soft); }
.seg { display: flex; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.seg button { flex: 1; min-height: 44px; border: 0; background: var(--card); font-weight: 700; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-fg); }
.bars { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; font-size: .9rem; }
.bars .progress { height: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translateX(-50%); background: var(--fg); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-weight: 700; z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.fade { animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.pop { animation: pop .4s ease-out; display: inline-block; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
