/* Deutsch Bereit — "Playful Immersion" design system (from the mobile app's design doc). */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("/static/fonts/nunito-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("/static/fonts/nunito-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Arabic interface (src/i18n.js): Baloo Bhaijaan 2, rounded like Nunito, weights 400-800 (900 and 1000 show as
   800), SIL Open Font License (fonts/OFL-BalooBhaijaan2.txt). Only its Arabic letters: Latin letters, digits and
   the German words keep Nunito. Loaded only where Arabic text is shown. */
@font-face {
  font-family: "Baloo Bhaijaan 2";
  font-style: normal;
  font-display: swap;
  font-weight: 400 800;
  src: url("/static/fonts/baloo-bhaijaan-2-arabic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
html:lang(ar), :lang(ar) { --font: "Baloo Bhaijaan 2", "Nunito", "Segoe UI", Tahoma, "Geeza Pro", "Noto Sans Arabic", system-ui, sans-serif; }

:root {
  --green: #5cc900;
  --green-dark: #47a200;
  --green-light: #ebf9eb;
  --blue: #2daef0;
  --blue-dark: #1a8fca;
  --blue-light: #e8f5fe;
  --yellow: #ffc800;
  --yellow-dark: #d9a800;
  --yellow-light: #fff9e6;
  --red: #f04e45;
  --red-light: #fdf1f0;
  --ink: #2d2d2d;
  --text: #333333;
  /* colours as text: each reads at 4.5:1 or better on every light surface of every design
     (measured by public/dev-audit.js); the bright ones above are for fills, edges and pictures */
  --green-ink: #2b7400;
  --blue-ink: #0b6aa2;
  --gold-ink: #7a5c00;
  --red-ink: #a12a22;
  --red-strong: #d6362d; /* red under white text */
  --muted: #5f6670;
  --faint: #8a9099; /* locked and switched off: 3:1 */
  /* white text on a bright fill gets a dark rim around its letters, which carries the contrast */
  --rim: var(--green-ink);
  --tap: 44px; /* the smallest tap area */
  /* pixel icon sizes: small, medium beside text, medium on its own, large (set per screen density at the end) */
  --i-s: 16px; --i-m: 24px; --i-b: 24px; --i-l: 32px;
  /* 32-pixel drawings (landmarks, scenery): small, medium, large */
  --a-s: 32px; --a-m: 64px; --a-l: 128px;
  --line: #e5e5e5;
  --line-strong: #d4d8de;
  --bg: #f6f7f8;
  --card: #ffffff;
  /* one radius scale: picture tiles and small boxes, rows and boxes inside a card, cards and sheets */
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 4px 0 var(--line), 0 10px 24px rgba(0, 0, 0, 0.05);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 68px;
  --side-w: 248px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 16px/1.5 var(--font);
  min-height: 100vh;
  min-height: 100dvh;
}
/* a tap acts at once (no wait for a second tap), without the grey flash phones add */
a, button, label, summary, input, select, textarea { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-weight: 900; line-height: 1.15; margin: 0 0 12px; color: var(--text); text-wrap: balance; overflow-wrap: break-word; }
/* three heading levels in the whole app: the page title (h1, a pixel picture before it in .page-head), the section
   or card heading (h2 and .card-title: title case, may start with a medium picture) and the small grey label
   (.label-s and the classes listed with it under Cards & chips) */
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 12px; }
a { color: var(--blue-ink); font-weight: 700; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.caps { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 900; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; top: 12px; inset-inline-start: 12px; background: #fff; padding: 12px 14px; z-index: 100; border-radius: 8px; }
/* hidden until focused: clipped where it stands, never moved off-screen (scripts/I18N.md section 9) */
.skip:not(:focus) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* a link on a line of its own (back to the list): a full tap area */
.back-link { display: inline-flex; align-items: center; min-height: var(--tap); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 84px; }

/* ---------- App shell ---------- */
.shell { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); background: rgba(246, 247, 248, 0.92); backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
/* the brand: the mark (src/brand.js, the same picture as the app icon) and the name in two tones */
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: var(--tap); min-height: var(--tap); font-weight: 1000; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.brand b { font-weight: inherit; color: var(--green-ink); }
.brand-mark { flex: none; display: block; width: var(--i-l); height: var(--i-l); }
.brand-mark .px-icon { display: block; width: var(--i-l); height: var(--i-l); }
.status { display: flex; align-items: center; gap: 8px; }
.status-chip { position: relative; gap: 4px; white-space: nowrap; } /* the chip (Cards & chips) */
.status-chip.streak.cold { color: var(--muted); }
/* no lesson yet today: the flame is out */
.status-chip.streak.cold .px-icon { filter: grayscale(1); opacity: 0.65; }
/* small controls take taps from a little further out, up to 44 px (a transparent ::after around them) */
.status-chip::after, .city-card-x::after, .audio-btn.round::after, .link-btn::after, .city-card-more::after, .city-card-due::after, .pw-word a::after { content: ""; position: absolute; inset: -6px; }
.status-chip::after { inset: -8px -3px; }
.audio-btn.round::after { border-radius: 50%; }
.link-btn::after, .pw-word a::after { inset: -10px -6px; }
.city-card-more::after, .city-card-due::after { inset: -8px -6px; }
.avatar-chip { width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; font-size: 1.35rem; text-decoration: none; overflow: hidden; }
.avatar-chip .buddy { width: 34px; height: 34px; animation: none; }
.avatar-chip .buddy-canvas { border-radius: 50%; }
.page { width: 100%; max-width: 760px; margin: 0 auto; padding: 20px 16px 32px; }
.page.wide { max-width: 980px; }
.page-head { margin: 8px 0 20px; }
/* the picture beside a page's heading: 32 px (two pixel-grid steps of 16) on any screen, centred on the line */
.page-head h1:has(> .px-icon) { display: flex; align-items: center; gap: 12px; }
.page-head h1 > .px-icon { width: var(--i-l); height: var(--i-l); vertical-align: top; }
@supports not selector(:has(*)) { .page-head h1 > .px-icon { margin-inline-end: 12px; vertical-align: middle; } }
.page-head p { color: var(--muted); font-size: 1.1rem; font-weight: 600; }

/* bottom navigation (phones) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: var(--nav-h);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: #fff; border-top: 2px solid var(--line);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 0.8rem; font-weight: 800; }
.tabbar a:active { background: var(--bg); }
.tabbar a:focus-visible { outline-offset: -4px; }
.tabbar a.active { color: var(--green-ink); }
/* tab icons (src/pixel-icons.js navIcon): a quiet glyph in the label's colour, so it reads on any bar;
   the tab you are on shows its icon in full colour on a soft green tile, a little raised */
.px-icon.nav-on, .active > .px-icon.nav-off { display: none; }
.active > .px-icon.nav-on { display: inline-block; }
.tabbar a .px-icon { width: var(--i-l); height: var(--i-l); vertical-align: 0; border-radius: 9px; transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s; }
.tabbar a.active .px-icon { transform: translateY(-2px); background: var(--green-light); box-shadow: 0 0 0 5px var(--green-light); }
/* side navigation (desktop) */
.sidenav { display: none; }
@media (min-width: 960px) {
  .shell { padding-bottom: 24px; padding-inline-start: var(--side-w); }
  .tabbar { display: none; }
  .sidenav {
    display: flex; flex-direction: column; gap: 6px; position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: var(--side-w);
    padding: 22px 16px; background: #fff; border-inline-end: 2px solid var(--line); z-index: 25;
  }
  .sidenav .brand { padding: 4px 12px 22px; font-size: 1.35rem; }
  .sidenav a.nav-item {
    display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 14px; border: 2px solid transparent;
    color: var(--muted); text-decoration: none; font-weight: 800; font-size: 1rem;
  }
  .sidenav a.nav-item .px-icon { width: var(--i-l); height: var(--i-l); flex: none; vertical-align: 0; }
  .sidenav a.nav-item:hover > .px-icon.nav-on { display: inline-block; }
  .sidenav a.nav-item:hover > .px-icon.nav-off { display: none; }
  .sidenav a.nav-item:hover { background: var(--bg); }
  .sidenav a.nav-item.active { color: var(--green-ink); background: var(--green-light); border-color: #bfe8a3; }
  .sidenav .spacer { flex: 1; }
  .topbar .brand { visibility: hidden; }
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--green); --btn-fg: #fff; --btn-edge: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 12px 26px; border-radius: 999px; border: 2px solid var(--btn-edge);
  background: var(--btn-bg); color: var(--btn-fg); box-shadow: 0 5px 0 var(--btn-edge);
  font: 900 1.05rem/1.1 var(--font); text-transform: uppercase; letter-spacing: 0.06em; text-decoration: none; cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.06s ease, filter 0.15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
/* white letters on green or red: a dark rim around them (--rim) carries the contrast, as on a game's buttons */
.btn, .level-pill.active, .cal-day.l3 i, .cal-day.l4 i, .buddy-card .tag, .skin-on, .word-pop .pop-row button {
  text-shadow: 0 1px 0 var(--rim), 0 -1px 0 var(--rim), 1px 0 0 var(--rim), -1px 0 0 var(--rim), 1px 1px 0 var(--rim), -1px -1px 0 var(--rim), 1px -1px 0 var(--rim), -1px 1px 0 var(--rim), 0 2px 0 var(--rim);
}
.btn:hover { filter: brightness(1.04); }
.btn:active, .btn.pressed { transform: translateY(4px); box-shadow: 0 1px 0 var(--btn-edge); }
.btn:disabled, .btn[aria-disabled="true"] { --btn-bg: var(--line); --btn-fg: #8a8f96; --btn-edge: var(--line-strong); cursor: not-allowed; transform: none; box-shadow: 0 5px 0 var(--btn-edge); filter: none; text-shadow: none; }
.btn-block { display: flex; width: 100%; }
.btn-red { --btn-bg: var(--red-strong); --rim: #8f1d16; }
.btn-white { --btn-bg: #fff; --btn-fg: var(--text); --btn-edge: var(--line-strong); text-shadow: none; }
.btn-small { min-height: var(--tap); padding: 8px 16px; font-size: 0.85rem; box-shadow: 0 4px 0 var(--btn-edge); }
.btn-ghost { background: none; border: 0; box-shadow: none; color: var(--blue-ink); font: 800 1rem var(--font); cursor: pointer; min-height: var(--tap); padding: 8px; text-decoration: underline; text-shadow: none; }
.link-btn { position: relative; background: none; border: 0; padding: 0; font: inherit; color: var(--blue-ink); font-weight: 800; cursor: pointer; text-decoration: underline; text-shadow: none; }

/* ---------- Cards & chips ---------- */
.card-ui { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 2px solid var(--line); padding: 16px; margin-bottom: 16px; }
@media (min-width: 560px) { .card-ui { padding: 24px; margin-bottom: 24px; } }
a.card-ui:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.nowrap { white-space: nowrap; }
.card-title { font-size: 1.25rem; font-weight: 1000; line-height: 1.15; margin-bottom: 4px; color: var(--text); }
/* a section heading may start with a pixel picture: medium, centred on the line */
:is(h2, .card-title):has(> .px-icon) { display: flex; align-items: center; gap: 8px; }
:is(h2, .card-title) > .px-icon { width: var(--i-m); height: var(--i-m); vertical-align: top; }
/* the small grey label over a group (Profil's lists, Reise's sheet and cards, a text's kind) */
.label-s, .rows-title, .rk-h, .rk-card-state, .kind-tag, .postcard .chap { font: 900 0.8rem/1.2 var(--font); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
/* one chip in two sizes: the chip (top bar, choices, map, plan) and the small chip (facts, badges) */
.chip, .status-chip, .plan-chip, .rk-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; border: 2px solid var(--line); background: var(--card);
  color: var(--text); font: 900 0.95rem/1.2 var(--font); text-decoration: none;
}
/* a chip that is a link or a button: its shape says "tap me", so plain ink and no underline (blue stays for links in text) */
a.chip, button.chip, summary.chip, .plan-chip, .rk-chip { min-height: var(--tap); color: var(--ink); text-decoration: none; cursor: pointer; }
a.chip:active, button.chip:active, summary.chip:active, .plan-chip:active { background: var(--bg); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.badge-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-weight: 900; }
.badge-pill, .chip.chip-s, .rk-facts .chip { padding: 4px 11px; font-size: 0.85rem; min-height: 0; }
.chip-s .px-icon, .rk-facts .chip .px-icon { width: var(--i-s); height: var(--i-s); }
/* one chevron: pointing down it opens a choice (the folds, the level chip, the lesson length), pointing right
   it goes somewhere (a row you can tap) */
.fold-chev, .rk-caret, .length > summary::after, .row-chev, a.game-row::after, .today-item.goes::before {
  content: ""; flex: none; display: block; width: 9px; height: 9px; border: solid var(--muted); border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.fold-chev, .rk-caret, .length > summary::after { margin: -4px 2px 0; }
.row-chev { margin: 0; margin-inline-end: 4px; transform: rotate(-45deg); }
.row-chev.back { transform: rotate(135deg); }
/* after (or before) the words of a link or button: the words' own colour, a small gap */
:is(.rk-h-link, .rk-more, .wk-more, .btn) .row-chev { margin: 0; margin-inline: 6px 2px; border-color: currentColor; }
.btn .row-chev { margin: 0; }
a.game-row::after, .today-item.goes::before { position: absolute; inset-inline-end: 18px; top: 50%; margin-top: -5px; transform: rotate(-45deg); }
/* one row (Heute's plan, Reise's sheet, Spiele, Bibliothek, Fortschritt; grouped on Profil, below): a white box with
   a picture tile, a title and a quiet line under it; a row you can tap has the lower edge and the arrow, a row you
   cannot has neither */
.word-tile, .today-item, .rk-row, .rk-lvl { border: 2px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); }
a.word-tile, .today-item.goes, a.rk-row, a.rk-lvl { box-shadow: 0 3px 0 var(--line); }
a.word-tile:active, .today-item.goes:active, a.rk-row:active, a.rk-lvl:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.rk-ico, .rk-lv, .today-item .t-icon, .row-tile, .milestones .pct { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--bg); }
.rk-ico .px-icon, .today-item .t-icon .px-icon, .row-tile .px-icon { width: var(--i-b); height: var(--i-b); }
.rk-txt b, .today-item .t-text :is(strong, .t-link), .game-row .game-text strong { display: block; font-size: 1rem; font-weight: 900; line-height: 1.25; }
.rk-txt small, .today-item .t-text small, .game-row .game-text > span, .game-row .game-text small { display: block; color: var(--muted); font-size: 0.85rem; font-weight: 700; line-height: 1.3; }
/* a done row: a gold edge and a gold picture tile (done is gold, never a green tick) */
.today-item.done, .rk-row.done { border-color: var(--yellow); }
.today-item.done .t-icon, .rk-row.done .rk-ico { background: var(--yellow-light); }
/* a row you cannot tap that marks a step (Fortschritt's milestones): the row with its number in the picture tile;
   reached = done (gold edge, gold tile, a star at the end) */
.milestones li { display: flex; align-items: center; gap: 12px; min-height: 56px; padding-block: 8px; padding-inline: 10px 14px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); }
.milestones li.reached { border-color: var(--yellow); }
.milestones li.reached .pct { background: var(--yellow-light); color: var(--gold-ink); }
/* the grouped rows (Profil's places, settings and account): the same row, several stacked in one box. The box has
   the row's edge (2px var(--line)), --radius and surface and, as all its rows can be tapped, the 3px lower edge;
   inside it every row keeps the row's 56px height and paddings, the 40px picture tile (.row-tile), the title
   (1rem/900), the quiet text (0.85rem/700 grey, here on the right) and the arrow (.row-chev); a 2px line in the
   edge's colour between rows. A fold (details.fold) is a row whose arrow points down; open, its settings follow
   under its row. Grouped, a pressed row cannot sink with its edge: its surface greys (var(--bg)) instead, and the
   focus ring is drawn inside the box */
.row-group { list-style: none; margin: 0 0 20px; padding: 0; overflow: hidden; border: 2px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); box-shadow: 0 3px 0 var(--line); }
.row-group li + li, .row-group .fold { border-top: 2px solid var(--line); }
.row-group > .fold:first-child { border-top: 0; }
.row-group form { margin: 0; }
.row-group .row, .row-group .fold > summary { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding-block: 8px; padding-inline: 10px 14px; border: 0; border-radius: 0; background: none; color: var(--text); font: 700 1rem/1.25 var(--font); text-align: start; text-decoration: none; cursor: pointer; }
.row-group .row:active, .row-group .fold > summary:active { background: var(--bg); }
.row-group .row:focus-visible, .row-group .fold > summary:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.row-group .row-label, .row-group .fold > summary h2 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1rem; font-weight: 900; line-height: 1.25; color: inherit; }
.row-group .fold > summary:hover h2 { color: inherit; }
.row-group .row-value, .row-group .fold-now { flex: 0 1 auto; min-width: 0; max-width: 50%; color: var(--muted); font-size: 0.85rem; font-weight: 700; line-height: 1.3; text-align: end; }
.row-group .row-value { flex: none; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-group .fold-body { padding: 4px 16px 18px; }
.badge-streak { background: var(--yellow-light); color: var(--gold-ink); border: 2px solid #f3dc8a; }
.badge-new { background: var(--green-light); color: var(--green-ink); border: 2px solid #c9ecb0; }

.notice-ui { border-radius: var(--radius); padding: 13px 16px; margin-bottom: 18px; font-weight: 700; background: var(--green-light); border: 2px solid #c9ecb0; }
.error-ui { border-radius: var(--radius); padding: 13px 16px; margin-bottom: 18px; font-weight: 700; background: var(--red-light); border: 2px solid #f6c7c3; color: var(--red-ink); }

/* ---------- Forms ---------- */
.form-ui label:not(.check-ui) { display: block; font-weight: 900; margin: 0 0 6px; font-size: 0.95rem; }
.form-ui input:not([type="checkbox"]):not([type="radio"]), .form-ui select, .form-ui textarea {
  width: 100%; min-height: 52px; margin: 0 0 14px; padding: 10px 18px; border-radius: 16px; border: 3px solid var(--line); background: #fff;
  font: 700 1rem var(--font); color: var(--text);
}
.form-ui input:focus, .form-ui select:focus, .form-ui textarea:focus { border-color: var(--blue-dark); }
.form-ui .hint { color: var(--muted); font-size: 0.88rem; margin: -8px 0 14px; font-weight: 600; }
.form-ui .field-error { color: #c0392b; font-size: 0.9rem; margin: -8px 0 14px; font-weight: 800; }
.check-ui { display: flex; gap: 12px; align-items: center; min-height: var(--tap); font-weight: 700; margin: 4px 0 16px; cursor: pointer; }
.check-ui input { width: 24px; height: 24px; margin: 0; accent-color: var(--green); flex: none; cursor: pointer; }
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }

/* ---------- Auth screens ---------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; position: relative; overflow: hidden; }
/* a short screen (a phone with the keyboard open): the card starts at the top so the button stays in reach */
@media (max-height: 760px) { .auth-wrap { place-items: start center; padding: 16px; } .auth-hero .buddy-canvas { width: 72px !important; height: 72px !important; } .auth-card { padding: 20px 20px 24px; } }
@media (max-width: 380px) { .auth-card h1 { font-size: 1.5rem; } }
.auth-wrap::before, .auth-wrap::after { content: ""; position: absolute; border-radius: 50%; z-index: 0; filter: blur(2px); }
.auth-wrap::before { width: 380px; height: 380px; background: var(--green-light); top: -120px; inset-inline-start: -120px; }
.auth-wrap::after { width: 300px; height: 300px; background: var(--bg); bottom: -100px; inset-inline-end: -80px; }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 460px; background: #fff; border-radius: 32px; padding: 30px 24px; box-shadow: var(--shadow); border: 2px solid var(--line); }
.auth-card h1 { text-transform: uppercase; text-align: center; font-size: 1.9rem; }
.auth-card .lead { text-align: center; color: var(--muted); font-weight: 700; }
.auth-links { text-align: center; margin-top: 16px; font-weight: 700; }
.auth-hero { font-size: 4rem; text-align: center; line-height: 1; margin-bottom: 8px; }
.auth-hero .px-icon { width: 64px; height: 64px; }
.auth-links a { display: inline-flex; align-items: center; min-height: var(--tap); }
/* the switcher's line of links (views/partials/lang-switch.ejs): groups that never break apart (Deutsch · English, the
   two Arabics), a wider space between them; on a phone the line wraps between groups, nothing hangs at a line's end */
.lang-switch.auth-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; column-gap: 1.25em; }
.lang-switch .lang-group { display: inline-block; white-space: nowrap; }
.auth-card .check-ui { align-items: center; min-height: var(--tap); }
.auth-card .check-ui input { margin-top: 0; }
/* show/hide password (public/start.js adds the button) */
.pw-field { position: relative; margin: 0 0 14px; }
.form-ui .pw-field input { margin: 0; padding-right: 96px; }
.pw-toggle { position: absolute; top: 4px; right: 4px; min-width: var(--tap); min-height: 44px; padding: 0 12px; border: 0; border-radius: 14px; background: transparent; color: var(--blue-ink, #1a6e9a); font: 800 0.9rem var(--font); cursor: pointer; }
.pw-toggle:active { background: var(--bg); }
.pw-toggle:focus-visible { outline: 3px solid var(--blue); outline-offset: 0; }

/* ---------- Landing (views/landing.ejs, public/landing.js) ---------- */
/* .landing alone frames the other guest pages (Plus, Datenschutz, Impressum); the landing page itself is .lp. Logical
   properties throughout, so the page mirrors for right-to-left languages. */
.landing { max-width: 980px; margin: 0 auto; padding: 24px 16px 48px; }
.lp { overflow-x: clip; }
.lp-in { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px) { .lp-in { padding-inline: 32px; } }
/* the header: brand, the language switch (inserted at the lang-switch marker; its own row on a phone), Anmelden */
.lp-head-in { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-block: 10px; }
.lp-head .brand { margin-inline-end: auto; }
.lp-lang { order: 3; flex: 1 0 100%; display: flex; align-items: center; min-height: var(--tap); }
.lp-lang:empty { display: none; }
.lp-login { order: 2; flex: none; }
@media (min-width: 640px) { .lp-lang { order: 1; flex: 0 1 auto; justify-content: flex-end; } }
/* the switcher (views/partials/lang-switch.ejs, its quiet "links" look): one line, each choice a full tap height */
.lp-lang .lang-switch { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 0 18px; margin: 0; color: var(--muted); font-size: 0.95rem; font-weight: 700; text-align: start; }
.lp-lang .lang-switch :is(.link-btn, strong) { display: inline-flex; align-items: center; min-height: var(--tap); padding-inline: 4px; }
.lp-lang .lang-switch strong { color: var(--text); }
/* a quiet part of the header, not a row of links: plain words, the chosen one in ink over a short bar */
.lp-lang .lang-switch .link-btn { padding-inline: 8px; border-radius: 999px; color: var(--muted); text-decoration: none; }
.lp-lang .lang-switch .link-btn:hover { background: var(--card); color: var(--ink); }
.lp-lang .lang-switch strong { padding-inline: 8px; box-shadow: inset 0 -3px 0 var(--ink); }
/* 1. the first screen: the words and the actions, then (desktop: beside them) the app's home screen */
/* phone: the words, the stage, the facts; desktop: the words and the facts beside the stage */
.lp-hero { padding-block: 4px 40px; }
.lp-hero-in { display: grid; grid-template-areas: "copy" "stage" "facts"; gap: 24px 56px; }
.lp-hero-copy { grid-area: copy; }
.lp-stage { grid-area: stage; }
.lp-facts { grid-area: facts; }
@media (min-width: 900px) {
  .lp-hero { padding-block: 24px 48px; }
  .lp-hero-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); grid-template-areas: "copy stage" "facts stage"; align-items: center; }
  .lp-hero-copy { align-self: end; }
  .lp-facts { align-self: start; }
}
.lp-hero h1 { margin: 8px 0 14px; font-size: clamp(2rem, 1.2rem + 3.6vw, 3.6rem); line-height: 1.06; letter-spacing: -0.015em; }
.lp-lead { max-width: 32em; margin: 0 0 24px; color: var(--muted); font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem); font-weight: 700; line-height: 1.45; }
.lp-actions { display: grid; gap: 14px; max-width: 420px; }
.lp-trial-note { margin: 12px 0 0; color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.lp-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
/* the stage: the map in the look of Reise (the colours of the default .rk look, set here so the Reise rules stay
   its own), Felix on his stop, and the sheet under the map */
.lp-stage { position: relative; overflow: hidden; border: 2px solid var(--line); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow); }
.lp-map { position: relative; aspect-ratio: 4 / 3; background: #e6dcbf; }
/* the map is a map: it never mirrors, and its names sit as drawn in a right-to-left page too */
.lp .lp-map .map-svg { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; pointer-events: none; direction: ltr; }
.lp .lp-map .map-svg .state { fill: #f4eddb; stroke: #dccda4; stroke-width: 1.5; }
.lp .lp-map .map-svg .state.zone { fill: #80bf5c; stroke: #5a9442; }
.lp .lp-map .map-svg :is(.zone-lift, .zone-top, .road-edge) { display: inline; }
.lp .lp-map .map-svg .zone-lift { fill: #44703a; stroke: #44703a; stroke-width: 2; transform: translateY(6px); }
.lp .lp-map .map-svg .zone-top { stroke: #5a9442; stroke-width: 1.5; }
.lp .lp-map .map-svg .tex-bg { fill: #80bf5c; }
.lp .lp-map .map-svg .tex-a { fill: #68a44b; }
.lp .lp-map .map-svg .tex-b { fill: #9ccf7c; }
.lp .lp-map .map-svg :is(.road-edge, .lp-done-case) { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.lp .lp-map .map-svg .road-edge { stroke: #5a4a2c; stroke-width: 17; }
.lp .lp-map .map-svg .road { stroke: #fffaea; stroke-width: 12; }
.lp .lp-map .map-svg .road-dash { stroke: #b08d58; stroke-width: 4; stroke-dasharray: 0.1 9.5; }
.lp .lp-map .map-svg .lp-done-case { stroke: #9a6c06; stroke-width: 13; }
.lp .lp-map .map-svg .road-done { stroke: var(--yellow); stroke-width: 10; stroke-dasharray: none; }
.lp .lp-map .map-svg .node circle.bg { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.lp .lp-map .map-svg .node.done circle.bg { fill: var(--yellow); stroke: #fff; }
.lp .lp-map .map-svg .node text { font-size: 13px; fill: var(--ink); }
.lp .lp-map .map-svg .city-label { font-size: 12px; fill: var(--ink); stroke-width: 4px; }
.lp .lp-map .map-svg .city-label.lp-end { text-anchor: end; }
/* Felix's line, over his head */
.lp-say { position: absolute; top: 6%; inset-inline: 0; width: max-content; max-width: calc(100% - 32px); margin: 0 auto; padding: 8px 14px; border-radius: 14px; background: var(--ink); color: #fff; font-size: clamp(0.9rem, 0.8rem + 0.4vw, 1.1rem); font-weight: 900; line-height: 1.25; text-align: center; }
.lp-say::after { content: ""; position: absolute; top: 100%; inset-inline-start: 50%; margin-inline-start: -8px; border: 8px solid transparent; border-top-color: var(--ink); border-bottom-width: 0; }
/* until Felix is drawn (public/landing.js adds .lp-live), neither his line nor his shadow shows */
.lp-stage:not(.lp-live) :is(.lp-say, .pin-shadow) { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) { .lp-live .lp-say { animation: pop 0.3s ease-out; } }
.lp-sheet { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 2px solid var(--line); }
.lp .lp-sheet-art .px-icon { display: block; width: 48px; height: 48px; }
.lp-sheet-txt { flex: 1; min-width: 0; }
.lp-sheet-txt b { display: block; font-size: 1.2rem; font-weight: 1000; line-height: 1.2; }
.lp-sheet-txt small { display: block; color: var(--muted); font-size: 0.85rem; font-weight: 800; }
.lp-chip-xp { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border: 2px solid #f3dc8a; border-radius: 999px; background: var(--yellow-light); color: var(--gold-ink); font-size: 0.85rem; font-weight: 1000; }
.lp-chip-xp .px-icon { width: var(--i-s); height: var(--i-s); }
/* the sections */
.lp-sec { padding-block: 44px; }
@media (min-width: 900px) { .lp-sec { padding-block: 72px; } }
.lp-band { border-block: 2px solid var(--line); background: var(--card); }
.lp-h2 { margin: 0 0 8px; font-size: clamp(1.55rem, 1.1rem + 1.6vw, 2.3rem); text-align: center; }
.lp-sub { max-width: 34em; margin: 0 auto 28px; color: var(--muted); font-size: 1.05rem; font-weight: 700; text-align: center; }
@media (min-width: 900px) { .lp-sub { margin-bottom: 40px; } }
/* 2. how it works: three beats, each a real part of the app on a quiet surface */
.lp-beats { display: grid; gap: 36px; }
@media (min-width: 900px) { .lp-beats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; } }
.lp-beat { display: flex; flex-direction: column; min-width: 0; }
.lp-show { flex: 1; display: grid; place-items: center; padding: 20px 16px; border-radius: var(--radius-lg); background: #eceef1; }
.lp-beat h3 { display: flex; align-items: center; gap: 8px; margin: 18px 0 6px; font-size: 1.25rem; }
.lp-beat h3 .px-icon { flex: none; width: var(--i-m); height: var(--i-m); }
.lp-beat > p { margin: 0; color: var(--muted); font-weight: 700; }
.lp-card { width: 100%; max-width: 300px; margin: 0; }
/* a wider, lower picture than in a lesson, so the three beats stand about as tall as each other */
.lp-card .wc-img:not(.noimg) { max-width: none; aspect-ratio: 4 / 3; }
.lp-rows { display: grid; gap: 10px; width: 100%; max-width: 340px; }
.lp-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding-block: 8px; padding-inline: 10px 14px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: 0 3px 0 var(--line); }
.lp-row-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--bg); }
.lp .lp-row-ico .px-icon { width: 32px; height: 32px; }
.lp-row-txt { min-width: 0; }
.lp-row-txt b { display: block; font-weight: 900; line-height: 1.25; }
.lp-row-txt small { display: block; color: var(--muted); font-size: 0.85rem; font-weight: 700; line-height: 1.3; }
.lp-boss { border-color: #f6c7c3; }
.lp-boss .lp-row-ico { background: var(--red-light); }
.lp-boss b { color: var(--red-ink); }
.lp-row-flat { min-height: 56px; box-shadow: none; }
.lp-today { display: grid; gap: 14px; width: 100%; max-width: 340px; padding: 16px; border: 2px solid var(--line); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow); }
.lp-streak { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.lp-streak-n { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-ink); font-size: 2rem; font-weight: 1000; line-height: 1; }
.lp-streak-n .px-icon { width: var(--i-l); height: var(--i-l); }
.lp-streak-l { color: var(--muted); font-weight: 900; }
.lp-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; }
.lp-week li { display: grid; justify-items: center; gap: 4px; }
.lp-week i { display: grid; place-items: center; width: 32px; max-width: 100%; aspect-ratio: 1; border: 2px solid var(--line); border-radius: 50%; background: var(--bg); }
.lp-week li.on i { border-color: var(--yellow); background: var(--yellow-light); }
.lp-week li.today i { box-shadow: 0 0 0 2px var(--ink); }
.lp-week .px-icon { width: 18px; height: 18px; }
.lp-week small { color: var(--muted); font-size: 0.75rem; font-weight: 800; }
.lp-goal { display: grid; gap: 6px; }
.lp-goal-l { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 8px; }
.lp-goal-l b { font-weight: 900; }
.lp-goal-l small { color: var(--muted); font-size: 0.85rem; font-weight: 800; }
.lp-bar { display: block; height: 12px; overflow: hidden; border-radius: 999px; background: var(--line); }
.lp-bar i { display: block; width: 60%; height: 100%; border-radius: inherit; background: var(--yellow); }
/* 3. the buddies: three in a row on a phone, four on a tablet, all seven on a wide screen; a tap and they cheer */
.lp-buddy-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0; padding: 0; list-style: none; }
.lp-buddy-list > li { flex: 0 0 calc((100% - 24px) / 3); }
@media (min-width: 760px) { .lp-buddy-list > li { flex-basis: calc((100% - 36px) / 4); } }
@media (min-width: 1100px) { .lp-buddy-list { gap: 16px; } .lp-buddy-list > li { flex-basis: calc((100% - 96px) / 7); } }
.lp-buddy { display: grid; justify-items: center; align-content: start; gap: 2px; width: 100%; height: 100%; padding: 8px 6px 12px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--bg); box-shadow: 0 3px 0 var(--line); color: var(--text); font: inherit; text-align: center; cursor: pointer; }
.lp-buddy:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.lp-buddy-art { display: grid; place-items: center; width: 100%; aspect-ratio: 1; }
.lp-buddy-art .buddy-canvas { width: 100% !important; height: 100% !important; }
.lp-buddy-name { font-size: 1.05rem; font-weight: 1000; }
.lp-buddy-tag { color: var(--muted); font-size: 0.8rem; font-weight: 700; line-height: 1.25; }
/* 4. free and Plus */
.lp-plans { display: grid; gap: 16px; max-width: 980px; margin: 24px auto 0; }
@media (min-width: 820px) { .lp-plans { grid-template-columns: 1fr 1fr; align-items: start; gap: 24px; } }
.lp-plan { margin: 0; }
.lp-plan h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.25rem; }
.lp-plan h3 .px-icon { width: var(--i-m); height: var(--i-m); }
.lp-plan-plus { border-color: #f3dc8a; }
.lp-plus-list { display: grid; gap: 12px; margin: 0 0 8px; padding: 0; list-style: none; }
.lp-plus-list li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; }
.lp-plus-list .px-icon { width: var(--i-m); height: var(--i-m); }
.lp-plus-list b { display: block; font-weight: 900; }
.lp-plus-list small { display: block; color: var(--muted); font-size: 0.88rem; font-weight: 700; line-height: 1.35; }
.lp-plus-list small + small { color: var(--text); font-weight: 800; }
/* 5. the closing action */
.lp-end { padding-block-start: 0; }
.lp-end-card { display: grid; justify-items: center; max-width: 640px; margin: 0 auto; padding: 28px 14px; text-align: center; }
@media (min-width: 560px) { .lp-end-card { padding: 36px 32px; } }
.lp .lp-end-art .px-icon { display: block; width: 96px; height: 96px; margin-bottom: 8px; }
.lp-end-card .lp-sub { margin-bottom: 20px; }
.lp-end-card .lp-actions { width: 100%; }

/* ---------- Onboarding ---------- */
.buddy-carousel { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 16% 24px; margin: 0 -16px; scrollbar-width: none; }
.buddy-carousel::-webkit-scrollbar { display: none; }
.buddy-option { flex: 0 0 min(320px, 78vw); scroll-snap-align: center; position: relative; }
.buddy-option input { position: absolute; opacity: 0; pointer-events: none; }
.buddy-card {
  display: block; height: 100%; text-align: center; padding: 26px 20px; border-radius: 28px; border: 4px solid var(--line); background: #fff; cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.buddy-card .emoji { font-size: 5rem; line-height: 1.1; display: flex; justify-content: center; margin-bottom: 6px; }
.buddy-card .name { font-size: 1.5rem; font-weight: 1000; display: block; }
.buddy-card .tag { display: inline-block; margin: 10px 0 12px; padding: 4px 14px; border-radius: 999px; background: var(--green); color: #fff; font-weight: 900; font-size: 0.85rem; border: 2px solid var(--ink); }
.buddy-card .desc { display: block; font-weight: 600; color: #444; font-size: 0.98rem; }
/* what a buddy is remembered by: home, dream, quirk, and what it likes to say (partials/buddy-sheet.ejs) */
.buddy-sheet { display: grid; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 2px dashed var(--line); text-align: start; font-size: 0.9rem; }
.buddy-sheet .row { display: grid; grid-template-columns: 16px 68px 1fr; gap: 6px; align-items: start; font-weight: 600; color: #444; }
.buddy-sheet .row .px-icon { width: var(--i-s); height: var(--i-s); margin-top: 1px; }
.buddy-sheet .row b { font-weight: 1000; color: var(--ink); }
.buddy-sheet .motto { margin-top: 4px; text-align: center; font-weight: 1000; font-size: 1rem; color: var(--ink); }
.buddy-about { margin-bottom: 14px; }
.buddy-about > p { margin: 0; font-weight: 600; color: #444; }
.buddy-option input:checked + .buddy-card { border-color: var(--green); transform: scale(1.02); }
.buddy-option input:focus-visible + .buddy-card { outline: 3px solid var(--blue); outline-offset: 3px; }
.step-label { margin: 0 0 4px; color: var(--muted); font-weight: 800; font-size: 0.85rem; }
.page-head .step-label { margin-bottom: 8px; }
.buddy-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 8px; }
.buddy-count { min-width: 180px; text-align: center; font-weight: 800; }
.buddy-step { width: var(--tap); height: var(--tap); border-radius: 50%; border: 2px solid var(--line); background: #fff; color: var(--ink); font: 900 1.6rem/1 var(--font); cursor: pointer; }
.buddy-step:active:not(:disabled) { background: var(--bg); }
.buddy-step:disabled { opacity: 0.4; cursor: default; }
.buddy-step:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.dots { display: flex; justify-content: center; gap: 8px; margin: 4px 0 22px; }
.dots span { width: 10px; height: 10px; border-radius: 99px; background: var(--line); transition: width 0.2s, background 0.2s; }
.dots span.on { width: 32px; background: var(--green); }
.level-choice { display: grid; gap: 12px; }
/* .form-ui label sets display: block; the level choices are rows, so they need the stronger selector */
.level-choice label, .form-ui .level-choice label { display: flex; align-items: center; gap: 14px; margin: 0; padding: 14px 16px; border-radius: 20px; border: 3px solid var(--line); background: #fff; cursor: pointer; font-weight: 800; font-size: 1rem; }
.level-choice input { width: 22px; height: 22px; accent-color: var(--green); }
.level-choice + .hint { margin-top: 10px; }
.level-choice label:has(input:checked) { border-color: var(--green); }
.level-choice .lvl { min-width: 48px; text-align: center; padding: 6px 0; border-radius: 12px; background: var(--bg); color: var(--ink); font-weight: 1000; }
/* "Warum lernst du Deutsch?" (partials/goal-fields.ejs): like the levels, two per row; the exam's fields show
   once "Für eine Prüfung" is picked, or always where :has isn't supported */
.goal-choice { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 520px) { .goal-choice { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.goal-choice label > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.goal-choice label, .form-ui .goal-choice label { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border-radius: 18px; border: 3px solid var(--line); background: #fff; cursor: pointer; font-weight: 800; }
.goal-choice label:has(input:checked) { border-color: var(--green); background: var(--green-light); }
.goal-choice input { width: 20px; height: 20px; accent-color: var(--green); flex: none; }
.goal-icon .px-icon { width: var(--i-m); height: var(--i-m); vertical-align: middle; }
.exam-fields { display: none; gap: 6px; margin-top: 14px; }
.goal-choice:has(input[value="pruefung"]:checked) + .exam-fields { display: grid; }
@supports not selector(:has(*)) { .exam-fields { display: grid; } }
.exam-fields label { margin: 6px 0 0; font-weight: 800; }
/* the exam card on Lernen (_exam.ejs) and the mock exam's result (game.js) */
.exam-card .exam-days { padding: 4px 12px; border-radius: 999px; background: var(--bg); font-weight: 800; white-space: nowrap; }
.exam-card .exam-days b { font-size: 1.2rem; font-weight: 1000; }
.exam-card .exam-line { margin: 8px 0; }
.exam-card .progress { margin: 8px 0 12px; }
.exam-card .btn { margin-top: 8px; }
.mock-score { font-size: 1.1rem; font-weight: 800; }
.mock-score b { font-size: 2rem; font-weight: 1000; }
.mock-missed { text-align: start; margin: 16px 0; }
.mock-missed h2 { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; margin: 0 0 8px; }
.mock-missed ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; }

/* ---------- Reise ---------- */
.stat-tile { border-radius: 22px; padding: 16px 10px; text-align: center; border: 2px solid var(--line); background: #fff; }
.stat-tile .icon { font-size: 1.6rem; display: block; }
.stat-tile .num { font-size: 2rem; font-weight: 1000; display: block; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-tile .label { font-weight: 900; color: var(--muted); font-size: 0.9rem; }

/* level pills */
.level-pills { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 14px; margin-bottom: 8px; scrollbar-width: none; }
.level-pill {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 10px 22px; border-radius: 999px;
  min-height: var(--tap); font-weight: 1000; font-size: 1.3rem; text-decoration: none; border: 3px solid var(--line); color: var(--text); background: #fff; box-shadow: 0 4px 0 var(--line);
}
.level-pill.active { background: var(--green); color: #fff; border-color: var(--ink); box-shadow: 0 5px 0 var(--ink); }
/* a finished level: a gold rim and a gold star (done is gold, never a green tick); a locked one: faint on grey */
.level-pill.done { background: #fff; color: var(--text); border-color: #f3dc8a; box-shadow: 0 4px 0 #f3dc8a; }
.level-pill.locked { cursor: not-allowed; color: var(--faint); background: var(--bg); }
.level-pill .px-icon { width: var(--i-s); height: var(--i-s); }

/* map */
.map-card { padding: 18px; }
.map-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.map-wrap { position: relative; border-radius: 22px; overflow: hidden; background: var(--bg); border: 2px solid var(--line); }
.map-svg { display: block; width: 100%; height: auto; max-height: 72vh; }
.map-svg .state { fill: var(--line); stroke: #fff; stroke-width: 1.5; }
.map-svg .state.zone { fill: var(--green); }
.map-svg .state.zone.locked-zone { fill: #b8dd9a; }
.map-svg :is(.zone-lift, .zone-top, .road-edge) { display: none; } /* the raised region and the road's edge: Reise only (.rk) */
.map-svg .road { fill: none; stroke: #fff; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.map-svg .road-dash { fill: none; stroke: var(--line-strong); stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; }
.map-svg .road-done { fill: none; stroke: #fff; stroke-width: 4; stroke-dasharray: 10 6; stroke-linecap: round; }
.map-svg .node circle.bg { fill: #fff; stroke: var(--line); stroke-width: 4; }
.map-svg .node text { font: 900 15px var(--font); text-anchor: middle; dominant-baseline: central; fill: var(--muted); }
.map-svg .node.done circle.bg { fill: var(--green-ink); stroke: #fff; }
.map-svg .node.done text { fill: #fff; }
.map-svg .node.current circle.bg { fill: #fff; stroke: var(--green-dark); stroke-width: 6; }
.map-svg .node.current text { fill: var(--green-ink); }
.map-svg .node.current circle.pulse { fill: none; stroke: #fff; stroke-width: 3; opacity: 0.5; animation: pulse 1.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.map-svg .node.open circle.bg { stroke: var(--green-dark); }
/* the stop you look at: neutral (gold means "sicher gelernt"); the current stop keeps its green */
.map-svg .node.selected circle.bg { stroke: var(--ink); stroke-width: 6; }
.map-svg .node.current.selected circle.bg { stroke: var(--green-dark); }
.map-svg a { cursor: pointer; }
.map-svg a:focus-visible circle.bg { stroke: var(--ink); stroke-dasharray: 4 3; }
.map-svg .buddy-pin circle { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.map-svg .buddy-pin text { font-size: 19px; text-anchor: middle; dominant-baseline: central; }
.map-credit { font-size: 0.75rem; color: var(--muted); margin: 8px 2px 0; font-weight: 700; }
.zone-locked { text-align: center; padding: 28px 16px; }
.zone-locked .big { font-size: 3rem; }

/* chapter sheet */
.chapter-sheet .meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.progress { height: 16px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--green); transition: width 0.4s ease; }
.progress.blue > span { background: var(--green); }
.sheet-actions { display: grid; gap: 14px; margin-top: 18px; }

/* ---------- Lernen hub ---------- */
.hub-grid { display: grid; gap: 16px; margin-bottom: 16px; }
@media (min-width: 560px) { .hub-grid { margin-bottom: 24px; } }
@media (min-width: 640px) { .hub-grid { grid-template-columns: 1fr 1fr; } }
.hub-tile { display: block; text-decoration: none; color: var(--text); border-radius: var(--radius-lg); padding: 16px; margin: 0; border: 2px solid var(--line); background: #fff; box-shadow: var(--shadow); }
@media (min-width: 560px) { .hub-tile { padding: 24px; } }
/* on a phone the tile is a row (picture left, words right): four of them stay short */
@media (max-width: 559px) {
  .hub-tile { display: grid; grid-template-columns: 48px 1fr; column-gap: 16px; align-items: center; }
  .hub-tile .emoji { grid-row: 1 / span 2; margin: 0; }
}
.hub-tile .emoji { font-size: 2.2rem; display: block; margin-bottom: 6px; }
.hub-tile strong { font-size: 1.2rem; font-weight: 1000; display: block; }
.hub-tile span { color: var(--muted); font-weight: 700; }
.goal-ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--yellow) calc(var(--p) * 1%), var(--bg) 0); }
.goal-ring > div { width: 92px; height: 92px; border-radius: 50%; background: #fff; display: grid; place-items: center; align-content: center; gap: 2px; text-align: center; font-weight: 1000; line-height: 1.1; }
.goal-ring small { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 800; }
.goal-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.btn-block + p { margin: 14px 0 0; }

/* ---------- Lesson ---------- */
.lesson { max-width: 620px; margin: 0 auto; padding: 14px 16px 210px; }
/* a word card: room for "Wort hören / Satz hören" above the bar and the corner buddy */
.lesson[data-step="intro"] { padding-bottom: 290px; }
.lesson-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
/* the result screen: leaving and progress have no job any more */
.lesson.lesson-done .lesson-top .close, .lesson.lesson-done .lesson-progress { visibility: hidden; }

.lesson-progress { flex: 1; }
.lesson-progress .label { font-weight: 1000; color: #6f6f6f; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.92rem; }
.flashcard { position: relative; background: #fff; border-radius: 26px; border: 2px solid var(--line); box-shadow: var(--shadow); overflow: visible; padding: 22px 22px 24px; text-align: center; }
.new-tag { margin-inline-start: 8px; vertical-align: middle; }
.type-pill { display: inline-block; padding: 9px 20px; border-radius: 999px; border: 2px solid var(--line); background: var(--bg); font-weight: 1000; font-size: 1.15rem; }
/* the word pictures are square: every large frame is square too, so nothing of the picture is cut off; it is only as
   wide as leaves room for the word and the buttons on a phone */
.flash-image { display: block; width: 100%; max-width: min(480px, 42vh); height: auto; aspect-ratio: 1; object-fit: cover; margin: 0 auto 16px; border-radius: 18px; border: 0; background: var(--bg); }
/* the word page: the same headword as the word cards (chip, word without endings, one line of forms) */
.flash-head { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 12px; }
.flash-head .g { font-size: 1.05rem; }
.flash-head .flash-word { margin: 0; }
.flash-sub { margin: 6px 0 0; color: var(--muted); font-weight: 800; }
.flash-meaning { display: inline-block; margin: 14px 0 6px; padding: 10px 18px; border-radius: 16px; background: var(--green-light); color: var(--ink); font-size: 1.5rem; font-weight: 1000; line-height: 1.2; }
.flashcard .example-box { text-align: start; }
.flashcard .chip-row { justify-content: center; }
.flash-article { text-align: center; font-size: 2.6rem; font-weight: 1000; line-height: 1; margin-top: 12px; }
.art-der { color: var(--blue-ink); }
.art-die { color: var(--red-strong); }
.art-das { color: var(--green-ink); }
.flash-word { text-align: center; font-size: clamp(2rem, 7vw, 3.1rem); font-weight: 1000; line-height: 1.1; margin: 6px 0 16px; overflow-wrap: anywhere; color: var(--text); }
.example-box { border-radius: 22px; border: 2px solid var(--line); border-inline-start: 8px solid var(--line); background: var(--bg); padding: 14px 18px; margin-top: 8px; }
.example-box .caps { font-size: 0.82rem; color: var(--muted); display: block; margin-bottom: 2px; }
.example-box p { font-size: 1.15rem; font-weight: 800; margin: 0; }
.example-box .en { font-weight: 600; color: var(--muted); font-size: 1rem; margin-top: 4px; }
.answer { margin-top: 18px; text-align: center; animation: pop 0.25s ease-out; }
.answer .meaning { font-size: 1.6rem; font-weight: 1000; color: var(--green-ink); }
.grammar-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 4px; }
.grammar-chips span { padding: 5px 12px; border-radius: 12px; background: var(--bg); font-weight: 800; font-size: 0.9rem; }
.grammar-chips b { color: var(--ink); margin-inline-end: 4px; font-weight: 1000; }
.audio-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 170px); justify-content: center; gap: 10px; margin-top: 12px; } /* "Wort hören" and "Satz hören": always the same size */
.audio-row .audio-btn { justify-content: center; padding-inline: 12px; white-space: nowrap; }
.audio-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); border-radius: 999px; padding: 8px 16px; border: 2px solid #d8e8f3; background: var(--blue-light); color: var(--blue-ink); font: 900 0.95rem var(--font); cursor: pointer; box-shadow: 0 3px 0 #c6dcec; }
.audio-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #c6dcec; }
.buddy-peek { position: absolute; inset-inline-end: -26px; top: 46%; width: 66px; height: 66px; border-radius: 50%; background: #fff; border: 3px solid var(--line); box-shadow: 0 6px 16px rgba(0,0,0,0.12); display: grid; place-items: center; font-size: 2.1rem; transition: transform 0.3s; z-index: 2; }
@media (max-width: 520px) { .buddy-peek { inset-inline-end: -10px; width: 56px; height: 56px; font-size: 1.8rem; } }
.buddy-peek.cheer { animation: cheer 0.7s ease; }
.buddy-peek.oops { animation: wobble 0.6s ease; }
.speech { position: absolute; inset-inline-end: 30px; top: calc(46% - 52px); background: var(--ink); color: #fff; font-weight: 900; padding: 7px 13px; border-radius: 14px; font-size: 0.92rem; white-space: nowrap; animation: pop 0.2s ease-out; z-index: 3; }
.speech::after { content: ""; position: absolute; inset-inline-end: 18px; bottom: -7px; border: 8px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.lesson-actions { position: fixed; left: 0; right: 0; bottom: var(--kb, 0px); padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, rgba(246,247,248,0)); z-index: 15; }
.lesson-actions .inner { max-width: 620px; margin: 0 auto; }
.rate-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 520px) { .rate-grid { grid-template-columns: 1fr 1fr; } }
.rate-grid .btn { flex-direction: column; gap: 2px; padding: 8px 6px; min-height: 64px; font-size: 0.95rem; }
.rate-grid .btn small { font-size: 0.75rem; opacity: 0.85; text-transform: none; letter-spacing: 0; font-weight: 800; }
.keys-hint { text-align: center; font-size: 0.8rem; color: var(--muted); font-weight: 700; margin-top: 10px; }
.keys-hint kbd { font: 800 0.75rem var(--font); border: 2px solid var(--line); border-bottom-width: 3px; border-radius: 6px; padding: 0 5px; background: #fff; }

/* lesson complete */
.complete { text-align: center; padding: 28px 8px; animation: pop 0.35s ease-out; }
.complete .hero { font-size: 5.5rem; line-height: 1; animation: cheer 1s ease 0.2s; display: inline-block; }
.complete h1 { color: var(--ink); text-transform: uppercase; margin-top: 12px; }
.result-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0 26px; }
/* each tile takes two rows of the grid (subgrid): the labels share the first row and the values the second, so the
   values line up even when one label wraps (a longer translation) */
.result-tile { border-radius: 20px; border: 2px solid var(--line); overflow: hidden; background: #fff; display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
.result-tile .head { font-size: 0.78rem; font-weight: 1000; text-transform: uppercase; color: var(--muted); background: var(--bg); padding: 5px 4px; letter-spacing: 0.04em; display: flex; align-items: center; justify-content: center; }
.result-tile .val { font-size: 1.6rem; font-weight: 1000; padding: 10px 4px; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

/* ---------- Games ---------- */
.game-card { border-radius: 30px; padding: 24px; margin-bottom: 22px; border: 2px solid var(--line); background: #fff; box-shadow: 0 5px 0 var(--line); }
.game-head { display: flex; align-items: center; gap: 18px; }
.game-icon { font-size: 2.6rem; font-weight: 1000; min-width: 74px; text-align: center; }
.game-head h2 { margin: 0; text-transform: uppercase; font-size: 1.45rem; }
.game-head p { margin: 2px 0 0; color: var(--muted); font-weight: 800; font-size: 1.05rem; }
/* the list of games: one row each (a word-tile in its shape), the shared rules said once above it */
.games-rules { margin: -4px 0 16px; color: var(--muted); font-weight: 800; font-size: 0.95rem; }
.game-list { display: grid; gap: 8px; margin-bottom: 24px; }
.game-row { position: relative; gap: 12px; padding-block: 10px; padding-inline: 12px 40px; min-height: 72px; }
.game-row .game-icon { min-width: 0; flex: none; width: 48px; height: 48px; display: grid; place-items: center; }
.game-row .game-text { display: grid; gap: 2px; min-width: 0; }
.game-row .game-text small .px-icon { width: 16px; height: 16px; vertical-align: -3px; }
a.game-row:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.game-row.locked { background: var(--bg); }
.game-row.locked .game-icon { filter: grayscale(1); opacity: 0.55; }
.boss-card-row { margin-bottom: 8px; }
.boss-card-row .game-head { margin-bottom: 14px; gap: 12px; }
.boss-card-row .game-head h2 { text-transform: none; font-size: 1.25rem; }
.boss-card-row .game-head p { font-size: 0.95rem; }
.boss-card-row .game-icon { min-width: 48px; }
/* a game's start card: the rules in one line, the start button down by the thumb */
.game-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; margin: 12px 0 4px; font-weight: 800; color: var(--ink); }
.game-facts span { white-space: nowrap; }
.game-facts span + span::before { content: "·"; margin: 0 8px; color: var(--muted); }
.game-stage [data-screen]:has(> [data-start], > .lock-note) { display: flex; flex-direction: column; min-height: calc(100vh - 100px); min-height: calc(100dvh - 100px); }
.game-stage [data-screen]:has(> [data-start], > .lock-note) > .question-card { margin-top: auto; }
.game-stage [data-screen]:has(> [data-start], > .lock-note) > .question-card + * { margin-top: auto; }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); background: #fff; color: var(--ink); font-size: 0.95rem; font-weight: 700; line-height: 1.4; }
.privacy-note .px-icon { flex: none; width: 24px; height: 24px; }
.game-stage { max-width: 600px; margin: 0 auto; padding: 14px 16px 40px; }
.game-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.game-bar .lesson-progress { flex: 1; }
.game-bar .spacer { flex: 1; }
/* leaving a lesson or a game: the cross keeps its place, its tap area is 44 px */
.close { flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); margin: 0 -10px; font-size: 1.6rem; color: var(--muted); text-decoration: none; font-weight: 900; line-height: 1; }
.hearts { font-size: 1.4rem; letter-spacing: 2px; white-space: nowrap; }
.hearts .lost { filter: grayscale(1); opacity: 0.35; }
.timer { --t: 1; position: relative; width: 58px; height: 58px; flex: none; }
.timer svg { transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 7; }
.timer .track { stroke: var(--line); }
.timer .bar { stroke: var(--green); stroke-linecap: round; stroke-dasharray: 157; stroke-dashoffset: calc(157 * (1 - var(--t))); transition: stroke-dashoffset 0.1s linear, stroke 0.3s; }
.timer.low .bar { stroke: var(--red); }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 1000; font-size: 1.1rem; }
.question-card { background: #fff; border-radius: 30px; border: 2px solid var(--line); box-shadow: var(--shadow); padding: 26px 20px; text-align: center; margin-bottom: 20px; }
.question-card img { width: 160px; height: 160px; object-fit: cover; border-radius: 22px; border: 4px solid var(--line); margin-bottom: 10px; }
.question-card .prompt { font-size: clamp(1.8rem, 7vw, 2.7rem); font-weight: 1000; line-height: 1.15; overflow-wrap: anywhere; }
.question-card .hint { color: var(--muted); font-weight: 800; margin-top: 6px; }
.options { display: grid; gap: 14px; }
.options.three { grid-template-columns: repeat(3, 1fr); }
.options.two { grid-template-columns: 1fr 1fr; }
.options .btn { min-height: 64px; font-size: 1.25rem; text-transform: none; letter-spacing: 0; }
.options .btn.correct { --btn-bg: var(--green); --btn-fg: #fff; text-shadow: 0 1px 0 var(--rim), 0 -1px 0 var(--rim), 1px 0 0 var(--rim), -1px 0 0 var(--rim), 1px 1px 0 var(--rim), -1px -1px 0 var(--rim), 1px -1px 0 var(--rim), -1px 1px 0 var(--rim); }
.options .btn.wrong { --btn-bg: var(--red-strong); --btn-fg: #fff; --rim: #8f1d16; text-shadow: 0 1px 0 var(--rim), 0 -1px 0 var(--rim), 1px 0 0 var(--rim), -1px 0 0 var(--rim), 1px 1px 0 var(--rim), -1px -1px 0 var(--rim), 1px -1px 0 var(--rim), -1px 1px 0 var(--rim); animation: wobble 0.4s; }
/* "Gut zugehört!": whole sentences as answers, one per row, left-aligned */
.options.sentences { grid-template-columns: 1fr; gap: 12px; }
.options.sentences .btn { justify-content: flex-start; text-align: start; min-height: 56px; padding: 12px 18px; font-size: 1.02rem; line-height: 1.3; }
[data-skin="klar"] .options.sentences .btn { border-radius: 22px; } /* a pill around two lines of text looks like a capsule */
.question-card .listen-row { margin-bottom: 6px; }
.game-over { text-align: center; }

.zone-label { font-size: 0.8rem; font-weight: 1000; text-transform: uppercase; letter-spacing: 0.06em; color: var(--green-ink); margin: 6px 14px 4px; }

/* ---------- Bibliothek ---------- */
.lib-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; margin-bottom: 12px; align-items: center; }
.lib-filters input[type="search"] { grid-column: 1 / 3; grid-row: 1; min-width: 0; }
.lib-filters select { min-width: 0; width: 100%; }
.lib-selects { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px; }
.lib-filters button { grid-column: 3; grid-row: 1; min-height: 48px; }
@media (min-width: 561px) { .lib-filters { grid-template-columns: minmax(0, 1fr) auto auto; } .lib-filters input[type="search"] { grid-column: 1; } .lib-selects { grid-column: 2; grid-row: 1; grid-template-columns: 9rem 11rem; } .lib-filters button { grid-column: 3; } }
.lib-tabs { margin-bottom: 16px; }
.lib-tabs .chip { min-height: var(--tap); text-decoration: none; color: var(--ink); }
.lib-tabs .chip[aria-current="page"] { border-color: var(--green); background: var(--green-light); color: var(--green-ink); }
/* the shared selected state of a chip that is a choice: aria-current, aria-pressed="true" or class "on" */
a.chip[aria-current], .chip[aria-pressed="true"], .chip.on { border-color: var(--green); background: var(--green-light); color: var(--green-ink); text-decoration: none; }
.chip[aria-pressed] { cursor: pointer; }
/* a quiet line under a disabled button saying why; tie it to the button with aria-describedby */
.why-off { margin: 8px 0 0; font-size: 0.85rem; font-weight: 700; color: var(--muted); text-align: center; }
.lib-tabs .lib-reset { color: var(--muted); }
.word-tile .wt-text { display: grid; gap: 2px; min-width: 0; }
.word-tile .wt-en { color: var(--muted); font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.word-tile .wt-meta { color: var(--muted); font-weight: 800; font-size: 0.9rem; line-height: 1.3; }
.word-tile .wt-meta .nw { white-space: nowrap; }
.word-tile .wt-meta .px-icon { width: 16px; height: 16px; vertical-align: -3px; margin-inline-end: 4px; }
.pager { flex-wrap: wrap; }
.pager .pager-jump { order: -1; flex: 0 0 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pager .pager-jump input { width: 72px; min-height: var(--tap); text-align: center; border-radius: 14px; border: 3px solid var(--line); font: 800 1rem var(--font); background: #fff; }
.pager > .btn, .pager > .pager-gap { flex: 1 1 0; max-width: 200px; }
.lib-filters input, .lib-filters select { min-height: 48px; border-radius: 14px; border: 3px solid var(--line); padding: 6px 14px; font: 700 1rem var(--font); background: #fff; }
/* a select shows the app's chevron (Cards & chips), not the browser's arrow (:not([multiple]) only lifts the rule
   above the designs' `background` shorthands for these fields) */
.lib-filters select:not([multiple]), .form-ui select:not([multiple]) { -webkit-appearance: none; appearance: none; padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath d='M2 2l5 5 5-5' fill='none' stroke='%235f6670' stroke-width='3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 14px 10px; }
.word-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.word-tile { display: flex; gap: 12px; align-items: center; padding: 12px; text-decoration: none; } /* the row (Cards & chips) */
.word-tile img, .word-tile .ph { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex: none; background: var(--bg); display: grid; place-items: center; font-size: 1.6rem; }
.word-tile strong { display: block; font-weight: 1000; font-size: 1.05rem; line-height: 1.2; }
.word-tile small { color: var(--muted); font-weight: 700; }
.state-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 4px; background: var(--line-strong); }
.state-dot.s1, .state-dot.s3 { background: var(--yellow); }
.state-dot.s2 { background: var(--green); }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 22px 0; font-weight: 800; }

/* ---------- Profil ---------- */
.profile-head { text-align: center; padding: 10px 0 6px; }
.profile-avatar { width: 116px; height: 116px; margin: 0 auto 10px; border-radius: 50%; background: #fff; border: 4px solid var(--green); display: grid; place-items: center; font-size: 4rem; box-shadow: var(--shadow); }
.profile-head h1 { margin-bottom: 2px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 18px 0; }
@media (min-width: 640px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 2px solid var(--bg); font-weight: 800; }
.toggle-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 56px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch::after { content: ""; position: absolute; inset: -6px 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: 0.2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 24px; height: 24px; inset-inline-start: 4px; top: 4px; border-radius: 50%; background: #fff; transition: 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(24px); }
.switch input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.buddy-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.buddy-picker label { cursor: pointer; position: relative; min-width: 0; }
.buddy-picker input { position: absolute; opacity: 0; }
.buddy-picker span { display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; font-size: 2rem; border-radius: 18px; border: 3px solid var(--line); background: #fff; }
.buddy-picker .buddy-canvas { max-width: 100%; height: auto !important; }
.buddy-picker input:checked + span { border-color: var(--green); background: var(--green-light); }
.buddy-picker input:focus-visible + span { outline: 3px solid var(--blue); }
.menu-list { list-style: none; padding: 0; margin: 0; }
.menu-list a, .menu-list button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 15px 4px; border: 0; border-bottom: 2px solid var(--bg); background: none; font: 800 1.05rem var(--font); color: var(--text); text-decoration: none; cursor: pointer; text-align: start; }
.menu-list li:last-child a { border-bottom: 0; }

/* ---------- Reading ---------- */
.reading-paper { background: #fff; border-radius: 28px; border: 2px solid var(--line); box-shadow: var(--shadow); padding: 24px; font-size: 1.22rem; line-height: 2; white-space: pre-wrap; font-weight: 600; }
.reading-paper .w[data-en] { cursor: pointer; border-radius: 6px; }
.reading-paper .w.target { background: #fff6d1; border-bottom: 3px solid var(--yellow); padding: 0 2px; font-weight: 800; }
.reading-paper .w.oov { border-bottom: 3px dotted #a3a9b1; }
.reading-paper .w.known:hover { background: var(--blue-light); }
.word-pop { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 18px; font-weight: 800; max-width: min(92vw, 520px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); animation: pop 0.2s ease-out; }
@media (min-width: 960px) { .word-pop { left: calc(50% + var(--side-w) / 2); bottom: 24px; } }
.legend-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; font-weight: 800; font-size: 0.9rem; }
.legend-row .w { padding: 2px 8px; border-radius: 8px; }
.legend-row .target { background: #fff6d1; border-bottom: 3px solid var(--yellow); }
.legend-row .oov { border-bottom: 3px dotted #a3a9b1; }
.topic-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .topic-grid { grid-template-columns: 1fr; } }
.radio-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.radio-pills label { cursor: pointer; position: relative; }
.radio-pills input { position: absolute; opacity: 0; }
.radio-pills span { display: inline-flex; align-items: center; min-height: var(--tap); padding: 9px 18px; border-radius: 999px; border: 3px solid var(--line); background: #fff; font-weight: 900; }
.radio-pills input:checked + span { border-color: var(--green); background: var(--green-light); color: var(--green-ink); }
.radio-pills input:focus-visible + span { outline: 3px solid var(--blue); }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 2px solid var(--bg); text-decoration: none; color: var(--text); font-weight: 800; }
.list-row:last-child { border-bottom: 0; }

/* ---------- Utilities ---------- */
.actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 16px 0; }
.stack { display: grid; gap: 14px; }
.toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 60; background: var(--red-strong); color: #fff; padding: 10px 18px; border-radius: 14px; font-weight: 900; box-shadow: 0 6px 16px rgba(0,0,0,0.2); }
.toast.info { background: var(--ink); }

/* ---------- Footer ---------- */
.app-footer { text-align: center; font-size: 0.82rem; color: var(--muted); font-weight: 700; padding: 8px 16px 24px; }
.app-footer a { display: inline-block; padding: 12px 6px; color: var(--muted); }

/* ---------- Motion ---------- */
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes cheer { 0% { transform: scale(1) rotate(0); } 30% { transform: scale(1.25) rotate(-8deg); } 60% { transform: scale(1.1) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes wobble { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.6; } 100% { transform: scale(1.9); opacity: 0; } }
/* =====================================================================================
   Engagement: buddy, exercises, juice, quests, cities, boss, shop, album, progress
   ===================================================================================== */

/* ---------- Buddy personas (inline SVG rig; every part animates on its own, pivots set inline) ---------- */
.buddy { display: block; overflow: visible; }
.buddy .bd-eyes { animation: bd-blink 5.2s infinite; }
/* moods, shared */
.buddy-idle .bd-body, .buddy-idle .bd-arms { animation: bd-breathe 3.8s ease-in-out infinite; }
.buddy-idle .bd-head { animation: bd-head-bob 3.8s ease-in-out infinite; }
.buddy-idle .bd-ear-r { animation: bd-ear-twitch 7s ease-in-out infinite; }
.buddy-idle .bd-ear-l { animation: bd-ear-twitch 7s ease-in-out 3.4s infinite; }
.buddy-idle .bd-tail { animation: bd-tail-wag 3.2s ease-in-out infinite; }
.buddy-happy .bd-rig { animation: bd-hop 1.3s cubic-bezier(.33, 0, .3, 1) infinite; }
.buddy-happy .bd-shadow { animation: bd-shadow-hop 1.3s cubic-bezier(.33, 0, .3, 1) infinite; }
.buddy-happy .bd-arm-l { animation: bd-wave-l .65s ease-in-out infinite alternate; }
.buddy-happy .bd-arm-r { animation: bd-wave-r .65s ease-in-out infinite alternate; }
.buddy-happy .bd-tail { animation: bd-tail-wag .5s ease-in-out infinite; }
.buddy-happy .bd-spark { animation: bd-twinkle 1.3s ease-in-out infinite; }
.buddy-happy .bd-spark:nth-of-type(2n) { animation-delay: -.65s; }
.buddy-sad .bd-head { animation: bd-sigh 4.2s ease-in-out infinite; }
.buddy-sad .bd-body, .buddy-sad .bd-arms { animation: bd-breathe 4.2s ease-in-out infinite; }
.buddy-sad .bd-tear { animation: bd-tear 2.6s ease-in infinite; }
.buddy-sleepy .bd-head { animation: bd-nod 4.8s ease-in-out infinite; }
.buddy-sleepy .bd-body, .buddy-sleepy .bd-arms { animation: bd-breathe-deep 4.8s ease-in-out infinite; }
.buddy-sleepy .bd-zzz { animation: bd-zzz 3.6s linear infinite; opacity: 0; }
.buddy-sleepy .bd-zzz:nth-child(2) { animation-delay: 1.2s; }
.buddy-sleepy .bd-zzz:nth-child(3) { animation-delay: 2.4s; }

/* idle habits, one per buddy */
.buddy--felix.buddy-idle .bd-look { animation: fx-glance 5.5s ease-in-out infinite; }
.buddy--felix.buddy-idle .bd-tail { animation: fx-tail 2.6s ease-in-out infinite; }
.buddy--hansi.buddy-idle .bd-rig { animation: hs-jog .62s ease-in-out infinite; }
.buddy--hansi.buddy-idle .bd-leg-l { animation: hs-leg .62s ease-in-out infinite; }
.buddy--hansi.buddy-idle .bd-leg-r { animation: hs-leg .62s ease-in-out -.31s infinite; }
.buddy--hansi.buddy-idle .bd-arm-l { animation: hs-arm-l .62s ease-in-out infinite; }
.buddy--hansi.buddy-idle .bd-arm-r { animation: hs-arm-r .62s ease-in-out infinite; }
.buddy--arthur.buddy-idle .bd-head { animation: ar-nod 1.5s ease-in-out infinite; }
.buddy--arthur .bd-glint { animation: ar-glint 4.4s ease-in-out infinite; }
.buddy--fiona.buddy-idle .bd-rig { animation: fi-sway 3.4s ease-in-out infinite; }
.buddy--fiona.buddy-idle .bd-arm-l { animation: fi-flutter 3.4s ease-in-out infinite; }
.buddy--fiona.buddy-idle .bd-head { animation: fi-neck 3.4s ease-in-out infinite; }
.buddy--dieter.buddy-idle .bd-rig { animation: dt-waddle 1.1s ease-in-out infinite; }
.buddy--dieter.buddy-idle .bd-tail { animation: bd-tail-wag .55s ease-in-out infinite; }
.buddy--heidi.buddy-idle .bd-arm-r { animation: hd-whistle 5.5s ease-in-out infinite; }
.buddy--heidi.buddy-idle .bd-note { animation: hd-note 5.5s ease-out infinite; opacity: 0; }
.buddy--heidi.buddy-idle .bd-note:nth-child(2) { animation-delay: .25s; }
.buddy--ingo.buddy-idle .bd-rig { animation: ig-sway 4s ease-in-out infinite; }
.buddy--ingo.buddy-idle .bd-look { animation: ig-peek 6s ease-in-out infinite; }
.buddy--ingo.buddy-idle .bd-arms { animation: ig-apple 6s ease-in-out infinite; }

/* shadow boxing, every buddy in its own style */
.act-box .bd-rig { animation: bx-bounce .5s ease-in-out infinite; }
.act-box .bd-shadow { animation: bx-shadow .5s ease-in-out infinite; }
.buddy--felix.act-box .bd-rig { animation: fx-footwork .8s ease-in-out infinite; }
.buddy--felix.act-box .bd-fore-l { animation: fx-jab 1.6s ease-out infinite; }
.buddy--felix.act-box .bd-hand-l { animation: fx-jab-glove 1.6s ease-out infinite; }
.buddy--felix.act-box .bd-fore-r { animation: fx-cross 1.6s ease-out infinite; }
.buddy--felix.act-box .bd-hand-r { animation: fx-cross-glove 1.6s ease-out infinite; }
.buddy--felix.act-box .bd-head { animation: fx-weave 1.6s ease-in-out infinite; }
.buddy--felix.act-box .bd-tail { animation: bd-tail-wag .4s ease-in-out infinite; }
.buddy--hansi.act-box .bd-fore-l { animation: hs-one 1s cubic-bezier(.2, .8, .3, 1) infinite; }
.buddy--hansi.act-box .bd-hand-l { animation: hs-one-glove 1s cubic-bezier(.2, .8, .3, 1) infinite; }
.buddy--hansi.act-box .bd-fore-r { animation: hs-two 1s cubic-bezier(.2, .8, .3, 1) infinite; }
.buddy--hansi.act-box .bd-hand-r { animation: hs-two-glove 1s cubic-bezier(.2, .8, .3, 1) infinite; }
.buddy--hansi.act-box .bd-body, .buddy--hansi.act-box .bd-arms { animation: hs-twist 1s ease-in-out infinite; }
.buddy--hansi.act-box .bd-sweat { animation: hs-sweat 1s ease-out infinite; opacity: 0; }
.buddy--arthur.act-box .bd-rig { animation: ar-lean 2.4s ease-in-out infinite; }
.buddy--arthur.act-box .bd-fore-l { animation: ar-jab 2.4s ease-in-out infinite; }
.buddy--arthur.act-box .bd-hand-l { animation: ar-jab-glove 2.4s ease-in-out infinite; }
.buddy--arthur.act-box .bd-head { animation: ar-nod 1.2s ease-in-out infinite; }
.buddy--arthur.act-box .bd-arm-r { animation: ar-swing 2.4s ease-in-out infinite; }
.buddy--fiona.act-box .bd-rig { animation: fi-pirouette 3s ease-in-out infinite; }
.buddy--fiona.act-box .bd-fore-l { animation: fi-punch-l 3s ease-out infinite; }
.buddy--fiona.act-box .bd-fore-r { animation: fi-punch-r 3s ease-out infinite; }
.buddy--fiona.act-box .bd-hand-l { animation: fi-glove-l 3s ease-out infinite; }
.buddy--fiona.act-box .bd-hand-r { animation: fi-glove-r 3s ease-out infinite; }
.buddy--dieter.act-box .bd-rig { animation: dt-stumble 2.4s ease-in-out infinite; }
.buddy--dieter.act-box .bd-arm-l { animation: dt-mill-l .8s linear infinite; }
.buddy--dieter.act-box .bd-arm-r { animation: dt-mill-r .8s linear infinite; }
.buddy--heidi.act-box .bd-rig { animation: hd-hop .6s ease-in-out infinite; }
.buddy--heidi.act-box .bd-arm-l { animation: hd-slap-l 1.2s ease-in-out infinite; }
.buddy--heidi.act-box .bd-arm-r { animation: hd-slap-r 1.2s ease-in-out infinite; }
.buddy--heidi.act-box .bd-leg-r { animation: hd-kick 1.2s ease-in-out infinite; }
.buddy--heidi.act-box .bd-leg-l { animation: hd-kick 1.2s ease-in-out -.6s infinite; }
.buddy--ingo.act-box .bd-rig { animation: ig-tremble 2.8s ease-in-out infinite; }
.buddy--ingo.act-box .bd-arm-l { animation: ig-peek-l 2.8s ease-in-out infinite; }
.buddy--ingo.act-box .bd-arm-r { animation: ig-peek-r 2.8s ease-in-out infinite; }
.buddy--ingo.act-box .bd-fore-r { animation: ig-jab 2.8s ease-out infinite; }

/* cooking, every buddy its own dish */
.act-cook .bd-body, .act-cook .bd-head { animation: bd-breathe 2.6s ease-in-out infinite; }
.act-cook .bd-steam { animation: bd-steam 2.4s ease-out infinite; opacity: 0; }
.buddy--felix.act-cook .bd-fore-r { animation: fx-flip .9s ease-in-out infinite; }
.buddy--felix.act-cook .bd-arm-l { animation: fx-shake .45s ease-in-out infinite; }
.buddy--felix.act-cook .bd-food { animation: fd-hop .9s ease-in-out infinite; }
.buddy--felix.act-cook .bd-sizzle { animation: fd-sizzle .6s ease-out infinite; }
.buddy--hansi.act-cook .bd-arms { animation: hs-roll 1.2s ease-in-out infinite; }
.buddy--hansi.act-cook .bd-dough { animation: hs-dough 1.2s ease-in-out infinite; }
.buddy--hansi.act-cook .bd-flour { animation: hs-flour 1.2s ease-out infinite; opacity: 0; }
.buddy--arthur.act-cook .bd-flip { animation: ar-flip 1.8s cubic-bezier(.3, 0, .4, 1) infinite; }
.buddy--arthur.act-cook .bd-arm-r { animation: ar-toss 1.8s ease-out infinite; }
.buddy--arthur.act-cook .bd-head { animation: ar-nod 1.8s ease-in-out infinite; }
.buddy--fiona.act-cook .bd-fore-r { animation: fi-pipe 1.8s ease-in-out infinite; }
.buddy--fiona.act-cook .bd-cream { animation: fi-cream 3.6s ease-out infinite; }
.buddy--fiona.act-cook .bd-arm-l { animation: fi-flutter 3.6s ease-in-out infinite; }
.buddy--dieter.act-cook .bd-flip { animation: dt-flip 4.5s linear infinite; }
.buddy--dieter.act-cook .bd-arm-r { animation: dt-toss 1.5s ease-out infinite; }
.buddy--dieter.act-cook .bd-head { animation: dt-bonk 4.5s ease-in-out infinite; }
.buddy--heidi.act-cook .bd-fore-r { animation: hd-stir 1.4s ease-in-out infinite; }
.buddy--heidi.act-cook .bd-cheese { animation: hd-cheese 1.4s ease-in-out infinite; }
.buddy--ingo.act-cook .bd-fore-r { animation: ig-ladle 1.6s ease-in-out infinite; }
.buddy--ingo.act-cook .bd-hat { animation: ig-hat 3.2s ease-in-out infinite; }

/* small or repeated buddies stay on the spot */
.buddy-hero-center .buddy { margin: 0 auto; }
.avatar-chip .bd-rig, .avatar-chip .bd-shadow, .avatar-chip .bd-arm-l, .avatar-chip .bd-arm-r, .avatar-chip .bd-leg-l, .avatar-chip .bd-leg-r,
.map-svg .buddy .bd-rig, .map-svg .buddy .bd-shadow,
.buddy-picker .bd-rig, .buddy-picker .bd-shadow, .wardrobe .bd-rig, .wardrobe .bd-shadow,
.shop-item .bd-rig, .shop-item .bd-shadow { animation: none !important; }
.shop-item:nth-child(2n) .buddy *, .buddy-picker label:nth-child(2n) .buddy * { animation-delay: -1.7s; }

@keyframes bd-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
@keyframes bd-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.018, 1.032); } }
@keyframes bd-breathe-deep { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, 1.055); } }
@keyframes bd-head-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-1.3px) rotate(-1.6deg); } }
@keyframes bd-ear-twitch { 0%, 86%, 100% { transform: rotate(0); } 89% { transform: rotate(-14deg); } 92% { transform: rotate(5deg); } 95% { transform: rotate(-4deg); } }
@keyframes bd-tail-wag { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(7deg); } }
@keyframes bd-hop { 0% { transform: translateY(0) scale(1.07, .93); } 22% { transform: translateY(-12px) scale(.95, 1.06); } 38% { transform: translateY(-14px) scale(1, 1); } 58% { transform: translateY(0) scale(1.08, .92); } 72% { transform: translateY(0) scale(.98, 1.02); } 86%, 100% { transform: translateY(0) scale(1, 1); } }
@keyframes bd-shadow-hop { 0%, 58%, 100% { transform: scale(1); opacity: 1; } 38% { transform: scale(.68); opacity: .5; } }
@keyframes bd-wave-l { from { transform: rotate(-16deg); } to { transform: rotate(10deg); } }
@keyframes bd-wave-r { from { transform: rotate(16deg); } to { transform: rotate(-10deg); } }
@keyframes bd-twinkle { 0%, 100% { transform: scale(.45) rotate(0); opacity: .25; } 50% { transform: scale(1.1) rotate(20deg); opacity: 1; } }
@keyframes bd-sigh { 0%, 100% { transform: rotate(0) translateY(0); } 50% { transform: rotate(-4deg) translateY(1.6px); } }
@keyframes bd-tear { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 80% { transform: translateY(9px); opacity: .9; } 100% { transform: translateY(11px); opacity: 0; } }
@keyframes bd-nod { 0%, 100% { transform: rotate(0) translateY(0); } 45% { transform: rotate(6deg) translateY(2px); } 55% { transform: rotate(6.5deg) translateY(2.4px); } 62% { transform: rotate(1deg) translateY(0); } }
@keyframes bd-zzz { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(8px, -16px) scale(1.15); opacity: 0; } }
@keyframes bd-steam { 0% { transform: translateY(0) scaleX(.6); opacity: 0; } 25% { opacity: .85; } 100% { transform: translateY(-12px) scaleX(1.2); opacity: 0; } }
/* felix */
@keyframes fx-glance { 0%, 30%, 100% { transform: translateX(0); } 38%, 52% { transform: translateX(-2.6px); } 60%, 72% { transform: translateX(.6px); } }
@keyframes fx-tail { 0%, 100% { transform: rotate(-4deg); } 30% { transform: rotate(9deg); } 45% { transform: rotate(2deg); } 60% { transform: rotate(10deg); } }
@keyframes fx-footwork { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-1.8px, -2px); } 50% { transform: translate(0, 0); } 75% { transform: translate(1.8px, -2px); } }
@keyframes fx-jab { 0%, 8%, 18%, 30%, 100% { transform: rotate(0); } 12%, 24% { transform: rotate(62deg); } }
@keyframes fx-jab-glove { 0%, 8%, 18%, 30%, 100% { transform: scale(1); } 12%, 24% { transform: scale(1.35); } }
@keyframes fx-cross { 0%, 56%, 72%, 100% { transform: rotate(0); } 63% { transform: rotate(72deg); } }
@keyframes fx-cross-glove { 0%, 56%, 72%, 100% { transform: scale(1); } 63% { transform: scale(1.42); } }
@keyframes fx-weave { 0%, 100% { transform: translate(0, 0) rotate(0); } 38% { transform: translate(-3px, 1px) rotate(-5deg); } 48% { transform: translate(0, 0); } 80% { transform: translate(1px, 3px) rotate(3deg); } 88% { transform: translate(0, 0); } }
@keyframes fx-flip { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(18deg); } }
@keyframes fx-shake { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-3deg); } }
@keyframes fd-hop { 0%, 60%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-7px) rotate(180deg); } 45% { transform: translateY(0) rotate(360deg); } }
@keyframes fd-sizzle { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-5px); opacity: 0; } }
/* hansi */
@keyframes hs-jog { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.6px); } }
@keyframes hs-leg { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes hs-arm-l { 0%, 100% { transform: rotate(14deg); } 50% { transform: rotate(-14deg); } }
@keyframes hs-arm-r { 0%, 100% { transform: rotate(14deg); } 50% { transform: rotate(-14deg); } }
@keyframes hs-one { 0%, 4%, 24%, 100% { transform: rotate(0); } 12% { transform: rotate(70deg); } }
@keyframes hs-one-glove { 0%, 4%, 24%, 100% { transform: scale(1); } 12% { transform: scale(1.45); } }
@keyframes hs-two { 0%, 46%, 68%, 100% { transform: rotate(0); } 56% { transform: rotate(74deg); } }
@keyframes hs-two-glove { 0%, 46%, 68%, 100% { transform: scale(1); } 56% { transform: scale(1.5); } }
@keyframes hs-twist { 0%, 100% { transform: rotate(0); } 12% { transform: rotate(-3deg); } 56% { transform: rotate(3deg); } }
@keyframes hs-sweat { 0% { transform: translate(0, 0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(-6px, -8px); opacity: 0; } }
@keyframes hs-roll { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@keyframes hs-dough { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(1.08); } }
@keyframes hs-flour { 0% { transform: translateY(0) scale(.4); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-8px) scale(1.4); opacity: 0; } }
/* arthur */
@keyframes ar-nod { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(3deg) translateY(.8px); } }
@keyframes ar-glint { 0%, 70% { transform: translateX(-6px); opacity: 0; } 76% { opacity: .9; } 88%, 100% { transform: translateX(9px); opacity: 0; } }
@keyframes ar-lean { 0%, 60%, 100% { transform: rotate(0) translate(0, 0); } 72%, 82% { transform: rotate(-7deg) translate(-2px, 0); } }
@keyframes ar-jab { 0%, 32%, 50%, 100% { transform: rotate(0); } 40% { transform: rotate(64deg); } }
@keyframes ar-jab-glove { 0%, 32%, 50%, 100% { transform: scale(1); } 40% { transform: scale(1.3); } }
@keyframes ar-swing { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-6deg); } }
@keyframes ar-flip { 0%, 6% { transform: translateY(0) rotate(0); } 34% { transform: translateY(-36px) rotate(270deg); } 62% { transform: translateY(0) rotate(540deg); } 70% { transform: translateY(-2px) rotate(540deg); } 76%, 100% { transform: translateY(0) rotate(540deg); } }
@keyframes ar-toss { 0%, 100% { transform: rotate(0); } 5% { transform: rotate(-14deg); } 14% { transform: rotate(4deg); } 24% { transform: rotate(0); } 62% { transform: rotate(0); } 66% { transform: rotate(5deg); } 72% { transform: rotate(0); } }
/* fiona */
@keyframes fi-sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2.4deg); } }
@keyframes fi-flutter { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-8deg); } }
@keyframes fi-neck { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-3deg); } }
@keyframes fi-pirouette { 0%, 20% { transform: scaleX(1) rotate(0); } 28% { transform: scaleX(.1) rotate(0); } 34% { transform: scaleX(-1); } 40% { transform: scaleX(-.1); } 46%, 100% { transform: scaleX(1); } }
@keyframes fi-punch-l { 0%, 56%, 66%, 100% { transform: rotate(0); } 61% { transform: rotate(60deg); } }
@keyframes fi-punch-r { 0%, 72%, 82%, 100% { transform: rotate(0); } 77% { transform: rotate(64deg); } }
@keyframes fi-glove-l { 0%, 56%, 66%, 100% { transform: scale(1) rotate(0); } 61% { transform: scale(1.35) rotate(-20deg); } }
@keyframes fi-glove-r { 0%, 72%, 82%, 100% { transform: scale(1) rotate(0); } 77% { transform: scale(1.38) rotate(-20deg); } }
@keyframes fi-pipe { 0%, 100% { transform: rotate(-6deg); } 25% { transform: rotate(4deg); } 50% { transform: rotate(8deg); } 75% { transform: rotate(-2deg); } }
@keyframes fi-cream { 0% { transform: scale(0); opacity: 0; } 10% { transform: scale(1.25); opacity: 1; } 16%, 88% { transform: scale(1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
/* dieter */
@keyframes dt-waddle { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes dt-stumble { 0%, 100% { transform: translateY(0) rotate(0); } 15% { transform: translateY(-3px); } 30% { transform: translateY(0); } 45% { transform: translateY(-3px); } 60% { transform: translateY(0); } 72% { transform: rotate(9deg) translateX(2px); } 80% { transform: rotate(-6deg); } 88% { transform: rotate(2deg); } }
@keyframes dt-mill-l { from { transform: rotate(0); } to { transform: rotate(-360deg); } }
@keyframes dt-mill-r { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes dt-toss { 0%, 100% { transform: rotate(0); } 6% { transform: rotate(-12deg); } 16% { transform: rotate(3deg); } 26% { transform: rotate(0); } }
@keyframes dt-flip {
  0% { transform: translate(0, 0) rotate(0); } 12% { transform: translate(0, -30px) rotate(180deg); } 24%, 33% { transform: translate(0, 0) rotate(360deg); }
  45% { transform: translate(0, -30px) rotate(540deg); } 57%, 66% { transform: translate(0, 0) rotate(720deg); }
  78%, 86% { transform: translate(1px, -63px) rotate(900deg); } 94% { transform: translate(10px, -40px) rotate(960deg); } 100% { transform: translate(0, 0) rotate(1080deg); }
}
@keyframes dt-bonk { 0%, 76%, 90%, 100% { transform: translateY(0) scale(1, 1); } 79% { transform: translateY(2px) scale(1.06, .92); } 83% { transform: translateY(0) scale(.98, 1.03); } }
/* heidi */
@keyframes hd-whistle { 0%, 55%, 92%, 100% { transform: rotate(0); } 63%, 84% { transform: rotate(150deg); } }
@keyframes hd-note { 0%, 62% { transform: translate(0, 0); opacity: 0; } 68% { opacity: 1; } 90% { transform: translate(6px, -14px); opacity: 0; } 100% { opacity: 0; } }
@keyframes hd-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes hd-slap-l { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-26deg); } 40% { transform: rotate(0); } 70% { transform: rotate(-34deg); } }
@keyframes hd-slap-r { 0%, 100% { transform: rotate(0); } 45% { transform: rotate(26deg); } 65% { transform: rotate(0); } 90% { transform: rotate(34deg); } }
@keyframes hd-kick { 0%, 40%, 100% { transform: translateY(0); } 60%, 72% { transform: translateY(-6px) rotate(-8deg); } }
@keyframes hd-stir { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(14deg); } }
@keyframes hd-cheese { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.5); } }
/* ingo */
@keyframes ig-sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes ig-peek { 0%, 55%, 100% { transform: translate(0, 0); } 62%, 76% { transform: translate(1.6px, -2.2px); } }
@keyframes ig-apple { 0%, 58%, 100% { transform: translateY(0); } 64%, 76% { transform: translateY(-5px); } }
@keyframes ig-tremble { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-.6px, 0); } 75% { transform: translate(.6px, 0); } }
@keyframes ig-peek-l { 0%, 30%, 64%, 100% { transform: rotate(0); } 40%, 54% { transform: rotate(22deg); } }
@keyframes ig-peek-r { 0%, 30%, 64%, 100% { transform: rotate(0); } 40%, 54% { transform: rotate(-22deg); } }
@keyframes ig-jab { 0%, 74%, 86%, 100% { transform: rotate(0); } 80% { transform: rotate(40deg); } }
@keyframes ig-ladle { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(12deg); } }
@keyframes ig-hat { 0%, 100% { transform: translateY(0); } 70% { transform: translateY(5px); } 78% { transform: translateY(-1px); } 84% { transform: translateY(0); } }
/* boxing, shared */
@keyframes bx-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.4px); } }
@keyframes bx-shadow { 0%, 100% { transform: scale(1); } 50% { transform: scale(.92); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-10deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
@keyframes pop-big { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.buddy-hero { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.buddy-hero > .buddy { flex: none; width: 108px; height: 108px; }
.bubble { position: relative; flex: 1; background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: 12px 16px; font-weight: 800; box-shadow: var(--shadow); }
.bubble::before { content: ""; position: absolute; inset-inline-start: -12px; top: 50%; transform: translateY(-50%); border: 11px solid transparent; border-inline-end-color: var(--line); border-inline-start: 0; }
.bubble::after { content: ""; position: absolute; inset-inline-start: -9px; top: 50%; transform: translateY(-50%); border: 10px solid transparent; border-inline-end-color: #fff; border-inline-start: 0; }
.bubble strong { display: block; font-size: 1.15rem; font-weight: 1000; }
.bubble p { margin: 2px 0 0; color: var(--muted); font-size: 0.95rem; }
.bubble .btn { margin-top: 10px; white-space: nowrap; }

/* ---------- Quests & chests ---------- */
.quest-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
/* a quest is a row (Cards & chips) you cannot tap: white, its edge, its picture tile */
.quest { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; min-height: 56px; padding-block: 8px; padding-inline: 10px 14px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--card); }
.quest .q-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 1.35rem; background: var(--bg); }
.quest .q-title { font-weight: 900; line-height: 1.25; }
.quest .q-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 0.82rem; font-weight: 900; color: var(--muted); font-variant-numeric: tabular-nums; }
.quest .q-bar .progress { flex: 1; height: 12px; }
.quest.done .q-icon { background: var(--yellow-light); border-color: #f3dc8a; }
.quest.done:not(.claimed) { border-color: var(--yellow); background: #fff; }
/* paid (by itself when the lesson, game or text ended): gold, nothing left to tap */
.quest.claimed { opacity: 0.75; }
.quest.claimed .progress > span { background: var(--yellow); }
.quest .claimed-tag { display: inline-flex; align-items: center; gap: 4px; font-weight: 1000; color: var(--gold-ink); white-space: nowrap; }
.chest-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
@media (max-width: 560px) { .chest-row { grid-template-columns: 1fr; } }
.chest { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; border: 2px dashed var(--line); background: var(--bg); font-weight: 900; }
.chest .c-icon { font-size: 2rem; line-height: 1; flex: none; }
.chest small { display: block; color: var(--muted); font-weight: 800; }
.chest .progress { height: 10px; margin-top: 4px; }
.chest > div { flex: 1; min-width: 0; }
.chest.ready { border-style: solid; border-color: var(--yellow); }
.chest.ready .c-icon { animation: wiggle 1.2s ease-in-out infinite; }
.chest.opened { opacity: 0.6; border-style: solid; border-color: var(--line); background: var(--bg); }

/* ---------- Comprehension meter ---------- */
.understand { display: flex; align-items: center; gap: 18px; }
.understand-ring { --p: 0; flex: none; width: 100px; height: 100px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--line) 0); }
.understand-ring > span { width: 78px; height: 78px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 1000; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.understand .big-line { font-weight: 900; font-size: 1.08rem; line-height: 1.35; margin-bottom: 4px; }
.understand.large .understand-ring { width: 150px; height: 150px; }
.understand.large .understand-ring > span { width: 118px; height: 118px; font-size: 2.1rem; }
@media (max-width: 480px) { .understand { flex-direction: column; text-align: center; } }

/* ---------- Map: cities, boss, flyover ---------- */
.map-svg .city-label { font: 900 12px var(--font); text-anchor: middle; fill: #4d5560; paint-order: stroke; stroke: rgba(255, 255, 255, 0.95); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.map-svg .city-label.locked { fill: #7b828c; }
.map-svg .city-label.current { fill: var(--ink); font-size: 13px; }
.map-svg .road-boss { fill: none; stroke: var(--red); stroke-width: 3; stroke-dasharray: 3 8; stroke-linecap: round; opacity: 0.75; }
.map-svg .boss-node circle.bg { fill: #fff; stroke: var(--red); stroke-width: 5; }
.map-svg .boss-node text { font-size: 24px; text-anchor: middle; dominant-baseline: central; }
.map-svg .boss-node.locked { filter: grayscale(1); opacity: 0.55; }
.map-svg .boss-node.open circle.bg { stroke-width: 7; }
.map-svg .boss-node.open circle.pulse { fill: none; stroke: var(--red); stroke-width: 3; opacity: 0.5; animation: pulse 1.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.map-svg .boss-node.won circle.bg { fill: var(--yellow); stroke: #fff; }
.map-svg .boss-node.selected circle.bg { stroke: var(--ink); }
/* the buddy stands on its stop and walks the road (public/journey.js) */
.map-svg .pin-shadow { fill: rgba(20, 40, 10, 0.3); }
.map-svg .map-buddy { cursor: pointer; }
.map-svg .map-buddy .buddy { animation: none; }
.map-svg .node-badge { animation: badge-bob 1.4s ease-in-out infinite; pointer-events: none; }
@keyframes badge-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.map-svg a.stop.nope { animation: nope 0.45s ease; }
@keyframes nope { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.map-svg .map-say { pointer-events: none; }
.map-svg .map-say-in { animation: say-in 0.22s ease-out; transform-box: fill-box; transform-origin: 50% 100%; }
.map-svg .map-say rect, .map-svg .map-say path { fill: #fff; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.map-svg .map-say text { font: 900 12px var(--font); text-anchor: middle; dominant-baseline: central; fill: var(--ink); }
@keyframes say-in { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.map-svg .road-boss.won { stroke: #fff; stroke-width: 4; stroke-dasharray: 10 6; opacity: 1; }
.chapter-sheet.sheet-in, .boss-sheet.sheet-in { animation: sheet-in 0.32s ease-out; }
@keyframes sheet-in { from { opacity: 0.4; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* compact city card under the map (filled by public/journey.js) */
.city-card { position: relative; display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; background: #fff; border: 2px solid var(--line); border-radius: 18px; box-shadow: 0 4px 0 var(--line); }
.city-card[hidden] { display: none; }
.city-card.in { animation: card-in 0.25s ease-out; }
@keyframes card-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.city-card-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.city-card-main strong { font-size: 1.08rem; font-weight: 1000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-card-main .muted { font-size: 0.8rem; font-weight: 800; }
.city-card .progress { display: block; height: 8px; margin-top: 3px; }
.city-card-act { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.city-card-act form { margin: 0; }
.city-card-act .btn { white-space: nowrap; }
.city-card-more { position: relative; font-size: 0.8rem; font-weight: 900; }
.city-card-lock .px-icon { width: var(--i-l); height: var(--i-l); vertical-align: top; }
.city-card-x { position: absolute; top: -12px; inset-inline-end: -10px; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; padding: 0; cursor: pointer; }
.city-card-x .px-icon { width: var(--i-s); height: var(--i-s); vertical-align: top; }
.count-dot { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: 0.75rem; font-weight: 1000; }
.postcard-claim { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; padding: 10px 14px; border-radius: 16px; background: var(--bg); border: 2px solid var(--line); font-weight: 800; }
.flyover-banner { position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 45; background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 18px; font-weight: 1000; font-size: 1.1rem; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); text-align: center; max-width: 92vw; }
.city-fact { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 18px; background: var(--bg); border: 2px solid var(--line); margin: 4px 0 14px; font-weight: 700; }
.city-fact .pin { font-size: 1.4rem; line-height: 1.2; }
.boss-sheet { border-top: 6px solid var(--red); }
.boss-head { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.boss-face { font-size: 3.4rem; line-height: 1; flex: none; }
.boss-head h2 { margin: 0; }
.boss-head p { margin: 2px 0 0; color: var(--muted); font-weight: 800; }
.postcard-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 20px; background: #fff; border: 2px solid var(--line); border-inline-start: 6px solid var(--yellow); box-shadow: var(--shadow); }
.postcard-banner .stamp { font-size: 2.4rem; line-height: 1; animation: wiggle 1.8s ease-in-out infinite; }
.postcard-banner > div { flex: 1; min-width: 180px; }
.postcard-banner strong { display: block; font-size: 1.1rem; font-weight: 1000; }
.notice-ui.freeze { background: var(--bg); border-color: var(--line); }
.head-links { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Lesson: top bar, juice ---------- */
.icon-btn { width: var(--tap); height: var(--tap); flex: none; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 1.1rem; cursor: pointer; display: grid; place-items: center; padding: 0; }
.combo-badge { display: inline-flex; align-items: center; gap: 3px; padding: 4px 11px; border-radius: 999px; background: var(--yellow-light); color: var(--gold-ink); border: 2px solid #f3dc8a; font-weight: 1000; white-space: nowrap; font-variant-numeric: tabular-nums; }
.combo-badge.hot { background: var(--yellow); color: var(--ink); border-color: var(--yellow-dark); box-shadow: 0 0 0 4px rgba(255, 200, 0, 0.25); }
.xp-counter { display: inline-flex; align-items: center; gap: 3px; font-weight: 1000; color: var(--gold-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pop { animation: pop-big 0.35s ease-out; }
.xp-fly { position: fixed; z-index: 70; pointer-events: none; font-weight: 1000; font-size: 1.35rem; color: var(--gold-ink); text-shadow: 0 2px 0 #fff, 0 0 10px #fff; transition: transform 0.6s cubic-bezier(0.5, -0.3, 0.7, 1), opacity 0.6s ease-in; will-change: transform; }
.lesson-city { font-weight: 900; color: var(--muted); margin: -4px 0 12px; font-size: 0.95rem; }
/* where the lesson plays is said at the start and on word cards; a question keeps its room for the question */
.lesson[data-step]:not([data-step="intro"]) .lesson-city { display: none; }
.task { font-size: 1.35rem; font-weight: 1000; margin: 6px 0 16px; color: var(--ink); }
/* why a word is here again: a new word asked once more, or an extra exercise (public/lesson.js ROUNDS) */
.round-tag { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 2px; padding-block: 2px; padding-inline: 6px 10px; border-radius: 999px; background: #fff; border: 2px solid var(--line); color: var(--muted); font-weight: 900; font-size: 0.8rem; }
.round-tag .px-icon { width: var(--i-s); height: var(--i-s); }
.round-tag + .task { margin-top: 8px; }

/* prompts */
.prompt-word { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 10px; padding: 18px 16px; margin: 0 0 18px; border-radius: 26px; background: #fff; border: 2px solid var(--line); box-shadow: var(--shadow); font-size: clamp(1.8rem, 6vw, 2.4rem); font-weight: 1000; line-height: 1.15; overflow-wrap: anywhere; text-align: center; }
.audio-btn.round { width: 46px; height: 46px; min-height: 0; padding: 0; justify-content: center; border-radius: 50%; font-size: 1.15rem; }
.prompt-en { text-align: center; font-size: clamp(1.4rem, 5vw, 1.9rem); font-weight: 1000; margin: 0 0 18px; color: var(--ink); overflow-wrap: anywhere; }
.prompt-en.small { font-size: 1.05rem; color: var(--muted); margin-top: -10px; }
.prompt-image { display: block; width: min(46vw, 200px); aspect-ratio: 1; object-fit: cover; margin: 0 auto 14px; border-radius: 24px; border: 4px solid var(--line); background: var(--bg); }
.big-listen, .big-mic { display: grid; place-items: center; width: 120px; height: 120px; margin: 6px auto 22px; border-radius: 32px; border: 2px solid var(--blue-dark); background: var(--blue); color: #fff; font-size: 3rem; box-shadow: 0 6px 0 var(--blue-dark); cursor: pointer; }
.big-listen:active, .big-mic:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--blue-dark); }
.big-mic { border-radius: 50%; background: var(--red); border-color: #c63a32; box-shadow: 0 6px 0 #c63a32; }
.big-mic.listening { animation: mic 1s ease-in-out infinite; }
.big-mic:disabled { filter: grayscale(0.6); cursor: default; }
@keyframes mic { 0%, 100% { box-shadow: 0 6px 0 #c63a32, 0 0 0 0 rgba(240, 78, 69, 0.45); } 50% { box-shadow: 0 6px 0 #c63a32, 0 0 0 20px rgba(240, 78, 69, 0); } }

/* answer choices */
.choice-grid { display: grid; gap: 12px; }
@media (min-width: 480px) { .choice-grid { grid-template-columns: 1fr 1fr; } }
.choice-grid.images { grid-template-columns: 1fr 1fr; max-width: 420px; margin: 0 auto; }
.choice-grid.article { grid-template-columns: repeat(3, 1fr); }
.choice { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; border-radius: 20px; border: 2px solid var(--line); border-bottom-width: 5px; background: #fff; color: var(--text); font: 800 1.12rem/1.25 var(--font); text-align: start; cursor: pointer; transition: transform 0.06s, border-color 0.15s, background 0.15s; -webkit-tap-highlight-color: transparent; overflow-wrap: anywhere; }
.choice:hover:not(:disabled) { background: var(--bg); border-color: var(--line-strong); }
.choice:active:not(:disabled) { transform: translateY(2px); }
.choice:disabled { cursor: default; color: var(--text); }
.choice-num { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; font: 900 0.85rem var(--font); color: var(--muted); background: #fff; }
.choice img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; display: block; }
.choice-grid.images .choice { flex-direction: column; padding: 10px; }
.choice-grid.images .choice-num { position: absolute; top: 16px; inset-inline-start: 16px; z-index: 1; }
.choice-grid.article .choice { justify-content: center; font-size: 1.5rem; font-weight: 1000; min-height: 80px; }
.choice-grid.article .choice-num { position: absolute; top: 8px; inset-inline-start: 8px; width: 22px; height: 22px; font-size: 0.75rem; }
.choice.correct { border-color: var(--green); background: var(--green-light); color: var(--green-ink); animation: pop-big 0.35s ease-out; }
.choice.correct .choice-num { border-color: var(--green); color: var(--green-ink); }
.choice.wrong { border-color: var(--red); background: var(--red-light); color: var(--red-ink); animation: wobble 0.4s; }
/* the numbers are for the keyboard (1-4): a touch screen has no use for them */
@media (hover: none) and (pointer: coarse) { .choice-num, .choice-grid.images .choice-num, .choice-grid.article .choice-num { display: none; } }

/* typing and sentence tiles */
.type-row { display: flex; align-items: center; gap: 10px; }
.type-row .art { font-size: 1.5rem; font-weight: 1000; }
.type-input { flex: 1; min-width: 0; min-height: 60px; padding: 10px 18px; border-radius: 18px; border: 3px solid var(--line); background: #fff; font: 800 1.4rem var(--font); color: var(--text); }
.type-input:focus { outline: none; border-color: var(--blue); }
.type-input::placeholder { color: var(--faint); letter-spacing: 0.02em; font-weight: 700; font-size: 1.1rem; }
/* the buddy's voice switched off: its speech bubble greyed and struck through */
.icon-btn.off { position: relative; }
.icon-btn.off .px-icon { filter: grayscale(1); opacity: 0.45; }
.icon-btn.off::after { content: ""; position: absolute; left: 9px; right: 9px; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: var(--muted); transform: rotate(-45deg); }
.type-hint { margin: 8px 2px 0; color: var(--muted); font-weight: 800; font-size: 0.92rem; text-align: center; }
.type-hint b { color: var(--ink); font-weight: 1000; }
.umlauts { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.chip-btn { min-width: 46px; min-height: var(--tap); border-radius: 12px; border: 2px solid var(--line); border-bottom-width: 4px; background: #fff; font: 900 1.15rem var(--font); cursor: pointer; color: var(--text); }
/* listening: the example sentence by ear (lesson.js dictation, sentence_meaning) */
.listen-row { display: flex; flex-direction: column; align-items: center; margin-bottom: 14px; }
.listen-row .big-listen { margin-bottom: 12px; }
.slow-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; font-size: 0.95rem; }
.dict-count { text-align: center; color: var(--muted); font-weight: 800; margin: 0 0 8px; }
.dict-input { display: block; width: 100%; resize: none; font-size: 1.2rem; line-height: 1.4; }
.choice-grid.sentences { grid-template-columns: 1fr; }
.choice-grid.sentences .choice { font-size: 1.02rem; min-height: 56px; }
.dict-marks { display: block; margin-top: 6px; line-height: 1.75; }
.dict-marks .dm { font-weight: 800; }
.dict-marks .dm-slip { text-decoration: underline wavy var(--red); text-underline-offset: 4px; }
.dict-marks .dm-wrong, .dict-marks .dm-missing { padding: 0 5px; border-radius: 6px; background: #fff; color: var(--red-ink); box-shadow: inset 0 0 0 2px var(--red); } /* white: it stands out on the red answer sheet */
.dict-marks .dm-missing { text-decoration: underline dashed; text-underline-offset: 4px; }
.dict-yours { display: block; margin-top: 4px; font-size: 0.9rem; font-weight: 700; opacity: 0.8; }
.tile-answer { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; min-height: 70px; padding: 10px 2px; margin-bottom: 20px; border-bottom: 3px solid var(--line); }
.tile-answer:empty::before { content: "Tippe die Wörter in der richtigen Reihenfolge"; align-self: center; color: var(--muted); font-weight: 800; font-size: 0.95rem; }
.tile-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tile:active { transform: translateY(2px); border-bottom-width: 2px; margin-bottom: 2px; }
.umlauts .chip-btn:active, .listen-row .chip-btn:active { transform: translateY(2px); border-bottom-width: 2px; }
.tile { padding: 9px 14px; border-radius: 14px; border: 2px solid var(--line); border-bottom-width: 4px; background: #fff; font: 800 1.1rem var(--font); color: var(--text); cursor: pointer; animation: pop 0.15s ease-out; }

/* swiping a word card away (public/lesson.js) */
@keyframes swipe-r { to { transform: translateX(120%) rotate(12deg); opacity: 0; } }
@keyframes swipe-l { to { transform: translateX(-120%) rotate(-12deg); opacity: 0; } }

/* feedback sheet */
.feedback-sheet { position: fixed; left: 0; right: 0; bottom: var(--kb, 0px); z-index: 40; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); border-top: 3px solid; animation: slide-up 0.22s ease-out; }
.feedback-sheet .inner { max-width: 620px; margin: 0 auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.feedback-sheet .sheet-text { flex: 1; min-width: 200px; }
.feedback-sheet strong { display: block; font-size: 1.4rem; font-weight: 1000; }
.feedback-sheet .sheet-text span { font-weight: 800; }
.feedback-sheet.good { background: #d7ffb8; border-color: #a5ed6e; color: #2f6a00; }
.feedback-sheet.bad { background: #ffdfe0; border-color: #ffb1b4; color: var(--red-ink); }
/* "Weiter" stays green on the red sheet: red is for what went wrong, not for going on */
/* offline: the answer waits for the connection, neither right nor wrong yet (lesson.js) */
.feedback-sheet.offline { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.choice.picked { border-color: var(--line-strong); background: var(--bg); }
.feedback-sheet .btn { min-width: 170px; }
@media (max-width: 520px) { .feedback-sheet .btn { width: 100%; } }

/* the word after every answer: meaning, picture, sound, example */
.reveal-word { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.82); color: var(--text); animation: pop 0.25s ease-out; }
.reveal-word img { width: 64px; height: 64px; flex: none; border-radius: 12px; object-fit: cover; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14); }
.reveal-word .rw-text { min-width: 0; }
.reveal-word .rw-de { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; font-size: 1.32rem; font-weight: 1000; line-height: 1.2; color: var(--ink); }
.reveal-word .rw-de small { font-size: 0.85rem; font-weight: 800; color: var(--muted); }
.reveal-word .audio-btn.round { width: 34px; height: 34px; font-size: 0.9rem; box-shadow: 0 2px 0 #c6dcec; }
.reveal-word .rw-en { font-size: 1.12rem; font-weight: 900; color: var(--ink); margin-top: 2px; overflow-wrap: anywhere; }
.reveal-word .rw-ex { margin-top: 4px; font-size: 0.9rem; font-weight: 700; color: #555; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.reveal-word .rw-ex .en { display: block; color: var(--muted); font-weight: 600; }
.reveal-word.sentence .rw-ex { font-size: 1.05rem; color: var(--ink); -webkit-line-clamp: 4; }
/* after a sentence exercise the sentence comes first; the word it practised follows, smaller (the
   sentence may use another form of it: "Ich bin Nora." for "sein") */
.reveal-word.sentence .rw-text { display: flex; flex-direction: column; }
.reveal-word.sentence .rw-ex { order: -1; margin: 0 0 6px; }
.reveal-word.sentence .rw-de { font-size: 1.02rem; }
.reveal-word.sentence .rw-en { font-size: 0.92rem; font-weight: 700; color: var(--muted); margin-top: 0; }
.game-reveal { margin: 12px 0 0; padding: 8px 12px; border-radius: 14px; font-size: 1.1rem; font-weight: 800; animation: pop 0.2s ease-out; }
.game-reveal.good { background: var(--green-light); color: var(--green-ink); }
.game-reveal.bad { background: var(--red-light); color: var(--red-ink); }
.game-reveal b { font-weight: 1000; }
/* grammar trainers: the group on Spiele and the typed answer (game.js typedField) */
.games-group { margin: 30px 0 14px; }
.games-group h2 { margin: 0; }
.games-group p { margin: 4px 0 0; color: var(--muted); font-weight: 700; }
.game-card.locked .game-icon { filter: grayscale(1); opacity: 0.55; }
.lock-note { color: var(--muted); font-weight: 700; margin: 0 0 14px; }
.task-label { margin-bottom: 4px; font-size: 0.85rem; }
.game-type { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; } /* a column that can shrink: the field's own width must not widen it on phones */
.game-type .umlauts { margin-top: 0; }
.type-before { font-size: 1.5rem; font-weight: 1000; color: var(--ink); }
.type-input.correct { border-color: var(--green); background: var(--green-light); }
.type-input.wrong { border-color: var(--red); background: var(--red-light); animation: wobble 0.4s; }
.game-reveal .reveal-yours { display: block; font-weight: 700; opacity: 0.75; }
.game-reveal .reveal-note { display: block; margin-top: 4px; font-size: 0.95rem; font-weight: 700; }
/* the installable app: install and push boxes in Profil (play.js), the offline page (public/sw.js) */
.push-box, .install-box { margin: 14px 0; padding: 14px 16px; border-radius: 16px; border: 2px dashed var(--line); background: var(--bg); }
.push-box p, .install-box p { margin: 0 0 8px; }
.push-box .hint { margin-bottom: 10px; }
.push-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.offline-page { max-width: 440px; margin: 12vh auto 0; padding: 0 16px; }
.offline-hero .px-icon { width: 96px; height: 96px; }
.offline-page h1 { margin: 12px 0 8px; }
.offline-page .muted { margin: 0 0 16px; }
.offline-page .offline-tip { margin: 12px 0 0; font-size: 0.9rem; }
.error-actions { display: grid; gap: 12px; margin: 16px 0 0; }

/* buddy reacting in the corner */
.buddy-corner { position: fixed; z-index: 45; inset-inline-end: 10px; bottom: 116px; width: 80px; height: 80px; pointer-events: none; transition: bottom 0.2s ease; }
.buddy-corner .buddy-pose, .buddy-corner .buddy { width: 100%; height: 100%; }
.buddy-corner .buddy-scale { position: relative; width: 100%; height: 100%; transform: scale(var(--s, 1)); transform-origin: 50% 100%; transition: transform .55s cubic-bezier(.34, 1.56, .64, 1); }
.buddy-corner:not(.engine) .speech { bottom: calc(100% * var(--s, 1) + 8px) !important; }
.buddy-canvas { display: block; }
/* a still picture (the profile picture) is drawn at twice the size: let the browser smooth it down */
.buddy-canvas[data-still] { image-rendering: auto; }
.buddy-corner.engine { width: 136px; height: 136px; inset-inline-end: 0; }
.buddy-corner.engine .buddy-canvas { width: 100% !important; height: 100% !important; }
@media (min-width: 900px) { .buddy-corner.engine { inset-inline-start: calc(50% + 312px); width: 210px; height: 210px; } }
.complete .hero .hero-canvas { width: 180px; height: 180px; margin: 0 auto; }
.buddy-hero > .buddy-canvas { flex: none; }
.boss-vs .buddy-canvas { flex: none; }
.buddy-fx { position: absolute; inset: 0; pointer-events: none; }
.buddy-fx .ray { position: absolute; left: 50%; top: 42%; width: 4px; height: 14px; margin-left: -2px; border-radius: 2px; background: #ffc800; transform-origin: 50% 0; animation: fx-ray .75s ease-out forwards; }
.buddy-fx .ray:nth-child(2n) { background: #ffe066; height: 10px; }
.buddy-fx .puff { position: absolute; left: 50%; top: 58%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #8f8f8f; opacity: 0; animation: fx-puff 1.5s ease-out forwards; }
@keyframes fx-ray { 0% { transform: rotate(var(--a)) translateY(8px) scaleY(.2); opacity: 1; } 100% { transform: rotate(var(--a)) translateY(52px) scaleY(1); opacity: 0; } }
@keyframes fx-puff { 0% { transform: translate(0, 0) scale(.4); opacity: .9; } 100% { transform: translate(var(--dx), -46px) scale(1.7); opacity: 0; } }
.dish-line { font-weight: 900; color: var(--muted); margin: 4px 0 0; }
.buddy-corner .speech { top: auto; bottom: calc(100% + 8px); inset-inline-end: 0; width: max-content; max-width: 220px; white-space: normal; text-align: center; }
/* the buddy's face beside its line, in the mood of the moment (public/lesson.js: faces) */
.buddy-corner .speech.has-face { display: flex; align-items: center; gap: 10px; inset-inline-end: 8px; max-width: min(268px, calc(100vw - 24px)); padding-block: 5px; padding-inline: 5px 14px; text-align: start; }
.speech .face { flex: none; width: 52px; height: 52px; border-radius: 50%; background: #fff; overflow: hidden; }
.speech .face .buddy-canvas { width: 100% !important; height: 100% !important; }
.speech .line { min-width: 0; }
@media (min-width: 900px) {
  .speech .face { width: 60px; height: 60px; }
  .buddy-corner .speech.has-face::after { inset-inline-start: 92px; } /* over the buddy, in the middle of its corner */
}
/* narrower desktops: the corner reaches the window's edge, so the bubble keeps 12–20 px from it (a
   scrollbar takes some) and its tail stays over the buddy (the corner: left 50% + 312 px, 210 px wide) */
@media (min-width: 900px) and (max-width: 1199px) {
  .buddy-corner .speech.has-face { inset-inline-start: auto; inset-inline-end: calc(542px - 50vw); }
  .buddy-corner .speech.has-face::after { inset-inline-start: auto; inset-inline-end: calc(50vw - 445px); }
}
/* phones: the buddy's line always sits in the same place, beside the buddy at its feet, just above the main
   button or the answer sheet (never floating over the question, the card or the options in the middle) */
@media (max-width: 899px) {
  .buddy-corner .speech, .buddy-corner .speech.has-face, .buddy-corner:not(.engine) .speech { bottom: 8px !important; inset-inline-end: calc(100% - 34px) !important; inset-inline-start: auto; max-width: min(250px, calc(100vw - 118px)); }
  .buddy-corner .speech::after { display: none; }
  /* while the tap-to-hear pill is there (sound blocked until the first tap), it has that place: the line sits above it */
  body:has(> .sound-hint:not([hidden])) .buddy-corner .speech, body:has(> .sound-hint:not([hidden])) .buddy-corner .speech.has-face, body:has(> .sound-hint:not([hidden])) .buddy-corner:not(.engine) .speech { bottom: 66px !important; }
}
/* while the answer sheet is open, the line would lie over the options or the typed answer: the buddy stays, its line goes */
.buddy-corner.on-sheet .speech { display: none !important; }
/* on a short phone there is no room for both: the pill is the one that does something, so the line waits */
@media (max-width: 899px) and (max-height: 700px) { body:has(> .sound-hint:not([hidden])) .buddy-corner .speech { display: none; } }
/* the phone's keyboard is up (lesson.js followKeyboard): the buddy steps out of the way, and the screen
   makes room for the field and the main button */
.lesson.kb-open ~ .buddy-corner { opacity: 0; }
/* short phones: a smaller buddy, so it covers less of the screen; the typing picture is a clue, not the star */
@media (max-width: 899px) and (max-height: 700px) { .buddy-corner.engine { width: 100px; height: 100px; } }
.lesson[data-step="type_word"] .prompt-image { width: min(34vw, 150px); border-width: 3px; }
.lesson.kb-open .task { margin: 0 0 8px; font-size: 1.15rem; }
.lesson.kb-open .prompt-image { width: 72px; margin-bottom: 8px; border-width: 3px; border-radius: 16px; }
.lesson.kb-open .prompt-en { margin-bottom: 8px; font-size: 1.25rem; }
.lesson.kb-open .round-tag { display: none; }
.lesson.kb-open .big-listen { width: 64px; height: 64px; margin-bottom: 8px; font-size: 1.6rem; border-radius: 20px; }
.lesson.kb-open .umlauts { margin-top: 8px; }
.buddy-corner.bounce { animation: cheer 0.7s ease; }
.buddy-corner.wobble { animation: wobble 0.6s ease; }
@media (min-width: 900px) {
  .buddy-corner { inset-inline-start: calc(50% + 330px); inset-inline-end: auto; bottom: 150px; width: 112px; height: 112px; }
  .buddy-corner .speech { inset-inline-end: auto; inset-inline-start: 0; }
  .buddy-corner .speech::after { inset-inline-end: auto; inset-inline-start: 26px; }
}

/* lesson complete */
.result-tiles.four { grid-template-columns: repeat(4, 1fr); }
.result-tiles.two { grid-template-columns: repeat(2, 1fr); max-width: 360px; margin-inline: auto; }
@media (max-width: 560px) { .result-tiles.four { grid-template-columns: 1fr 1fr; } }
.streak-line { font-weight: 1000; color: var(--ink); font-size: 1.15rem; }
/* the end of a lesson: the daily goal as one line over a thin bar (gold once reached), then what was earned
   as gold rows (a quest's Brezeln, a chest ready to open); the ways on are in the bar at the bottom */
.goal-line { max-width: 420px; margin: -8px auto 16px; }
.goal-line p { margin: 0 0 6px; font-weight: 900; color: var(--ink); }
.goal-line p .px-icon { width: var(--i-s); height: var(--i-s); vertical-align: -4px; }
.goal-line .progress { height: 8px; }
.goal-line.done p { color: var(--gold-ink); }
.goal-line.done .gl-xp { color: var(--muted); font-weight: 800; }
.goal-line.done .progress > span { background: var(--yellow); }
.reward-row { display: flex; align-items: center; gap: 10px; max-width: 520px; margin: 0 auto 10px; padding: 10px 14px; border-radius: var(--radius); border: 2px solid #f3dc8a; background: var(--yellow-light); color: var(--gold-ink); font-weight: 800; text-align: start; animation: pop 0.3s ease-out 0.9s backwards; }
.reward-row > .px-icon { flex: none; width: var(--i-m); height: var(--i-m); }
.reward-row .rr-text { flex: 1; min-width: 0; line-height: 1.25; }
.reward-row .rr-gain { flex: none; display: inline-flex; align-items: center; gap: 3px; font-weight: 1000; white-space: nowrap; }
.reward-row .rr-gain .px-icon { width: var(--i-s); height: var(--i-s); }
.reward-row .btn { flex: none; }
.reward-row + .recap, .reward-row + .recap-perfect { margin-top: 18px; }
.result-tile.none .val { color: var(--muted); }
.brezel-tip { margin: -10px 0 14px; font-weight: 700; }
.complete .hero .buddy-pose, .complete .hero .buddy { width: 150px; height: 150px; margin: 0 auto; }
/* the results come in one after another, under the buddy's celebration */
.complete .result-tile { animation: pop 0.3s ease-out backwards; }
.complete .result-tile:nth-child(1) { animation-delay: 0.15s; }
.complete .result-tile:nth-child(2) { animation-delay: 0.25s; }
.complete .result-tile:nth-child(3) { animation-delay: 0.35s; }
.complete .result-tile:nth-child(4) { animation-delay: 0.45s; }

/* ---------- the lesson's intro and outro: the buddy on a wide stage (public/lesson.js) ---------- */
.buddy-corner.pending { opacity: 0; } /* waits for the intro to hand over */
/* only on a word card on a small phone, when the picture is already at its smallest and the buddy would still stand on
   a button: it steps aside until the screen changes (public/lesson.js keepClear; elsewhere it moves up instead) */
.buddy-corner.aside { opacity: 0; transition: opacity 0.2s, bottom 0.2s ease; }
.lesson-intro { text-align: center; padding-top: 6px; cursor: pointer; animation: pop 0.3s ease-out; }
.stage-buddy { position: relative; padding-top: 58px; } /* room for the buddy's line */
/* the line overlaps the stage's empty top (kept for jumps, over by the time the buddy talks) */
.stage-buddy .stage-canvas, .hero.stage .stage-canvas { margin-top: -30px; }
/* the sides fade out, so an entrance comes in softly instead of out of a hard edge */
.stage-canvas { width: 100%; max-width: 460px; height: 250px; margin: 0 auto; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.speech.stage-speech { top: 0; left: 0; right: 0; margin: 0 auto; width: max-content; max-width: min(300px, 92%); white-space: normal; text-align: center; }
.speech.stage-speech::after { inset-inline-end: auto; inset-inline-start: calc(50% - 8px); }
.intro-sum { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 12px 0 0; color: var(--muted); font-weight: 800; }
.intro-sum span { display: inline-flex; align-items: center; gap: 2px; }
/* the start button fills up while the intro plays: the lesson starts by itself when it is full */
.btn.intro-go { position: relative; overflow: hidden; }
.btn.intro-go.auto::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.24); transform-origin: left center; animation: intro-fill var(--auto, 3s) linear forwards; pointer-events: none; }
@keyframes intro-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.complete .hero.stage { position: relative; display: block; padding-top: 58px; font-size: 1rem; animation: none; }
.complete .hero.stage .stage-canvas { height: 220px; }
.complete .hero:not(.stage) .stage-speech { position: relative; margin-bottom: 8px; }

/* ---------- Boss fight ---------- */
.boss-intro { border-top: 8px solid var(--red); }
.boss-intro .auth-hero { font-size: 4.4rem; }
.boss-vs { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
.boss-vs .vs { font-weight: 1000; font-size: 1.6rem; color: var(--red-strong); letter-spacing: .04em; }
.boss-vs .boss-icon { font-size: 4.2rem; line-height: 1; animation: bob 2.4s ease-in-out infinite; }
.boss-rules { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0 4px; }
.heart-choice { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 16px; font-weight: 800; }
.heart-choice input { width: 22px; height: 22px; accent-color: var(--red); }
.badge-img { display: block; width: min(100%, 340px); height: auto; margin: 6px auto 16px; border-radius: 26px; box-shadow: var(--shadow); }

/* ---------- Speaking ---------- */
.speak-score { font-size: 2.6rem; font-weight: 1000; text-align: center; line-height: 1; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.speak-score.good { color: var(--green-ink); }
.speak-score.bad { color: var(--red-strong); }
.heard { text-align: center; font-weight: 800; color: var(--muted); }
.speak-list { list-style: none; padding: 0; margin: 0 0 18px; text-align: start; }
.speak-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 2px solid var(--bg); font-weight: 800; }
.speak-list li:last-child { border-bottom: 0; }

/* ---------- Album ---------- */
.album-level { margin-bottom: 28px; }
.album-claim { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 20px; padding: 12px 16px; border-radius: var(--radius); background: var(--card); border: 2px solid var(--yellow); }
.album-claim .stamp .px-icon { width: var(--i-l); height: var(--i-l); display: block; }
.album-claim p { flex: 1; min-width: 160px; margin: 0; line-height: 1.3; }
.album-claim form { flex: 1 1 100%; margin: 0; } /* the screen's one main button: full size, full width */
.album-claim strong, .album-claim .muted { display: block; }
.album-claim .muted { font-size: 0.9rem; font-weight: 700; }
.album-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.album-head h2 { margin: 0; }
.album-count { font-size: 0.95rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.album-count b { font-size: 1.25rem; font-weight: 1000; color: var(--ink); }
.album-bar { height: 8px; margin: 8px 0 16px; }
.album-note { display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; }
.album-note .px-icon { width: var(--i-s); height: var(--i-s); }
.album-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .album-grid { grid-template-columns: repeat(auto-fill, 246px); justify-content: center; gap: 16px; } }
@media (min-width: 960px) { .album-grid { grid-template-columns: repeat(4, 164px); } .pc-pic { height: 120px; background-size: 164px auto; } .pc-empty .pc-pic { height: 64px; } }
.pc { display: flex; flex-direction: column; border-radius: 6px; background: var(--card); border: 2px solid var(--line-strong); box-shadow: 0 4px 0 var(--line); overflow: hidden; scroll-margin-top: 90px; }
.pc-pic { position: relative; display: grid; place-items: center; height: 120px; background: var(--yellow-light) center bottom / 164px auto no-repeat; image-rendering: pixelated; border-bottom: 2px solid var(--line-strong); }
@media (min-width: 640px) { .pc-pic { height: 168px; background-size: 246px auto; } }
.pc-icon .px-icon { width: var(--i-l); height: var(--i-l); display: block; }
.pc-no { position: absolute; top: 6px; inset-inline-start: 6px; padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.92); color: var(--ink); font-size: 0.75rem; font-weight: 900; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.pc-seal { position: absolute; inset-inline-end: 6px; bottom: 6px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--yellow); border: 2px solid #fff; }
.pc-seal .px-icon { width: var(--i-m); height: var(--i-m); }
.pc-body { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 10px; flex: 1; }
.pc-city { margin: 0; font-size: 1rem; font-weight: 1000; line-height: 1.2; overflow-wrap: anywhere; }
.pc-body .btn { white-space: nowrap; }
.pc-go, .pc-more summary { display: flex; align-items: center; min-height: var(--tap); margin: -6px 0 -10px; font-weight: 800; font-size: 0.9rem; color: var(--blue-ink); cursor: pointer; }
.pc-more { margin: 0; }
.pc-more p { margin: 4px 0 8px; font-size: 0.9rem; font-weight: 600; }
.pc-more form { margin-bottom: 4px; }
.pc-wait { color: var(--muted); font-size: 0.85rem; font-weight: 800; }
.pc-empty { background: transparent; border-style: dashed; box-shadow: none; }
.pc-empty .pc-pic { height: 64px; background: var(--bg); border-bottom-style: dashed; color: var(--faint); }
.pc-empty .pc-icon { opacity: 0.55; filter: grayscale(1); }
.pc-empty .pc-city { color: var(--muted); }
.pc-ready { border-color: var(--yellow); box-shadow: 0 4px 0 var(--yellow-dark); }
.pc-ready .pc-pic { border-bottom-color: var(--yellow); }
.pc-art .pc-pic { background-color: #cfe6f3; }
.pc-boss.pc-empty { border-color: var(--line-strong); }
.pc-boss .pc-body .btn { white-space: normal; }
@media (prefers-reduced-motion: no-preference) { .pc-ready .pc-seal { animation: wiggle 1.8s ease-in-out infinite; } }
.album-level h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.postcard-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.postcard { position: relative; border-radius: 20px; background: #fff; border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); padding: 16px 16px 14px; min-height: 176px; display: flex; flex-direction: column; gap: 6px; scroll-margin-top: 90px; }
.postcard::before { content: ""; position: absolute; inset: 6px; border: 2px dashed rgba(201, 138, 60, 0.25); border-radius: 15px; pointer-events: none; }
.postcard .stamp { position: absolute; top: 12px; inset-inline-end: 12px; width: 46px; height: 54px; display: grid; place-items: center; font-size: 1.45rem; background: #fff; border: 2px dashed var(--line-strong); border-radius: 6px; transform: rotate(4deg); }
.postcard .city { font-size: 1.25rem; font-weight: 1000; padding-inline-end: 56px; line-height: 1.2; }
.postcard p { font-size: 0.95rem; font-weight: 600; margin: 0; flex: 1; }
.postcard.locked { background: var(--bg); border-color: var(--line); box-shadow: 0 4px 0 var(--line); color: var(--muted); }
.postcard.locked .stamp { filter: grayscale(1); opacity: 0.5; }
.postcard.ready { background: #fff; border-color: var(--yellow); }
.postcard.ready .stamp { animation: wiggle 1.8s ease-in-out infinite; }
.postcard.boss-card { background: #fff; border-color: #f6c7c3; box-shadow: 0 4px 0 #f3d0cd; }
.postcard .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; position: relative; }

/* ---------- Laden (shop) ---------- */
.wallet { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wallet .amount { font-size: 2.3rem; font-weight: 1000; color: var(--ink); line-height: 1.1; }
.shop-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 24px; }
.shop-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; border-radius: var(--radius-lg); background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow); padding: 18px 16px; }
.shop-item .icon { font-size: 2.6rem; line-height: 1.2; }
.shop-item > .buddy { width: 112px; height: 112px; }
.shop-item h3 { margin: 4px 0 0; }
.shop-item p { color: var(--muted); font-weight: 700; font-size: 0.92rem; flex: 1; margin-bottom: 10px; }
.shop-item .have { font-weight: 900; color: var(--ink); margin-bottom: 8px; }
.shop-item .have.full { color: var(--gold-ink); }
.shop-item .need { margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.wallet-earn { flex-basis: 100%; margin: 0; }
.wallet-earn a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 800; }
.shop-item form { width: 100%; }
.shop-item.owned { border-color: #c9ecb0; }

/* ---------- Fortschritt ---------- */
.milestones { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.milestones .px-icon { width: var(--i-m); height: var(--i-m); display: block; }
.milestones .pct { width: 48px; color: var(--ink); font-size: 0.85rem; font-weight: 1000; white-space: nowrap; font-variant-numeric: tabular-nums; }
.milestones .ms-label { flex: 1 1 auto; min-width: 0; font-size: 1rem; font-weight: 900; line-height: 1.25; }
.known-line { margin: 12px 0 0; }
#delete_password ~ .check-ui { min-height: var(--tap); align-items: center; }
.fold-note { margin-top: 4px; }
.fold-note summary { display: flex; align-items: center; min-height: var(--tap); font-weight: 800; font-size: 0.9rem; color: var(--blue-ink); cursor: pointer; }
.fold-note p { margin: 0 0 8px; font-size: 0.9rem; }
.week-empty { margin: 16px 0 4px; padding: 14px 16px; border-radius: 14px; background: var(--bg); }
.week-bars .bar.zero .col, .week-bars .bar.today.zero .col { background: var(--line-strong); }
.week-bars .bar.today small { color: var(--ink); }
.week-bars .bar.today small::after { content: ""; display: block; height: 3px; margin-top: 2px; border-radius: 2px; background: var(--ink); }
.milestones li > :last-child { margin-inline-start: auto; }
.report-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .report-grid { grid-template-columns: repeat(4, 1fr); } }
.delta { display: block; font-size: 0.8rem; font-weight: 900; margin-top: 2px; }
.delta.up { color: var(--ink); }
.delta.less { color: var(--muted); }
.delta.down { color: var(--muted); }
.delta.same { color: var(--muted); }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 180px; margin: 16px 0 4px; }
.week-bars .bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.week-bars .col { width: 100%; max-width: 46px; border-radius: 10px 10px 4px 4px; background: var(--yellow); min-height: 4px; }
.week-bars .bar.today .col { background: var(--yellow); }
.week-bars .bar b { font-size: 0.78rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.week-bars .bar small { font-weight: 900; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; }

/* ---------- Reading adventures ---------- */
.quiz-q { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.quiz-q legend { font-weight: 1000; font-size: 1.08rem; margin-bottom: 8px; padding: 0; }
.quiz-options { display: grid; gap: 8px; }
.quiz-options label { position: relative; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); border-bottom-width: 4px; background: #fff; cursor: pointer; font-weight: 800; }
.quiz-options input { width: 20px; height: 20px; accent-color: var(--green); flex: none; margin: 0; }
.quiz-options label:has(input:checked) { border-color: var(--green); background: var(--green-light); }
.quiz-options .opt { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 16px; border: 2px solid var(--line); font-weight: 800; }
.quiz-options .opt.right { border-color: var(--green); background: var(--green-light); color: var(--green-ink); }
.quiz-options .opt.wrong { border-color: var(--red); background: var(--red-light); color: var(--red-ink); }
.reading-paper .w.speaking { background: #fff1a8; border-radius: 6px; box-shadow: 0 0 0 3px #fff1a8; }
.reading-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 14px; }
.word-pop .pop-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.word-pop .pop-row button { min-height: var(--tap); border: 0; border-radius: 999px; padding: 6px 16px; font: 900 0.9rem var(--font); cursor: pointer; background: var(--green); color: #fff; }
.word-pop .pop-row button.ghost { background: rgba(255, 255, 255, 0.16); text-shadow: none; }
.word-pop .pop-row button:disabled { opacity: 0.75; cursor: default; }
.story-hero { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin: 0 0 18px; border: 2px solid var(--line); border-radius: 20px; background: var(--bg); cursor: pointer; }
.story-hero .story-text { flex: 1; display: grid; gap: 2px; font-weight: 700; line-height: 1.35; }
.story-hero .story-text strong { font-weight: 1000; }
.story-hero:has(input:checked) { border-color: #bfe8a3; background: var(--green-light); }
.form-ui label.story-hero { display: flex; font-size: inherit; margin: 0 0 18px; }
.story-hero .switch { display: inline-block; }
.story-hero > .buddy { width: 72px; height: 72px; flex: none; }
.badge-wait { background: var(--bg); color: var(--muted); border: 2px solid var(--line); --px: var(--line-strong); }
.badge-bad { background: var(--red-light); color: var(--red-ink); border: 2px solid #f6c7c3; --px: var(--red-strong); }
.badge-streak .px-icon, .badge-wait .px-icon, .badge-bad .px-icon { width: 16px; height: 16px; }
.more-texts > summary { display: flex; align-items: center; min-height: var(--tap); font-weight: 800; color: var(--blue-ink); cursor: pointer; }
.more-texts > summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.list-row .badge-pill { margin-top: 4px; }

/* ---------- Profil: buddy and wardrobe ---------- */
.profile-avatar { overflow: hidden; }
.profile-avatar .buddy { width: 100px; height: 100px; }
.buddy-picker span .buddy { width: 76%; height: 76%; animation: none; }
.wardrobe { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 10px; }
.wardrobe form { margin: 0; }
.wardrobe button { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 10px 6px; border-radius: 18px; border: 3px solid var(--line); background: #fff; font: 800 0.82rem var(--font); color: var(--text); cursor: pointer; }
.wardrobe button[aria-pressed="true"] { border-color: var(--green); background: var(--green-light); }
.wardrobe .buddy { width: 64px; height: 64px; animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Polish: phones, touch, game icons ---------- */
.on-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .on-desk { display: none !important; }
  .on-touch { display: inline; }
}
@media (max-width: 480px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar .brand > span:last-child { display: none; }
  .status { gap: 6px; }
  .status-chip { padding: 4px 9px; font-size: 0.88rem; }
  .buddy-hero { gap: 10px; }
  .buddy-hero > .buddy-canvas { width: 100px !important; height: 100px !important; }
  .bubble { padding: 10px 12px; }
  .bubble strong { font-size: 1.02rem; }
  .bubble p { font-size: 0.86rem; }
  .level-pills { gap: 8px; -webkit-mask-image: linear-gradient(to right, #000 86%, transparent); mask-image: linear-gradient(to right, #000 86%, transparent); }
  .level-pill { padding: 7px 14px; font-size: 1.05rem; gap: 4px; }
  .story-hero { padding: 10px 12px; gap: 10px; }
}

/* ---------- Pixel icons (src/pixel-icons.js) ---------- */
/* a 16-pixel picture is sharp at 16, 32, 48 …, and at 24 on a phone's dense screen: icons take those sizes
   only (beside text: 16 px in small text, 24 px from 16 px text up) */
.px-icon { display: inline-block; width: 1.25em; height: 1.25em; width: round(1.25em, 8px); height: round(1.25em, 8px); vertical-align: -0.24em; flex: none; overflow: visible; }
.px-icon.px-24 { width: 24px; height: 24px; }
.px-icon.px-32 { width: var(--a-s); height: var(--a-s); }
/* big spots: whole multiples of the 16 px grid keep every pixel the same size */
.auth-hero > .px-icon, .boss-vs .boss-icon .px-icon, .complete .hero > .px-icon { width: 80px; height: 80px; vertical-align: top; }
.boss-face .px-icon, .big-listen .px-icon, .big-mic .px-icon { width: 64px; height: 64px; vertical-align: top; }
.game-icon .px-icon, .hub-tile .emoji .px-icon, .postcard-banner .stamp .px-icon, .chest .c-icon .px-icon, .shop-item .icon .px-icon { width: 48px; height: 48px; vertical-align: top; }
.stat-tile .icon .px-icon, .quest .q-icon .px-icon, .postcard .stamp .px-icon, .word-tile .ph .px-icon, .city-fact .pin .px-icon { width: var(--i-l); height: var(--i-l); vertical-align: top; }
.hearts { display: flex; gap: 2px; letter-spacing: 0; }
.hearts .px-icon, .icon-btn .px-icon, .audio-btn.round .px-icon, .close .px-icon { width: var(--i-b); height: var(--i-b); vertical-align: top; }
.auth-hero .buddy-canvas { margin: 0 auto; }
.map-svg .pin-icon { pointer-events: none; }
.map-svg circle.hit { fill: transparent; pointer-events: all; }
/* progress rings: green = words started, gold = learned for good, dashed = marked as known */
.map-svg .ring-track { fill: none; stroke: rgba(255, 255, 255, 0.9); stroke-width: 4.5; }
.map-svg .ring-start, .map-svg .ring-learn, .map-svg .ring-known { fill: none; stroke-width: 4.5; }
.map-svg .ring-start { stroke: var(--green-dark); }
.map-svg .ring-learn { stroke: #ffb800; }
.map-svg .ring-known { stroke: var(--green-dark); stroke-dasharray: 3 3; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 10px 2px 0; font-size: 0.8rem; font-weight: 800; color: var(--muted); }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend .dot { width: 12px; height: 12px; border-radius: 50%; border: 3px solid; }
.map-legend .dot.start { border-color: var(--green-dark); }
.map-legend .dot.learn { border-color: #ffb800; }
.map-legend .hint { margin-inline-start: auto; font-weight: 700; }
/* the legend's own display wins over the global .on-touch rule, so hide and show the hint here */
.map-legend .hint.on-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .map-legend .hint.on-touch { display: inline-flex; }
}
/* words due for review, on the current stop */
.map-svg .due-badge { animation: badge-bob 1.6s ease-in-out infinite; pointer-events: none; }
.map-svg .due-badge rect { fill: #fff; stroke: var(--line-strong); stroke-width: 2.5; }
.map-svg .due-badge text { font: 1000 11px var(--font); fill: var(--ink); text-anchor: start; dominant-baseline: central; }
.map-svg :is(.node, .boss-node) .due-badge text { text-anchor: start; fill: var(--ink); } /* beats the stops' own text rules (centred, grey; skins too) */
.due-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 14px; padding: 10px 14px; border-radius: 16px; background: var(--bg); border: 2px solid var(--line); font-weight: 800; }
.due-line .btn { margin-inline-start: auto; }
.city-card-due { position: relative; display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 0.8rem; font-weight: 900; color: var(--blue-ink); text-decoration: none; }
/* zoom and pan (public/journey.js): labels stay the same size on screen, hidden ones appear */
.map-svg { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.map-svg.zoomed { touch-action: none; cursor: grab; }
.map-svg.panning { cursor: grabbing; }
.map-svg .city-label { font-size: calc(12px / var(--zoom, 1)); stroke-width: calc(4px / var(--zoom, 1)); }
.map-svg .city-label.current { font-size: calc(13px / var(--zoom, 1)); }
.map-svg .city-label.extra { display: none; }
.map-svg.zoomed-in .city-label.extra { display: inline; }
.map-svg .map-buddy canvas { image-rendering: pixelated; }
.map-zoom { position: absolute; top: 10px; inset-inline-end: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-zoom[hidden] { display: none; }
.map-zoom button { width: var(--tap); height: var(--tap); display: grid; place-items: center; padding: 0; border-radius: 12px; border: 2px solid var(--line); background: #fff; box-shadow: 0 3px 0 var(--line); cursor: pointer; }
.map-zoom button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.map-zoom button:disabled { opacity: 0.4; cursor: default; }
.map-zoom button[hidden] { display: none; }
.map-zoom .px-icon { width: var(--i-s); height: var(--i-s); vertical-align: top; }
/* the mistakes recap after a lesson */
.recap { text-align: start; margin: 18px 0 6px; padding: 16px; }
.recap h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.1rem; }
.recap ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.recap li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; background: var(--bg); }
.recap li img, .recap li .ph { width: 44px; height: 44px; flex: none; border-radius: 10px; object-fit: cover; background: var(--bg); display: grid; place-items: center; }
.recap li .ph .px-icon { width: var(--i-b); height: var(--i-b); }
.recap-word { flex: 1; min-width: 0; display: grid; gap: 1px; }
.recap-word strong { font-weight: 1000; }
.recap-word .muted { font-size: 0.85rem; }
.recap .audio-btn.round { width: var(--tap); height: var(--tap); flex: none; }
.recap-note { margin: 12px 0 0; font-size: 0.85rem; }
.recap-perfect { margin: 8px 0 0; font-weight: 900; color: var(--green-ink); }

/* the "Heute" plan (views/app/_today.ejs) */
.today .map-head { margin-bottom: 10px; }
.goal-ring.mini { width: 68px; height: 68px; flex: none; }
.goal-ring.mini > div { width: 54px; height: 54px; gap: 0; font-size: 0.95rem; }
.goal-ring.mini small { font-size: 0.75rem; }
.today-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.today-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding-block: 8px; padding-inline: 10px 14px; } /* the row (Cards & chips) */
/* a row with somewhere to go: the title is its link, stretched over the whole row, with an arrow at the end */
.today-item .t-link { color: var(--text); text-decoration: none; }
.today-item .t-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.today-item.goes { padding-inline-end: 40px; }
.today-item .t-link:focus-visible { outline: none; }
.today-item .t-link:focus-visible::after { outline: 3px solid var(--blue); outline-offset: 2px; }
.today-item .t-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
/* the day's XP goal: gold, as in its ring and in the top bar */
.today-item .t-text .progress, .rk-txt .progress { display: block; height: 8px; margin-top: 4px; }
.today-item .t-text .progress > span { background: var(--yellow); }
.today-item.waiting .t-icon { background: #fff4d6; }
.today-done { text-align: center; font-weight: 900; margin: 4px 0 12px; }
.today-rewards { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-weight: 900; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.hero-today { font-size: 0.88rem; font-weight: 800; display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); }
.hero-today .px-icon { width: var(--i-s); height: var(--i-s); }
/* lesson length (views/app/_length.ejs): one chip, "5 Min" with the chevron, under the main button on Heute and on
   Reise; open, the three choices take the chip's own row (nothing covered, nothing moves) and the chip shrinks to
   its chevron, after them, which closes the row again */
.today-go, .rk-act { display: grid; gap: 8px; justify-items: center; }
.today-go .btn, .rk-act .btn { justify-self: stretch; }
.length { display: inline-block; }
.length[open] { display: flex; align-items: center; gap: 6px; }
.length > summary { list-style: none; gap: 8px; padding: 0 14px; white-space: nowrap; }
.length > summary::-webkit-details-marker { display: none; }
.length[open] > summary { order: 1; justify-content: center; width: var(--tap); padding: 0; border-color: var(--line-strong); }
.length[open] .length-now { display: none; }
.length[open] > summary::after { margin: 4px 0 0; transform: rotate(225deg); }
.length-opts { display: flex; gap: 6px; }
.length-opts .chip { justify-content: center; white-space: nowrap; }
/* the length in use: ink, as a menu marks its pick (green stays the main button's) */
.length-opts .chip.on { border-color: var(--ink); background: var(--card); color: var(--ink); }
.quiet-known { justify-self: center; min-height: var(--tap); font-size: 0.95rem; }
/* the week under the map: seven dots, learned days gold, today outlined */
.week-strip { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin: 0 0 16px; padding: 10px 16px; border-radius: 16px; border: 2px solid var(--line); background: #fff; color: var(--text); text-decoration: none; font-weight: 800; }
.week-strip .wk { display: grid; justify-items: center; gap: 3px; }
.week-strip .wk i { width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); }
.week-strip .wk.learned i { background: var(--yellow); border-color: var(--yellow); }
.week-strip .wk.today i { border-color: var(--text); }
.week-strip small { font-size: 0.75rem; color: var(--muted); font-weight: 800; }
.week-strip .wk-more { display: inline-flex; align-items: center; color: var(--muted); font-size: 0.85rem; margin-inline-start: auto; }

/* stages of a city: marks on the progress bar, and what's left */
.progress.stages { position: relative; }
.progress.stages i { position: absolute; top: 0; bottom: 0; width: 3px; margin-inline-start: -1.5px; background: #fff; }
.stage-line { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 0.9rem; }
.stage-line .px-icon { width: var(--i-m); height: var(--i-m); flex: none; }
.stage-done { display: flex; align-items: center; justify-content: center; gap: 6px; }

/* problem words (red = mistakes): badge, the list, hints and extra examples */
.badge-problem { background: var(--red-light); color: var(--red-ink); border: 2px solid #f6c7c3; }
a.chip.badge-problem { text-decoration: none; }
.problem-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.problem-word { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.pw-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pw-head img, .pw-head .ph { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--bg); }
.pw-head .pw-word { flex: 1; min-width: 140px; display: grid; gap: 2px; }
.pw-word a { position: relative; }
.pw-head audio { flex: 1 1 220px; min-width: 0; width: 100%; height: 40px; }
.pw-hint label { display: block; font-weight: 900; font-size: 0.85rem; margin: 0 0 4px; }
.pw-hint-row { display: flex; gap: 8px; }
.pw-hint-row input { flex: 1; min-width: 0; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; font: inherit; }
.pw-hint .hint { margin-top: 4px; }
.paused-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.paused-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.paused-list li .muted { flex: 1; }
.problem-preview { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; } /* rows you can tap (Cards & chips) */
.hint-box { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: #fff8e1; text-align: start; font-size: 0.92rem; }
.hint-box .px-icon, .rw-hint .px-icon { width: var(--i-m); height: var(--i-m); flex: none; }
.rw-hint { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; font-weight: 700; font-size: 0.88rem; }
.example-box.more p { margin: 6px 0 0; }
.example-box.more .en { display: block; color: var(--muted); font-size: 0.85rem; }

/* placement test (views/app/einstufung.ejs) */
.placement { max-width: 620px; margin: 0 auto; padding: 14px 16px 60px; }
.placement-intro { margin-top: 18px; }
.placement-buddy { display: grid; place-items: center; margin-bottom: 4px; }
.placement-stage { margin-top: 18px; }
.placement-stage .dont-know { margin-top: 14px; }
.choice.picked { border-color: var(--line-strong); background: var(--bg); }
.placement-start { font-size: 1.5rem; font-weight: 1000; margin: 4px 0 12px; }
.placement-facts { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; text-align: start; }
.placement-facts li { display: flex; gap: 8px; align-items: flex-start; font-weight: 700; }
.placement-facts .px-icon { width: var(--i-m); height: var(--i-m); flex: none; }
.placement-result + .btn { margin-top: 14px; }
.form-ui .level-choice .level-test, .level-choice .level-test { border-style: dashed; border-color: var(--green-dark); }
.level-choice .level-test small { display: block; font-weight: 700; color: var(--muted); font-size: 0.82rem; }
.level-choice .level-test .lvl .px-icon { width: var(--i-m); height: var(--i-m); vertical-align: -5px; }

/* the trial lesson: where it starts and how it ends */
.trial-invite { margin-top: 18px; padding-top: 16px; border-top: 2px solid var(--line); text-align: start; }
.trial-invite p { margin: 0 0 10px; }
.trial-pitch { margin: 18px 0 0; font-weight: 700; }
.trial-login { margin: 4px 0 0; text-align: center; font-weight: 700; color: var(--muted); font-size: 0.95rem; }
.trial-login a { color: var(--blue, #1cb0f6); font-weight: 900; }
/* email address not confirmed yet: the home screen's quiet line (views/auth/_confirm-note.ejs), and the
   development-only note that no mail is really sent (views/auth/_dev-mail.ejs) */
.confirm-note { display: flex; align-items: flex-start; gap: 6px 16px; }
.confirm-note form { flex: 1; min-width: 0; }
.dev-note { margin: 8px 0 0; color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.auth-card .dev-note { margin: 0 0 14px; }

/* smooth page changes (cross-document view transitions: Chrome, Edge, Safari 18.2+);
   the header, tab bar and side nav stay put while the page content fades over */
@view-transition { navigation: auto; }
.topbar { view-transition-name: topbar; }
.tabbar { view-transition-name: tabbar; }
.sidenav { view-transition-name: sidenav; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.18s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
/* icons on the 24-pixel grid (src/pixel-icons.js n: 24) stay crisp at multiples of 24 */
.game-icon .px-icon.px-24, .hub-tile .emoji .px-icon.px-24 { width: 48px; height: 48px; }
.auth-hero > .px-icon.px-24 { width: 72px; height: 72px; }
/* profile picture poses */
.pose-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.pose-picker form { margin: 0; }
.pose-picker button { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 10px 4px 8px; border-radius: 18px; border: 3px solid var(--line); background: #fff; font: 800 0.8rem var(--font); color: var(--text); cursor: pointer; }
.pose-picker button:hover { border-color: #cfd6de; }
.pose-picker button[aria-pressed="true"] { border-color: var(--green); background: var(--green-light); }
.pose-picker .buddy-canvas { border-radius: 50%; background: var(--bg); }
a.profile-avatar { text-decoration: none; }
/* travel on the map: dust behind runners, ropes of the balloon */
.map-svg .map-dust { fill: rgba(255, 255, 255, 0.9); stroke: rgba(120, 130, 110, 0.35); stroke-width: 1; animation: dust 0.65s ease-out forwards; transform-box: fill-box; transform-origin: center; pointer-events: none; }
@keyframes dust { from { opacity: 0.95; transform: scale(0.6); } to { opacity: 0; transform: scale(1.9) translateY(-3px); } }
.map-svg .map-rope { stroke: #6b4a2a; stroke-width: 1.4; stroke-linecap: round; }
.map-svg .map-prop { pointer-events: none; }

/* =====================================================================================
   Designs (src/data/skins.js): Klar lives here, the others in public/skins/<id>.css
   ===================================================================================== */

/* ---------- the design picker (Profil): a tiny scene in each look ---------- */
.skin-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.skin-picker form { margin: 0; }
.skin-option { position: relative; display: grid; align-content: start; gap: 6px; width: 100%; height: 100%; padding: 10px 10px 12px; border-radius: 20px; border: 3px solid var(--line); background: #fff; font: inherit; color: var(--text); text-align: left; cursor: pointer; transition: border-color 0.15s, transform 0.15s, background-color 0.15s; }
.skin-option:hover { border-color: var(--line-strong); }
.skin-option:active { transform: translateY(2px); }
.skin-option[aria-pressed="true"] { border-color: var(--green); background: var(--green-light); }
.skin-name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-weight: 1000; font-size: 1.05rem; }
.skin-name small { padding: 1px 8px; border-radius: 999px; background: var(--green-light); color: var(--green-ink); font-size: 0.75rem; font-weight: 1000; letter-spacing: 0.06em; text-transform: uppercase; }
.skin-option[aria-pressed="true"] .skin-name small { background: #fff; }
.skin-n { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--ink); color: #fff; font-size: 0.8rem; }
.skin-blurb { font-size: 0.85rem; font-weight: 700; color: var(--muted); line-height: 1.35; }
.skin-on { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; padding-block: 2px; padding-inline: 6px 9px; border-radius: 999px; background: var(--green); color: #fff; font-weight: 1000; font-size: 0.75rem; box-shadow: 0 2px 0 var(--green-dark); }
.skin-on .px-icon { width: var(--i-s); height: var(--i-s); }
.skin-preview { position: relative; display: block; height: 108px; overflow: hidden; border-radius: 13px; background: var(--bg); }
.skin-preview i { position: absolute; font-style: normal; }
.sp-card { inset-inline-start: 10px; top: 12px; display: flex; align-items: center; gap: 5px; padding: 9px 11px; }
.sp-chip { position: relative; padding: 1px 6px; border-radius: 99px; background: var(--red-light); color: #c23a33; font-size: 0.6rem; font-weight: 1000; }
.sp-word { position: relative; font-size: 0.98rem; font-weight: 1000; color: var(--ink); }
.sp-bubble { inset-inline-end: 8px; top: 40px; z-index: 1; padding: 4px 10px; font-size: 0.72rem; font-weight: 1000; color: var(--ink); }
.sp-btn { left: 10px; right: 10px; bottom: 11px; padding: 6px 4px; text-align: center; font-size: 0.66rem; font-weight: 1000; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: var(--green); }
/* 3 · Klar */
.sp-klar .sp-card { background: #fff; border: 2px solid var(--line); border-radius: 12px; box-shadow: 0 3px 0 var(--line); }
.sp-klar .sp-bubble { background: #fff; border: 2px solid var(--line); border-radius: 12px; }
.sp-klar .sp-bubble::after { content: ""; position: absolute; inset-inline-start: 12px; bottom: -6px; width: 8px; height: 8px; background: #fff; border: solid var(--line); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.sp-klar .sp-btn { border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); }
/* 1 · Postkarte */
.sp-postkarte { background: #f3ead8 radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.5), transparent 60%); }
.sp-postkarte .sp-card { background: #fffdf8; border: 1px solid #e3d6bf; border-radius: 4px; box-shadow: 0 2px 0 #e2d4bb, 0 6px 12px rgba(70, 50, 20, 0.1); transform: rotate(-2deg); padding-inline-end: 30px; }
.sp-postkarte .sp-card::after { content: ""; position: absolute; inset-inline-end: 6px; top: 5px; width: 14px; height: 17px; background: var(--green-light); outline: 1.5px dashed #c9b994; outline-offset: 1px; transform: rotate(4deg); }
.sp-postkarte .sp-word { font-family: Georgia, "Times New Roman", serif; font-style: italic; }
.sp-postkarte .sp-bubble { background: #fffdf8; border: 1.5px dashed #c9a96e; border-radius: 3px; transform: rotate(3deg); font-family: Georgia, serif; font-style: italic; color: #6b4f2a; }
.sp-postkarte .sp-btn { border-radius: 5px; -webkit-mask: radial-gradient(circle 5px at 0 50%, #0000 96%, #000) left / 51% 100% no-repeat, radial-gradient(circle 5px at 100% 50%, #0000 96%, #000) right / 51% 100% no-repeat; mask: radial-gradient(circle 5px at 0 50%, #0000 96%, #000) left / 51% 100% no-repeat, radial-gradient(circle 5px at 100% 50%, #0000 96%, #000) right / 51% 100% no-repeat; outline: 1.5px dashed rgba(255, 255, 255, 0.75); outline-offset: -5px; }
/* 2 · Sammelkarte */
.sp-sammelkarte { background: #f7f3ea; }
.sp-sammelkarte .sp-card, .sp-sammelkarte .sp-btn { clip-path: polygon(0 3px, 3px 3px, 3px 0, calc(100% - 3px) 0, calc(100% - 3px) 3px, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 3px calc(100% - 3px), 0 calc(100% - 3px)); }
.sp-sammelkarte .sp-card { gap: 5px; padding: 8px 9px; background: #3b3f4a; }
.sp-sammelkarte .sp-card::before { content: ""; position: absolute; inset: 3px; background: #fff; }
.sp-sammelkarte .sp-card::after { content: "A1"; position: relative; margin-inline-start: 2px; padding: 0 3px; background: var(--yellow); color: #5a4300; font-size: 0.55rem; font-weight: 1000; }
.sp-sammelkarte .sp-bubble { background: #fff; border: 2px solid #3b3f4a; box-shadow: 3px 3px 0 #3b3f4a; }
.sp-sammelkarte .sp-btn { background: var(--green); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.22), inset 3px 3px 0 rgba(255, 255, 255, 0.28); outline: 2px solid #3b3f4a; outline-offset: -2px; }
/* 4 · Buddy */
.sp-buddy { background: linear-gradient(160deg, #eef9e6, #f6f7f8 70%); }
.sp-buddy .sp-card { background: #fff; border-radius: 18px; box-shadow: 0 6px 14px rgba(40, 80, 20, 0.12); }
.sp-buddy .sp-bubble { background: var(--green); color: #fff; border-radius: 14px; border-end-end-radius: 4px; box-shadow: 0 4px 10px rgba(92, 201, 0, 0.3); }
.sp-buddy .sp-btn { border-radius: 999px; box-shadow: 0 6px 12px rgba(92, 201, 0, 0.35); }
/* 7 · Pixel-Fenster */
.sp-pixel { background-color: #dfe6ee; background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.35) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.35) 75%), linear-gradient(45deg, rgba(255, 255, 255, 0.35) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.35) 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.sp-pixel .sp-card { background: #fff; box-shadow: 0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink); padding-top: 13px; }
.sp-pixel .sp-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--green-dark); }
.sp-pixel .sp-chip { border-radius: 0; }
.sp-pixel .sp-bubble { background: #23263a; color: #ffe066; box-shadow: 0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink); }
.sp-pixel .sp-btn { box-shadow: 0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 5px 0 rgba(0, 0, 0, 0.2); }
.sp-pixel .sp-btn::before { content: "▶ "; color: #ffe066; }

/* ---------- the word card in lessons: shared parts ---------- */
.g { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-weight: 1000; font-size: 0.9rem; line-height: 1.45; flex: none; }
.g-der { background: var(--blue-light); color: var(--blue-ink); }
.g-die { background: var(--red-light); color: #c23a33; }
.g-das { background: var(--green-light); color: var(--green-ink); }
.wc { position: relative; max-width: 440px; margin: 0 auto 10px; container-type: inline-size; cursor: pointer; outline: none; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.wc:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.wc img { display: block; }
.wc .audio-btn.round { width: var(--tap); height: var(--tap); flex: none; }
.wc .px-icon { flex: none; }
/* the headword shrinks to fit its line (German has 26-letter nouns): rather than shrink below --fit-solo
   next to its der/die/das chip it takes a line of its own; below --fit-min phones hyphenate (lang="de").
   A design sets --fit-max, --room (the rest of its line) and --chip; lesson.js sets --w and --a. */
.wc .fit {
  --fit-beside: calc(1.66 * (100cqi - var(--room, 0px) - var(--a, 0) * var(--chip, 0px)) / var(--w, 8));
  --fit-alone: calc(1.66 * (100cqi - var(--room, 0px)) / var(--w, 8));
  font-size: clamp(var(--fit-min, 0.95rem), max(var(--fit-beside), min(var(--fit-alone), var(--fit-solo, 1.4rem))), var(--fit-max, 2rem));
  font-weight: 1000; line-height: 1.1; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere;
}
.wc :is(p, li) { overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }
/* flip cards (Postkarte, Sammelkarte): both faces share one grid cell, the taller one sets the height */
.wc-flip { perspective: 1600px; }
.wc-inner { position: relative; display: grid; transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1); transform-style: preserve-3d; }
.wc-flip.flipped .wc-inner { transform: rotateY(180deg); }
/* each face is its own 3D layer and stacking context: without that, positioned children (the postcard's
   stamp and postmark) escape backface-visibility in Chrome and show through from behind */
.wc-face { grid-area: 1 / 1; min-width: 0; transform: rotateY(0deg); isolation: isolate; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.wc-face.back { transform: rotateY(180deg); }
.wc.swipe-right { animation: swipe-r 0.25s ease-in forwards; }
.wc.swipe-left { animation: swipe-l 0.25s ease-in forwards; }

/* ---------- 3 · Klar: the picture on top, only the meaning covered until tapped ---------- */
.wc-klar { overflow: hidden; background: #fff; border: 2px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.wc-img { position: relative; aspect-ratio: 1; width: 100%; max-width: min(100%, 34vh); margin: 0 auto; background: var(--bg); }
.wc-img img { width: 100%; height: 100%; object-fit: cover; }
.wc-img.noimg { aspect-ratio: auto; max-width: none; height: 60px; border-bottom: 2px solid var(--line); }
.wc-badge { position: absolute; inset-inline-start: 12px; top: 12px; display: inline-flex; align-items: center; gap: 5px; padding-block: 5px; padding-inline: 8px 11px; border-radius: 999px; background: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08); font-weight: 1000; font-size: 0.8rem; }
.wc-badge .px-icon { width: var(--i-s); height: var(--i-s); }
.wc-badge.p { color: var(--red-ink); }
.wc-badge.n { color: var(--green-ink); }
.wc-img .wc-audio { position: absolute; inset-inline-end: 12px; bottom: 12px; }
.wc-img.noimg .wc-badge { top: 14px; }
.wc-img.noimg .wc-audio { bottom: 8px; }
.wc-body { padding: 16px 18px 18px; }
.wc-word { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.wc-word .fit { --fit-max: 2.2rem; --room: 38px; --chip: 60px; }
.wc-sub { margin: 4px 0 14px; color: var(--muted); font-weight: 800; font-size: 0.9rem; }
/* the covered meaning is a button (solid, with a thick lower edge like the other buttons), not an empty drop zone */
.wc-reveal { position: relative; padding: 14px; border-radius: 16px; border: 2px solid var(--line-strong); border-bottom-width: 4px; background: #fff; text-align: center; transition: background-color 0.2s; }
.wc-klar:not(.revealed):hover .wc-reveal { background: var(--bg); }
.wc-klar:not(.revealed):active .wc-reveal { transform: translateY(2px); border-bottom-width: 2px; margin-bottom: 2px; }
/* the hidden meaning only keeps its room (a blurred word showed through the label) */
.wc-blur { display: block; visibility: hidden; font-size: 1.4rem; font-weight: 1000; user-select: none; }
.wc-tap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 1000; color: var(--ink); }
.wc-tap .px-icon { width: var(--i-b); height: var(--i-b); }
.wc-meaning { display: none; margin: 0; font-size: 1.55rem; font-weight: 1000; line-height: 1.2; color: var(--ink); }
.wc-klar.revealed .wc-reveal { padding: 12px 14px; border: 0; background: var(--green-light); text-align: start; animation: pop 0.25s ease-out; }
.wc-klar.revealed .wc-blur, .wc-klar.revealed .wc-tap { display: none; }
.wc-klar.revealed .wc-meaning { display: block; }
.wc-klar.revealed { cursor: default; }
.wc-ex { margin: 14px 0 0; font-weight: 700; font-size: 1rem; }
.wc-ex .en { display: block; margin-top: 2px; color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.wc-hint { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--yellow-light); font-weight: 700; font-size: 0.92rem; }
.wc-hint .px-icon { width: var(--i-m); height: var(--i-m); }
.wc-more { margin-top: 2px; font-size: 0.92rem; font-weight: 700; }
.wc-more summary { padding: 10px 0; cursor: pointer; font-weight: 900; color: var(--muted); }
.wc-more ul { margin: 0; padding-inline-start: 18px; }
.wc-more li + li { margin-top: 4px; }
.wc-more .en { display: block; color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.wc-klar:not(.revealed) .wc-after { display: none; }

/* ---------- the last 30 days (Reise): a calendar, Monday to Sunday, with chains of days in a row ---------- */
.cal-card .card-title { margin: 0; }
.cal-line { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 9px 12px; border-radius: 14px; background: var(--yellow-light); font-weight: 800; }
.cal-line .px-icon { width: var(--i-m); height: var(--i-m); flex: none; }
.cal-line.done { background: var(--green-light); color: var(--green-ink); }
.cal-body { display: grid; gap: 16px; margin-top: 14px; }
@media (min-width: 700px) { .cal-body { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); align-items: center; gap: 28px; } }
.cal { display: grid; gap: 3px; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head span { padding-bottom: 4px; text-align: center; font-size: 0.75rem; font-weight: 1000; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.cal-day { position: relative; display: grid; place-items: center; aspect-ratio: 1; }
.cal-day.out { visibility: hidden; }
/* the day itself: its date in a circle */
.cal-day i { position: relative; z-index: 1; display: grid; place-items: center; width: 80%; aspect-ratio: 1; border-radius: 50%; font-style: normal; font-weight: 900; font-size: 0.86rem; color: var(--muted); font-variant-numeric: tabular-nums; transition: transform 0.15s; }
.cal-day .px-icon { width: 62%; height: 62%; }
/* learned: the more XP, the stronger the green */
.cal-day.l1 i { background: #dcf5c4; color: var(--green-ink); }
.cal-day.l2 i { background: #a8e676; color: #1f4f00; }
.cal-day.l3 i { background: #74d330; color: #fff; }
.cal-day.l4 i { background: var(--green); color: #fff; box-shadow: 0 2px 0 var(--green-dark); }
/* days in a row are joined by a band behind them */
.cal-day.chain-l::before, .cal-day.chain-r::after { content: ""; position: absolute; top: 50%; height: 46%; transform: translateY(-50%); background: #e3f6d0; }
.cal-day.chain-l::before { inset-inline: 0 50%; }
.cal-day.chain-r::after { inset-inline: 50% 0; }
/* a streak freeze kept the chain going */
.cal-day.frozen i { background: #edf1f5; }
/* the 1st of a month is set apart by a thin line before it */
.cal-day.month i::before { content: ""; position: absolute; inset-inline-start: -12%; top: 15%; bottom: 15%; width: 2px; border-radius: 2px; background: var(--line-strong); }
/* today: a ring, dashed while nothing is learned yet */
.cal-day.today i { box-shadow: 0 0 0 3px var(--ink); }
.cal-day.today.l4 i { box-shadow: 0 0 0 3px var(--ink), 0 2px 0 3px var(--ink); }
.cal-day.today:not(.learned) i { box-shadow: none; outline: 2.5px dashed var(--ink); outline-offset: -1px; color: var(--ink); animation: cal-today 2.4s ease-in-out infinite; }
@keyframes cal-today { 50% { transform: scale(0.9); } }
.cal-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cal-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 16px; background: var(--bg); text-align: center; }
.cal-stat .px-icon { width: var(--i-l); height: var(--i-l); flex: none; }
.cal-stat b { display: block; font-size: 1.4rem; font-weight: 1000; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.cal-stat small { display: block; margin-top: 2px; color: var(--muted); font-weight: 800; font-size: 0.75rem; line-height: 1.2; }
@media (min-width: 700px) {
  .cal-stats { grid-template-columns: 1fr; gap: 10px; }
  .cal-stat { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; text-align: start; }
}
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 12px; font-size: 0.8rem; font-weight: 800; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend .px-icon { width: var(--i-s); height: var(--i-s); }
.cal-legend .k { display: inline-block; width: 13px; height: 13px; border-radius: 50%; }
.cal-legend .k.l1 { background: #dcf5c4; }
.cal-legend .k.l4 { background: var(--green); }
.cal-legend .k.chain { width: 22px; height: 7px; border-radius: 4px; background: #e3f6d0; }
.cal-legend .k.today { box-shadow: inset 0 0 0 2.5px var(--ink); }

/* ---------- Profil: the places outside the tab bar, then folded sections showing what they are set to ---------- */
.quick-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
@media (max-width: 640px) { .quick-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* icon on top and the words under it, like the stat tiles above: a label gets the tile's whole width
   (side by side, four in a row left too little room for FORTSCHRITT in capitals) */
.quick-tiles a { container-type: inline-size; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 14px 8px 12px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--card); box-shadow: 0 3px 0 var(--line); color: var(--text); text-align: center; text-decoration: none; transition: transform 0.15s, border-color 0.15s; }
.quick-tiles a:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.quick-tiles a:active { transform: translateY(1px); }
.quick-tiles .px-icon { width: var(--i-l); height: var(--i-l); flex: none; vertical-align: top; }
.quick-tiles span { min-width: 0; max-width: 100%; }
.quick-tiles b { display: block; font-weight: 1000; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.quick-tiles small { display: block; color: var(--muted); font-weight: 700; font-size: 0.78rem; line-height: 1.25; }
.fold { padding: 0; }
.fold > summary { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-radius: inherit; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h2 { flex: none; margin: 0; }
.fold > summary:hover h2 { color: var(--green-ink); }
.fold > summary:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
/* what a fold is set to: on one line where it fits, else on two (never cut off) */
.fold-now { flex: 1; min-width: 0; color: var(--muted); font-weight: 800; font-size: 0.86rem; line-height: 1.25; text-align: end; text-wrap: balance; }
.fold-chev { transition: transform 0.2s; } /* the chevron (Cards & chips) */
.fold[open] > summary .fold-chev { margin-top: 4px; transform: rotate(225deg); }
.fold[open] > summary { padding-bottom: 8px; }
.fold-body { padding: 0 20px 20px; animation: fold-in 0.2s ease-out; }
@keyframes fold-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.fold-save { margin-top: 16px; }
@media (max-width: 520px) {
  .fold > summary { padding: 14px 16px; }
  .fold-body { padding: 0 16px 16px; }
  /* two designs side by side on phones; the little scene says enough */
  .skin-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .skin-preview { height: 92px; }
  .skin-blurb { display: none; }
  .skin-name { font-size: 0.95rem; gap: 6px; }
  .skin-on { margin-inline-start: 0; }
}

/* ---------- Reise on phones: a slimmer hero, the map sooner; waiting postcards sit on the album chip ---------- */
.chip.mail-waiting { border-color: var(--yellow); background: var(--yellow-light); }
.chip.mail-waiting .px-icon { animation: wiggle 1.8s ease-in-out infinite; }
@media (max-width: 600px) {
  .reise-hero { gap: 10px; margin-bottom: 14px; }
  .reise-hero > .buddy-canvas, .reise-hero > .buddy { width: 84px !important; height: 84px !important; }
  .reise-hero .bubble { padding: 10px 12px; }
  .reise-hero .bubble strong { font-size: 1rem; }
  .reise-hero .bubble > p { display: none; }
  .reise-hero .bubble .hero-actions { margin-top: 6px; }
  .postcard-banner { display: none; }
}

/* ---------- Lesen: one tap for a surprise story, the full form below ---------- */
.surprise-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.surprise-card > .buddy-canvas, .surprise-card > .buddy { flex: none; width: 72px; height: 72px; }
.surprise-text { flex: 1; min-width: 180px; display: grid; gap: 2px; line-height: 1.35; font-weight: 700; }
.surprise-text strong { font-weight: 1000; font-size: 1.08rem; }
.surprise-card .btn { flex: none; }
.surprise-left { flex: 1 1 100%; margin: 0; text-align: center; font-size: 0.9rem; }
@media (max-width: 520px) { .surprise-card .btn { flex: 1 1 100%; } }
.choose-title { margin: 0 0 14px; }

/* the browser blocked the first sound (phones do until the first tap): a pulsing speaker asks for that tap */
.sound-hint { position: fixed; inset-inline-start: 16px; white-space: nowrap; bottom: calc(var(--kb, 0px) + var(--bar-h, 110px) + 10px); z-index: 60; display: inline-flex; align-items: center; gap: 8px; padding-block: 9px; padding-inline: 12px 18px; border: 2px solid #d8e8f3; border-radius: 999px; background: var(--blue-light); color: var(--blue-ink); font: 900 0.95rem var(--font); box-shadow: 0 6px 16px rgba(26, 143, 202, 0.25); cursor: pointer; animation: sound-hint 1.6s ease-in-out infinite; }
/* in a lesson it sits just above the main button, on the side the buddy is not (never over the label or the card) */
.sound-hint[hidden] { display: none; } /* it stepped back: lesson.js fitSoundHint (it would cover a control) */
/* ...and the buttons that play sound ask for the tap instead */
.audio-btn.ask { animation: sound-ask 1.6s ease-in-out infinite; }
@keyframes sound-ask { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } } /* a size pulse: every design draws its own rim and shadow, which stay */
@media (prefers-reduced-motion: reduce) { .sound-hint, .audio-btn.ask { animation: none; } .audio-btn.ask { transform: scale(1.03); } }
.sound-hint .px-icon { width: var(--i-m); height: var(--i-m); }
@keyframes sound-hint { 0%, 100% { box-shadow: 0 6px 16px rgba(26, 143, 202, 0.25), 0 0 0 0 rgba(45, 174, 240, 0.45); } 50% { box-shadow: 0 6px 16px rgba(26, 143, 202, 0.25), 0 0 0 10px rgba(45, 174, 240, 0); } }
@media (max-width: 640px) {
  .quick-tiles a { gap: 4px; padding: 12px 6px 10px; }
  .quick-tiles .px-icon { width: var(--i-m); height: var(--i-m); }
}

/* ---------- the word page's extras (views/app/_word-extras.ejs): "Im Video" and the full grammar ---------- */
.flash-ipa { margin: 4px 0 0; color: var(--muted); font-weight: 700; letter-spacing: 0.02em; }
.clip-intro { margin: 2px 0 12px; }
.clip-count { font-weight: 900; color: var(--muted); font-variant-numeric: tabular-nums; }
/* nothing from YouTube yet: a dark stage with a play button */
.clip-stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; background: #1d2230; }
.clip-load { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 12px; border: 0; background: radial-gradient(circle at 50% 40%, #323a56, #1d2230 72%); color: #fff; font: inherit; cursor: pointer; }
.clip-play { position: relative; width: 66px; height: 66px; flex: none; border-radius: 50%; background: var(--green); box-shadow: 0 4px 0 var(--green-dark), 0 0 0 9px rgba(255, 255, 255, 0.1); transition: transform 0.15s; }
.clip-play::after { content: ""; position: absolute; left: 26px; top: 20px; border-left: 20px solid var(--ink); border-top: 13px solid transparent; border-bottom: 13px solid transparent; }
.clip-load:hover .clip-play, .clip-load:focus-visible .clip-play { transform: scale(1.07); }
.clip-label { display: grid; gap: 2px; text-align: center; }
.clip-label b { font-size: 1.05rem; font-weight: 1000; }
.clip-label small { color: #c4c9d8; font-weight: 700; font-size: 0.82rem; }
.clip-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* the subtitle lines, the one with the word last */
.clip-lines { display: grid; gap: 4px; margin: 12px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--bg); list-style: none; font-weight: 700; }
.clip-lines li { color: var(--muted); }
.clip-lines li.hit { color: var(--ink); font-size: 1.08rem; }
.clip-lines mark, .clip-pop-line mark { padding: 0 3px; border-radius: 4px; background: var(--yellow-light); color: inherit; box-shadow: inset 0 -3px 0 var(--yellow); }
.clip-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.clip-nav { display: flex; gap: 8px; }
.clip-always { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); color: var(--muted); font-weight: 800; font-size: 0.88rem; cursor: pointer; }
.clip-always input { width: 18px; height: 18px; accent-color: var(--green); }
.clip-privacy { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; color: var(--muted); font-weight: 700; font-size: 0.85rem; line-height: 1.4; }
.clip-privacy .px-icon { flex: none; }
.clip-privacy .px-icon { width: var(--i-s); height: var(--i-s); }
/* grammar tables */
.gram-scroll { margin: 8px 0 4px; overflow-x: auto; }
.gram-table { width: 100%; border-collapse: collapse; font-weight: 700; }
.gram-table th, .gram-table td { padding: 8px 10px; border-bottom: 2px solid var(--bg); text-align: left; vertical-align: top; }
.gram-table thead th { color: var(--muted); font-size: 0.76rem; font-weight: 1000; letter-spacing: 0.05em; text-transform: uppercase; }
.gram-table tbody th { width: 1%; color: var(--muted); font-weight: 900; font-size: 0.86rem; white-space: nowrap; }
.gram-table tbody tr:last-child th, .gram-table tbody tr:last-child td { border-bottom: 0; }
.gram-table.small { font-size: 0.86rem; }
.gram-table.small th, .gram-table.small td { padding: 6px 8px; }
.gram-art { color: var(--muted); font-weight: 800; }
.gram-facts { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; font-weight: 700; }
.gram-facts b, .gram-origin b { display: inline-block; min-width: 128px; color: var(--muted); font-weight: 900; font-size: 0.85rem; }
.gram-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 4px; font-size: 1.2rem; font-weight: 1000; }
.gram-steps span { padding: 4px 12px; border-radius: 12px; background: var(--bg); }
.gram-steps i { color: var(--muted); font-style: normal; }
.gram-more { margin-top: 2px; }
.gram-more summary { padding: 10px 0; color: var(--green-ink); font-weight: 900; cursor: pointer; }
.gram-sub { margin: 14px 0 0; color: var(--muted); font-weight: 900; font-size: 0.85rem; }
.gram-origin { margin: 14px 0 0; padding-top: 12px; border-top: 2px solid var(--bg); font-weight: 600; }
/* in a lesson: the word's clip from the answer sheet, over the lesson */
.rw-video { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); margin-top: 8px; padding: 6px 14px; border: 2px solid #d8e8f3; border-radius: 999px; background: var(--blue-light); color: var(--blue-ink); font: 900 0.88rem var(--font); cursor: pointer; }
.rw-video .px-icon { width: var(--i-s); height: var(--i-s); }
.clip-pop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(20, 24, 36, 0.72); animation: pop 0.2s ease-out; }
.clip-pop-in { width: min(640px, 100%); padding: 14px; border-radius: 22px; background: #fff; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); }
.clip-pop-stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px; background: #1d2230; }
.clip-pop-line { margin: 12px 0 4px; font-size: 1.1rem; font-weight: 800; }
.clip-pop-note { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; color: var(--muted); font-weight: 700; font-size: 0.8rem; }
.clip-pop-note .px-icon { width: var(--i-s); height: var(--i-s); }

/* ---------- Plus (services/plans.js): the badge, quiet links where a limit is, the plan in Profil ---------- */
.plus-tag { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 6px; padding-block: 2px; padding-inline: 6px 8px; border-radius: 999px; background: var(--yellow-light); box-shadow: inset 0 0 0 2px var(--yellow); color: var(--ink); font-size: 0.75rem; font-weight: 1000; letter-spacing: 0.05em; text-transform: uppercase; vertical-align: middle; }
.plus-tag .px-icon { width: var(--i-s); height: var(--i-s); }
.plus-link { margin: 8px 0 0; font-size: 0.92rem; }
.plus-link a { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); }
.plus-link .px-icon { width: var(--i-s); height: var(--i-s); }
.plan-chip { margin-top: 8px; } /* the chip (Cards & chips) */
.plan-chip.on { border-color: var(--yellow); background: var(--yellow-light); }
.plan-chip .px-icon { width: var(--i-s); height: var(--i-s); }
.limit-card > p:first-child { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-weight: 700; }
.limit-card > p:first-child > .px-icon { flex: none; width: var(--i-m); height: var(--i-m); }
.limit-card .plus-link { padding-inline-start: 34px; }
a.skin-option { text-decoration: none; font-weight: inherit; }
.skin-name .plus-tag { margin-inline-start: auto; }

/* ---------- Statistik (Plus): small bar charts ----------
   Thin bars (at most 24px, a 4px rounded end, square on the one hairline baseline), 2px apart; now in green,
   the rest a quiet grey (3:1 on white); a number only on now and the peak, every value on hover or tap
   (focus) and in the table below. */
:root { --chart-mute: #8c949e; }
.stats-card h3 { margin: 22px 0 2px; font-size: 1.02rem; }
.stats-card .card-title + h3 { margin-top: 12px; }
.stats-card .muted strong.ink { color: var(--text); }
.stats-sub { margin: 16px 0 0; font-weight: 800; font-size: 0.9rem; }
.schart { margin: 8px 0 0; container-type: inline-size; }
.schart-plot { position: relative; height: 140px; margin: 22px 0 0; margin-inline-start: 36px; border-bottom: 1px solid var(--line-strong); }
.schart-tick { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.schart-tick:first-child { border-top: 0; }
.schart-tick small { position: absolute; inset-inline-start: -36px; width: 30px; transform: translateY(-50%); text-align: end; color: var(--muted); font-size: 0.75rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.schart-bars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; }
.sbar { position: relative; display: flex; align-items: flex-end; justify-content: center; min-width: 0; height: 100%; border-radius: 6px; outline: none; }
.sbar i { position: relative; display: block; width: 100%; max-width: 24px; background: var(--chart-mute); border-radius: 4px 4px 0 0; transition: filter 0.12s; }
.sbar.now i { background: var(--green); }
.sbar i > b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 3px; color: var(--text); font-size: 0.75rem; font-style: normal; font-weight: 900; white-space: nowrap; }
.sbar:hover, .sbar:focus { z-index: 2; }
.sbar:hover i, .sbar:focus i { filter: brightness(1.12); }
.sbar:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
/* the tooltip sits just above its bar (above the bar's number, when it has one) */
.stip { position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 3; transform: translateX(-50%); padding: 6px 10px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 0.8rem; font-style: normal; font-weight: 700; line-height: 1.3; white-space: nowrap; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.12s; }
.sbar i > b + .stip { bottom: calc(100% + 24px); }
.stip b { font-weight: 1000; }
.stip small { display: block; color: #cfd3d8; font-size: 0.75rem; }
.sbar:hover .stip, .sbar:focus .stip { opacity: 1; visibility: visible; }
.sbar:nth-child(-n + 3) .stip { inset-inline: 0 auto; transform: none; }
.sbar:nth-last-child(-n + 3) .stip { inset-inline: auto 0; transform: none; }
.schart-x { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; margin-inline-start: 36px; padding-top: 4px; }
.schart-x small { min-width: 0; text-align: center; color: var(--muted); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; }
.schart-x small.now { color: var(--text); font-weight: 1000; }
/* thin labels on a phone: every second (Arabic month names: third) label stays, anchored on the current month (months: the last one; days: today, the first). Hidden ones keep their bars, tips and table. */
@container (max-width: 479.98px) {
  .schart-x small { display: flex; justify-content: center; overflow: visible; white-space: nowrap; }
  .schart-days:not(:lang(ar)) .schart-x small:nth-child(even) { visibility: hidden; }
  .schart-days .schart-x small:first-child { justify-content: flex-start; }
}
@container (max-width: 419.98px) {
  .schart-months:not(:lang(ar)) .schart-x small:not(:nth-last-child(2n + 1)) { visibility: hidden; }
  .schart-months:lang(ar) .schart-x small:not(:nth-last-child(3n + 1)) { visibility: hidden; }
  .schart-months .schart-x small:last-child { justify-content: flex-end; }
}
@container (min-width: 420px) and (max-width: 639.98px) {
  .schart-months:lang(ar) .schart-x small { display: flex; justify-content: center; overflow: visible; white-space: nowrap; }
  .schart-months:lang(ar) .schart-x small:not(:nth-last-child(2n + 1)) { visibility: hidden; }
  .schart-months:lang(ar) .schart-x small:last-child { justify-content: flex-end; }
}
.schart-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 8px 0 0; font-size: 0.8rem; font-weight: 700; }
.schart-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.schart-key i + i { margin-inline-start: 8px; }
.schart-key .key-now { background: var(--green); }
.schart-key .key-rest { background: var(--chart-mute); }
.schart-table { margin: 0; }
.schart-table summary { padding: 12px 0; color: var(--muted); font-weight: 800; font-size: 0.85rem; cursor: pointer; }
.schart-table table { width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 0.9rem; }
.schart-table th, .schart-table td { padding: 5px 4px; border-bottom: 1px solid var(--line); text-align: start; }
.schart-table th { color: var(--muted); font-size: 0.75rem; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
.schart-table td + td, .schart-table th + th { text-align: end; font-variant-numeric: tabular-nums; }
.level-rates { display: grid; gap: 10px; margin: 10px 0 0; padding: 0; list-style: none; }
.level-rates li { display: grid; grid-template-columns: 34px minmax(0, 1fr) 48px 64px; align-items: center; gap: 10px; }
.level-rates .lv { padding: 2px 0; border-radius: 8px; background: var(--bg); font-size: 0.85rem; font-weight: 1000; text-align: center; }
.level-rates .progress { height: 10px; }
.level-rates b, .level-rates small { text-align: end; font-variant-numeric: tabular-nums; }
.level-rates small { font-size: 0.8rem; font-weight: 700; }
.stats-card .report-grid { margin-top: 10px; }
.stats-locked .plus-link { margin-top: 4px; }

/* ---------- the Plus page (routes/plus.js) ---------- */
.plan-now.on { background: var(--yellow-light); }
.plan-now-label { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1.1rem; }
.plan-now-label .px-icon { width: var(--i-m); height: var(--i-m); }
.plan-now p:last-child { margin-bottom: 0; }
.plan-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.plan-list li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; font-weight: 600; }
.plan-list .px-icon { width: var(--i-m); height: var(--i-m); }
/* a link standing alone under a list: a full tap height */
.plan-more { margin: 0; }
.plan-more a { display: inline-flex; align-items: center; min-height: var(--tap); }
.plan-features { display: grid; gap: 16px; margin: 0 0 16px; padding: 0; list-style: none; }
.plan-features li { scroll-margin-top: 90px; }
.pf-icon { display: inline-flex; vertical-align: middle; margin-inline-end: 8px; }
.pf-icon .px-icon { width: var(--i-m); height: var(--i-m); }
.plan-features h3 { display: flex; align-items: center; margin: 0 0 8px; }
.pf-compare { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 8px; margin: 0; }
.pf-compare div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.pf-compare .pf-plus { background: var(--yellow-light); }
.plan-features li:target .pf-plus { box-shadow: inset 0 0 0 2px var(--yellow); }
.pf-compare dt { display: flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.plan-features .fold-note { margin-top: 2px; }
.pf-compare dt .px-icon { width: var(--i-s); height: var(--i-s); }
.pf-compare dd { margin: 0; font-weight: 700; }
.plan-features p.muted { margin: 0; font-size: 0.9rem; }
@media (max-width: 520px) {
  .pf-compare dd { font-size: 0.92rem; }
}
.interest-row { display: grid; justify-items: start; gap: 10px; }
.interest-row p { margin: 0; }
.interest-row p.interest-on { display: flex; align-items: flex-start; gap: 8px; }
.interest-row p.interest-on > .px-icon { flex: none; width: var(--i-m); height: var(--i-m); }
.code-row { display: flex; align-items: flex-start; gap: 10px; }
.code-row input { flex: 1; min-width: 0; letter-spacing: 0.06em; text-transform: uppercase; }
.code-row .btn { flex: none; min-height: 52px; }
.code-form .hint { margin-top: 0; }

/* ---------- Profil: one row for who you are, a strip of numbers, then plain lists (rows) ---------- */
.profile-row { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.profile-row .profile-avatar { width: 72px; height: 72px; margin: 0; flex: none; border-width: 3px; box-shadow: none; }
.profile-who { flex: 1; min-width: 0; }
.profile-who h1 { margin: 0; font-size: 1.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-who p { margin: 2px 0 0; font-size: 0.92rem; font-weight: 700; }
.profile-row .plan-chip { margin: 8px 0 0; }
.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 20px; padding: 12px 4px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--card); }
.stat-strip > div { display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; padding: 0 6px; text-align: center; }
.stat-strip > div + div { border-inline-start: 2px solid var(--line); }
.stat-strip dt { color: var(--muted); font-weight: 800; font-size: 0.78rem; line-height: 1.2; }
.stat-strip dd { margin: 0; font-size: 1.5rem; font-weight: 1000; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.rows-title { margin: 22px 4px 8px; } /* the small label (Cards & chips) */
/* the places, the settings and the account: grouped rows (Cards & chips); signing out is red (destructive) */
.row-group .row-out { color: var(--red-ink); }

/* ---------- Reise: the map fills its card; waiting postcards are one button on it ---------- */
.map-card { padding: 8px; }
.map-card .map-wrap { border-radius: calc(var(--radius-lg) - 8px); }
.map-card .city-card { margin: 10px 4px 4px; }
.map-mail { position: absolute; top: 10px; inset-inline-start: 10px; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 6px 12px; border-radius: 999px; border: 2px solid var(--yellow); background: var(--yellow-light); text-decoration: none; }
.map-mail .px-icon { width: var(--i-b); height: var(--i-b); animation: wiggle 1.8s ease-in-out infinite; }

/* ---------- pixel icons, sized for the screen ----------
   A 16-pixel drawing is even only where each of its pixels covers a whole number of screen pixels.
   Phones (2 or 3 screen pixels per CSS pixel) are fine at 16, 24 and 32 px. Other screens are not:
   at 1 only 16 and 32 px are even, and Windows at 125 %, 150 % or 175 % makes every round size
   uneven, so the sizes there are the nearest ones that land on whole screen pixels
   (25.6 px at 125 % is 32 screen pixels: two per pixel of the drawing). */
@media (max-resolution: 1.12dppx) { :root { --i-s: 16px; --i-m: 16px; --i-b: 32px; --i-l: 32px; } }
@media (min-resolution: 1.13dppx) and (max-resolution: 1.37dppx) { :root { --i-s: 25.6px; --i-m: 25.6px; --i-b: 25.6px; --i-l: 38.4px; --a-s: 51.2px; --a-m: 76.8px; --a-l: 128px; } }
@media (min-resolution: 1.38dppx) and (max-resolution: 1.62dppx) { :root { --i-s: 21.333px; --i-m: 21.333px; --i-b: 32px; --i-l: 32px; --a-s: 42.667px; --a-m: 64px; --a-l: 128px; } }
@media (min-resolution: 1.63dppx) and (max-resolution: 1.9dppx) { :root { --i-s: 18.286px; --i-m: 27.429px; --i-b: 27.429px; --i-l: 36.571px; --a-s: 36.571px; --a-m: 73.143px; --a-l: 128px; } }
@media (max-resolution: 1.9dppx) {
  .px-icon { width: var(--i-s); height: var(--i-s); }
  .px-icon.px-24 { width: 24px; height: 24px; }
  .px-icon.px-32 { width: var(--a-s); height: var(--a-s); }
  .status-chip .px-icon, .chip .px-icon, .btn .px-icon { vertical-align: -0.3em; }
}

/* before the app: the brand link at the top of the sign-in cards, and the check-email steps */
.auth-brand { display: flex; justify-content: center; margin: 0 0 12px; }
.mail-steps { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 10px; text-align: start; }
.mail-steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 16px; font-weight: 800; font-size: 1.05rem; }
.mail-steps .n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 1000; font-size: 0.95rem; }

/* onboarding: the submit button stays at the bottom of the screen while the form scrolls */
.onboard-bar { position: sticky; bottom: 0; z-index: 15; margin: 16px -16px 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, rgba(246,247,248,0)); }
@media (min-width: 820px) { .onboard-bar { position: static; margin: 16px 0 0; padding: 0; background: none; } }

/* onboarding in three steps (views/app/onboarding.ejs, public/start.js): the script adds .ob-js; without it the form is one long page */
.ob-top { display: none; }
.ob-js .ob-top { display: block; margin: 0 0 14px; }
.ob-js .ob-step { display: none; }
.ob-js .ob-step.active { display: block; }
.ob-js { padding-bottom: 130px; }
.ob-js .onboard-bar { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px max(16px, calc((100% - 620px) / 2)) calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 75%, rgba(246,247,248,0)); }
.ob-js .onboard-bar .btn { width: 100%; }
.ob-back { order: 2; min-height: var(--tap); padding: 0 16px; border: 0; background: none; color: var(--blue-ink); font: 800 1rem var(--font); text-decoration: underline; cursor: pointer; }
.ob-back[hidden] { display: none; }
.ob .page-head { margin: 4px 0 16px; }
.ob .page-head h1 { font-size: 1.6rem; }
.ob .page-head .ob-note { margin: 6px 0 0; font-size: 0.92rem; color: var(--muted); font-weight: 600; }
.ob-slide { animation: ob-in 0.22s ease-out; }
@keyframes ob-in { from { opacity: 0; transform: translateX(calc(24px * var(--to-end, 1))); } to { opacity: 1; transform: none; } }
.ob-some-toggle, .ob-js .ob-some-toggle { display: none; }
.ob-js .form-ui .ob-some-toggle, .ob-js .ob-some-toggle { display: flex; }
.ob-some-toggle input { width: 22px; height: 22px; accent-color: var(--green); }
.ob-some { display: grid; gap: 12px; }
.ob-js .ob-some { display: none; }
.ob-js .ob-some.open { display: grid; }
.level-test small { display: block; font-weight: 600; color: var(--muted); }
.form-ui.ob .level-choice label { padding: 10px 14px; gap: 12px; }
.form-ui.ob .level-choice .level-test { border-style: solid; border-color: var(--line); }
.form-ui.ob .level-choice .level-test:has(input:checked) { border-color: var(--green); }
.ob .level-choice { gap: 10px; }
.ob .ob-some .hint { margin: 0 0 4px; }
.ob-buddies { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.form-ui .ob-buddy { position: relative; margin: 0; cursor: pointer; min-width: 0; }
.ob-buddy input { position: absolute; opacity: 0; pointer-events: none; }
.ob-buddy-card { display: grid; justify-items: center; gap: 2px; padding: 6px 2px 8px; border-radius: 16px; border: 3px solid var(--line); background: #fff; }
.ob-buddy-card .emoji { display: grid; place-items: center; width: 72px; height: 72px; }
.ob-buddy-card .buddy-canvas { max-width: 100%; height: auto !important; }
.ob-buddy-card .name { font-weight: 900; font-size: 0.82rem; }
.ob-buddy input:checked + .ob-buddy-card { border-color: var(--green); }
.ob-buddy input:focus-visible + .ob-buddy-card { outline: 3px solid var(--blue); outline-offset: 2px; }
.ob-details { margin-top: 14px; }
.ob-detail { padding: 2px 4px; }
.ob-detail[hidden] { display: none; }
.ob-detail p { margin: 0 0 6px; }
.ob-tag { font-weight: 1000; font-size: 1.05rem; }
.ob-desc { font-weight: 600; color: #444; font-size: 0.95rem; }
.ob-more summary { display: flex; align-items: center; min-height: var(--tap); font-weight: 800; color: var(--blue-ink); cursor: pointer; }
.ob .ob-sub { margin: 18px 0 8px; font-size: 1.05rem; }
.ob .goal-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.ob .goal-choice label, .form-ui.ob .goal-choice label { padding: 8px 14px; border-radius: 999px; min-height: var(--tap); font-size: 0.92rem; }
.ob .goal-choice label:has(input:checked) { background: #fff; }
.ob .goal-choice input { position: absolute; opacity: 0; pointer-events: none; }
.ob .goal-choice label { position: relative; }
.ob .goal-choice label:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }
.ob .ob-err { margin-top: 10px; }
.placement-count { flex: none; font-weight: 800; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

/* ---------- Top bar: today's XP against the daily goal (views/app/_head.ejs), on every page ---------- */
.status-chip.xp { padding-bottom: 8px; }
.status-chip .xp-goal { position: absolute; left: 11px; right: 11px; bottom: 3px; height: 3px; border-radius: 99px; background: var(--line); overflow: hidden; }
.status-chip .xp-goal i { display: block; height: 100%; background: var(--yellow); }
.status-chip.xp.met { border-color: var(--yellow); }
@media (max-width: 400px) {
  .topbar { gap: 6px; padding-inline: 10px; }
  .topbar .status { gap: 5px; }
  .topbar .status-chip { padding-inline: 7px; font-size: 0.85rem; }
  .status-chip .xp-goal { left: 7px; right: 7px; }
}

/* ---------- Reise as a map (views/app/reise.ejs, public/journey.js; scripts/REISE-KARTE-PLAN.md) ----------
   The map fills the room between the top bar and the tab bar (no page scroll); a sheet at the bottom with three
   heights holds the rest, on wide screens a panel on the right. Colours: neutral, gold = done, red = the boss,
   green only for the one action. Layers inside .rk: map 0, buddy and bubble 4, top row, tools and card 5,
   sheet 6, toasts 7, flyover banner 8. */
.layout-karte { overflow: hidden; overscroll-behavior: none; }
.layout-karte .shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.layout-karte .topbar { flex: none; }
.layout-karte main.page { position: relative; flex: 1 1 auto; min-height: 0; max-width: none; margin: 0; padding: 0; }
.layout-karte .app-footer { display: none; }
@media (min-width: 960px) { .layout-karte .shell { padding-bottom: 0; } }
.rk { position: absolute; inset: 0; overflow: hidden; background: var(--bg); --rk-vis: 0px; --rk-panel: 0px; }

/* the map */
.rk-map { position: absolute; inset: 0; z-index: 0; cursor: grab; }
.rk-map.panning { cursor: grabbing; }
.rk-map:focus-visible { outline: 3px solid var(--blue); outline-offset: -4px; }
.rk .map-svg { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; touch-action: none; user-select: none; -webkit-user-select: none; }
/* The map's look: three candidates (rk-look-a/b/c on .rk, ?look=a|b|c, reise.ejs sets the default c; a bare .rk gets c too). Every look only sets
   these variables; the rules below and the skins read them. The region is a meadow or forest green that is clearly
   not the action green (--green): the one green button stays the strongest green on the screen. */
.rk.rk-look-a {
  /* a: Wanderkarte, a meadow on cream paper, a white path with a dotted brown trail */
  --m-bg: #e3d7b6; --m-land: #f5edd8; --m-land-edge: #e2d3ab; --m-land-dash: none;
  --m-zone: #8ccb68; --m-zone-edge: #79b858; --m-lift: #5f9350; --m-lift-y: 4px; --m-tuft: #72ab54; --m-speck: #a3d887;
  --m-road: #fffdf4; --m-road-w: 11; --m-road-edge: #6ea456; --m-road-edge-w: 13.5;
  --m-dash: #9a7440; --m-dash-w: 4; --m-dash-a: 0.1 9.5; --m-done: var(--yellow); --m-done-w: 7; --m-done-edge: #5f9350;
  --m-stop: #fff; --m-stop-edge: #6b4f2a; --m-stop-w: 5; --m-next-edge: var(--ink);
  --m-label: var(--ink); --m-label-far: #3d4249; --m-halo: rgba(255, 253, 244, 0.96);
  --m-sieg-zone: #f5d36a; --m-sieg-edge: #d9a521; --m-sieg-lift: #a87c12; --m-sieg-tuft: #e6bd45; --m-sieg-speck: #fde7a0;
  --m-target: #8ccb68;
}
.rk.rk-look-b {
  /* b: Spielbrett, a dark forest board standing on sand tiles, a chunky cream road with dark edges, bright stops */
  --m-bg: #cdb88a; --m-land: #ead7ad; --m-land-edge: #fff4da; --m-land-dash: none;
  --m-zone: #44845c; --m-zone-edge: #376f4c; --m-lift: #1f4632; --m-lift-y: 7px; --m-tuft: #33694a; --m-speck: #64a379;
  --m-road: #fff1cc; --m-road-w: 14; --m-road-edge: #1d3a2a; --m-road-edge-w: 19;
  --m-dash: #7a5524; --m-dash-w: 4.5; --m-dash-a: 0.1 9.5; --m-done: var(--yellow); --m-done-w: 10; --m-done-edge: #8a6410;
  --m-stop: #fff; --m-stop-edge: var(--ink); --m-stop-w: 5; --m-next-edge: var(--ink);
  --m-label: var(--ink); --m-label-far: #2d2d2d; --m-halo: rgba(255, 255, 255, 0.97);
  --m-sieg-zone: #f5d36a; --m-sieg-edge: #d9a521; --m-sieg-lift: #8a6410; --m-sieg-tuft: #e6bd45; --m-sieg-speck: #fde7a0;
  --m-target: #44845c;
}
.rk, .rk.rk-look-c {
  /* c (default): Atlas, a fresh meadow on a raised plinth over calm paper, a cream road in a firm brown casing, a wide gold walked road */
  --m-bg: #e6dcbf; --m-land: #f4eddb; --m-land-edge: #dccda4; --m-land-dash: none;
  --m-zone: #80bf5c; --m-zone-edge: #5a9442; --m-lift: #44703a; --m-lift-y: 6px; --m-tuft: #68a44b; --m-speck: #9ccf7c;
  --m-road: #fffaea; --m-road-w: 12; --m-road-edge: #5a4a2c; --m-road-edge-w: 17;
  --m-dash: #b08d58; --m-dash-w: 4; --m-dash-a: 0.1 9.5; --m-done: var(--yellow); --m-done-w: 10; --m-done-edge: #9a6c06;
  --m-stop: #fff; --m-stop-edge: var(--ink); --m-stop-w: 5; --m-next-edge: var(--ink);
  --m-label: var(--ink); --m-label-far: #2d2d2d; --m-halo: rgba(255, 255, 255, 0.97);
  --m-sieg-zone: #f5d36a; --m-sieg-edge: #cf9a14; --m-sieg-lift: #8a6410; --m-sieg-tuft: #e6bd45; --m-sieg-speck: #fde7a0;
  --m-target: #80bf5c;
}
/* level beaten: a gold trophy region on a high plinth; the next region in the look's green with a gold edge that
   breathes slowly (still under reduced motion) */
.rk[data-mode="sieg"] { --m-zone: var(--m-sieg-zone); --m-zone-edge: var(--m-sieg-edge); --m-lift: var(--m-sieg-lift); --m-tuft: var(--m-sieg-tuft); --m-speck: var(--m-sieg-speck); --m-lift-y: 7px; }
.rk .map-svg { background: var(--m-bg); }
.rk .map-svg .state { fill: var(--m-land); stroke: var(--m-land-edge); stroke-width: 1.5; stroke-dasharray: var(--m-land-dash); }
.rk .map-svg .state.zone, .rk .map-svg .state.zone.locked-zone { fill: var(--m-zone); stroke: var(--m-zone-edge); stroke-dasharray: none; }
.rk .map-svg :is(.zone-lift, .zone-top, .road-edge) { display: inline; }
.rk .map-svg .zone-lift { fill: var(--m-lift); stroke: var(--m-lift); stroke-width: 2; transform: translateY(var(--m-lift-y)); }
.rk .map-svg .zone-top { stroke: var(--m-zone-edge); stroke-width: 1.5; }
.rk .map-svg .tex-bg { fill: var(--m-zone); }
.rk .map-svg .tex-a { fill: var(--m-tuft); }
.rk .map-svg .tex-b { fill: var(--m-speck); }
.rk .map-svg use.state.next-zone.next-zone { fill: var(--m-target); stroke: var(--yellow); stroke-width: 3.5; stroke-dasharray: none; }
/* its glow: a copy of the edge (journey.js .rk-glow) that only fades, three times once the page has settled */
.rk .map-svg .rk-glow { fill: none; stroke: var(--yellow); stroke-width: 8; stroke-linejoin: round; opacity: 0; pointer-events: none; }
@keyframes rk-glow { 50% { opacity: 0.75; } }
@media (prefers-reduced-motion: no-preference) { .rk .map-svg .rk-glow { animation: rk-glow 2.6s ease-in-out 1.5s 3; } }
/* while the map moves (finger, wheel, flight) its animations wait and the grass pattern gives way to its plain colour:
   each frame then repaints less (measured with a 4-6x throttled Chrome). (!important: the stops' own `animation`
   shorthands would set the play state back to running) */
.rk.rk-moving .map-svg * { animation-play-state: paused !important; }
.rk.rk-moving .map-svg .zone-top use { fill: var(--m-zone); }
.rk .map-svg .rk-region { font: 900 calc(15px / var(--s, 1)) var(--font); text-anchor: middle; fill: var(--gold-ink); paint-order: stroke; stroke: rgba(255, 255, 255, 0.95); stroke-width: calc(4px / var(--s, 1)); stroke-linejoin: round; pointer-events: none; }
.rk .map-svg .road-edge { fill: none; stroke: var(--m-road-edge); stroke-width: var(--m-road-edge-w); stroke-linecap: round; stroke-linejoin: round; }
.rk .map-svg .road { stroke: var(--m-road); stroke-width: var(--m-road-w); }
.rk .map-svg .road-dash { stroke: var(--m-dash); stroke-width: var(--m-dash-w); stroke-dasharray: var(--m-dash-a); stroke-linecap: round; }
/* the walked road: gold with a thin darker casing (journey.js copies the path as .rk-done-case) */
.rk .map-svg .road-done { stroke: var(--m-done); stroke-width: var(--m-done-w); stroke-dasharray: none; opacity: 1; }
.rk .map-svg .rk-done-case { fill: none; stroke: var(--m-done-edge); stroke-width: calc(var(--m-done-w) + 3); stroke-linecap: round; stroke-linejoin: round; }
/* the boss line and the bridge to the next region: the same size on screen at every zoom (--s = screen px per map
   unit): 4 px, 6 px dashes with 5 px gaps (the round caps add 2 px at each end), on a 7 px white casing (journey.js
   copies the path as .rk-boss-case); red, gold once the boss is beaten */
.rk .map-svg .road-boss, .rk .map-svg .road-boss.won { fill: none; stroke: var(--red); stroke-width: calc(4px / var(--s, 1)); stroke-dasharray: calc(2px / var(--s, 1)) calc(9px / var(--s, 1)); stroke-linecap: round; opacity: 1; }
.rk .map-svg .road-boss.won { stroke: var(--yellow); }
.rk .map-svg .rk-boss-case { fill: none; stroke: #fff; stroke-width: calc(7px / var(--s, 1)); stroke-linecap: round; stroke-linejoin: round; opacity: 0.95; }
/* stops: done = gold with a star, current = white with an ink edge (the buddy stands on it), open = the same without
   the pulse, locked = a small grey dot; the drawings a little smaller (scaled about the stop's centre) */
.rk .map-svg .node > circle:not(.hit):not(.pulse), .rk .map-svg .node > .pin-icon, .rk .map-svg .node > text { transform: scale(0.82); }
.rk .map-svg .node circle.bg { fill: #fff; stroke: var(--line-strong); stroke-width: 3; stroke-dasharray: none; }
.rk .map-svg .node text { fill: var(--muted); }
.rk .map-svg :is(.node, .boss-node) .due-badge text { fill: var(--ink); }
/* zoomed out (s < 1) the due badge keeps its screen size, growing from the stop's edge (_due-badge.ejs) */
.rk .map-svg .due-hold { transform: scale(max(1, calc(1 / var(--s, 1)))); }
/* (journey.js placeBadge then sets its size and spot; with no spot clear of the other stops it fades out) */
.rk .map-svg .rk-badge-off { opacity: 0; transition: opacity 0.2s; }
.rk .map-svg .node.done circle.bg { fill: var(--yellow); stroke: #fff; stroke-width: 3; }
.rk .map-svg .node.current circle.bg, .rk .map-svg .node.open circle.bg { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.rk .map-svg .node.current text, .rk .map-svg .node.open text { fill: var(--ink); }
/* the current city under the buddy: a white ground spot (22 units, 60 %) around its 4 px progress ring */
.rk .map-svg .node.current circle.pulse { fill: #fff; stroke: none; opacity: 0.6; animation: none; transform: scale(1.22); }
/* a city still ahead: a solid white disc with a strong edge (a place to go, not a ghost); the next one larger, in ink */
.rk .map-svg .node.locked circle.bg { fill: var(--m-stop); stroke: var(--m-stop-edge); stroke-width: var(--m-stop-w); transform: scale(0.56); }
.rk .map-svg .node.locked :is(.pin-icon, text) { display: none; }
.rk .map-svg a.stop.rk-next .node.locked circle.bg { stroke: var(--m-next-edge); stroke-width: 3.5; transform: scale(0.66); }
.rk .map-svg a.stop.rk-far .node { opacity: 0.92; }
.rk .map-svg a.stop.rk-far.rk-picked .node { opacity: 1; }
/* a progress ring only at the current stop: ink = practised, gold = learned for sure */
.rk .map-svg .node:not(.current) :is(.ring-track, .ring-start, .ring-learn, .ring-known) { display: none; }
.rk .map-svg .ring-track { stroke: var(--line); }
.rk .map-svg .node.current :is(.ring-track, .ring-start, .ring-learn, .ring-known) { stroke-width: 6; } /* (scaled .82: 4 px+ on screen) */
.rk .map-svg .ring-start { stroke: var(--ink); }
.rk .map-svg .ring-learn { stroke: var(--yellow); }
/* the boss: grey while locked, red and pulsing when open, gold with a trophy when beaten */
.rk .map-svg .boss-node.locked { filter: none; opacity: 1; }
.rk .map-svg .boss-node.locked circle.bg { fill: #fff; stroke: var(--red); stroke-width: 4; }
.rk .map-svg .boss-node.open circle.bg { fill: #ffe6e3; stroke: var(--red); stroke-width: 6; }
/* boss pictures stay neutral on the map: the green hill (Kahler Asten) would be a second green */
.rk .map-svg .boss-node:not(.won) .pin-icon[href$="#hill"] { filter: grayscale(1) brightness(0.95); }
/* the bridge's end (g.next-entry, boss beaten): the entry to the next region, white with a gold edge */
.rk .map-svg .next-entry-node circle.bg { fill: #fff; stroke: var(--yellow); stroke-width: 4; transform: scale(0.8); }
.rk .map-svg .boss-node.won circle.bg { fill: var(--yellow); stroke: #fff; stroke-width: 5; }
/* the server's "selected" ring means nothing here (the sheet or the card says what is chosen); the open card's stop gets ink */
.rk .map-svg a.stop.rk-picked :is(.node, .node.locked, .boss-node) circle.bg { stroke: var(--ink); stroke-width: 4; }
.rk .map-svg a.stop:focus-visible { outline: none; }
.rk .map-svg a.stop:focus-visible circle.bg { stroke: var(--ink); stroke-width: 4; stroke-dasharray: 4 3; }
/* names: in their own layer above the stops, shown only where they help (journey.js), at least 13 screen pixels
   (--s = screen pixels per map unit) with a white halo */
.rk .map-svg .city-label { display: none; font-size: calc(13px / var(--s, 1)); stroke-width: calc(4px / var(--s, 1)); fill: var(--m-label); stroke: var(--m-halo); }
.rk .map-svg .city-label.current { font-size: calc(14px / var(--s, 1)); fill: var(--ink); }
.rk .map-svg .city-label.locked { fill: var(--m-label-far); }
.rk .map-svg .city-label.rk-show { display: inline; }
/* zoomed far out a name that must show and has no spot by its own stop sits a little away, joined by this line */
.rk .map-svg .rk-leader { display: none; stroke: var(--ink); stroke-width: calc(1.5px / var(--s, 1)); stroke-linecap: round; pointer-events: none; }
.rk .map-svg .rk-leader.rk-show { display: inline; }
.rk .map-svg .map-buddy { pointer-events: none; cursor: default; }

/* floating bits on the map: the top row (level chip, progress pill, fit toggle) and the zoom tools (panel only) */
.rk-top { position: absolute; z-index: 5; top: 10px; inset-inline-start: 12px; inset-inline-end: calc(12px + var(--rk-panel)); display: flex; align-items: center; gap: 8px; pointer-events: none; }
.rk-top > * { pointer-events: auto; }
.rk-top .rk-prog { margin-inline-start: auto; }
.rk-top .rk-level:last-child, .rk-top .rk-level + .rk-fit { margin-inline-end: auto; }
/* the chip (Cards & chips); floating on the picture, the map's chips and tools stand on a lower edge */
.rk-chip { position: relative; gap: 8px; padding: 0 16px; }
.rk-chip, .rk-tool { box-shadow: 0 3px 0 var(--line); }
.rk-chip:active, .rk-tool:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.rk-chip b { font-weight: 1000; }
.rk-n { color: var(--muted); }
.rk-n b { color: var(--text); }
.rk-boss { display: inline-flex; align-items: center; gap: 4px; padding-inline-start: 8px; border-inline-start: 2px solid var(--line); }
.rk-boss .px-icon { width: 24px; height: 24px; }
.rk-arrow { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 10px solid var(--red); transform: rotate(var(--a, 0deg)); }
.rk-tool { display: grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0; border-radius: 50%; border: 2px solid var(--line); background: var(--card); cursor: pointer; }
.rk-tool .px-icon { width: 24px; height: 24px; filter: grayscale(1) brightness(0.6) contrast(1.3); } /* neutral: no green, no blue */
.rk-tool.on { border-color: var(--ink); }
.rk-tools { display: none; }
.rk:not(.rk-js) :is(.rk-top, .rk-tools, .rk-buddy, .rk-say, .rk-card-x, .rk-handle) { display: none; }

/* the buddy's tap area (placed over the drawn buddy by journey.js) and its bubble */
.rk-buddy { position: absolute; z-index: 4; left: 0; top: 0; width: 60px; height: 76px; padding: 0; border: 0; border-radius: 18px; background: transparent; cursor: pointer; pointer-events: none; }
.rk-say { position: absolute; z-index: 4; left: 0; top: 0; max-width: 240px; padding: 7px 12px; border-radius: 14px; background: #fff; border: 2px solid var(--ink); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
  font: 900 0.86rem/1.25 var(--font); color: var(--ink); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0s 0.2s; }
.rk-say.on { opacity: 1; visibility: visible; transition: opacity 0.2s; }
.rk-say span { display: block; white-space: nowrap; }
.rk-say.two span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rk-say::after { content: ""; position: absolute; width: 10px; height: 10px; background: inherit; }
.rk-say[data-side="r"]::after { top: 50%; left: -7px; margin-top: -5px; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
.rk-say[data-side="l"]::after { top: 50%; right: -7px; margin-top: -5px; border-right: 2px solid var(--ink); border-top: 2px solid var(--ink); transform: rotate(45deg); }
.rk-say[data-side="t"]::after { bottom: -7px; left: var(--tail, 24px); margin-left: -5px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
.rk-say[data-side="b"]::after { top: -7px; left: var(--tail, 24px); margin-left: -5px; border-left: 2px solid var(--ink); border-top: 2px solid var(--ink); transform: rotate(45deg); }

/* notices over the map: white with a quiet edge, never a tinted card */
.rk-toasts { position: absolute; z-index: 7; top: 62px; inset-inline-start: 12px; inset-inline-end: calc(12px + var(--rk-panel)); display: grid; gap: 8px; pointer-events: none; }
.rk-toasts > * { pointer-events: auto; }
.rk-toasts .notice-ui { position: relative; display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); font-size: 0.92rem; }
.rk-toasts .notice-ui .px-icon { flex: none; width: 24px; height: 24px; }
.rk-toasts .notice-ui.has-x { padding-inline-end: 48px; }
.rk-toasts .confirm-note[hidden] { display: none; }
.rk-toast-x { position: absolute; top: 50%; inset-inline-end: 2px; display: grid; place-items: center; width: var(--tap); height: var(--tap); margin-top: -22px; padding: 0; border: 0; background: none; cursor: pointer; }
.rk-toast-x .px-icon, .rk-card-x .px-icon { width: var(--i-s); height: var(--i-s); } /* every close cross: small, on a 44 px tap area */
.rk .flyover-banner { position: absolute; z-index: 8; top: 64px; left: calc(50% - var(--rk-panel) / 2); max-width: calc(100% - var(--rk-panel) - 24px); }

/* the card of another stop, above the sheet */
.rk-card { position: absolute; z-index: 5; left: 12px; right: 12px; bottom: calc(var(--rk-vis) + 12px); padding: 12px 16px 16px; border-radius: var(--radius-lg); background: var(--card); border: 2px solid var(--line);
  box-shadow: var(--shadow); } /* the card surface (.card-ui) */
.rk-card:focus { outline: none; }
.rk-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.rk:not(.rk-js) .rk-card { top: 12px; bottom: auto; }
.rk-card-x { position: absolute; top: 2px; inset-inline-end: 2px; display: grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0; border: 0; background: none; cursor: pointer; }
.rk-card-state { margin: 0; padding-inline-end: 40px; } /* the small label (Cards & chips) */
.rk-card-state.gold { color: var(--gold-ink); }
.rk-card-name { margin: 2px 0; padding-inline-end: 40px; font-size: 1.25rem; } /* a section heading */
.rk-card-text { margin: 0 0 8px; color: var(--muted); font-weight: 700; font-size: 0.92rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rk-card .progress { display: block; height: 8px; margin-top: 4px; }
.rk-card-meta { margin: 4px 0 0; color: var(--muted); font-weight: 700; font-size: 0.85rem; }
.rk-card-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 10px; }
.rk-card-act form { margin: 0; }
.rk-card-act > .btn, .rk-card-act > form:first-child { flex: 1 1 auto; }
.rk-card-act > form:first-child { display: flex; }
.rk-card-act > form:first-child .btn { flex: 1 1 auto; }
.rk-card-act .link-btn { display: inline-flex; align-items: center; min-height: var(--tap); }
.rk-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.rk .progress > span { background: var(--yellow); }

/* the sheet: peek (head and the action), half, full; without the script it simply scrolls */
.rk-sheet { position: absolute; z-index: 6; inset-inline: 0; bottom: 0; max-height: 48%; overflow-y: auto; display: flex; flex-direction: column; background: #fff;
  border: 2px solid var(--line); border-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.1); }
.rk-js .rk-sheet { max-height: none; overflow: hidden; height: var(--rk-vis); }
.rk-js.rk-ready .rk-sheet { transition: height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.rk-js .rk-sheet.rk-drag { transition: none; }
.rk-handle { flex: none; position: relative; z-index: 0; margin-bottom: -20px; }
.rk-grip { display: flex; justify-content: center; align-items: flex-start; width: 100%; height: var(--tap); padding: 10px 0 0; border: 0; background: none; cursor: grab; touch-action: none; }
.rk-grip:focus-visible { outline-offset: -3px; }
.rk-bar { width: 44px; height: 5px; border-radius: 99px; background: var(--line-strong); }
.rk-grip:hover .rk-bar { background: var(--faint); }
.rk-main { position: relative; z-index: 1; flex: none; padding: 0 16px 10px; }
.rk:not(.rk-js) .rk-main { padding-top: 16px; }
.rk-js .rk-main { touch-action: none; }
.rk-head { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.rk-art { flex: none; width: 48px; height: 48px; margin-inline-end: -2px; image-rendering: pixelated; object-fit: contain; }
.rk-title { flex: 1 1 auto; min-width: 0; }
.rk-title h2 { margin: 0; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-title p { margin: 2px 0 0; color: var(--muted); font-weight: 800; font-size: 0.92rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-sublink { position: relative; color: var(--blue-ink); font-weight: 800; }
.rk-sublink::after { content: ""; position: absolute; inset: -12px -6px; }
.rk-stars { flex: none; display: flex; gap: 2px; }
.rk-star .px-icon { display: block; width: 22px; height: 22px; }
.rk-star:not(.on) .px-icon { filter: grayscale(1); opacity: 0.35; }
.rk-corner { flex: none; }
.rk-corner .px-icon { display: block; width: 32px; height: 32px; }
/* the main button and the lesson length under it: the same as on Heute (.today-go) */
.rk-act { padding-top: 10px; }
.rk-go { text-align: center; }

.rk-body { flex: 1 1 auto; min-height: 0; padding: 4px 16px 20px; border-top: 2px solid var(--line); display: flex; flex-direction: column; }
.rk-js .rk-body { overflow-y: auto; overscroll-behavior: contain; }
.rk-js .rk-sheet[data-state="peek"] .rk-body { visibility: hidden; }
.rk-js .rk-sheet.rk-drag .rk-body { visibility: visible; } /* dragged up from peek: the content comes along */
.rk[data-mode="neu"] .rk-city { order: -1; } /* the first visit: the city before the plan */
.rk-sec { margin-top: 16px; }
.rk-h { margin: 0 0 8px; } /* the small label (Cards & chips) */
.rk-h-link { display: inline-flex; align-items: center; min-height: var(--tap); margin: -12px 0 -8px; color: var(--blue-ink); text-decoration: none; }
.rk-text { margin: 0; font-weight: 600; }
.rk-plan, .rk-lvls { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
/* the rows, their picture tiles and arrows: the row (Cards & chips) */
.rk-row, .rk-lvl { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding-block: 8px; padding-inline: 10px 14px; text-decoration: none; font-weight: 700; }
.rk-quests { margin-top: 8px; }
.rk-mail .rk-ico { background: var(--yellow-light); }
.rk-txt { flex: 1 1 auto; min-width: 0; }
.rk-streak { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; font-weight: 800; }
.rk-streak .px-icon { width: 24px; height: 24px; }
.rk-body .week-strip { margin: 0; }
.rk-mail { flex-wrap: wrap; }
.rk-mail form { margin: 0; margin-inline-start: auto; }
.rk-more { display: inline-flex; align-items: center; min-height: var(--tap); margin-top: 4px; font-size: 0.92rem; }
.rk-city .progress { margin-top: 12px; }
.rk-meta { margin: 6px 0 0; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.rk-known-form { margin: 8px 0 0; }
.rk-known { display: inline-flex; align-items: center; min-height: var(--tap); }
.rk-lvl.on { border-color: var(--ink); }
.rk-lvl.locked { color: var(--muted); }
.rk-lv { position: relative; width: 48px; font-weight: 1000; white-space: nowrap; }
.rk-lv .px-icon { position: absolute; top: -5px; inset-inline-end: -5px; width: 16px; height: 16px; filter: grayscale(1); opacity: 0.6; } /* the lock sits on the corner: every title starts at the same x */
.rk-lv-end .px-icon { display: block; width: 22px; height: 22px; }
.rk-legal { margin: 24px 0 0; text-align: center; font-size: 0.82rem; color: var(--muted); font-weight: 700; }
.rk-legal a { display: inline-block; padding: 12px 6px; color: var(--muted); }

/* the tones: gold (day done, level done), red (boss) */
.rk:is([data-mode="gold"], [data-mode="sieg"]) .rk-sheet { border-color: var(--yellow); border-top-width: 3px; }
.rk:is([data-mode="gold"], [data-mode="sieg"]) .rk-title h2 { color: var(--gold-ink); }
.rk:is([data-mode="gold"], [data-mode="sieg"]) .rk-body { border-top-color: var(--yellow); }
.rk[data-mode="boss"] .rk-sheet { border-color: var(--red); border-top-width: 4px; }
.rk[data-mode="boss"] .rk-title h2 { color: var(--red-ink); }
.rk[data-mode="boss"] .rk-body { border-top-color: var(--red); }

@media (max-width: 380px) {
  .rk-chip { padding: 0 12px; }
}

/* wide screens and phones held sideways: the sheet is a fixed panel on the right (the same query is in journey.js) */
@media (min-width: 960px), (min-width: 700px) and (max-height: 520px) {
  .rk { --rk-panel: 340px; }
  .rk-sheet, .rk-js .rk-sheet { top: 0; inset-inline-start: auto; width: var(--rk-panel); height: auto; max-height: none; overflow-y: auto; overscroll-behavior: contain; border: 0; border-inline-start: 2px solid var(--line); border-radius: 0; box-shadow: none; transition: none; }
  .rk:is([data-mode="gold"], [data-mode="sieg"]) .rk-sheet { border-inline-start: 3px solid var(--yellow); }
  .rk[data-mode="boss"] .rk-sheet { border-inline-start: 4px solid var(--red); }
  .rk .rk-handle { display: none; }
  .rk-main, .rk:not(.rk-js) .rk-main { padding-top: 20px; }
  .rk-title h2, .rk-title p { white-space: normal; }
  .rk-js .rk-main { touch-action: auto; }
  .rk-body, .rk-js .rk-body { flex: none; overflow: visible; }
  .rk-js .rk-sheet[data-state] .rk-body { visibility: visible; }
  .rk-tools { position: absolute; z-index: 5; top: 64px; inset-inline-end: calc(12px + var(--rk-panel)); display: grid; gap: 8px; }
  .rk-card, .rk:not(.rk-js) .rk-card { top: auto; inset-inline-start: 16px; inset-inline-end: auto; bottom: 16px; width: 340px; max-width: calc(100% - var(--rk-panel) - 32px); }
}
@media (min-width: 1200px) { .rk { --rk-panel: 380px; } }

/* ---------- Right to left (Arabic; scripts/I18N.md section 9) ----------
   The shared rules above use logical properties (inline start/end), so a right-to-left page mirrors by itself. Below
   only what a logical property cannot say (rotations, transforms, background positions, gradients), what stays left
   to right inside an Arabic page, and the Arabic type. Every rule is under [dir="rtl"] or :lang(ar): German and
   English pages never match them. */
[dir="rtl"] { --to-end: -1; } /* keyframes that slide in from the inline end (ob-in) */
/* things that point somewhere point the other way; pictures of real objects (speaker, pencil, map, buddies) never mirror */
[dir="rtl"] .rtl-flip { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .row-chev, [dir="rtl"] a.game-row::after, [dir="rtl"] .today-item.goes::before { transform: rotate(135deg); }
[dir="rtl"] .row-chev.back { transform: rotate(-45deg); }
[dir="rtl"] .switch input:checked + span::before { transform: translateX(-24px); }
[dir="rtl"] :is(.lib-filters, .form-ui) select:not([multiple]) { background-position: left 14px center; }
[dir="rtl"] .btn.intro-go.auto::after { transform-origin: right center; }
[dir="rtl"] .postcard .stamp { transform: rotate(-4deg); }
@media (max-width: 480px) { [dir="rtl"] .level-pills { -webkit-mask-image: linear-gradient(to left, #000 86%, transparent); mask-image: linear-gradient(to left, #000 86%, transparent); } }
@media (min-width: 960px) { [dir="rtl"] .word-pop { left: calc(50% - var(--side-w) / 2); } }
[dir="rtl"] .rk .flyover-banner { left: calc(50% + var(--rk-panel) / 2); }
/* stays left to right: the map (geography; the chips, sheet and card around it follow the page), German content
   (lang="de" from a script; the server's own marks carry dir="ltr"), the sentence tiles and their row, typed answers
   and their letters, the der/die/das choices, grammar tables, the reading text, e-mail, password and code fields */
[dir="rtl"] :is(.map-svg, .rk-say) { direction: ltr; } /* (the buddy's bubble on the map is part of the map, its line German) */
[dir="rtl"] [lang|="de"]:not([dir]) { direction: ltr; unicode-bidi: isolate; }
/* ... but lined up with the page: German that has no alignment of its own takes its parent's (start = right), not
   left (zero specificity: a rule that centres it still wins) */
:where([dir="rtl"] [lang|="de"]) { text-align: -webkit-match-parent; text-align: match-parent; }
[dir="rtl"] :is(.tile-answer, .tile-bank, .type-row, .choice-grid.article, .umlauts, .gram-scroll, .reading-paper, .options[dir="ltr"]) { direction: ltr; }
[dir="rtl"] :is(input[type="email"], input[type="password"], input[data-reveal], .pw-field input, input[name="code"], input[autocomplete="one-time-code"], input[inputmode="numeric"]) { direction: ltr; }
/* an empty field shows its Arabic hint from the right; typing starts left to right again */
:lang(ar) :is(input[type="email"], input[type="password"], input[data-reveal], .pw-field input, input[name="code"], input[autocomplete="one-time-code"], input[inputmode="numeric"]):placeholder-shown { direction: rtl; }
/* a number with its unit or sign that stands alone ("+15", "3/5"): one left-to-right piece */
[dir="rtl"] :is(.xp-fly, .xp-counter, .combo-badge, .rk-n, .count-dot, .clip-count, .result-tile .val, .rr-gain, .claimed-tag) { unicode-bidi: isolate; direction: ltr; }

/* Arabic type: the joined letters take no letter-spacing or word-spacing (the uppercase look does nothing to them),
   no faked bold (Baloo Bhaijaan 2 stops at 800), and taller lines than Nunito's, so no mark is clipped */
:lang(ar) { letter-spacing: normal !important; word-spacing: normal !important; font-synthesis: none; }
:lang(ar) :is(h1, h2, h3, .card-title) { line-height: 1.4; }
:lang(ar) .btn { line-height: 1.45; padding-block: 8px; }
:lang(ar) :is(.chip, .status-chip, .plan-chip, .rk-chip, .label-s, .rows-title, .rk-h, .rk-card-state, .kind-tag, .badge-pill) { line-height: 1.5; }
:lang(ar) :is(.rk-title h2, .rk-title p, .row-group .row-value, .rk-txt b, .rk-txt small, .today-item .t-text :is(strong, .t-link, small), .game-row .game-text :is(strong, small, > span)) { line-height: 1.55; }
/* white letters on green or red: the rim is drawn below and softly around, not as a hard 1px outline on every side,
   which smears the thin Arabic strokes */
:lang(ar) .btn, :lang(ar) :is(.level-pill.active, .cal-day.l3 i, .cal-day.l4 i, .buddy-card .tag, .skin-on, .word-pop .pop-row button) { text-shadow: 0 1px 0 var(--rim), 0 2px 0 var(--rim), 0 0 2px var(--rim); }
:lang(ar) :is(.btn-white, .btn-ghost, .link-btn, .btn:disabled, .btn[aria-disabled="true"]) { text-shadow: none; }
/* the tab bar: one line per label ("الملف الشخصي" would wrap and be cut by the bar) */
:lang(ar) .tabbar { grid-template-columns: repeat(5, minmax(min-content, 1fr)); } /* the longest label takes a little more */
:lang(ar) .tabbar a { white-space: nowrap; line-height: 1.3; font-size: 0.75rem; }
[dir="rtl"] .reading-paper { text-align: left; } /* a German text reads as a German page */
/* the word card on a phone (all three languages): its picture gives way on a short screen, so the two hear buttons
   stay above the corner buddy and the tap-to-hear pill (longer English labels, taller Arabic lines) */
@media (max-width: 899px) {
  .lesson[data-step="intro"] :is(.wc-img, .pw-pic, .pc-photo, .tc-art) { max-width: clamp(96px, calc(100vh - 590px - var(--clear, 0px)), calc(34vh - var(--clear, 0px))); max-width: clamp(96px, calc(100dvh - 590px - var(--clear, 0px)), calc(34vh - var(--clear, 0px))); }
}
