:root {
  --page: #0f1613; --board: #1d2b27; --panel: #22322d; --edge: #3a5047;
  --chalk: #ece8dc; --dim: #9aaba3; --faint: #5d7068;
  --task: #f0b45a; --quiz: #86c9e8; --good: #8fd6b0; --bad: #f08c7a;
  --ui: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--page); }
body { color: var(--chalk); font: 26px/1.4 var(--ui); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--task); outline-offset: 3px; }
button[hidden] { display: none; }

/* One fixed 1600×960 frame (900 stage + 60 controls), scaled to fit the window. */
#frame { position: absolute; left: 50%; top: 50%; width: 1600px; height: 960px; transform: translate(-50%, -50%) scale(var(--k, .5));
  border-radius: 20px; overflow: hidden; background: var(--board); box-shadow: 0 0 0 1px var(--edge), 0 30px 80px rgba(0, 0, 0, .45); }
#stage { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; display: block; }
#ui { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; pointer-events: none; }
#ui > * { pointer-events: auto; }

.cover { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; display: grid; place-items: center; background: rgba(15, 22, 19, .5); border: 0; }
.cover[hidden] { display: none; }
.cover > div { display: flex; flex-direction: column; align-items: center; }
/* Das Zeichen des Baeren ueber dem Kapiteltitel. Es ist das gleiche Zeichen,
   das die Titelkarte der ersten Marke zeigt -- auf der Vorderseite des
   Kapitels steht es ueber dem Titel, damit der Leser das Buch wiedererkennt,
   bevor die Lektion losgeht. */
.cover-mark { width: 132px; height: 132px; margin: 0 0 30px; object-fit: contain;
  filter: drop-shadow(0 16px 20px rgba(0, 0, 0, .55)); }
