/* Shared completion dialog and loading state for student pages and the teacher's try-out. */
.player-done { width: min(420px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 0; border-radius: 22px;
  background: #fff; color: #172238; box-shadow: 0 24px 80px rgb(16 22 39 / 30%); }
.player-done::backdrop { background: rgb(16 22 39 / 65%); }
.player-done[open] { animation: done-enter 220ms cubic-bezier(.23, 1, .32, 1) both; }
.player-done-card { display: grid; justify-items: center; gap: 12px; padding: 32px 28px 26px; text-align: center; }
.player-done-mark { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: #e2f6f0; color: #08795e; }
.player-done-mark svg { width: 32px; height: 32px; }
/* The heading takes the focus when the dialog opens (player-host.mjs), so no button looks chosen. */
.player-done h2:focus { outline: none; }
.player-done h2 { margin: 0; font-size: clamp(27px, 7vw, 34px); line-height: 1.1; letter-spacing: -.03em; }
.player-done p { margin: 0; color: #62687a; font-size: 16px; }
.player-done-place { color: #08795e; font-size: 30px; line-height: 1.15; }
.player-done-place[hidden] { display: none; }
.player-done-close, .player-done-next, .player-done-again { min-height: 48px; margin-top: 12px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--tool, #3b6fd8); color: #fff;
  font: inherit; font-weight: 700; cursor: pointer; transition: transform 140ms cubic-bezier(.23, 1, .32, 1); }
.player-done-close:active, .player-done-next:active, .player-done-again:active { transform: scale(.97); }
.player-done-close:focus-visible, .player-done-next:focus-visible, .player-done-again:focus-visible { outline: 3px solid #1f63b0; outline-offset: 3px; }
.player-done-next + .player-done-close { margin-top: 0; }
/* Mit Ersatzwert: --tool gibt es nur auf der Schülerseite (student.css). Im Beispiel-Dialog der
   Lehrerseite war der Knopf sonst durchsichtig mit weißer Schrift, also unsichtbar. */
.player-done-close.is-quiet { background: transparent; color: var(--tool-dark, #2f5bb0); }
/* A warm-up: the main button as wide as the row of two outlined ones below it. */
.player-done-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.player-done-pair > button { min-height: 46px; margin-top: 0; padding: 4px 8px; border: 1.5px solid #cfd6ea; background: transparent; color: var(--tool-dark, #2f5bb0); font-size: 14px; line-height: 1.15; }
.player-done-card:has(.player-done-pair) .player-done-next { width: 100%; min-height: 54px; font-size: 18px; }
@keyframes done-enter { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .player-done[open] { animation: none; } }
/* Loading state like the other Mentio tools: the Mentio mark breathing, text below. */
.play-page .loading { display: grid; place-items: center; align-content: center; gap: 16px; min-height: 70vh; padding: 24px; color: #65697d; text-align: center; }
.play-page .loading p { margin: 0; }
.play-page .loading img { animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.96); opacity: .72; } }
@media (prefers-reduced-motion: reduce) { .play-page .loading img { animation: none; } }

/* Start screen in front of a game (game-splash.mjs): the game says its name and what it wants, the
   ring fills while it stands, then the board takes over. --game, --game-soft, --ring and
   --splash-seconds are set per element – the CSP of this tool forbids style attributes in markup. */
.game-splash { display: grid; align-content: center; justify-items: center; gap: 14px; min-height: min(58vh, 430px);
  padding: 32px 20px 40px; text-align: center; animation: game-splash-enter 260ms cubic-bezier(.23, 1, .32, 1) both; }
.game-splash-eyebrow { margin: 0; color: #65697d; font-size: 14px; font-weight: 650; }
.game-splash-ring { position: relative; display: grid; place-items: center; width: 80px; height: 80px; }
/* Only the ring's own drawing, never the symbol's svg inside it: that one keeps its place in the
   middle. Turned so the ring starts at twelve o'clock, like the step ring in the header. */
.game-splash-ring > svg { position: absolute; inset: 0; rotate: -90deg; }
.game-splash-track { fill: none; stroke: var(--game-soft); stroke-width: 5; }
/* One arc that grows from nothing to the full circle in exactly the time the screen stands. */
.game-splash-arc { fill: none; stroke: var(--game); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: var(--ring); stroke-dashoffset: var(--ring); animation: game-splash-fill var(--splash-seconds) linear var(--splash-delay, 0s) forwards; }
@keyframes game-splash-fill { to { stroke-dashoffset: 0; } }
.game-splash-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--game-soft); color: var(--game); }
.game-splash-icon svg { width: 26px; height: 26px; }
.game-splash-name { margin: 4px 0 0; color: var(--game); font-size: clamp(26px, 7vw, 30px); line-height: 1.1; letter-spacing: -.02em; }
/* The heading only takes the focus so a screen reader names the game; it is not a control, and a
   ring around it would read as something to tap. Nothing can reach it with the keyboard. Written
   with the element as well, so it outweighs the student page's own ".student :focus-visible". */
.game-splash h2.game-splash-name:focus, .game-splash h2.game-splash-name:focus-visible { outline: none; }
.game-splash-text { max-width: 34em; margin: 0; color: #65697d; font-size: 17px; }
@keyframes game-splash-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Only the arrival is decoration. The ring keeps filling: it says how long this lasts. */
@media (prefers-reduced-motion: reduce) { .game-splash { animation: none; } }

/* Lernpfad: numbered steps on top, the current step below (path-player.mjs). */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The ring is the whole button – one segment per step, the number in the middle, nothing around it.
   The 44px hit area stays, it is only invisible. */
.path-ring { display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--ink); cursor: pointer; }
.path-ring-face { position: relative; display: grid; place-items: center; width: 40px; height: 40px; }
.path-ring-face svg { position: absolute; inset: 0; }
.path-ring-number { position: relative; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.path-ring:hover, .path-ring.is-open { background: var(--page); }
.path-ring:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: none) { .path-ring:hover { background: none; } }

/* The steps as a card over the board: a list grows downwards, so ten steps are no harder than two. */
.path-sheet { position: absolute; inset: -12px 0 auto; z-index: 30; }
.path-sheet::before { content: ""; position: fixed; inset: 0; background: rgb(10 15 31 / 45%); }
.path-sheet-card { position: relative; max-height: min(70dvh, 560px); overflow-y: auto; overflow-x: hidden; padding: 16px 14px 12px; border-radius: 18px;
  background: #fff; box-shadow: 0 20px 60px rgb(21 24 44 / 28%); }
.path-sheet-title { margin: 0 0 2px; font-size: 17px; font-weight: 750; letter-spacing: -0.01em; }
.path-sheet-count { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.path-steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0; padding: 0; list-style: none; }
.path-step { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 10px; border: 0; border-radius: 12px;
  background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.path-step-mark { flex: none; display: grid; place-items: center; width: 28px; height: 28px; box-sizing: border-box;
  border: 2px solid #dfe2ec; border-radius: 50%; color: #a3a7b7; font-size: 13px; font-weight: 700; }
.path-step-mark svg { width: 16px; height: 16px; }
.path-step-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.path-step-text strong { overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.path-step-text span { color: var(--muted); font-size: 13px; }
.path-step-state { flex: none; color: #08795e; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.path-step.is-done .path-step-mark { border-color: #10a37f; background: #e2f6f0; color: #08795e; }
.path-step.is-current { background: var(--accent-soft); }
.path-step.is-current .path-step-mark { border-color: var(--accent); background: var(--accent); color: #fff; }
.path-step.is-current .path-step-state { color: var(--accent-ink); }
.path-step:disabled { color: #a3a7b7; cursor: default; }
.path-step:disabled .path-step-mark { border-style: dashed; }
.path-step:not(:disabled):hover { background: var(--page); }
.path-step:focus-visible { outline: 3px solid var(--accent); outline-offset: -2px; }
.path-stage { position: relative; display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
/* The next game's start screen during the shared countdown, over the finished step. */
.path-presplash { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: center; background: var(--page); }
.path-step-title { margin: 0; font-size: 22px; line-height: 1.25; }
.path-info { display: flex; flex-direction: column; gap: 16px; }
.path-info-text p { margin: 0 0 12px; font-size: 18px; line-height: 1.6; }
.path-info-text p:last-child { margin-bottom: 0; }
/* A text without „Gelesen“: the teacher goes on (the class acts first). */
.path-teacher-goes { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; margin: 0; color: var(--muted); font-size: 15px; font-weight: 600; text-align: center; }
.path-teacher-goes svg { width: 18px; height: 18px; }
/* Sections of an explanation (info-text.mjs): a hairline between them, an optional small heading. */
.info-section + .info-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid #dfe2ec; }
.info-heading { margin: 0 0 4px; color: var(--tool-dark, #2f5bb0); font-size: 13px; font-weight: 700; line-height: 1.3; letter-spacing: .06em; text-transform: uppercase; }
/* An explanation as a designed piece (info-text.mjs textCardHtml): a card with a head (default) or a
   note on lined paper. On the note every line of text is exactly one ruled line high. */
@font-face { font-family: 'Lernen Handschrift'; src: url('/assets/fonts/patrick-hand-latin.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
.text-card.is-card { overflow: hidden; border-radius: 20px; background: #fff; box-shadow: 0 1px 2px rgb(29 29 43 / 6%), 0 8px 24px rgb(29 29 43 / 8%); }
.text-card-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #e4e6ef; }
.text-card-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--tool-soft, #e8eefb); color: var(--tool, #3b6fd8); }
.text-card-icon svg { width: 20px; height: 20px; }
.text-card-title { margin: 0; font-size: 20px; line-height: 1.25; letter-spacing: -.01em; }
.text-card-image { display: block; width: 100%; max-height: 52vh; object-fit: contain; background: var(--page, #f4f5f9); }
.is-card .text-card-body { padding: 16px 18px 18px; }
.text-card.is-note { --zl: 32px; position: relative; margin: 14px 4px 0; padding: 26px 20px 20px; transform: rotate(-1deg);
  background: #fffbe6; box-shadow: 0 6px 16px rgb(60 50 10 / 14%), 0 1px 2px rgb(60 50 10 / 12%); }
.text-card.is-note::before { content: ""; position: absolute; top: -11px; left: 50%; width: 104px; height: 24px; transform: translateX(-50%) rotate(2deg); background: rgb(190 205 235 / 70%); }
.is-note .text-card-title, .is-note .text-card-body p, .is-note .info-heading { margin: 0; font-family: 'Lernen Handschrift', cursive; font-weight: 400; line-height: var(--zl); letter-spacing: 0; text-transform: none; }
/* The heading takes one ruled line of its own; the body's lines start right below it. */
.is-note .text-card-title { font-size: 28px; color: #2b4a8a; box-shadow: inset 0 -1px #ddd5ab; }
.is-note .text-card-image { margin: 10px 0; border-radius: 6px; background: transparent; }
.is-note .text-card-body { background-image: repeating-linear-gradient(transparent 0 calc(var(--zl) - 1px), #ddd5ab calc(var(--zl) - 1px) var(--zl)); }
.is-note .text-card-body p { font-size: 21px; color: #2a2d3c; }
.is-note .info-heading { font-size: 21px; color: #2b4a8a; }
.is-note .info-section + .info-section { margin: 0; padding: 0; border: 0; }
/* "Gelesen" at the end of the text and the waiting line that replaces it: one slot, one height. */
.path-read { display: grid; margin-top: 8px; }
.path-read-ask, .path-read .path-wait { box-sizing: border-box; min-height: 88px; margin-top: 0; }
.path-read-ask { display: grid; align-content: center; gap: 6px; }
.path-read-ask[hidden] { display: none; }
.path-read-ask .button { width: 100%; }
.path-read-ask p { margin: 0; color: #65697d; font-size: 14px; text-align: center; }
/* A Baustein fills the screen below lernen's head; its own head sits inside the frame. */
.path-block { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.path-block-frame { flex: 1 1 auto; width: 100%; min-height: max(440px, 70dvh); border: 1px solid #dfe2ec; border-radius: 18px; background: #fff; }
/* Phone: the Baustein runs edge to edge, its picture uses the whole width (wish of the user). */
@media (max-width: 600px) {
  .path-block-frame { width: calc(100% + 2 * var(--app-gutter, 0px)); margin-inline: calc(-1 * var(--app-gutter, 0px)); border-inline: 0; border-bottom: 0; border-radius: 0; }
  /* … and down to the bottom edge: no page margin and no line below it, only the iPhone's home bar keeps its room. */
  .student-app:has(.path-block-frame) { padding-bottom: env(safe-area-inset-bottom, 0px); }
}
.path-block .path-wait { margin-top: 0; }
.path-next { display: flex; }
.path-next .button { flex: 1; }
.path-next[hidden], .path-error[hidden] { display: none; }
/* The board reaches the bottom of the screen instead of leaving white below it. */
.play-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.path-stage, .path-game, .player-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.path-game > *, .player-stage > * { flex: 1; }
.path-finish { display: grid; justify-items: center; gap: 12px; padding: 32px 0; text-align: center; }
.path-finish-mark { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: #e2f6f0; color: #08795e; }
.path-finish-mark svg { width: 36px; height: 36px; }
.path-finish h2 { margin: 0; font-size: 28px; }
.path-finish p { margin: 0; color: #65697d; }
/* The waiting line: quieter than the result, but it has to be read – nobody should wonder
   why nothing happens after the last step. */
.path-finish-score { display: grid; gap: 2px; }
.path-finish-score[hidden] { display: none; }
.path-finish-score strong { color: #08795e; font-size: 48px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.path-finish-score span { color: #65697d; font-size: 16px; }
.path-finish-wait { max-width: 34ch; padding: 10px 16px; border-radius: 14px; background: #f4f5f9; font-size: 15px; }
.path-wait { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 16px; border-radius: 18px; background: #f0f7ff; color: #26344f; }
.path-wait[hidden] { display: none; }
.path-wait.is-info { margin-top: 24px; }
.path-wait-check { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #dff5ed; color: #08795e; }
.path-wait-check svg { width: 19px; height: 19px; }
.path-wait strong { display: block; }
.path-wait p { margin: 2px 0 0; color: #65697d; font-size: 14px; }
.path-medals { width: 100%; }
.medal-table-head { width: min(100%, 740px); display: grid; grid-template-columns: 32px minmax(0, 1fr) 46px 64px 58px; gap: 8px; padding: 0 12px; color: #65697d; font-size: 11px; font-weight: 700; text-align: center; }
.medal-table-head > span:nth-child(n + 3) { justify-self: end; text-align: right; }
.medal-table { width: min(100%, 740px); margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; text-align: left; }
.medal-table li { display: grid; grid-template-columns: 32px minmax(0, 1fr) 46px 64px 58px; align-items: center; gap: 8px; min-height: 48px; padding: 6px 12px; border: 1px solid #e2e4ec; border-radius: 14px; background: #fff; }
.medal-rank { color: #65697d; font-weight: 750; text-align: center; }
.medal-count { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 12px; font-weight: 800; }
.medal-count.games { background: #eef0f6; color: #4f5668; }
.medal-count.perfect { background: #dff6e9; color: #176b3f; }
.medal-count.games, .medal-count.perfect { justify-self: end; }
.medal-count.points { justify-self: end; width: auto; min-width: 0; height: auto; padding: 0; border-radius: 0; background: transparent; color: #4b3fa5; font-size: 17px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .medal-table-head { display: none; }
  .medal-table li { grid-template-columns: 32px 32px 42px minmax(42px, 1fr); grid-template-rows: auto auto; gap: 6px; }
  .medal-table li > .medal-rank { grid-column: 1; grid-row: 1 / 3; }
  .medal-table li > strong { grid-column: 2 / -1; grid-row: 1; }
  .medal-table li > .medal-count { grid-row: 2; }
  .medal-table li > .games { grid-column: 2; }
  .medal-table li > .perfect { grid-column: 3; }
  .medal-table li > .points { grid-column: 4; justify-self: end; }
}
.path-loading { margin: 24px 0; color: #65697d; text-align: center; }
.path-error { margin: 0; color: #c93643; }
.path-media { display: grid; gap: 16px; }
.youtube-host { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 18px; background: #171923; }
.youtube-placeholder { display: grid; place-items: center; align-content: center; gap: 12px; width: 100%; height: 100%; padding: 24px; color: #fff; text-align: center; }
.youtube-placeholder small { color: #c5c8d5; }
.youtube-start { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px; border: 0; border-radius: 999px; background: #fff; color: #202332; font: inherit; font-weight: 750; cursor: pointer; }
.youtube-start svg { width: 22px; height: 22px; color: #d92d20; }
.youtube-start:focus-visible { outline: 3px solid #8ab4ff; outline-offset: 4px; }
.youtube-frame { display: block; width: 100%; height: 100%; border: 0; }
.youtube-host.is-audio { display: grid; place-items: center; aspect-ratio: auto; min-height: 112px; padding: 22px; background: #f1ebf8; }
.audio-player { width: min(100%, 680px); }
.path-info-image { display: block; width: min(100%, 760px); max-height: 52vh; margin-inline: auto; border-radius: 18px; object-fit: contain; }
.path-beamer-wait { display: grid; justify-items: center; gap: 10px; padding: 38px 20px; border-radius: 20px; background: #f0f4ff; text-align: center; }
.path-beamer-wait > span { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: #dce7ff; color: #315fb5; }
.path-beamer-wait svg { width: 34px; height: 34px; }
.path-beamer-wait h2, .path-beamer-wait p { margin: 0; }
.path-beamer-wait p { color: #65697d; }

/* ---------- Prüf-Fußzeile, gemeinsam für die Bretter ----------
   Links eine milchige Pille mit Stand und Hinweis, rechts der runde Prüfknopf: Vorbild ist die
   Fußzeile von „Paare“ (die noch ihre eigenen Klassen trägt, weil sie mit dem Korkbrett verzahnt
   ist). Sie klebt am unteren Rand, damit der Knopf am Handy immer erreichbar ist, ohne bis unter
   das Brett zu scrollen, und sie schwebt über dem Spielfeld statt eine Zeile zu belegen.
   Das Brett MUSS unten so viel Polster freihalten, wie der negative Rand hier beträgt – sonst
   verdeckt der Knopf die letzte Zeile. Prüfen ist überall derselbe blaue Kreis, nie die Spielfarbe. */
/* min-width: 0 an BEIDEN Stellen, Fußzeile wie Pille: Die Fußzeile ist selbst ein Flex-Kind des
   Spielfelds und könnte sonst nicht schmäler werden als ihr breitester Inhalt – dann hilft es
   nichts, dass die Pille darin schrumpfen darf. */
.board-footer { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 7; display: flex;
  align-items: end; justify-content: space-between; gap: 10px; min-width: 0; margin-top: -72px; padding: 0 2px; pointer-events: none; }
/* Die Pille wächst nach oben über das Brett: Der Knopf bleibt dabei stehen, nichts verschiebt sich. */
/* min-width: 0 ist Pflicht, nicht Kosmetik: Ein Flex-Kind hat von sich aus `min-width: auto` und
   kann darum nicht schmäler werden als sein längster Textblock – das `max-width` darunter läuft
   dann ins Leere, die Pille wird breiter als die Zeile und schiebt den Prüfknopf hinaus. */
.board-status { display: grid; gap: 2px; flex: 0 1 auto; min-width: 0; width: max-content; max-width: calc(100% - 76px);
  padding: 9px 14px; border: 1px solid rgb(255 255 255 / 54%); border-radius: 18px; background: rgb(255 255 255 / 74%);
  box-shadow: 0 3px 12px rgb(60 50 30 / 12%); backdrop-filter: blur(10px); color: #4a4f61; font-size: 14px;
  line-height: 1.3; pointer-events: auto; }
.board-status[hidden] { display: none; }
.board-hint { color: #65697d; }
.board-message { color: #b3202a; font-weight: 650; }
/* margin-left: auto hält den Kreis rechts, auch wenn die Pille verborgen ist und er allein steht. */
.board-check { display: grid; place-items: center; margin-left: auto; width: 64px; height: 64px; flex: none; border: 0; border-radius: 50%;
  background: #2f86de; color: #fff; box-shadow: 0 4px 10px rgb(31 99 176 / 40%); cursor: pointer; pointer-events: auto;
  transition: transform 140ms cubic-bezier(.23, 1, .32, 1); }
.board-check:active:not(:disabled) { transform: scale(.96); }
.board-check svg { width: 30px; height: 30px; }
.board-check:disabled { background: #9fb9d6; box-shadow: none; cursor: not-allowed; }
.board-check:focus-visible { outline: 3px solid #1f63b0; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .board-check { transition: none; } }
