:root {
  --bg: #fff8ec;
  --ink: #1f2a44;
  --muted: #66708a;
  --panel: #ffffff;
  --line: #f0e3cc;
  --primary: #ff7a3d;
  --primary-ink: #ffffff;
  --accent: #2ec4b6;
  --good: #24a35a;
  --bad: #e5484d;
  --shadow: 0 6px 0 rgba(31, 42, 68, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; margin-top: 1.2em; color: var(--muted); }
p { margin: 0 0 .8em; }

.screen { max-width: 980px; margin: 0 auto; padding: 16px 16px 48px; }
.screen.narrow { max-width: 560px; }
.screen.center { text-align: center; }
.screen section { margin-bottom: 32px; }
.lead { color: var(--muted); }
.logo { font-size: 2.4rem; text-align: center; margin: 24px 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.row h2 { margin: 0; }

.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  max-width: 980px; margin: 0 auto; padding: 12px 16px;
}
.wallet { display: flex; gap: 8px; }
.pill {
  background: var(--panel); border: 2px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-weight: 700; white-space: nowrap;
}

.btn {
  border: 0; border-radius: 16px; padding: 14px 22px; font-weight: 800; font-size: 1.05rem;
  box-shadow: var(--shadow); transition: transform .08s;
}
.btn:active { transform: translateY(3px); box-shadow: none; }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.ghost { background: var(--panel); border: 2px solid var(--line); box-shadow: none; }
.btn.small { padding: 8px 14px; font-size: .95rem; }
.btn:focus-visible, .card:focus-visible, .key:focus-visible, .choice:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.panel {
  background: var(--panel); border: 2px solid var(--line); border-radius: 24px;
  padding: 24px; box-shadow: var(--shadow);
}
.panel > .btn { display: block; width: 100%; margin-top: 12px; }

/* Profile */
.profile-list { display: grid; gap: 10px; }
.profile-row { display: flex; gap: 8px; align-items: stretch; }
.profile {
  flex: 1; display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 12px 16px;
}
.profile-avatar { font-size: 2rem; }
.profile-name { font-weight: 800; flex: 1; }
.profile-meta { color: var(--muted); font-size: .9rem; }
.avatar-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.avatar { font-size: 1.8rem; width: 54px; height: 54px; border-radius: 50%; border: 3px solid transparent; background: var(--bg); }
.avatar.on { border-color: var(--primary); background: #fff; }
.text-input { width: 100%; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); font-size: 1.1rem; background: #fff; }

/* Karten */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  background: var(--panel); border: 2px solid var(--line); border-radius: 22px;
  padding: 18px; box-shadow: var(--shadow); transition: transform .1s;
}
.card:hover:not(:disabled) { transform: translateY(-2px); }
.card-icon { font-size: 2.2rem; }
.card-title { font-weight: 800; font-size: 1.15rem; }
.card-text { color: var(--muted); font-size: .95rem; flex: 1; }
.card-meta { font-size: .85rem; font-weight: 700; color: var(--accent); margin-top: 6px; }
.card.game { background: #eefaf8; border-color: #c6ece7; }
.card.locked { opacity: .6; cursor: not-allowed; }
.card.locked .card-meta { color: var(--muted); }

/* Tutorial */
.tutorial .step { color: var(--muted); font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.tutorial-body .big { font-size: 1.6rem; font-weight: 800; text-align: center; margin: .5em 0; }
.tutorial-body .c1 { color: var(--primary); }
.tutorial-body .c2 { color: var(--accent); }
.tutorial .row { margin: 16px 0 0; }

/* Aufgabenrunde */
.progress { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.progress-bar { flex: 1; height: 18px; background: #fff; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .3s; }
.progress-label { font-weight: 800; min-width: 54px; text-align: right; }

.task-card {
  background: var(--panel); border: 3px solid var(--line); border-radius: 24px; padding: 24px;
  text-align: center; box-shadow: var(--shadow); transition: border-color .2s;
}
.task-card.right { border-color: var(--good); }
.task-card.wrong { border-color: var(--bad); }
.task-prompt { font-size: 2.4rem; font-weight: 800; margin-bottom: 12px; }
.answer-display {
  font-size: 2.4rem; font-weight: 800; min-width: 140px; display: inline-block;
  border-bottom: 4px solid var(--ink); margin-bottom: 18px; padding: 0 12px;
}
.answer-display.empty { color: #c9c2b4; }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 0 auto; }
.key {
  padding: 16px 0; font-size: 1.5rem; font-weight: 800; border-radius: 16px;
  border: 2px solid var(--line); background: var(--bg);
}
.key:active { transform: translateY(2px); }
.key.ok { background: var(--good); border-color: var(--good); color: #fff; }
.key.del { color: var(--muted); }
.choices { display: grid; gap: 10px; }
.choice { padding: 16px; font-size: 1.3rem; font-weight: 800; border-radius: 16px; border: 2px solid var(--line); background: var(--bg); }
.task-card.right .task-body { opacity: .5; pointer-events: none; }
.feedback { font-weight: 800; font-size: 1.3rem; margin-top: 12px; }
.feedback.good { color: var(--good); }
.feedback.bad { text-align: left; background: #fff4f2; border-radius: 16px; padding: 16px; margin: 0 0 16px; font-size: 1.1rem; }
.feedback-title { color: var(--bad); margin-bottom: 6px; }
.explain-line { font-weight: 600; }
.solution { margin-top: 8px; }

/* Belohnung / Pause */
.celebrate { margin-top: 32px; }
.huge { font-size: 4.5rem; line-height: 1; margin-bottom: 8px; }

/* Spiel */
.game-screen { padding: 8px; }
.game-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 980px; margin: 0 auto 8px; }

/* Spielkarten mit zwei Knöpfen */
div.card.game { cursor: default; }
div.card.game:hover { transform: none; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.center-text { text-align: center; margin-top: 24px; }
.small-text { font-size: .85rem; margin: 12px 0 0; }
h3.flat { margin-top: 0; color: var(--ink); font-size: 1.25rem; }
.field { display: block; font-weight: 700; margin: 12px 0; }
.field .text-input { margin-top: 6px; font-weight: 400; }

/* Werkstatt */
.wish { resize: vertical; font-family: inherit; }
.ideas { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.chip { border: 2px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: .9rem; font-weight: 600; }
.thinking { display: flex; align-items: center; gap: 14px; margin-top: 16px; font-weight: 700; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--primary); animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 4s; } }
.result { margin-top: 16px; border-color: var(--accent); position: relative; }
.result.no { text-align: center; border-color: var(--line); }
.badge { position: absolute; top: 14px; right: 14px; background: var(--bg); border: 2px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: .75rem; font-weight: 800; color: var(--muted); }
.changes { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.changes li { background: #eefaf8; border-radius: 10px; padding: 4px 10px; font-size: .95rem; font-weight: 600; }
.mod-list { display: grid; gap: 10px; margin-bottom: 14px; }
.mod { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px; }
.mod.off { opacity: .6; }
.mod-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mod-text span { color: var(--muted); font-size: .85rem; }
.switch input { width: 26px; height: 26px; accent-color: var(--accent); }

/* Handy quer: Spielleiste flach halten, damit das Bild Platz hat */
@media (orientation: landscape) and (max-height: 560px) {
  .game-screen { padding: 4px 8px; }
  .game-bar { margin-bottom: 4px; }
  .game-bar .btn.small { padding: 5px 12px; }
  .game-bar .pill { padding: 3px 12px; }
}

/* Local Lernwelt: calm, tactile learning spaces and original companions. */
:root { --bg: #f6f7f2; --ink: #26334b; --muted: #667484; --line: #e3e8df; --primary: #187e73; --accent: #198779; --shadow: 0 4px 0 rgba(38,51,75,.06); }
button, input, textarea, select { font: inherit; }
a { color: var(--primary); }
a.btn { display: inline-block; text-decoration: none; text-align: center; }
button, a, input, textarea, select, summary { outline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #de9e45; }
.screen, .topbar { max-width: 1120px; }
.screen.narrow { max-width: 720px; }
.topbar { padding-top: 16px; }
.topbar .who { display: flex; align-items: center; gap: 9px; padding: 4px 16px 4px 4px; border-radius: 50px; }
.topbar .who .companion { width: 45px; }
.topbar .pill { font-size: 15px; }
.panel { box-shadow: 0 3px 12px #26334b04; }
.eyebrow { display: block; color: #53756a; font-size: 11px; font-weight: 850; letter-spacing: 1.8px; margin-bottom: 12px; }
.welcome-heading { text-align: center; margin: 28px auto; }
.welcome-heading .logo { margin: 0 0 12px; color: var(--ink); font-size: clamp(34px, 7vw, 48px); letter-spacing: -2px; }
.welcome-heading .lead { max-width: 420px; margin: auto; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 12px; flex-wrap: wrap; }
.section-heading h2 { font-size: 23px; margin: 0; letter-spacing: -.5px; }
.status-chip { padding: 6px 11px; background: #edf2e8; color: #55734d; font-size: 12px; font-weight: 750; border-radius: 9px; }
.card { padding: 24px; border-width: 1px; min-height: 200px; box-shadow: 0 3px 0 #26334b07; }
.card-icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; background: #f4f1e8; border-radius: 17px; margin-bottom: 14px; font-size: 26px; }
.card-title { margin-bottom: 6px; }
.card-text { font-size: 15px; }
.card-meta { font-size: 12px; margin-top: 16px; color: #537c6b; }
.companion { display: inline-block; width: 90px; vertical-align: middle; flex-shrink: 0; }
.companion svg, .companion img { display: block; width: 100%; height: auto; overflow: visible; }
.companion-eyes { transform-origin: 80px 83px; animation: blink 6s infinite; }
@keyframes blink { 0%,43%,47%,100% { transform: scaleY(1); } 45% { transform: scaleY(.12); } }
.companion.happy { animation: hop .7s ease-in-out 3; }
.companion.hello svg, .companion.hello img { animation: hello 3s ease-in-out infinite; }
@keyframes hop { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-12px) rotate(4deg); } }
@keyframes hello { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.companion-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 20px 0; }
.companion-option { display: flex; flex-direction: column; align-items: center; border: 2px solid #e9ede5; border-radius: 20px; background: #f7f8f3; padding: 10px 4px 12px; transition: background .2s, transform .2s; }
.companion-option .companion { width: 105px; max-width: 100%; }
.companion-option strong { font-size: 16px; }
.companion-option small { font-size: 11px; color: var(--muted); }
.companion-option:hover { transform: translateY(-3px); }
.companion-option.selected { border-color: var(--primary); background: #eaf3e8; box-shadow: 0 0 0 2px #187e7310; }
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.color-row span { font-size: 13px; font-weight: 700; margin-right: auto; }
.color-dot { background: var(--swatch); width: 29px; height: 29px; border-radius: 50%; border: 3px solid white; box-shadow: 0 0 0 1px #e3e8df; }
.color-dot.selected { box-shadow: 0 0 0 2px var(--ink); }
.profile .companion { width: 58px; }
.profile { min-width: 0; }
.profile-name { overflow-wrap: anywhere; }
.profile-meta { font-size: 12px; }
.avatar-studio { max-width: 720px; margin: auto; }
.avatar-studio .companion-option .companion { width: 125px; }
.reward-companion { width: 150px; }
.custom-intro { display: flex; align-items: center; justify-content: space-between; background: #edf2e7; border-color: transparent; margin: 20px 0; }
.custom-intro .companion { width: 115px; }
.local-label { font-size: 12px; color: #55734d; }
.create-package { margin: 20px 0; }
.create-package summary { cursor: pointer; font-weight: 750; }
.form-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.field { font-size: 14px; }
.text-input { font-size: 16px; font-weight: 400; }
textarea.text-input { font-family: inherit; resize: vertical; }
.local-note { color: var(--muted); font-size: 13px; margin: 18px 0; }
.package-icon { color: #187e73; font-size: 30px; margin-bottom: 10px; }
.empty-state { padding: 24px 12px; color: var(--muted); text-align: center; font-size: 15px; }
.workflow { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin: 24px 0; }
.workflow-step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #7e887e; }
.workflow-step span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e6eae1; font-size: 12px; font-weight: 750; flex: none; }
.workflow-step.done { color: var(--primary); font-weight: 700; }
.workflow-step.done span { color: white; background: var(--primary); }
.upload-zone { display: flex; flex-wrap: wrap; gap: 10px; padding: 20px; margin: 16px 0 0; border: 2px dashed #d5dfcd; border-radius: 15px; justify-content: center; }
.upload-zone label { cursor: pointer; }
.upload-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-input:focus-visible + label { outline: 3px solid var(--accent); }
.source-text { line-height: 1.7; }
.task-editor { padding: 18px; border-radius: 18px; background: #f6f7f2; margin: 16px 0; }
.task-editor .row { margin: 0; }
.task-editor .text-input { background: white; }
.inline-status { margin: 0; }
.inline-status:not(:empty) { margin: 14px 0; padding: 14px 16px; background: #edf3e8; border-radius: 12px; font-size: 15px; }
.inline-status.error { background: #fff0e9; color: #9c412b; }
.inline-status.success { color: #226750; }
.ready-panel { border-color: #a5c9b9; background: #f0f8ee; }
.pdf-viewer { border: 1px solid var(--line); width: 100%; height: 75vh; margin-top: 24px; border-radius: 16px; }
.share-preview { padding: 18px; background: #edf2e7; border-radius: 16px; margin: 18px 0; font-size: 15px; }
.share-preview small { display: block; color: #667484; line-height: 1.6; }
.share-qr { display: block; width: 260px; max-width: 100%; margin: 24px auto; border-radius: 20px; }
.share-panel { margin-top: 20px; }
.share-list-item { margin: 16px 0; }
.share-landing { margin-top: 48px; }
.share-landing > .panel { margin: 24px 0; }
.progress-share { text-align: center; }
.progress-share > .companion { width: 150px; }
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 24px 0; }
.stats-row strong { display: block; font-size: 30px; color: var(--primary); }
.stats-row span { font-size: 13px; color: var(--muted); }
@media (min-width: 850px) { .avatar-studio .companion-grid { grid-template-columns: repeat(6,1fr); } .avatar-studio { max-width: none; } }
@media (max-width: 560px) {
  .screen { padding: 12px 16px 36px; }
  .panel { padding: 18px; }
  .section-heading h2 { font-size: 21px; }
  .workflow-step { flex-direction: column; text-align: center; gap: 6px; font-size: 11px; }
  .custom-intro .companion { width: 80px; }
  .custom-intro p { font-size: 14px; }
  .local-label { font-size: 10px; }
  .profile-meta { display: none; }
  .topbar .pill { padding: 6px 9px; font-size: 13px; }
  .topbar .who { font-size: 14px; max-width: 58%; }
  .topbar .who span:not(.companion) { overflow: hidden; text-overflow: ellipsis; }
  .color-row { gap: 8px; }
  .color-dot { width: 25px; height: 25px; }
  .task-prompt { font-size: clamp(24px, 7vw, 38px); overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) { .companion, .companion svg, .companion img, .companion-eyes { animation: none !important; } }
.companion-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.companion-option { min-width: 0; }
@media (min-width: 850px) { .avatar-studio .companion-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* Lebendige 3D-Begleiter: Bild als Platzhalter, 3D-Fläche darüber sobald geladen */
.companion img { user-select: none; -webkit-user-drag: none; }
.companion-live { position: relative; display: block; aspect-ratio: 6 / 7; flex: none; }
.companion-live > .companion { position: absolute; left: 50%; bottom: 4%; width: 66%; transform: translateX(-50%); }
.companion-live.is-3d > .companion { visibility: hidden; }
.companion-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.companion-stage { position: relative; border-radius: 22px; background: radial-gradient(circle at 50% 78%, #ffffff 0, #eaf3e8 55%, #dfeadf 100%); margin-bottom: 12px; overflow: hidden; }
.stage-buddy { width: min(100%, 330px); margin: 0 auto; }
.stage-buddy .companion-canvas { cursor: grab; touch-action: pan-y; }
.stage-buddy .companion-canvas:active { cursor: grabbing; }
.stage-caption { position: absolute; left: 14px; top: 12px; background: #ffffffcc; border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.stage-hint { position: absolute; right: 14px; bottom: 10px; font-size: 11px; color: var(--muted); }
.trick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; }
.trick-label { font-size: 13px; font-weight: 700; margin-right: 2px; }
.chip.trick { background: #fff; }
.chip.trick:hover { border-color: var(--primary); }
/* In der Aufgabenrunde sitzt der Begleiter neben dem Fortschritt; Sprünge dürfen über den Rand hinaus */
.round-top { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 16px; }
.round-top .progress { flex: 1; margin-bottom: 14px; }
.round-buddy { width: 104px; margin: -18px 0 0 -6px; }
.round-buddy .companion-canvas { inset: auto; left: -25%; top: -55%; width: 150%; height: 161%; pointer-events: none; }
/* Die Überschrift rückt ein, damit der Begleiter darüber Platz zum Springen hat */
.round-head { padding-left: 128px; min-height: 44px; }
.round-top > .legacy-avatar { font-size: 2.6rem; }
.summary-panel { background: #f3f8ee; margin: 20px 0; }
.summary-panel ul { margin: 8px 0 12px; padding-left: 20px; }
.summary-panel li { margin: 4px 0; }
.reward-buddy { width: 230px; margin: 0 auto 4px; }
.reward-buddy .companion-canvas { inset: auto; left: -30%; top: -18%; width: 160%; height: 118%; pointer-events: none; }
@media (max-width: 560px) { .round-buddy { width: 86px; } .round-head { padding-left: 104px; } .round-head h2 { font-size: 19px; } .reward-buddy { width: 190px; } .stage-hint { display: none; } }

/* Anmeldung der Eltern */
.auth-panel { display: grid; gap: 4px; }
.auth-panel .btn.primary { margin-top: 8px; }
.auth-links { justify-content: space-between; }
.account-line { color: var(--muted); font-size: 13px; margin-top: 8px; }
.account-settings .panel + .panel { margin-top: 16px; }
.code-input { font-size: 28px; letter-spacing: 8px; text-align: center; font-weight: 800; }

/* Lernpaket: Standardweg oben, Feinheiten eingeklappt */
.build-panel { margin: 20px 0; }
details.advanced { margin: 20px 0; }
details.advanced > summary { cursor: pointer; font-weight: 750; }
.advanced-block { margin-top: 20px; padding-top: 16px; border-top: 2px solid var(--line, #e9ede5); }
.summary-panel.advanced-block { background: none; }

/* Einladung und Gäste */
.join-form { display: grid; gap: 4px; margin-top: 12px; }
.guest-notice { background: #fff6dd; border-color: #f0dca0; margin: 0 0 16px; }
.guest-notice .lead { margin: 4px 0 10px; }

/* Avatar-Editor */
.editor-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 10px; }
.editor-tab { border: 2px solid var(--line, #e9ede5); background: #f7f8f3; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px; }
.editor-tab.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.editor-tab.dice { margin-left: auto; background: #fff6dd; border-color: #f0dca0; }
.editor-panel { min-height: 150px; }
.part-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.part-option { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px solid #e9ede5; border-radius: 16px; background: #f7f8f3; padding: 10px 4px 8px; }
.part-option.selected { border-color: var(--primary); background: #eaf3e8; }
.part-icon { font-size: 28px; line-height: 1.1; }
.part-option small { font-size: 11px; color: var(--muted); text-align: center; }
.slider-row { display: grid; grid-template-columns: 70px auto 1fr auto; align-items: center; gap: 10px; margin: 14px 0; font-size: 13px; color: var(--muted); }
.slider-row strong { color: var(--ink); font-size: 15px; }
.slider-row input[type=range] { width: 100%; accent-color: var(--primary); height: 28px; }
.color-row { margin: 12px 0; }
/* Freunde neben dem eigenen Avatar */
.friends-row { display: flex; align-items: flex-end; gap: 0; }
.friend + .friend:not(.add) { margin-left: -14px; }
.friend.add { width: 64px; }
.friend { display: flex; flex-direction: column; align-items: center; width: 84px; border: 0; background: none; padding: 0; font: inherit; color: inherit; }
.friend .companion { width: 84px; }
.friend small { font-size: 12px; font-weight: 700; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend.add { cursor: pointer; }
.friend-plus { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px dashed #9bb7a0; color: #4c7a58; font-size: 24px; font-weight: 700; margin-bottom: 6px; background: #ffffff88; }
.invite-out { display: grid; gap: 10px; justify-items: center; margin-top: 8px; }
.invite-out .text-input { width: 100%; }
.mod .companion { width: 52px; }
@media (max-width: 560px) { .slider-row { grid-template-columns: 56px auto 1fr auto; gap: 6px; } }

/* Aufgabenformen: Kacheln, Mehrfachauswahl, Kärtchen und Felder */
.task-prompt.long { font-size: 1.45rem; line-height: 1.3; }
.task-hint { color: var(--muted); font-weight: 700; margin: 0 0 12px; }
.choices.tiles { grid-template-columns: repeat(2, 1fr); max-width: 420px; margin: 0 auto; }
.choices.tiles .choice { font-size: 1.7rem; padding: 20px 8px; }
.choices.truefalse .choice { font-size: 1.25rem; }
.choice { cursor: pointer; transition: transform .08s, border-color .15s, background .15s; }
.choice:active { transform: translateY(2px); }
.choices.multi .choice { position: relative; }
.choices.multi .choice.picked { border-color: var(--primary); background: #e3f1ec; }
.choices.multi .choice.picked::after { content: '✓'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--primary); font-size: 1.2rem; }
/* Lesetext über einer Frage */
.task-passage { text-align: left; background: #fbf7ee; border-left: 5px solid #e2c98f; border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-size: 1.12rem; line-height: 1.55; white-space: pre-line; }
.task-passage p { margin: 0 0 8px; }
.task-passage p:last-child { margin-bottom: 0; }
/* Markieren: Farben wie Buntstifte – Leuchtfarbe plus kräftige Linie darunter */
.mark-pens { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 12px; position: sticky; top: 6px; z-index: 2; }
.mark-pen { font: inherit; font-weight: 800; font-size: 1.05rem; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 3px solid transparent; background: #f1f1ec; color: var(--ink); cursor: pointer; box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.mark-pen.on { border-color: var(--ink); transform: translateY(-1px); }
.mark-text { text-align: left; font-size: 1.28rem; line-height: 2.05; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.mark-text p { margin: 0 0 10px; }
.mark-text p:last-child { margin: 0; }
.mark-text.small { font-size: 1.08rem; line-height: 1.95; }
.mark-tok { border-radius: 6px; padding: 3px 1px; cursor: pointer; -webkit-tap-highlight-color: transparent; box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: background .12s; }
.mark-tok.sentence { padding: 3px 2px; border-bottom: 2px dotted #c9c3b2; }
.mark-tok:focus-visible { outline: 3px solid var(--accent); }
.mark-tok.m0, .mark-pen.m0 { background: #ffe76a; box-shadow: inset 0 -4px 0 #e0b400; }
.mark-tok.m1, .mark-pen.m1 { background: #a9dcff; box-shadow: inset 0 -4px 0 #2f8fd8; }
.mark-tok.m2, .mark-pen.m2 { background: #b8f0c0; box-shadow: inset 0 -4px 0 #2e9e4c; }
.mark-tok.m3, .mark-pen.m3 { background: #ffc9de; box-shadow: inset 0 -4px 0 #d9487e; }
.mark-tok.sentence.m0, .mark-tok.sentence.m1, .mark-tok.sentence.m2, .mark-tok.sentence.m3 { border-bottom-color: transparent; }
.mark-tok.strike, .mark-pen.strike { text-decoration: line-through; text-decoration-color: var(--bad); text-decoration-thickness: 3px; background: #fff0f0; }
.mark-tok.missed { outline: 2px dashed var(--muted); outline-offset: 1px; }
.mark-tok.mistake { text-decoration: underline wavy var(--bad); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.mark-review { text-align: left; margin: 10px 0 4px; }
.mark-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.mark-legend .mark-pen { font-size: .9rem; min-height: 0; padding: 4px 10px; border-color: transparent; cursor: default; }
.mark-note { font-size: .95rem; margin-top: 6px; }
/* Absätze gliedern: Sätze untereinander, dazwischen breite Tippflächen für die Linien. Jeder entstehende Absatz hat
   einen Rand in seiner Farbe und oben seine Nummer. */
.split-text { text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 8px 10px 8px 6px; user-select: none; -webkit-user-select: none; }
.split-text [data-para="0"] { --c: #187e73; }
.split-text [data-para="1"] { --c: #8f5f0f; }
.split-text [data-para="2"] { --c: #2f6fd0; }
.split-text [data-para="3"] { --c: #c03a6b; }
.split-text [data-para="4"] { --c: #3f7d32; }
.split-sentence { position: relative; margin-left: 16px; padding: 4px 4px 4px 20px; border-left: 4px solid var(--c); font-size: 1.2rem; line-height: 1.5; overflow-wrap: anywhere; }
.split-num { display: none; position: absolute; left: -14px; top: 5px; width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff; font-size: .8rem; font-weight: 800; place-items: center; }
.split-sentence.first .split-num { display: grid; }
.split-gap { position: relative; display: flex; align-items: center; justify-content: flex-end; width: 100%; min-height: 44px; margin: 0; padding: 0 6px 0 36px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: min-height .15s; }
.split-gap::before { content: ''; position: absolute; left: 16px; top: 0; bottom: 0; width: 4px; background: var(--c); }
.split-line { position: absolute; left: 30px; right: 6px; top: 50%; border-top: 2px dashed #d3dacd; }
.split-gap:hover .split-line { border-top-color: #a9b5a4; }
.split-gap:focus-visible { outline: 3px solid var(--accent); outline-offset: -2px; }
.split-gap.on { min-height: 56px; }
.split-gap.on::before { display: none; }
.split-gap.on .split-line { left: 0; right: 0; margin-top: -2px; border-top: 4px solid var(--accent); }
.split-tag { display: none; position: relative; padding: 2px 10px; border-radius: 999px; background: var(--primary); color: #fff; font-size: .78rem; font-weight: 800; }
.split-gap.on .split-tag { display: inline-block; }
.split-count { margin: 10px 0 0; font-weight: 800; color: var(--muted); }
.split-count.over { display: inline-block; padding: 2px 12px; border-radius: 999px; background: #fff1c7; color: #9a4a00; }
.split-review { text-align: left; margin: 10px 0 4px; }
.split-flow { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 1.08rem; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.split-flow p { margin: 0; }
.split-rule { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: .9rem; font-weight: 800; }
.split-rule::before, .split-rule::after { content: ''; flex: 1; border-top: 3px solid var(--good); }
.split-rule::before { flex: 0 0 18px; }
.split-rule.hit { color: var(--good); }
.split-rule.missed { color: var(--muted); }
.split-rule.missed::before, .split-rule.missed::after { border-top: 3px dashed var(--muted); }
.split-wrong { display: inline-block; padding: 0 7px; border: 2px solid var(--bad); border-radius: 999px; color: var(--bad); font-size: .85rem; font-weight: 800; line-height: 1.4; white-space: nowrap; }
.split-key { display: inline-block; width: 28px; vertical-align: middle; border-top: 3px solid var(--good); }
.split-key.missed { border-top: 3px dashed var(--muted); }
@media (max-width: 560px) { .split-sentence { font-size: 1.1rem; padding-left: 16px; } }
@media (prefers-reduced-motion: reduce) { .split-gap { transition: none; } }
.pick-review { margin: 10px 0 4px; text-align: left; }
.pick-title { font-weight: 800; margin-bottom: 6px; }
.pick-review ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pick-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 8px 12px; border-radius: 12px; border: 2px solid transparent; background: #fff; }
.pick-row span { font-weight: 700; font-size: .95rem; }
.pick-row.hit { border-color: var(--primary); }
.pick-row.hit span { color: var(--primary); }
.pick-row.wrong { border-color: var(--bad); }
.pick-row.wrong span { color: var(--bad); }
.pick-row.missed { border-style: dashed; border-color: var(--muted); }
.pick-row.missed span { color: var(--muted); }
.btn.check { margin-top: 18px; min-width: 200px; }
.btn.check:disabled { opacity: .45; }
.cloze-text { font-size: 1.35rem; font-weight: 700; line-height: 2.5; margin: 0 0 6px; text-align: left; }
.cloze-text.short { font-size: 2.2rem; font-weight: 800; text-align: center; }
.slot { display: inline-flex; vertical-align: middle; min-width: 92px; min-height: 48px; margin: 0 4px; border: 2px dashed #b9c4b4; border-radius: 14px; background: #f7f8f3; align-items: stretch; justify-content: center; transition: border-color .15s, background .15s; }
.slot.wide { display: flex; flex: 1; min-width: 0; margin: 0; }
.slot.active { border-color: var(--primary); background: #eef6f2; }
.slot.over { border-style: solid; border-color: var(--accent); background: #fff6dd; }
.slot.filled { border-style: solid; border-color: transparent; background: none; }
.slot-empty { flex: 1; border: 0; background: none; border-radius: 12px; font: inherit; cursor: pointer; min-width: 60px; }
.slot .chip-word { flex: 1; margin: 0; }
.chip-bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; min-height: 58px; margin: 16px 0 0; padding: 12px; border-radius: 18px; background: #f1f3ec; }
.chip-bank.wide { flex-direction: column; align-items: stretch; }
.chip-bank.empty { background: none; min-height: 0; padding: 0; margin: 0; }
.chip-word { font: inherit; font-size: 1.15rem; font-weight: 800; line-height: 1.25; padding: 10px 16px; border-radius: 12px; border: 2px solid #cfd8ca; border-bottom-width: 4px; background: #fff; color: var(--ink); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; max-width: 100%; overflow-wrap: anywhere; }
.chip-bank.wide .chip-word, .slot.wide .chip-word { text-align: left; font-size: 1rem; font-weight: 700; }
.chip-word.dragging { opacity: .25; }
.chip-word.ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; cursor: grabbing; box-shadow: 0 12px 28px rgba(30, 50, 40, .28); rotate: -2deg; margin: 0; }
.match-rows { display: grid; gap: 10px; text-align: left; }
.match-row { display: grid; grid-template-columns: minmax(80px, 36%) auto 1fr; align-items: center; gap: 8px; }
.match-left { font-weight: 800; font-size: 1.1rem; overflow-wrap: anywhere; }
.match-arrow { color: var(--muted); }
.match-row .slot { margin: 0; display: flex; }
.order-rows { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.order-row { display: flex; align-items: center; gap: 10px; }
.order-row .slot { margin: 0; display: flex; flex: 1; }
.order-number { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; display: grid; place-items: center; }
.solution-list { margin: 6px 0 0; padding-left: 20px; }
@media (max-width: 560px) { .task-prompt.long { font-size: 1.2rem; } .cloze-text { font-size: 1.15rem; } .cloze-text.short { font-size: 1.7rem; } .chip-word { font-size: 1.05rem; padding: 9px 13px; } .match-row { grid-template-columns: minmax(70px, 34%) auto 1fr; gap: 6px; } }

/* Erklär-Fenster */
button.pill { font: inherit; font-weight: 700; color: inherit; cursor: pointer; }
button.pill:hover, button.status-chip:hover { border-color: var(--primary); }
button.status-chip { border: 1px solid transparent; font-family: inherit; cursor: pointer; }
button.progress-label { border: 0; background: none; font: inherit; font-weight: 800; color: inherit; cursor: pointer; padding: 4px 0 4px 6px; }
.round-buddy { cursor: pointer; }
.info-dialog { border: 0; border-radius: 24px; padding: 26px 26px 20px; width: min(440px, calc(100vw - 32px)); background: #fff; color: var(--ink); box-shadow: 0 24px 60px rgba(30, 45, 40, .28); }
.info-dialog::backdrop { background: rgba(38, 51, 75, .38); }
.info-title { margin: 0 0 10px; font-size: 1.35rem; color: var(--ink); }
.info-body p { margin: 0 0 10px; line-height: 1.45; }
.info-big { font-size: 1.15rem; font-weight: 800; }
.info-list { margin: 0 0 10px; padding-left: 20px; color: var(--muted); }
.info-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.friend-card { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.friend-card .companion { width: 96px; flex: none; }
.friend-card p { margin: 0 0 4px; }
/* Freunde: Sterne, „heute aktiv“, Hinweise an den Karten, Feed und Rangliste */
button.friend { cursor: pointer; border-radius: 14px; }
button.friend:hover .companion { transform: translateY(-3px); }
.friend .companion { transition: transform .15s; }
.friend-stars { color: #7a6a2c; font-weight: 800; }
.friend.active .companion { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 6px #f2c230); }
.card-friends { display: none; align-items: center; gap: 4px; margin-top: 10px; padding: 6px 10px 6px 6px; border-radius: 12px; background: #f1f3ec; font-size: 13px; font-weight: 700; color: #55655a; text-align: left; }
.card-friends.todo, .card-friends.done, .card-friends:not(:empty) { display: flex; }
.card-friends.todo { background: #fff3d6; color: #7a5a10; }
.card-friends.done { background: #e3f1ec; color: #1c6a5f; }
.card-friends .companion { width: 26px; flex: none; margin-right: -6px; }
.card-friends span:last-child { margin-left: 8px; }
.nudge-slot:empty, .feed-slot:empty { display: none; }
.nudge { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; padding: 12px 16px; border-radius: 18px; background: #eef2ea; }
.nudge.hot { background: #fff3d6; }
.nudge-icon { font-size: 26px; }
.nudge-text { flex: 1; min-width: 0; }
.nudge .btn { flex: none; }
.social { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; margin: 28px 0 8px; align-items: start; }
.feed-list, .rank-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.feed-item { display: flex; align-items: center; gap: 10px; }
.feed-item .companion { width: 44px; flex: none; }
.feed-text { flex: 1; min-width: 0; line-height: 1.3; }
.feed-text small { display: block; color: var(--muted); }
.rank { display: grid; grid-template-columns: 22px 38px 1fr auto auto; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 12px; }
.rank.me { background: #e3f1ec; font-weight: 800; }
.rank .companion { width: 38px; }
.rank-place { font-weight: 800; color: var(--muted); text-align: center; }
.rank-score { font-size: 13px; }
.rank-stars { font-size: 13px; color: #7a6a2c; font-weight: 700; min-width: 52px; text-align: right; }
@media (max-width: 720px) { .social { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .nudge { flex-wrap: wrap; } .nudge .btn { margin-left: auto; } .info-dialog { padding: 22px 20px 16px; } .feed-item .btn { padding: 8px 10px; font-size: 13px; } }

/* Ton: Lautsprecher-Knopf und die beiden Schalter im Erklär-Fenster */
.pill.sound-button { padding-left: 11px; padding-right: 11px; }
.game-bar .wallet { align-items: center; }
.sound-switches { display: grid; gap: 10px; margin-bottom: 14px; }
.sound-switch { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--panel); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.sound-switch.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, #fff); }
.sound-icon { font-size: 1.5rem; }
.sound-text { display: grid; flex: 1; }
.sound-text small { color: var(--muted); }
.sound-state { min-width: 46px; padding: 4px 0; border-radius: 999px; background: var(--line); font-weight: 800; font-size: .9rem; text-align: center; }
.sound-switch.on .sound-state { background: var(--primary); color: #fff; }
@media (max-width: 560px) { .topbar .wallet { gap: 5px; } .topbar .pill.sound-button { padding: 6px 8px; } }

/* Stumme Karte: Bild mit abgedeckten Beschriftungen, Nummern zum Antippen, darunter die Felder */
.map-task { display: grid; gap: 14px; }
.map-figure { position: relative; display: inline-block; max-width: 100%; justify-self: center; line-height: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 2px var(--line); user-select: none; -webkit-user-select: none; }
.map-figure img { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; -webkit-user-drag: none; }
.map-pin { position: absolute; transform: translate(-50%, -50%); width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: var(--primary); color: #fff; font: inherit; font-size: .95rem; font-weight: 800; line-height: 1; display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 6px rgba(30, 45, 40, .35); transition: transform .12s, background .12s; }
.map-pin.active { background: #ffd60a; color: #26334b; border-color: #26334b; transform: translate(-50%, -50%) scale(1.3); z-index: 2; }
.map-pin.filled { background: #26334b; }
.map-pin.edit { cursor: grab; touch-action: none; }
.map-rows .slot { min-height: 46px; }
.map-number { width: 30px; height: 30px; font-size: .95rem; }
.map-name { position: absolute; transform: translate(-50%, -50%); padding: 3px 7px; border-radius: 8px; background: #fff; color: #26334b; font-size: .78rem; font-weight: 700; line-height: 1.2; white-space: nowrap; box-shadow: 0 1px 5px rgba(30, 45, 40, .4); }
.map-name.left { transform: translate(0, -50%); }
.map-name.right { transform: translate(-100%, -50%); }
.map-name b { color: var(--primary); }
.map-task .chip-bank { margin: 0; }
.feedback .map-figure { margin: 10px 0 4px; }
.feedback .map-figure img { max-height: 48vh; }
.map-editor { display: grid; gap: 10px; }
.map-editor .map-figure img { max-height: 70vh; }
.map-labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.map-label { display: flex; align-items: center; gap: 8px; }
.map-label .text-input { margin: 0; min-width: 0; flex: 1; }
@media (max-width: 560px) { .map-pin { width: 26px; height: 26px; font-size: .85rem; } .map-figure img { max-height: 54vh; } .map-name { font-size: .7rem; padding: 2px 5px; } }

/* ================================================================== Handy zuerst
   Rahmen der App: feste Leiste unten (Lernen, Spielen, Ich), darüber kurze Listen.
   Am Rechner bleibt alles eine schmale Spalte in der Mitte. */
.topbar { max-width: 720px; padding: 10px 16px 6px; }
.screen.hub { max-width: 640px; padding: 4px 16px calc(108px + env(safe-area-inset-bottom)); }
.screen.hub section { margin-bottom: 0; }
.page-title { font-size: 30px; letter-spacing: -.6px; margin: 10px 2px 12px; }
.list-title { font-size: 15px; font-weight: 800; color: var(--muted); margin: 24px 4px 8px; }
.sub-head { margin: 4px 0 6px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .95); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tab-item { display: grid; justify-items: center; gap: 1px; min-height: 56px; padding: 4px; border: 0; background: none; border-radius: 16px; color: #7c8792; font-size: 12px; font-weight: 800; }
.tab-icon { display: grid; place-items: center; width: 60px; height: 32px; border-radius: 999px; transition: background .15s; }
.tab-icon svg { width: 25px; height: 25px; }
.tab-avatar .companion { width: 30px; margin-top: -3px; }
.tab-item.active { color: var(--primary); }
.tab-item.active .tab-icon { background: #d9eee8; }
.tab-item:active .tab-icon { transform: scale(.94); }
@media (min-width: 700px) { .tabbar { left: 50%; right: auto; bottom: 18px; width: 420px; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 26px; padding: 6px 10px; box-shadow: 0 12px 34px rgba(38, 51, 75, .14); } }

/* Zeilen zum Antippen */
.row-list { display: grid; gap: 10px; }
.card.list-row, .card.game { flex-direction: row; align-items: center; gap: 14px; width: 100%; min-height: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 2px 0 rgba(38, 51, 75, .05); font: inherit; color: inherit; }
.card.list-row .card-icon, .card.game .card-icon { flex: none; width: 48px; height: 48px; margin: 0; border-radius: 14px; font-size: 24px; }
.row-text { display: grid; gap: 2px; flex: 1; min-width: 0; text-align: left; }
.row-text .card-title { margin: 0; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.row-text .card-meta { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.chev { flex: none; color: #b5bec6; font-size: 26px; line-height: 1; }
.card.list-row:hover:not(:disabled) { transform: none; border-color: #c5d6cc; }
.card.list-row:active { transform: scale(.985); }
.add-row { border-style: dashed; background: none; box-shadow: none; }
.add-row .card-icon { background: #d9eee8; color: var(--primary); font-weight: 800; }
.card.game { flex-wrap: wrap; background: #fff; }
.card.game .card-actions { flex-basis: 100%; margin: 2px 0 0; }
.card.game .card-actions .btn { flex: 1; padding: 11px 14px; }
.row-text .card-friends { margin: 4px 0 0; justify-self: start; }

/* Startseite: Begrüßung und Freunde in einer Reihe zum Wischen */
.home-head { display: grid; gap: 2px; }
.friends-row { display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 10px; scrollbar-width: none; }
.friends-row::-webkit-scrollbar, .option-strip::-webkit-scrollbar, .editor-tabs::-webkit-scrollbar, .color-row::-webkit-scrollbar { display: none; }
.friends-row:empty { display: none; }
.friend, .friend.add { flex: none; width: 62px; }
.friend .companion { width: 56px; }
.friend + .friend:not(.add) { margin-left: 0; }
.friend small { max-width: 62px; font-size: 11px; }
.friend-plus { width: 48px; height: 48px; margin: 8px 0 6px; font-size: 24px; }

/* Spielen */
.ticket-banner { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 12px; padding: 14px 16px; border: 0; border-radius: 18px; background: #fff1c7; color: #5a4810; font: inherit; font-size: 15px; font-weight: 700; text-align: left; }
.ticket-banner.empty { background: #e9edea; color: var(--muted); }
.ticket-count { flex: none; font-size: 22px; font-weight: 800; white-space: nowrap; }
.hub-content > .btn { display: block; width: 100%; margin: 0 0 14px; }

/* Ich */
.me-head { text-align: center; }
.me-buddy { width: 190px; margin: 0 auto -6px; cursor: pointer; }
.me-head .page-title { margin: 0 0 8px; }
.me-stats { display: flex; justify-content: center; gap: 8px; margin: 0 0 20px; }
.me-stats .pill { font-size: 14px; }

/* Wer lernt? */
.who-screen { padding-top: 28px; text-align: center; }
.who-screen .logo { margin: 0 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -.5px; color: var(--primary); }
.who-title { font-size: 32px; letter-spacing: -.8px; margin: 0 0 22px; }
.who-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 420px; margin: 0 auto; }
.who-tile { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 196px; padding: 16px 10px; border: 1px solid var(--line); border-radius: 26px; background: #fff; box-shadow: 0 3px 0 rgba(38, 51, 75, .06); font: inherit; color: inherit; }
.who-tile:active { transform: scale(.97); }
.who-tile .companion { width: 112px; }
.who-tile strong { font-size: 20px; overflow-wrap: anywhere; }
.who-tile small { font-size: 13px; color: var(--muted); font-weight: 700; }
.who-tile.add { border-style: dashed; background: none; box-shadow: none; color: var(--primary); }
.who-plus { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 8px; border-radius: 50%; background: #d9eee8; font-size: 34px; font-weight: 700; line-height: 1; }
.who-foot { margin-top: 28px; }

/* Avatar-Editor: ein Bildschirm ohne Scrollen. Oben die Figur, unten Symbolleiste und eine Reihe zum Wischen. */
.editor-screen { display: flex; flex-direction: column; height: 100dvh; max-width: 560px; margin: 0 auto; padding-bottom: env(safe-area-inset-bottom); }
.editor-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 10px 12px 8px; }
.editor-bar h1 { margin: 0; font-size: 18px; text-align: center; }
.editor-bar > :first-child { justify-self: start; }
.editor-bar > :last-child { justify-self: end; }
.editor-close { width: 42px; padding: 8px 0; }
.editor-name { width: auto; margin: 0 12px 8px; text-align: center; font-size: 20px; font-weight: 800; }
.editor-screen > .inline-status:not(:empty) { margin: 0 12px 8px; }
.editor-screen .companion-picker { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.editor-screen .companion-stage { flex: 1; min-height: 150px; margin: 0 12px; border-radius: 28px; }
.editor-screen .stage-buddy { height: 100%; width: auto; max-width: 100%; aspect-ratio: 6 / 7; margin: 0 auto; }
.stage-dice { position: absolute; right: 12px; top: 12px; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: #fff; font-size: 24px; line-height: 1; box-shadow: 0 3px 10px rgba(38, 51, 75, .16); }
.stage-dice:active { transform: rotate(40deg) scale(.94); }
.editor-screen .stage-hint { display: block; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 12px; pointer-events: none; }
.editor-sheet { padding: 8px 0 10px; }
.editor-tabs { flex-wrap: nowrap; justify-content: space-between; gap: 2px; margin: 0; padding: 0 10px 6px; overflow-x: auto; scrollbar-width: none; }
.editor-tab { display: grid; justify-items: center; flex: 1 0 auto; min-width: 46px; padding: 2px; border: 0; border-radius: 14px; background: none; color: var(--muted); font-size: 11px; font-weight: 700; }
.editor-tab small { font-size: 11px; }
.editor-tab-icon { display: grid; place-items: center; width: 46px; height: 38px; border-radius: 14px; font-size: 22px; line-height: 1; }
.editor-tab.selected { background: none; border: 0; color: var(--primary); }
.editor-tab.selected .editor-tab-icon { background: #d9eee8; }
.editor-panel { height: 206px; min-height: 0; overflow: hidden; }
.option-strip { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 68px); grid-auto-columns: 84px; gap: 8px; padding: 2px 12px 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.option-strip.figures { grid-template-rows: 144px; grid-auto-columns: 100px; }
.option-strip > * { scroll-snap-align: center; min-width: 0; }
.option-strip .part-option { padding: 6px 4px; justify-content: center; }
.option-strip .companion-option { padding: 6px 4px 8px; justify-content: center; }
.option-strip .companion-option .companion { width: 78px; }
.option-strip .companion-option:hover { transform: none; }
.editor-panel .color-row { flex-wrap: nowrap; gap: 10px; margin: 0; padding: 6px 12px; overflow-x: auto; scrollbar-width: none; }
.editor-panel .color-dot { flex: none; width: 34px; height: 34px; }
.editor-panel .slider-row { margin: 12px 16px; }

/* Freunde-Bereich auf der Startseite: untereinander statt nebeneinander */
.social { grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 26px 0 8px; }
.social .panel { padding: 16px; border-radius: 20px; border-width: 1px; }
.nudge { margin: 4px 0 2px; }
.feed-text { flex: 1; min-width: 0; font-size: 15px; }
.editor-bar { padding: 8px 10px 6px; }
.editor-bar .btn { white-space: nowrap; padding: 9px 13px; }
.editor-name { padding: 10px 14px; margin-bottom: 6px; }
.editor-screen > .inline-status:not(:empty) { margin: 0 12px 6px; padding: 8px 12px; font-size: 14px; }
/* niedrige Bildschirme: Auswahlreihen flacher, damit die Figur Platz behält */
@media (max-height: 700px) {
  .editor-panel { height: 180px; }
  .option-strip { grid-template-rows: repeat(2, 56px); gap: 6px; }
  .option-strip.figures { grid-template-rows: 122px; grid-auto-columns: 88px; }
  .option-strip .companion-option .companion { width: 60px; }
  .option-strip .part-option .part-icon { font-size: 22px; }
  .editor-tab-icon { height: 32px; }
  .editor-panel .color-dot { width: 30px; height: 30px; }
  .editor-panel .slider-row { margin: 6px 16px; }
}

/* Lernpaket */
.section-heading.sub-head { margin: 4px 0 6px; }
.package-meta { margin: -6px 2px 14px; font-size: 15px; }
.ready-panel, .build-panel, .screen.hub .panel { border-width: 1px; border-radius: 20px; }
.screen.hub .panel + .panel, .screen.hub section.panel { margin-top: 12px; }
.ready-panel .card-actions .btn { flex: 1 1 100%; }

/* Fächer als Kacheln, darin Themen und Einheiten */
.subject-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.subject-tile { display: grid; justify-items: start; gap: 2px; padding: 16px 16px 14px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 2px 0 rgba(38, 51, 75, .05); font: inherit; color: inherit; text-align: left; }
.subject-tile:active { transform: scale(.97); }
.subject-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 8px; border-radius: 16px; background: #f4f1e8; font-size: 28px; line-height: 1; }
.subject-tile strong { font-size: 19px; }
.subject-tile small { font-size: 13px; font-weight: 600; color: var(--muted); }
.subject-bar { display: block; width: 100%; height: 6px; margin-top: 10px; border-radius: 99px; background: #e9ede5; overflow: hidden; }
.subject-bar span { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.own-row { margin-top: 14px; }
.row-list.continue { margin: 6px 0 0; }
.continue-row { background: #e3f1ec; border-color: #b9dccf; }
.continue-row .card-icon { background: #fff; }
.continue-row .card-meta { color: var(--primary); font-weight: 800; }
.unit-row.done .card-icon { box-shadow: inset 0 0 0 2px #9fcfbd; }

/* Lücke mitten im Wort: Feld so klein wie zwei Buchstaben */
.cloze-text.word { letter-spacing: 1px; }
.cloze-text.word .slot { min-width: 58px; min-height: 54px; margin: 0 3px; }
.cloze-text.word .slot-empty { min-width: 44px; }
.cloze-text.word .slot .chip-word { padding: 8px 10px; }

/* Vokabeltrainer: Wort legen und selbst schreiben */
.spell-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 4px 0 2px; }
.spell-word { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.spell-row .slot { min-width: 40px; min-height: 48px; margin: 0; }
.spell-row .slot-empty { min-width: 36px; }
.spell-row .slot .chip-word, .spell-row ~ .chip-bank .chip-word { min-width: 40px; padding: 8px 6px; font-size: 1.3rem; text-align: center; }
.write-input { max-width: 420px; margin: 4px auto 0; display: block; text-align: center; font-size: 1.4rem; font-weight: 800; padding: 16px; }
.explain-line.given s { color: var(--bad); }
.due-row { background: #fff1c7; border-color: #f0dca0; }
.due-row .card-icon { background: #fff; }
.due-row .card-meta { color: #7a5a10; font-weight: 800; }
.row-list.continue:empty { display: none; }

/* Lernpaket: Fotos sammeln, Fortschritt beim Erstellen, kurzer Ergebnis-Bildschirm */
/* Fotos eines Lernpakets: nur eine Liste, nie das Bild selbst (Urheberrecht) */
.photo-list { list-style: none; display: grid; gap: 8px; margin: 4px 0 8px; padding: 0; }
.photo-list li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 2px solid var(--line); border-radius: 14px; background: #fff; }
.photo-list strong { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.photo-icon { flex: none; font-size: 20px; }
/* gelesene Fotos: eine Zeile mit Hinweis statt einer Zeile je Foto (die Dateien sind gelöscht) */
.photo-list .photo-done { min-height: 40px; background: var(--paper, #fffdf7); }
.photo-list .photo-done strong { font-weight: 600; font-size: .92rem; }
.photo-list .photo-map { background: var(--sky, #e4ebff); }
.photo-remove { flex: none; width: 36px; height: 36px; padding: 0; border: 2px solid var(--ink); border-radius: 50%; background: #fff; color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.photo-remove:disabled { opacity: .4; }
.photo-note { margin: 0 0 12px; }
.upload-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.upload-button { display: block; padding: 16px 8px; text-align: center; cursor: pointer; font-size: 1rem; }
.upload-button.disabled { opacity: .5; pointer-events: none; }
.upload-progress { display: grid; gap: 6px; margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--muted); }
.progress-bar > span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width .4s linear; }
.progress-bar.big { height: 22px; margin: 6px 0 2px; }
.btn.build-button { display: block; width: 100%; margin: 16px 0 6px; padding: 18px; font-size: 1.15rem; }
.ready-facts { font-size: 1.15rem; font-weight: 800; margin: 0 0 6px; }
.ready-panel .card-actions .btn { flex: 1 1 100%; }
.build-progress { text-align: center; margin-top: 8px; }
.build-progress .companion { width: 120px; }
.build-progress h2 { margin: 6px 0 2px; }
.build-title { color: var(--muted); font-weight: 700; margin: 0 0 10px; }
.build-note { min-height: 3em; margin: 8px 0 4px; }
.build-steps { list-style: none; display: grid; gap: 8px; max-width: 300px; margin: 6px auto 16px; padding: 0; text-align: left; }
.build-steps li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; color: #9aa5ad; font-weight: 700; }
.build-steps .step-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #eef1ea; filter: grayscale(1); opacity: .6; }
.build-steps li.now { background: #e3f1ec; color: var(--ink); }
.build-steps li.now .step-icon { filter: none; opacity: 1; animation: pulse 1.2s ease-in-out infinite; }
.build-steps li.done { color: var(--primary); }
.build-steps li.done .step-icon { filter: none; opacity: 1; background: #d9eee8; }
.build-steps li.done .step-icon::after { content: '✓'; position: absolute; }
.build-steps li.done .step-icon { position: relative; font-size: 0; }
.build-steps li.done .step-icon::after { font-size: 16px; font-weight: 800; color: var(--primary); }
@keyframes pulse { 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .build-steps li.now .step-icon { animation: none; } }
.build-progress > .btn { display: block; width: 100%; margin-top: 8px; }
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 0 auto; padding: 12px 12px 12px 16px; border-radius: 18px; background: #26334b; color: #fff; font-weight: 700; box-shadow: 0 12px 30px rgba(38, 51, 75, .3); }
.toast > span { flex: 1; }
.toast-close { border: 0; background: none; color: #fff; font-size: 22px; line-height: 1; padding: 4px 6px; }

/* ---- Eltern: Spiele freischalten, Credits */
.choice-row { display: flex; gap: 8px; margin-top: 10px; }
.choice { flex: 1; min-height: 44px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--panel); font: inherit; font-weight: 750; color: inherit; cursor: pointer; }
.choice.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, #fff); }
.ticket-banner.free { background: #dff5e3; color: #1f5b33; }
.credit-balance { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; font-size: 1.25rem; }
.credit-free { padding: 5px 10px; border-radius: 9px; background: #dff5e3; color: #1f5b33; font-size: 13px; font-weight: 750; }
.credit-prices, .credit-events { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.credit-prices li, .credit-events li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: #f4f6f1; font-size: 14px; }
.credit-prices li span:nth-child(2), .credit-events li span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.credit-events li { background: none; padding: 4px 2px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 13px; }
.credit-events li strong { white-space: nowrap; color: var(--muted); }
.credit-events li strong.plus { color: #1f7a3d; }
.credit-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.credits-panel h4 { margin: 14px 0 8px; }
.cost-note { display: block; margin: 8px auto 0; padding: 6px 12px; border: 0; border-radius: 10px; background: #f4f6f1; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.cost-note.short { background: #fde8e4; color: #9a2b1b; }

/* Familie und Freunde: dasselbe Konto (Partner, eigenes Gerät) oder eine andere Familie (Freunde) – klar getrennt */
.share-choice { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: 12px; }
.share-option { border: 2px solid var(--line); border-radius: 18px; padding: 16px; background: #fbfcf8; }
.share-option h4 { margin: 0 0 6px; font-size: 1.05rem; }
.share-option .lead { margin: 0 0 12px; font-size: 15px; }
.share-option .btn { width: 100%; }
.pair-out { display: grid; gap: 10px; justify-items: center; }
.pair-out:not(:empty) { margin-top: 12px; }
.pair-out .share-qr { margin: 4px auto; width: 220px; }
.pair-out .text-input { width: 100%; }
.pair-out .lead { margin: 0; text-align: center; }
.pair-warning { margin: 0; padding: 10px 12px; border-radius: 12px; background: #fff6dd; border: 1px solid #f0dca0; font-size: 14px; }
.family-hint { margin: 0 0 16px; padding: 14px 16px; border-radius: 16px; background: #eef5f9; border: 1px solid #c9dde8; font-size: 15px; }
.family-hint p { margin: 0; }
.family-hint .btn { margin-top: 10px; }
.join-form .family-hint, .auth-panel .family-hint { margin: 16px 0 0; }
.family-tip { margin-top: 10px; }
.pair-panel h1 { margin: 0 0 8px; }
.pair-panel .pair-warning { margin: 12px 0 0; }
@media (max-width: 560px) { .share-choice { grid-template-columns: 1fr; } }

/* Teilen: Freunde zum Antippen, Postfach für geschickte Lernmodule, Teilen direkt aus der Lernrunde */
.round-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex: none; }
.share-friends { margin: 12px 0; }
.share-friends h2, .share-panel h2 { margin: 0 0 6px; }
.friend-picks { display: grid; gap: 8px; margin: 12px 0; }
.friend-pick { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 16px; background: #fbfcf8; cursor: pointer; }
.friend-pick:has(input:checked) { border-color: var(--primary); background: #e3f1ec; }
.friend-pick:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.friend-pick input { width: 24px; height: 24px; flex: none; accent-color: var(--primary); }
.friend-pick .companion { width: 44px; flex: none; }
.friend-pick-text { display: grid; min-width: 0; }
.friend-pick-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-pick-text small { color: var(--muted); font-weight: 700; }
.friend-pick.sent { cursor: default; opacity: .75; }
.friend-pick.sent small { color: #226750; }
.inbox-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 12px; padding: 14px 16px; background: #eef5f9; border-color: #c9dde8; }
.inbox-card .companion { width: 48px; flex: none; }
.inbox-text { display: grid; gap: 2px; flex: 1; min-width: 180px; }
.inbox-text span { color: var(--muted); font-size: 14px; font-weight: 700; }
.inbox-status:empty { display: none; }
.inbox-card .card-actions { margin: 0; flex-basis: 100%; }

/* Fragen ansehen, melden und entfernen */
.question-list { display: grid; gap: 10px; margin-top: 12px; }
.question-card { display: grid; gap: 4px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 18px; background: var(--panel); text-align: left; }
.question-card.hot { border-color: #f0dca0; background: #fffaf0; }
.question-flag { font-weight: 800; color: #7a5a10; font-size: 14px; }
.question-kind { color: var(--muted); font-size: 13px; font-weight: 800; }
.question-prompt { overflow-wrap: anywhere; }
.question-text { margin: 2px 0 0; padding: 8px 10px; border-radius: 10px; background: #f4f6f1; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.question-solution { margin: 2px 0 0; color: #226750; font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.question-card .card-actions { margin-top: 6px; }
.flag-button { margin-top: 10px; }
.flag-note { margin: 10px 0 0; color: var(--muted); font-weight: 700; font-size: 14px; }
.reported-panel { background: #fffaf0; border-color: #f0dca0; }

/* Freunde einladen: Wer lädt ein? (Geschwister dazunehmen) */
.invite-who { margin: 12px 0 0; text-align: left; }
.invite-who:empty { display: none; }
.invite-who .choice-row { flex-wrap: wrap; }
.invite-who .choice { font-size: 1rem; padding: 10px 14px; }
.invite-who .choice:disabled { opacity: 1; cursor: default; }
.share-landing .friend-picks { text-align: left; }

/* Spielende: freigeschaltete Spielzeit, Tageslimit, Abschluss nach einem Ticket */
.free-play-state { margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; background: #f4f6f1; font-weight: 800; }
.free-play-state.on { background: #e3f1ec; color: #175c51; }
.free-play-panel .choice-row { flex-wrap: wrap; }
.free-play-panel .choice { flex: 1 1 96px; font-size: 1rem; padding: 12px 8px; }
.free-play-panel .limit-row .choice { flex: 1 1 64px; padding: 10px 6px; }
.free-play-panel h4 { margin: 18px 0 4px; }
.free-play-panel > .btn { margin-top: 10px; }
.played-today { margin-top: 12px; }
.play-clock { font-variant-numeric: tabular-nums; }
.game-end .reward-buddy { margin-bottom: 4px; }

/* Lernfortschritt (Für Eltern): Karte je Kind, Einzelansicht mit vier Wochen und Stufen je Einheit */
.progress-cards { display: grid; gap: 12px; }
.progress-card { border: 2px solid var(--line); border-radius: 18px; padding: 12px 14px; background: var(--panel); }
.progress-open { display: flex; align-items: center; gap: 12px; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 12px; }
.progress-open:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.progress-open .companion { width: 52px; flex: none; }
.progress-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.progress-who strong { font-size: 1.1rem; }
.progress-who span { color: var(--muted); font-size: .9rem; font-weight: 700; overflow-wrap: anywhere; }
.week-dots { display: flex; gap: 6px; margin: 12px 0 2px; }
.week-dot { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.week-dot i { display: grid; place-items: center; width: 100%; max-width: 34px; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--line); background: #f4f6f1; color: #fff; font-style: normal; font-weight: 900; font-size: 14px; }
.week-dot.on i { background: var(--good); border-color: var(--good); }
.week-dot.today i { box-shadow: 0 0 0 3px #19877933; }
.week-dot.future i { border-style: dashed; background: transparent; }
.week-dot small { color: var(--muted); font-size: 12px; font-weight: 800; }
.week-dot.today small { color: var(--ink); }
.progress-note { margin: 10px 0 0; font-size: .95rem; overflow-wrap: anywhere; }
.progress-note.good strong { color: #226750; }
.progress-note.hard strong { color: #7a5a10; }
.hard-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.hard-row span { min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.hard-row .btn { flex: none; }
.progress-line { margin: 0; font-weight: 800; }
.progress-played, .progress-hint { margin: 10px 0 0; color: var(--muted); font-size: .9rem; font-weight: 700; }
.weeks { display: grid; gap: 8px; }
.progress-body { display: grid; gap: 14px; }
.progress-body > .panel, .progress-body > p { margin: 0; }
.progress-untouched { color: var(--muted); font-size: .92rem; padding: 0 6px; overflow-wrap: anywhere; }
.week-row { display: grid; grid-template-columns: 96px minmax(48px, 1fr) max-content; align-items: end; gap: 10px; font-size: .86rem; font-weight: 700; }
.week-name { color: var(--muted); }
.week-sum { text-align: right; white-space: nowrap; }
.week-bars { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.week-bars i { flex: 1; border-radius: 3px; background: var(--line); }
.week-bars i.on { background: var(--good); }
.progress-subject h4 { margin: 14px 0 4px; font-size: .85rem; color: var(--muted); text-transform: none; }
.unit-progress { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.progress-topic h4 + .unit-progress { border-top: 0; }
.level-mark { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; font-size: 14px; background: #eef1ea; color: #56637a; }
.level-sure .level-mark { background: #e3f1ec; color: #1c6a4f; }
.level-shaky .level-mark { background: #fff0cc; color: #7a5a10; }
.unit-progress-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.unit-progress-text strong, .unit-progress-text small { overflow-wrap: anywhere; }
.unit-progress-text small { color: var(--muted); font-size: .82rem; font-weight: 700; }
.level-sure .unit-progress-text small { color: #1c6a4f; }
.level-shaky .unit-progress-text small { color: #7a5a10; }
.unit-progress .btn { flex: none; }
.progress-legend summary { font-weight: 800; cursor: pointer; }
.progress-legend p { margin: 10px 0 0; font-size: .92rem; }

/* Startseite: Empfehlung „Das üben wir noch einmal“ (wackelnde Einheit), mit „Später“ */
.again { display: flex; align-items: stretch; gap: 8px; }
.again .list-row { flex: 1; min-width: 0; }
.again-row { background: #fff0cc; border-color: #f0dca0; }
.again-row .card-icon { background: #fff; }
.again-row .card-meta { color: #7a5a10; font-weight: 800; }
.again-later { flex: none; align-self: center; }

/* „Mein Fortschritt“ für Kinder: Woche in Punkten, Auszeichnung, je Fach ein Balken */
.my-progress-body { display: grid; gap: 14px; }
.my-progress-body > .panel { margin: 0; }
.my-progress-body h2 { margin: 0 0 6px; font-size: 1.15rem; }
.my-cheer { margin: 12px 0 0; font-weight: 800; font-size: 1.05rem; }
.my-badge { display: flex; align-items: center; gap: 14px; background: #fff7df; border-color: #f0dca0; }
.my-medal { font-size: 40px; line-height: 1; }
.my-badge div { display: flex; flex-direction: column; min-width: 0; }
.my-badge div span { font-size: 1.15rem; font-weight: 800; overflow-wrap: anywhere; }
.my-subject { display: block; width: 100%; padding: 12px 0; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.my-progress-body h2 + .my-subject { border-top: 0; }
.my-subject:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.my-subject-head { display: flex; flex-direction: column; }
.my-subject-head small { color: var(--muted); font-weight: 700; }
.my-subject .subject-bar { height: 10px; margin-top: 8px; }

/* Nur mit Einladung (Anmeldeseite) und die Willkommens-Seiten für neue Familien */
.invite-only-note { margin: 16px 0 0; padding: 14px 16px; border-radius: 16px; background: #fff7df; border: 1px solid #f0dca0; font-size: 15px; }
.invite-only-note p { margin: 6px 0 0; }
.intro { min-height: 100dvh; display: grid; align-content: center; }
.intro-card { text-align: center; padding: 28px 22px 22px; }
.intro-icon { display: block; font-size: 64px; line-height: 1; margin-bottom: 12px; }
.intro-card h1 { margin: 0 0 10px; font-size: clamp(24px, 6vw, 30px); letter-spacing: -.5px; overflow-wrap: anywhere; }
.intro-card .lead { margin: 0 auto; max-width: 400px; font-size: 1.05rem; }
.intro-dots { display: flex; justify-content: center; gap: 8px; margin: 22px 0 6px; }
.intro-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.intro-dots i.on { width: 26px; border-radius: 99px; background: var(--primary); }
.intro-card > .btn.ghost { margin-top: 8px; }

/* Das Zeichen von Pipifax (Fuchs mit Sonnenbrille) neben dem Namen */
.brand-mark { width: 1.25em; height: 1.25em; vertical-align: -0.28em; margin-right: .22em; }
.welcome-heading .logo .brand-mark { display: block; width: 96px; height: 96px; margin: 0 auto 10px; }
.brand-mark.big { display: block; width: 120px; height: 120px; margin: 0 auto 12px; }

/* ================================================================== Sticker-Look (seit 12/2026)
   Die Marke Pipifax: helles Papier, Tinte als Kontur, harte Schatten, runde Schrift. Diese Schicht liegt über allem
   davor und ändert nur das Aussehen – Abläufe, Begleiter und Spiele bleiben, wie sie sind.
   Farben: Tinte (Text, Konturen) · Kugelschreiber-Blau (Lernen, Knöpfe) · Fuchs-Orange (Marke, Spielen) ·
   Stern-Gelb (Sterne, Hinweise) · Minze (richtig, sicher) · Papier (Grund). */
@font-face { font-family: 'Baloo 2'; font-style: normal; font-display: swap; font-weight: 400 800; src: url(../vendor/fonts/baloo-2-latin.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: 'Baloo 2'; font-style: normal; font-display: swap; font-weight: 400 800; src: url(../vendor/fonts/baloo-2-latin-ext.woff2) format('woff2-variations'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,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; }
@font-face { font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000; src: url(../vendor/fonts/nunito-latin.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(../vendor/fonts/nunito-latin-ext.woff2) format('woff2-variations'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,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; }

:root {
  --bg: #F3F6FC; --ink: #141B33; --muted: #4A5573; --panel: #FFFFFF; --line: #D5DCEC;
  --primary: #2A5CE6; --primary-ink: #FFFFFF; --accent: #2A5CE6; --good: #16946B; --bad: #D93A3F;
  --fox: #F26B21; --star: #FFC93C; --mint: #37C8A0; --sky: #E4EBFF; --sun: #FFF1C2; --lilac: #CDBEFF;
  --edge: 3px solid var(--ink);
  --shadow: 0 5px 0 var(--ink); --shadow-s: 0 3px 0 var(--ink);
  --display: 'Baloo 2', ui-rounded, 'Arial Rounded MT Bold', 'Nunito', sans-serif;
}
body { font-family: 'Nunito', ui-rounded, 'Trebuchet MS', system-ui, sans-serif; font-weight: 600; }
strong, b { font-weight: 800; }
h1, h2, h3, h4, .page-title, .who-title, .logo, .card-title, .list-title, .task-prompt, .answer-display, .info-title, .tab-item,
.btn, .key, .choice, .chip-word, .feedback, .progress-label, .subject-tile strong, .who-tile strong, .ticket-count, .editor-name { font-family: var(--display); font-weight: 800; }
h1, h2, .page-title, .who-title { letter-spacing: -.3px; line-height: 1.1; }
h3 { font-size: 1.2rem; }
h3.flat { font-size: 1.4rem; }
a { color: var(--primary); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible,
.btn:focus-visible, .card:focus-visible, .key:focus-visible, .choice:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.lead { color: var(--muted); }
.eyebrow { color: var(--primary); font-weight: 900; }
.page-title { font-size: 40px; margin: 10px 2px 14px; }
.list-title { font-size: 24px; color: var(--ink); margin: 22px 2px 10px; }

/* Knöpfe, Marken, Flächen */
.btn { background: #fff; color: var(--ink); border: var(--edge); border-radius: 18px; padding: 10px 22px; font-size: 1.2rem; line-height: 1.2; box-shadow: var(--shadow); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.ghost { background: #fff; border: var(--edge); box-shadow: var(--shadow-s); }
.btn.ghost:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn.small { padding: 5px 14px; font-size: 1.02rem; border-width: 2.5px; border-radius: 14px; box-shadow: var(--shadow-s); }
.btn:disabled { opacity: .5; box-shadow: none; }
.pill { background: #fff; border: var(--edge); padding: 4px 12px; font-weight: 800; }
.topbar .pill { font-size: 16px; }
.topbar .who { border-radius: 999px; box-shadow: none; font-size: 1.15rem; }
.panel { border: var(--edge); border-radius: 22px; box-shadow: var(--shadow); }
.ready-panel, .build-panel, .screen.hub .panel { border-width: 3px; border-radius: 22px; }
.panel + .panel { margin-top: 18px; }
.guest-notice, .reported-panel, .inbox-card, .result { border-color: var(--ink); }
.guest-notice, .reported-panel { background: var(--sun); }
.inbox-card, .family-hint { background: var(--sky); }
.family-hint, .invite-only-note { border: 2.5px solid var(--ink); border-radius: 16px; }
.invite-only-note { background: var(--sun); }
.status-chip { background: var(--sky); color: var(--ink); border: 2px solid var(--ink); font-weight: 800; }
.text-input { border: var(--edge); border-radius: 14px; font-weight: 700; }
.inline-status:not(:empty) { background: var(--sky); border-radius: 14px; font-weight: 700; }
.inline-status.error { background: #FFE3DC; color: #8A2A12; }
.inline-status.success { color: #0F6B4B; }
.mod, .progress-card, .question-card, .share-option, .friend-pick { border: 2.5px solid var(--ink); background: #fff; }
.question-card.hot { border-color: var(--ink); background: var(--sun); }
.friend-pick:has(input:checked) { border-color: var(--ink); background: var(--sky); }
.info-dialog { border: var(--edge); border-radius: 26px; box-shadow: 0 8px 0 var(--ink); }
.info-dialog::backdrop { background: rgba(20, 27, 51, .5); }
.toast { background: var(--ink); border-radius: 18px; bottom: calc(100px + env(safe-area-inset-bottom)); }
.upload-zone { border: 3px dashed var(--ink); border-radius: 18px; }
.friend-plus { border: 3px dashed var(--ink); color: var(--ink); background: #fff; }
.switch input, .friend-pick input { accent-color: var(--primary); }

/* Marke */
.brand-mark { border-radius: 30%; }
.welcome-heading .logo { font-size: clamp(44px, 12vw, 60px); letter-spacing: -1px; line-height: 1; }
.welcome-heading .logo .brand-mark, .brand-mark.big { background: var(--star); border: var(--edge); border-radius: 28px; box-shadow: var(--shadow); padding: 8px; }
.welcome-heading .logo .brand-mark { width: 104px; height: 104px; margin-bottom: 18px; }
.who-screen .logo { color: var(--ink); font-size: 26px; }
.intro-dots i.on { background: var(--ink); }

/* Zeilen und Karten zum Antippen */
.card, .card.list-row, .card.game { border: var(--edge); border-radius: 20px; box-shadow: 0 4px 0 var(--ink); background: #fff; }
.card.list-row:hover:not(:disabled) { border-color: var(--ink); }
.card.list-row:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.card.list-row .card-icon, .card.game .card-icon { background: var(--sky); border: 2.5px solid var(--ink); }
.row-text .card-title { font-size: 20px; line-height: 1.15; }
.row-text .card-meta, .card-meta { color: var(--muted); font-weight: 700; }
.chev { color: var(--ink); font-weight: 900; }
.add-row { border: 3px dashed var(--ink); background: #fff; box-shadow: none; }
.add-row .card-icon { background: var(--star); color: var(--ink); }
.card.game { background: #fff; }
.unit-row.done .card-icon { box-shadow: none; background: var(--mint); }
/* „Weiterlernen“, „Das üben wir noch einmal“, „Vokabeln wiederholen“: die kleine Zeile steht oben */
.continue-row .row-text, .again-row .row-text, .due-row .row-text { display: flex; flex-direction: column-reverse; gap: 0; }
.continue-row .card-meta, .again-row .card-meta, .due-row .card-meta { font-size: 12px; font-weight: 900; letter-spacing: 1.1px; text-transform: uppercase; }
.continue-row .row-text .card-title, .again-row .row-text .card-title, .due-row .row-text .card-title { font-size: 22px; }
.continue-row { background: #fff; border-color: var(--ink); }
.continue-row .card-meta { color: var(--primary); }
.again-row { background: var(--star); border-color: var(--ink); }
.again-row .card-meta, .due-row .card-meta { color: var(--ink); }
.due-row { background: var(--mint); border-color: var(--ink); }
.continue-row .card-icon, .again-row .card-icon, .due-row .card-icon { background: #fff; }
.again { align-items: center; gap: 10px; }
.nudge { background: #fff; border: var(--edge); border-radius: 20px; }
.nudge.hot { background: var(--sun); }
.ticket-banner { background: var(--star); color: var(--ink); border: var(--edge); border-radius: 20px; box-shadow: 0 4px 0 var(--ink); font-weight: 800; }
.ticket-banner.empty { background: #E9EDF7; color: var(--ink); }
.free-play-state { background: var(--sky); }
.free-play-state.on { background: var(--mint); color: var(--ink); }

/* Fächer: bunte Kacheln */
.subject-tile { gap: 4px; padding: 14px; border: var(--edge); border-radius: 22px; box-shadow: var(--shadow); background: var(--tile, #fff); color: var(--tile-ink, var(--ink)); }
.subject-tile:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.subject-tile:nth-child(5n+1) { --tile: var(--primary); --tile-ink: #fff; }
.subject-tile:nth-child(5n+2) { --tile: var(--fox); }
.subject-tile:nth-child(5n+3) { --tile: var(--mint); }
.subject-tile:nth-child(5n+4) { --tile: var(--star); }
.subject-tile:nth-child(5n+5) { --tile: var(--lilac); }
.subject-icon { width: auto; min-width: 46px; height: 40px; margin-bottom: 6px; padding: 0 9px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 19px; }
.subject-tile strong { font-size: 25px; line-height: 1.1; }
.subject-tile small { color: inherit; font-size: 14px; font-weight: 700; }
.subject-bar { height: 8px; margin-top: 8px; background: rgba(20, 27, 51, .22); }
.subject-bar span { background: var(--tile-ink, var(--ink)); }
.my-subject .subject-bar { background: var(--line); }
.my-subject .subject-bar span { background: var(--primary); }

/* Leiste unten: schwebt, der gewählte Punkt ist in Tinte gefüllt */
.screen.hub { padding-bottom: calc(124px + env(safe-area-inset-bottom)); }
.tabbar { left: 14px; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); gap: 6px; padding: 6px; background: #fff; border: var(--edge); border-radius: 26px; box-shadow: var(--shadow); -webkit-backdrop-filter: none; backdrop-filter: none; }
.tab-item { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 52px; padding: 4px 6px; border-radius: 18px; color: var(--ink); font-size: 18px; }
.tab-icon { width: auto; height: auto; border-radius: 0; }
.tab-icon svg { width: 22px; height: 22px; }
.tab-avatar .companion { width: 30px; margin: -4px 0 0; }
.tab-item.active { background: var(--ink); color: #fff; }
.tab-item.active .tab-icon { background: none; }
@media (min-width: 700px) { .tabbar { left: 50%; right: auto; bottom: 18px; width: 440px; transform: translateX(-50%); border: var(--edge); border-radius: 26px; padding: 6px; box-shadow: var(--shadow); } }

/* Wer lernt? und Begleiter gestalten */
.who-tile { border: var(--edge); border-radius: 26px; box-shadow: var(--shadow); }
.who-tile:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.who-tile strong { font-size: 24px; }
.who-tile.add { border: 3px dashed var(--ink); background: #fff; box-shadow: none; color: var(--ink); }
.who-title { font-size: 40px; }
.companion-option, .part-option { border: 2.5px solid var(--line); background: #fff; }
.companion-option.selected, .part-option.selected { border-color: var(--ink); background: var(--sun); box-shadow: var(--shadow-s); }
.editor-tab { color: var(--muted); }
.editor-tab.selected { color: var(--ink); }
.editor-tab.selected .editor-tab-icon { background: var(--star); box-shadow: inset 0 0 0 2.5px var(--ink); }
.editor-tab.dice { background: none; }
.chip { border: 2.5px solid var(--ink); background: #fff; font-weight: 800; }
.chip.trick:hover { border-color: var(--primary); }

/* Lernrunde */
.progress-bar { height: 22px; border: var(--edge); background: #fff; }
.progress-fill, .progress-bar > span { background: var(--mint); }
.task-card { border: var(--edge); border-radius: 26px; box-shadow: var(--shadow); }
.task-card.right { border-color: var(--ink); box-shadow: 0 5px 0 var(--good); }
.task-card.wrong { border-color: var(--ink); box-shadow: 0 5px 0 var(--bad); }
.task-passage { border-radius: 16px; }
.answer-display.empty { color: #B9C2DA; }
.key { border: var(--edge); border-radius: 16px; background: #fff; box-shadow: var(--shadow-s); }
.key:active { transform: translateY(3px); box-shadow: none; }
.key.ok { background: var(--mint); border-color: var(--ink); color: var(--ink); }
.choice { border: var(--edge); border-radius: 16px; background: #fff; box-shadow: var(--shadow-s); }
.choice:active { transform: translateY(3px); box-shadow: none; }
.choice.on { border-color: var(--ink); background: var(--star); }
.choice:disabled { box-shadow: none; }
.choices.multi .choice.picked { border-color: var(--ink); background: var(--sky); }
.choices.multi .choice.picked::after { color: var(--primary); }
.chip-word { border: 2.5px solid var(--ink); border-bottom-width: 5px; }
.chip-bank { background: var(--sky); }
.slot { border: 2.5px dashed #7F8AAB; background: var(--bg); }
.slot.active { border-color: var(--primary); background: var(--sky); }
.slot.over { border-color: var(--ink); background: var(--sun); }
.feedback.bad { background: #FFE9E6; border: 2.5px solid var(--ink); border-radius: 18px; font-family: 'Nunito', ui-rounded, system-ui, sans-serif; font-weight: 700; }
.feedback-title { font-family: var(--display); font-size: 1.25rem; }
.mark-pen.on { border-color: var(--ink); }
.celebrate h2 { font-size: 2rem; }

/* Fortschritt */
.week-dot i { border: 2.5px solid var(--ink); background: #fff; color: var(--ink); }
.week-dot.on i { background: var(--mint); border-color: var(--ink); }
.week-dot.today i { box-shadow: 0 3px 0 var(--ink); }
.week-dot.future i { border-style: dashed; border-color: #7F8AAB; }
.week-bars i { background: var(--line); }
.week-bars i.on { background: var(--primary); }
.level-mark { background: var(--sky); color: var(--ink); border: 2px solid var(--ink); }
.level-sure .level-mark { background: var(--mint); color: var(--ink); }
.level-shaky .level-mark { background: var(--star); color: var(--ink); }
.level-sure .unit-progress-text small { color: #0F6B4B; }
.level-shaky .unit-progress-text small { color: #7A4B00; }
.progress-note.good strong { color: #0F6B4B; }
.progress-note.hard strong { color: #7A4B00; }
.my-badge { background: var(--star); }
.my-cheer { font-family: var(--display); font-size: 1.3rem; }

/* Sticker-Look: Feinschliff */
.chev { display: grid; place-items: center; width: 24px; height: 24px; font-size: 0; }
.chev svg { width: 22px; height: 22px; }
/* Empfehlung auf der Startseite: eine gelbe Karte, „Später“ steht als Wort darin */
.again { background: var(--star); border: var(--edge); border-radius: 20px; box-shadow: 0 4px 0 var(--ink); padding-right: 8px; gap: 4px; }
.again:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.again .again-row, .again .again-row:active { border: 0; box-shadow: none; background: none; transform: none; }
.again .again-row .chev { display: none; }
.again .again-later, .again .again-later:active { border: 0; box-shadow: none; background: none; transform: none; padding: 12px 10px; font-family: 'Nunito', system-ui, sans-serif; font-weight: 800; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
/* Spielen trägt Fuchs-Orange */
.card.game .btn.primary { background: var(--fox); color: var(--ink); }
.who-plus { background: var(--star); border: var(--edge); color: var(--ink); }
.card.add-row { border: 3px dashed var(--ink); box-shadow: none; }
.round-head h2 { font-size: 18px; line-height: 1.15; }
@media (max-width: 560px) { .round-head h2 { font-size: 17px; } }

/* Ladeanzeige „Weckruf“ (js/core/loader.js): Die Begleiter schlafen in einer Reihe; der Stern auf dem Balken weckt sie der Reihe nach. */
.boot-screen { min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 22px; padding: 24px 16px 15vh; }
.boot-screen .logo { margin: 0; font-size: clamp(34px, 10vw, 46px); line-height: 1; color: var(--ink); }
.buddy-loader { display: grid; gap: 4px; width: 100%; max-width: 420px; margin: 0 auto; padding: 0 16px; }
.buddy-line { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; margin-bottom: -3px; }
.buddy { position: relative; display: block; transform-origin: 50% 100%; transform: translateY(3px) scale(.78); transition: transform .3s; }
.buddy > img, .buddy > .companion { display: block; width: 100%; height: auto; filter: grayscale(1); opacity: .34; transition: filter .3s, opacity .3s; user-select: none; -webkit-user-drag: none; }
.buddy > .companion > img, .buddy > .companion > svg { animation: none; }
.buddy::after { content: 'z'; position: absolute; right: 8%; top: 0; font-family: var(--display); font-weight: 800; font-size: 15px; line-height: 1; color: var(--muted); opacity: 0; animation: buddy-snore 2.4s ease-in infinite; animation-delay: calc(var(--n, 0) * .37s); }
.buddy:nth-child(2) { --n: 1; } .buddy:nth-child(3) { --n: 2; } .buddy:nth-child(4) { --n: 3; } .buddy:nth-child(5) { --n: 4; } .buddy:nth-child(6) { --n: 5; }
.buddy.awake { transform: none; animation: buddy-wake .6s cubic-bezier(.3, 1.5, .5, 1), buddy-bob 1.5s ease-in-out infinite; animation-delay: 0s, calc(.6s + var(--n, 0) * .13s); }
.buddy.awake > img, .buddy.awake > .companion { filter: none; opacity: 1; }
.buddy.awake::after { content: none; }
.buddy-loader.done .buddy { animation: buddy-cheer .55s ease-in-out 3; animation-delay: calc(var(--n, 0) * .07s); }
.buddy-track { position: relative; height: 22px; border: var(--edge); border-radius: 999px; background: #fff; box-shadow: var(--shadow-s); }
.buddy-fill { position: absolute; left: -1px; top: -1px; bottom: -1px; width: 0; min-width: 20px; border-radius: 999px; background: var(--mint); transition: width .35s linear; }
.buddy-fill::after { content: '⭐'; position: absolute; right: -15px; top: 50%; margin-top: -15px; width: 30px; height: 30px; font-size: 26px; line-height: 30px; text-align: center; animation: buddy-star 1.4s ease-in-out infinite; }
.buddy-text { min-height: 1.5em; margin: 12px -16px 0; text-align: center; font-weight: 800; font-size: clamp(14px, 4.4vw, 17px); color: var(--muted); }
.upload-progress .buddy-loader, .build-progress .buddy-loader { max-width: 380px; }
.build-progress .buddy-loader { margin: 4px auto 14px; }
.build-progress .buddy-text { display: none; }
@keyframes buddy-snore { 0% { opacity: 0; transform: translate(0, 8px) scale(.7); } 30% { opacity: .9; } 100% { opacity: 0; transform: translate(7px, -10px) scale(1.15); } }
@keyframes buddy-wake { 0% { transform: translateY(3px) scale(.78); } 45% { transform: translateY(-34%) scale(1.14) rotate(-7deg); } 75% { transform: translateY(0) scale(1.04, .94); } 100% { transform: none; } }
@keyframes buddy-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7%); } }
@keyframes buddy-cheer { 0%, 100% { transform: translateY(0) rotate(0); } 40% { transform: translateY(-30%) rotate(6deg); } 70% { transform: translateY(0) scale(1.05, .93); } }
@keyframes buddy-star { 0%, 100% { transform: rotate(-14deg) scale(1); } 50% { transform: rotate(14deg) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .buddy, .buddy.awake, .buddy-loader.done .buddy, .buddy::after, .buddy-fill::after { animation: none !important; } .buddy::after { opacity: .7; } }

/* Klassen (js/core/klassen.js): Zeile „Deine Klasse 4b“, Klassenregal, „Mit der Klasse teilen“, Für Eltern → Klasse */
.class-slot { margin: 12px 0 0; }
.class-slot:empty { display: none; }
.new-dot { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; padding: 0 8px; border: 2px solid var(--ink); border-radius: 999px; background: var(--star); color: var(--ink); font-size: 12px; font-weight: 900; line-height: 1.5; vertical-align: 1px; white-space: nowrap; }
.new-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--fox); border: 1.5px solid var(--ink); }
.row-text > .new-dot { justify-self: start; margin: 4px 0 0; }
.shelf-item { flex-wrap: wrap; gap: 8px 12px; }
.shelf-item .companion { width: 48px; flex: none; }
.shelf-item .row-text { flex: 1 1 140px; }
.shelf-item > .btn { flex: none; margin-left: auto; }
.class-kids { margin-top: 2px; }
.class-kids .friend { cursor: default; }
.share-class { margin: 12px 0; }
.share-class h2 { margin: 0 0 6px; }
.class-picks { display: grid; gap: 10px; margin-top: 12px; }
.class-picks > .btn { width: 100%; }
.class-state p { margin: 0 0 4px; }
.class-state .card-actions { margin-top: 6px; }
.class-link .share-qr { margin: 8px auto 14px; width: 220px; }
.class-link .card-actions { margin-bottom: 12px; }
.class-screen .mod .btn { flex: none; }
.class-screen .mod-text strong { overflow-wrap: anywhere; }
/* Schulen (Klassen, Etappe 2 und 3): Suche, „in der Nähe“, Schule eintragen, Anfragen */
.class-school { margin: 0 0 6px; font-weight: 800; overflow-wrap: anywhere; }
.class-school::before { content: '🏫 '; }
.school-picker .field { margin-bottom: 8px; }
.school-picker > .card-actions { margin: 0 0 10px; }
.school-results { margin: 10px 0 4px; }
.school-results > .lead { margin: 0; }
.school-row .card-icon { width: 40px; height: 40px; font-size: 20px; }
.school-row .row-text .card-title { font-size: 15px; overflow-wrap: break-word; hyphens: auto; }
@media (max-width: 360px) { .school-row { gap: 10px; padding: 10px 12px; } .school-row .card-icon { width: 34px; height: 34px; font-size: 17px; } }
.school-note { justify-self: start; display: inline-block; margin-top: 4px; padding: 0 8px; border: 2px solid var(--ink); border-radius: 999px; background: var(--sky); color: var(--ink); font-size: 12px; font-weight: 800; line-height: 1.5; }
.school-source { margin: 14px 0 4px; font-size: 14px; }
.school-source > summary { cursor: pointer; font-weight: 800; }
.school-source ul { margin: 6px 0; padding-left: 20px; }
.school-source li, .school-source p { margin: 4px 0; overflow-wrap: anywhere; }
.school-missing:empty { display: none; }
.school-missing > .panel { margin-top: 12px; }
.zip-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.form-grid > .field { min-width: 0; }
.class-school-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 4px; }
.class-school-pick .class-school { flex: 1 1 180px; margin: 0; }
.class-school-pick > .btn { flex: none; }
.class-similar .class-picks .btn, .class-exists .card-actions .btn { white-space: normal; }
.class-asks:empty { display: none; }
.class-asks { display: grid; gap: 10px; margin: 12px 0; }
.class-asks-title { margin: 4px 0 0; }
.class-ask { flex-wrap: wrap; }
.class-ask .companion { width: 48px; flex: none; }
.class-ask .mod-text { flex: 1 1 160px; }
.class-ask .mod-text strong { overflow-wrap: anywhere; }
.class-ask > .card-actions { flex-basis: 100%; margin: 0; }
.class-ask.mine > .btn { flex: none; margin-left: auto; }
.class-ask-state { margin-top: 2px; }
/* Sehr schmale Handys (320 px): Die Kopfzeile passt, der Name wird notfalls gekürzt statt seitlich zu scrollen */
@media (max-width: 360px) {
  .topbar { gap: 6px; }
  .topbar .who { min-width: 0; padding-right: 10px; }
  .topbar .who span:not(.companion) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .wallet { flex: none; gap: 4px; }
  .topbar .pill { padding: 4px 7px; font-size: 14px; }
}