.cover-k { margin: 0 0 10px; text-align: center; font-size: 22px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--quiz); }
.cover-t { margin: 0 0 44px; max-width: 1200px; text-align: center; font: 500 64px/1.15 "Iowan Old Style", Palatino, Georgia, serif; color: var(--chalk); text-wrap: balance; }
.cover > div > * { animation: rise .7s cubic-bezier(.2, .8, .2, 1) backwards; }
.cover-t { animation-delay: .08s; }
.cover .go { animation-delay: .18s; }
.cover small { animation-delay: .26s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.cover .go { display: inline-flex; align-items: center; gap: 16px; padding: 20px 40px; border-radius: 999px; background: var(--chalk); color: var(--board); font-weight: 600; font-size: 32px; }
.cover small { display: block; margin-top: 22px; font-size: 22px; text-align: center; color: var(--dim); }
/* The publisher line, appended to the cover text by credit() in brand.js. Quieter than
   the line above it and one step smaller — it is a colophon, not an instruction. */
.cover .credit { display: block; margin-top: 16px; font-size: 19px; color: var(--faint); letter-spacing: .02em; }
.cover .credit b { font-weight: 600; color: var(--dim); }
/* The pause mark. It used to stand in the middle of the picture, right on the figure or on the title. In full screen that is the middle of the screen: the reader paused, and the picture they wanted to look at is covered. Damian noticed this on winkel/ch03 on 10.11.2026. The mark now stands at the bottom of the picture, just above the control strip, so the drawing stays clear. A question beat never shows it - the engine hides the mark while a question is on the stage - so no card is covered either. */
.paused-mark { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; display: none; place-items: end center; padding-bottom: 12px; pointer-events: none; }
.paused .paused-mark { display: grid; }
.paused-mark div { padding: 10px 26px; border-radius: 999px; background: rgba(15, 22, 19, .85); color: var(--dim); font-size: 20px; }
/* The CC caption floats just above the control strip as well. While the pause mark stands there, the caption moves up, so the two do not lie on top of each other. */
.paused .caption { bottom: 132px; }
/* Die Leertaste gibt es auf dem Telefon nicht. Dort tippt man. Zwei Saetze fuer
   zwei Geraete, statt eines, der auf dem Telefon ins Leere zeigt. */
.paused-mark .for-touch { display: none; }

/* Question cards inside the picture. */
.card { position: absolute; padding: 20px 26px; border-radius: 20px; background: rgba(34, 50, 45, .97); border: 1.5px solid var(--edge); border-left: 7px solid var(--quiz); box-shadow: 0 14px 44px rgba(0, 0, 0, .35); }
/* Local fix (diverges from upstream engine.css): an `auto` body track sizes to max-content
   and never yields, so three long option pills starved the `1fr` prompt column down to its
   minimum width — the prompt then wrapped one word per line and the card grew ~750px tall,
   running off the bottom of the frame and under the control bar. Bound the body so it wraps
   instead of crushing the prompt, and give the prompt a floor. */
.card.band { display: grid; grid-template-columns: auto minmax(260px, 1fr) minmax(0, 1.15fr) auto; grid-template-areas: "pic head body acts" "pic fb body acts"; column-gap: 28px; align-items: center; align-content: center; min-height: 150px; }
.band .mascot { grid-area: pic; }
.band .head { grid-area: head; align-self: end; }
.band .fb { grid-area: fb; align-self: start; }
.band .body { grid-area: body; min-width: 0; }
.band .acts { grid-area: acts; }
/* A BAND card sits at y=686 in a 900-tall stage, so it has 214px before the control strip.
   A long prompt wrapping to three lines at the default 28px type overran that and slid
   under the controls. The head column is widened so the prompt wraps less, and the band
   type is trimmed to match — the card still reads at 1600px wide. */
.card.band { padding: 13px 24px; }
/* The engine anchors a BAND card to the stage at top: 686px, so it grows downward —
   and a card that grows when it answers you (the feedback line is added to a card
   that was already sized) slid under the control strip only after the reader had
   committed an answer. Anchor it to the bottom of the stage instead so it grows up
   into the empty space above. `top` is inline from card(), hence !important. */
.card.band { top: auto !important; bottom: 0; max-height: 880px; }
.band .keys { margin-top: 2px; font-size: 16px; }
.band .head { grid-area: head; align-self: end; }
.band .prompt { font-size: 25px; line-height: 1.28; }
.band .kicker { font-size: 18px; margin-bottom: 2px; }
.band .opt { min-height: 44px; padding: 5px 18px; font-size: 22px; }
.band .fb { margin-top: 4px; font-size: 21px; }
.side .mascot { float: right; margin: -2px -4px 6px 10px; }
.kicker { margin: 0 0 4px; font-size: 20px; font-weight: 600; color: var(--quiz); }
.prompt { margin: 0; font-size: 28px; line-height: 1.35; }
.side .prompt { font-size: 24px; }
.body:empty { display: none; }
.side .body { margin-top: 14px; }
.opts { display: flex; gap: 12px; flex-wrap: wrap; }
.opt { padding: 8px 24px; border-radius: 999px; border: 2px solid var(--edge); background: transparent; color: var(--chalk); font-size: 24px; min-height: 58px; display: inline-flex; align-items: center; max-width: 100%; }
.opt:hover:not(:disabled) { border-color: var(--dim); }
.opt[aria-pressed="true"] { background: var(--c, var(--chalk)); border-color: var(--c, var(--chalk)); color: #1b2320; font-weight: 600; }
.opt.good { border-color: var(--good); box-shadow: 0 0 0 3px rgba(143, 214, 176, .35); }
.opt.bad { border-color: var(--bad); color: var(--bad); }
.opt:disabled { cursor: default; }
.fb { margin-top: 8px; font-size: 22px; line-height: 1.4; color: var(--chalk); }
.fb:empty { display: none; }
.fb.ok::before { content: "✓ "; color: var(--good); font-weight: 700; }
.fb.no::before { content: "✗ "; color: var(--bad); font-weight: 700; }
.fb ul { margin: 6px 0 0; padding-left: 22px; }
.side .fb { max-height: 110px; overflow: auto; font-size: 20px; }
.acts { display: flex; gap: 12px; align-items: center; }
.side .acts { margin-top: 16px; }
.side .acts { flex-wrap: wrap; gap: 10px; }
.side .btn { padding: 8px 16px; font-size: 20px; }
.card.side { padding: 18px 22px; }
.btn { padding: 10px 28px; border-radius: 999px; border: 0; background: var(--chalk); color: var(--board); font-weight: 600; font-size: 22px; white-space: nowrap; }
.btn.quiet { background: transparent; color: var(--dim); border: 1.5px solid var(--edge); }
.btn.go { background: var(--quiz); color: #10242e; }
.btn:disabled { background: var(--edge); color: var(--dim); cursor: default; }

.grid .row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 34px; gap: 16px; align-items: center; padding: 5px 0 5px 12px; border-bottom: 1px solid #2e433b; }
.grid .num { display: flex; justify-content: flex-end; align-items: center; font-size: 26px; }
.grid.text .row { grid-template-columns: minmax(0, 1fr) auto 34px; }
.grid.text .num { justify-content: flex-start; }
.grid .opts { gap: 8px; }
.grid .opt { padding: 3px 16px; min-height: 42px; font-size: 20px; }
.grid .mark { font-weight: 700; text-align: center; }
.grid .mark.good { color: var(--good); }
.grid .mark.bad { color: var(--bad); }
.grid .why { grid-column: 1 / -1; font-size: 19px; color: var(--dim); padding-left: 186px; }
.grid.text .why { padding-left: 0; }
.grid .why:empty { display: none; }

.hit { cursor: pointer; }
.hit .ring { fill: transparent; stroke: var(--chalk); stroke-width: 2.5; stroke-opacity: 0; }
.hit:hover .ring, .hit:focus .ring { stroke-opacity: .7; }
.hit.bad .ring { stroke: var(--bad); stroke-opacity: 1; }
.hit.good .ring { stroke: var(--good); stroke-opacity: 1; stroke-width: 4; }
.tok { cursor: grab; }

/* Controls strip, part of the frame. */
#bar { position: absolute; left: 0; top: 900px; width: 1600px; height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 20px; background: #16211d; border-top: 1px solid #2a3b35; }
.icon { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--edge); background: var(--panel); display: grid; place-items: center; flex: none; padding: 0; }
.icon svg { width: 18px; height: 18px; fill: var(--chalk); }
.icon .i-pause { display: none; }
.is-playing .icon .i-play { display: none; }
.is-playing .icon .i-pause { display: block; }
.segs { flex: 1; display: flex; gap: 4px; height: 30px; align-items: center; min-width: 0; margin: 0 8px; }
.seg { position: relative; display: block; min-width: 0; height: 8px; border-radius: 4px; background: #2f4640; border: 0; padding: 0; overflow: hidden; }
.seg:hover { height: 12px; }
.seg i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--chalk); }
.seg.ask { background: #2d4a57; }
.seg.ask i { background: var(--quiz); }
.step { width: 300px; flex: none; color: var(--dim); font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.volume { display: flex; align-items: center; flex: none; width: 44px; height: 44px; overflow: hidden;
  border: 1px solid var(--edge); border-radius: 999px; background: var(--panel); color: var(--chalk); transition: width .18s ease; }
.volume .icon { width: 42px; height: 42px; border: 0; background: transparent; }
.volume:hover, .volume:focus-within { width: 166px; gap: 10px; padding-right: 12px; }
.volume:hover { background: #2b3f36; border-color: var(--faint); }
.volume:has(:focus-visible) { outline: 2px solid var(--task); outline-offset: 3px; }
.volume .icon:focus-visible { outline: none; }
.volume input { appearance: none; flex: none; width: 0; height: 42px; margin: 0; opacity: 0; background: transparent; cursor: pointer; }
.volume:hover input, .volume:focus-within input { width: 100px; opacity: 1; }
.volume input:focus-visible { outline: none; }
.volume input::-webkit-slider-runnable-track { height: 4px; border-radius: 999px;
  background: linear-gradient(to right, var(--chalk) var(--volume, 100%), var(--faint) var(--volume, 100%)); }
.volume input::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4px; border: 0; border-radius: 50%; background: var(--chalk); }
.volume input::-moz-range-track { height: 4px; border-radius: 999px; background: var(--faint); }
.volume input::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--chalk); }
.volume input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--chalk); }
/* Keep the control strip usable without scaling down its touch targets. */
@media (max-width: 700px) {
  #frame { top: calc(50% - 50px); overflow: visible; }
  #bar { width: calc(1600px * var(--k)); height: auto; flex-wrap: wrap; gap: 6px; padding: 8px;
    transform: scale(calc(1 / var(--k))); transform-origin: left top; border-radius: 0 0 12px 12px; }
  #bar .icon { width: 36px; height: 40px; }
  .step { display: none; }
  .volume { width: 36px; height: 40px; }
  #bar .volume .icon { width: 34px; height: 38px; }
  .volume:hover, .volume:focus-within { width: 158px; }
  .volume input { height: 38px; }
  .segs { order: 1; }
  .segs { min-width: 80px; margin: 0; }

  /* Blase und Tonhinweis liegen ueber der Buehne. Auf dem Telefon ist die
     Buehne auf ein Drittel verkleinert: beide waren unlesbar klein, und die
     Blase lag mitten auf dem Text der Lektion. Die Groesse wird deshalb
     durch den Verkleinerungsfaktor geteilt -- sie bleibt auf dem Schirm
     gleich gross, egal wie klein die Buehne ist -- und die Blase rueckt nach
     unten, wo die Lektion ihre Zeichen nicht hat. */
  .paused-mark { place-items: end center; padding-bottom: 16px; }
  .paused-mark .for-key { display: none; }
  .paused-mark .for-touch { display: inline; }
  .paused-mark div {
    font-size: calc(15px / var(--k, .4));
    line-height: 1.3;
    padding: calc(9px / var(--k, .4)) calc(16px / var(--k, .4));
    border-radius: calc(12px / var(--k, .4));
    max-width: calc(300px / var(--k, .4));
    text-align: center;
  }
  .sound-note {
    font-size: calc(13px / var(--k, .4));
    line-height: 1.35;
    left: calc(10px / var(--k, .4));
    top: calc(10px / var(--k, .4));
    padding: calc(7px / var(--k, .4)) calc(12px / var(--k, .4));
    border-radius: calc(10px / var(--k, .4));
    max-width: calc(290px / var(--k, .4));
  }
}
.sound-note { position: absolute; left: 24px; top: 20px; margin: 0; padding: 8px 18px; border-radius: 12px; background: rgba(15, 22, 19, .85); color: var(--dim); font-size: 19px; }
.sound-note[hidden] { display: none; }
.blanks .brow { padding: 8px 0; border-bottom: 1px solid #2e433b; }
.blanks .brow:last-child { border-bottom: 0; }
.blanks .bline { line-height: 64px; white-space: nowrap; }
.blanks .mark { display: inline-block; margin-left: 14px; font-weight: 700; }
.blanks .mark.good { color: var(--good); animation: pop .35s ease-out; }
.blanks .mark.bad { color: var(--bad); }
.blanks .why { font-size: 19px; color: var(--dim); line-height: 1.35; }
.blanks .why:empty { display: none; }
.box { height: 52px; margin: 0 6px; padding: 0 6px; border: 0; border-bottom: 3px solid var(--quiz); border-radius: 8px 8px 0 0; background: rgba(236, 232, 220, .07); color: var(--chalk); font: 32px "STIX Two Text", "Cambria Math", "Iowan Old Style", Palatino, Georgia, serif; text-align: center; vertical-align: -6px; }
.box:focus { outline: none; background: rgba(134, 201, 232, .16); }
.box.good { border-color: var(--good); }
.box.bad { border-color: var(--bad); }
.box:disabled { opacity: 1; }
kbd { display: inline-block; min-width: 1.5em; padding: 0 .4em; margin-left: .5em; border: 1.5px solid currentColor; border-radius: 6px; font: 600 .7em/1.5 var(--ui); text-align: center; vertical-align: .12em; opacity: .6; }
.opt kbd { margin: 0 .6em 0 0; }
.keys { margin: 6px 0 0; font-size: 18px; color: var(--dim); }
.keys kbd { margin: 0 .15em; }
.grid .row.cur { background: rgba(236, 232, 220, .05); box-shadow: inset 4px 0 var(--quiz); }
.help { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; display: grid; place-items: center; background: rgba(10, 16, 14, .72); }
.help[hidden] { display: none; }
.help-box { width: 1120px; padding: 40px 50px; border-radius: 22px; background: var(--panel); border: 1.5px solid var(--edge); }
.help h2 { margin: 0 0 22px; font-size: 32px; font-weight: 600; }
.help h3 { margin: 0 0 12px; font-size: 20px; font-weight: 600; color: var(--quiz); }
.help-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.help dl { margin: 0; display: grid; grid-template-columns: 150px 1fr; row-gap: 10px; font-size: 22px; }
.help dt { text-align: right; padding-right: 18px; white-space: nowrap; }
.help dt kbd { margin: 0 0 0 .3em; opacity: .9; }
.help dd { margin: 0; color: var(--dim); }
.help-close { margin: 26px 0 0; font-size: 18px; color: var(--dim); }
.icon.txt { font-size: 20px; font-weight: 700; color: var(--dim); }
/* Optional captions of the narration, one sentence at a time. Off by default: teaching text lives in the picture. */
.caption { position: absolute; left: 50%; bottom: 78px; transform: translateX(-50%); width: max-content; max-width: 1180px; padding: 10px 24px; border-radius: 14px; background: rgba(10, 16, 14, .82); color: var(--chalk); font-size: 28px; line-height: 1.35; text-align: center; pointer-events: none; }
.caption[hidden] { display: none; }
.icon.cc { font-size: 15px; font-weight: 700; color: var(--dim); }
.icon.cc[aria-pressed="true"] { background: var(--chalk); border-color: var(--chalk); color: var(--board); }

.card.side { overflow: auto; }
svg.m { display: inline-block; overflow: visible; }
.card { animation: card-in .45s cubic-bezier(.2, .9, .3, 1.15); }
.fb:not(:empty) { animation: fb-in .3s ease-out; }
.opt.bad, .grid .mark.bad { animation: shake .4s; }
.grid .mark.good { animation: pop .35s ease-out; }
@keyframes card-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes fb-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.3); } }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
/* Full-screen chapter practice. */
.card.screen { height: 900px; padding: 50px 70px; border: 0; border-radius: 0; background: transparent; box-shadow: none; animation: screen-in .5s ease-out; max-height: none; overflow: visible; }
.screen .kicker { font-size: 22px; }
.screen .prompt { font-size: 40px; font-weight: 600; }
.screen .body { margin-top: 30px; }
.screen .fb { position: absolute; left: 70px; bottom: 56px; max-width: 1080px; margin: 0; font-size: 24px; }
.screen .acts { position: absolute; right: 70px; bottom: 48px; }
.screen .grid .row { grid-template-columns: 200px minmax(0, 1fr) 40px; padding: 9px 0 9px 12px; }
.screen .grid.text .row { grid-template-columns: minmax(0, 1fr) auto 40px; }
.screen .grid .opt { font-size: 22px; min-height: 50px; padding: 4px 20px; }
.screen .grid .why { padding-left: 216px; font-size: 20px; }
.screen .grid.text .why { padding-left: 0; }
#ui > .screen.sort { pointer-events: none; }
.screen.sort > * { pointer-events: auto; }
.screen.sort .head { position: absolute; right: 34px; top: 40px; width: 330px; }
.screen.sort .prompt { font-size: 28px; }
.screen.sort .fb { left: auto; right: 34px; bottom: 116px; width: 330px; max-height: 240px; overflow: auto; font-size: 20px; }
.screen.sort .acts { right: 34px; }
.card.screen.fin { overflow-y: auto; }
.fin .finwrap { display: flex; flex-direction: column; align-items: center; justify-content: safe center; height: 100%; text-align: center; padding-bottom: 60px; }
.fin .mascot { margin-bottom: 28px; }
.fin .fb, .fin .acts { position: static; }
.fin .acts { margin-top: 30px; }
/* The chapter workbook's report: the score and the section breakdown side by side,
   with the assessment underneath, left-aligned against a rule so the eye can find it. */
.wb-top { display: flex; align-items: center; justify-content: center; gap: 52px; margin-bottom: 4px; }
.wb-left { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wb-score { display: flex; align-items: baseline; gap: 10px; }
.wb-score b { font: 500 72px/1 var(--ui); color: var(--task); letter-spacing: -.02em; }
.wb-score span { color: var(--dim); font-size: 18px; }
.wb-left .fb { position: static; margin: 0; font-size: 20px; }
.wb-tiers { display: flex; gap: 8px; margin-top: 10px; }
.wb-tiers span { font-size: 16px; color: var(--dim); border: 1px solid var(--edge); border-radius: 999px; padding: 3px 12px; }
.wb-right { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; text-align: left; min-width: 320px; }
.wb-right .kicker { margin: 0; }
.wb-row { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 16px; width: 100%; }
.wb-row b { font-weight: 600; font-size: 24px; }
.wb-row span { color: var(--dim); font-size: 20px; }
.wb-row i { font-style: normal; font-size: 16px; }
.wb-tick { color: var(--good); }
.wb-dash { color: var(--faint); }
.wb-verdict { max-width: 60em; margin: 10px 0 12px; font-size: 22px; }
.wb-beurteilung { max-width: 62em; margin: 0 0 16px; font-size: 21px; line-height: 1.5; }
.wb-beurteilung p { margin: 2px 0; }
.wb-advice { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.45fr); gap: 36px; width: min(1120px, 100%); text-align: left; }
.wb-col { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.wb-advice .kicker { margin: 0; }
.wb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wb-chips span { font-size: 17px; color: var(--good); border: 1px solid var(--good); border-radius: 999px; padding: 4px 13px; }
.wb-none { margin: 0; color: var(--dim); font-size: 19px; line-height: 1.45; }
.wb-fix { width: 100%; border-left: 3px solid var(--task); padding-left: 15px; }
.wb-fix b { font-weight: 600; font-size: 20px; }
.wb-fix p { margin: 3px 0; color: var(--dim); font-size: 19px; line-height: 1.45; }
.wb-fix span { font-size: 16px; color: var(--faint); }
.wb-fix a.wb-back { font-size: 16px; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; }
.wb-fix a.wb-back:hover { color: var(--chalk); }
@media (max-height: 700px) { .wb-score b { font-size: 56px; } .wb-fix p { font-size: 17px; } }
/* Zwei Spalten brauchen Platz. Auf einem schmalen Bildschirm stehen sie
   untereinander, sonst wuerde der Ratgeber zusammengequetscht. */
@media (max-width: 820px) { .wb-advice { grid-template-columns: 1fr; gap: 22px; } }
@keyframes screen-in { from { opacity: 0; } }

/* The guide: an infinity sign whose loops are its eyes. */
.mascot { display: block; flex: none; overflow: visible; }
.mascot .mbody { transform-box: view-box; transform-origin: 60px 46px; animation: bob 3.4s ease-in-out infinite; }
.mascot .eyes { transition: transform .3s; }
.mascot .pupil { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
.mascot .joy, .mascot .flat { display: none; }
.mascot.happy .pupil { display: none; }
.mascot.happy .joy { display: inline; }
.mascot.happy .mbody { animation: hop .55s ease-out 2, bob 3.4s ease-in-out 1.1s infinite; }
.mascot.oops .eyes { transform: translate(-3px, 4px); }
.mascot.oops .smile { display: none; }
.mascot.oops .flat { display: inline; }
.mascot.oops .mbody { animation: wobble .5s ease-in-out, bob 3.4s ease-in-out .5s infinite; }
/* Our bear winks, because the logo does. The wink holds until the bear has an
   opinion about the answer, then the eye becomes a pupil like the other one. */
.mascot .wink { display: inline; }
.mascot .winkeye { display: none; transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
.mascot.happy .wink, .mascot.oops .wink { display: none; }
.mascot.happy .winkeye, .mascot.oops .winkeye { display: inline; }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-2deg); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes hop { 40% { transform: translateY(-12px) rotate(4deg); } }
@keyframes wobble { 25% { transform: rotate(-8deg); } 75% { transform: rotate(6deg); } }

/* The celebration for a right answer: a few stars fly out of the place where
 * the word "Richtig" appears, and the guide cheers with them. */
.sparkles { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 6; }
.spark { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; opacity: 0; clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%); animation: spark .95s cubic-bezier(.2, .7, .3, 1) forwards; animation-delay: var(--delay, 0ms); }
.confetti-rain { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 7; }
.confetti { position: absolute; top: -14px; width: 7px; height: 12px; border-radius: 2px; opacity: 0; animation: confetti 1.7s cubic-bezier(.25, .6, .45, 1) forwards; animation-delay: var(--delay, 0ms); }
@keyframes confetti {
  0% { opacity: 0; transform: translateY(-14px) rotate(0deg); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translateY(var(--fall, 420px)) rotate(var(--spin, 540deg)); }
}
@keyframes spark {
  0% { opacity: 0; transform: translate(0, 0) scale(.4); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.15) rotate(var(--rot)); }
}
.mascot.celebrate .mbody { animation: cheer .85s ease-out, bob 3.4s ease-in-out .85s infinite; }
@keyframes cheer {
  0% { transform: translateY(0) rotate(0deg); }
  28% { transform: translateY(-24px) rotate(-7deg); }
  58% { transform: translateY(0) rotate(6deg); }
  82% { transform: translateY(-9px) rotate(-3deg); }
  100% { transform: translateY(0) rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) { .volume { transition: none; } .card, .fb, .opt, .grid .mark, .mascot * { animation: none !important; } .spark { animation: none !important; opacity: .7 !important; transform: translate(var(--dx), var(--dy)) !important; } .confetti { animation: none !important; opacity: .45 !important; } }

a.icon { text-decoration: none; }
a.btn { text-decoration: none; display: inline-block; }
/* Page-to-page motion: the contents card grows into this frame, and shrinks back on the way out. */
@view-transition { navigation: auto; }
#frame { view-transition-name: lesson; }
::view-transition-group(lesson) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(lesson), ::view-transition-new(lesson) { height: 100%; object-fit: cover; }
::view-transition-old(lesson) { animation-duration: .18s; }
@media (prefers-reduced-motion: reduce) { .cover > div > * { animation: none; } ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }
/* The finish screen speaks the same type as the chapter cover and the contents page. */
.fin .kicker { font-size: 20px; letter-spacing: .14em; text-transform: uppercase; }
.fin .prompt { margin: 6px 0 14px; font: 500 56px/1.15 "Iowan Old Style", Palatino, Georgia, serif; }


/* Der 3D-Baer, der bei einer richtigen Antwort in die Karte springt. Er
   ersetzt den Kreide-Baeren an derselben Stelle und waechst mit einem
   kleinen Sprung in die Karte hinein. */
.celebrate-bear { grid-area: pic; display: block; height: 150px; width: auto; margin: 0 auto;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .5)); animation: bear-pop .55s cubic-bezier(.2, .9, .3, 1.25); }
.side .celebrate-bear { grid-area: auto; float: right; height: 104px; margin: -2px -4px 6px 10px; }
@keyframes bear-pop { 0% { opacity: 0; transform: scale(.45) translateY(18px); } 65% { transform: scale(1.1); } 100% { opacity: 1; transform: scale(1); } }
