:root {
  --ink: #1a1616;
  --ink-2: #463f3f;
  --paper: #ebe6e0;
  --card: #ddd6ce;
  --line: #bfb5ab;
  --red: #a8232e;
  --red-soft: #f2d3d6;
  --green: #1f6b57;
  --green-soft: #e1ede9;
  --gold: #a5620b;
  --dark: #2a2626;
  --surface: #ffffff;
  --head-fg: #ffffff;
  --radius: 14px;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Farben für Balken und Wortwolke */
  --c0: #a8232e; --c1: #1f6b57; --c2: #a5620b; --c3: #4b5aa8; --c4: #7a3d8f; --c5: #2f7f9a; --c6: #8a6d1f; --c7: #5d5656;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ink: #f3eeec; --ink-2: #b7adab; --paper: #1c1919; --card: #312c2c; --line: #423b3b; --surface: #262222;
  --red: #e0545f; --red-soft: #432427; --green: #4fae92; --green-soft: #1f3a33; --gold: #d08a2c; --dark: #0f0d0d; --head-fg: #f3eeec;
  --c0: #d9505b; --c1: #3f9c80; --c2: #d08a2c; --c3: #7484d6; --c4: #a96bbd; --c5: #4ba6c2; --c6: #b7983f; --c7: #8f8686;
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --ink: #f3eeec; --ink-2: #b7adab; --paper: #1c1919; --card: #312c2c; --line: #423b3b; --surface: #262222;
  --red: #e0545f; --red-soft: #432427; --green: #4fae92; --green-soft: #1f3a33; --gold: #d08a2c; --dark: #0f0d0d; --head-fg: #f3eeec;
  --c0: #d9505b; --c1: #3f9c80; --c2: #d08a2c; --c3: #7484d6; --c4: #a96bbd; --c5: #4ba6c2; --c6: #b7983f; --c7: #8f8686;
  color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.4; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .5em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }

/* Grundbausteine */
.btn { border: 0; border-radius: 10px; padding: .7em 1.2em; font-weight: 600; background: var(--card); color: var(--ink); min-height: 44px; }
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--red); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.big { font-size: 1.15rem; padding: .9em 1.4em; width: 100%; }
.input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: .65em .8em; min-height: 44px; }
.input:focus, .btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--red) 35%, transparent); outline-offset: 1px; }
label.field { display: block; margin: .6em 0; }
label.field > span { display: block; font-size: .85rem; color: var(--ink-2); margin-bottom: .25em; }
.error { color: var(--red); font-weight: 600; min-height: 1.4em; }
.logo { display: inline-flex; align-items: center; gap: .5em; font-family: var(--serif); font-weight: 700; font-size: 1.25rem; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--red); display: grid; place-items: center; color: #fff; font-family: var(--sans); font-size: .95rem; }

/* ---------- Einstiegsseite & Teilnehmen ---------- */
.narrow { max-width: 520px; margin: 0 auto; padding: 24px 16px 48px; }
.hero { text-align: center; padding: 8vh 0 4vh; }
.code-input { font-size: 2rem; letter-spacing: .25em; text-align: center; font-weight: 700; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }

.p-question { font-size: 1.5rem; margin: 18px 0; }
.choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: 12px; padding: 14px 16px; font-size: 1.1rem; min-height: 56px; }
.choice.selected { border-color: var(--red); background: var(--red-soft); }
.choice .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.choice.multi .dot { border-radius: 6px; }
.choice.selected .dot { background: var(--red); border-color: var(--red); }
.quiz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-btn { border: 0; border-radius: 12px; color: #fff; font-weight: 700; font-size: 1.1rem; min-height: 96px; padding: 12px; }
.quiz-btn.c0 { background: var(--c0); } .quiz-btn.c1 { background: var(--c1); } .quiz-btn.c2 { background: var(--c2); } .quiz-btn.c3 { background: var(--c3); }
.quiz-btn.c4 { background: var(--c4); } .quiz-btn.c5 { background: var(--c5); } .quiz-btn.c6 { background: var(--c6); } .quiz-btn.c7 { background: var(--c7); }
.quiz-btn.dim { opacity: .3; }
.scale-row { margin: 16px 0; }
.scale-row input[type=range] { width: 100%; accent-color: var(--red); height: 36px; }
.scale-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--ink-2); }
.scale-value { font-weight: 700; color: var(--red); }
.status { text-align: center; padding: 10vh 0; }
.status .big-emoji { font-size: 3.5rem; }
.feedback { border-radius: var(--radius); padding: 22px; text-align: center; color: #fff; font-size: 1.3rem; font-weight: 700; }
.feedback.ok { background: var(--green); } .feedback.no { background: var(--red); }
.timerbar { height: 8px; background: var(--card); border-radius: 4px; overflow: hidden; margin: 8px 0 14px; }
.timerbar > div { height: 100%; background: var(--red); transition: width .25s linear; }

/* ---------- Editor ---------- */
.editor { max-width: 980px; margin: 0 auto; padding: 20px 16px 120px; }
.ed-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 10px 0 18px; }
.ed-q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.ed-q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tag { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .25em .6em; border-radius: 6px; background: var(--card); }
.tag-choice { background: var(--red-soft); color: var(--red); } .tag-wordcloud { background: var(--green-soft); color: var(--green); }
.tag-scale { background: #e7e9f6; color: #3c4a96; } .tag-quiz { background: #f5eadb; color: var(--gold); }
.ed-q-head .spacer { flex: 1; }
.icon-btn { border: 0; background: transparent; border-radius: 8px; width: 40px; height: 40px; font-size: 1.05rem; }
.icon-btn:hover { background: var(--card); }
.opt-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.opt-row .input { flex: 1; }
.opt-row input[type=radio] { width: 22px; height: 22px; accent-color: var(--green); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.add-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.sticky-start { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px; justify-content: center; align-items: center; z-index: 5; }
.check { display: inline-flex; align-items: center; gap: 8px; margin: 6px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--red); }

/* ---------- Beamer-Ansicht ---------- */
.stage { display: grid; grid-template-rows: auto 1fr auto; height: 100vh; height: 100dvh; background: var(--paper); }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 28px; background: var(--dark); color: var(--head-fg); }
.join-hint { font-size: 1.1rem; }
.join-hint b { font-size: 1.6rem; letter-spacing: .12em; margin-left: .3em; }
.stage-body { display: grid; grid-template-columns: 1fr auto; gap: 28px; padding: 28px 36px; min-height: 0; overflow: hidden; }
.stage-main { display: flex; flex-direction: column; min-height: 0; }
.stage-q { font-size: clamp(1.6rem, 3.4vw, 3rem); margin-bottom: .6em; }
.stage-side { width: 230px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.qr { background: #ffffff; padding: 10px; border-radius: 12px; border: 1px solid var(--line); width: 210px; height: 210px; }
.qr img { width: 100%; height: 100%; display: block; }
.counter { font-size: 2.2rem; font-weight: 700; font-family: var(--serif); }
.stage-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 20px; background: var(--surface); border-top: 1px solid var(--line); }
.stage-foot .spacer { flex: 1; }
.progress { color: var(--ink-2); font-weight: 600; margin: 0 6px; }
.stage.fullscreen .stage-foot { opacity: .15; transition: opacity .2s; }
.stage.fullscreen .stage-foot:hover, .stage.fullscreen .stage-foot:focus-within { opacity: 1; }

.bars { display: flex; align-items: flex-end; gap: 3%; flex: 1; min-height: 0; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.bar-fill { width: 100%; border-radius: 10px 10px 0 0; transition: height .5s cubic-bezier(.2,.8,.2,1); min-height: 4px; }
.bar-num { font-size: clamp(1.1rem, 2vw, 1.8rem); font-weight: 700; margin-bottom: 6px; }
.bar-label { font-size: clamp(.9rem, 1.4vw, 1.25rem); text-align: center; margin-top: 10px; font-weight: 600; overflow-wrap: anywhere; }
.bar.correct .bar-label::before { content: "✓ "; color: var(--green); }
.bar.wrong .bar-fill { opacity: .25; }

.cloud { flex: 1; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: .15em .6em; padding: 10px; overflow: hidden; }
.cloud-word { font-family: var(--serif); font-weight: 700; line-height: 1.05; border: 0; background: transparent; padding: 0 .1em; border-radius: 6px; animation: pop .35s ease-out; }
.cloud-word:hover { background: var(--red-soft); text-decoration: line-through; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.scales { display: flex; flex-direction: column; justify-content: center; gap: 22px; flex: 1; }
.scale-item .s-label { font-size: clamp(1rem, 1.8vw, 1.5rem); font-weight: 600; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 10px; }
.scale-track { position: relative; height: 22px; background: var(--card); border-radius: 11px; }
.scale-dot { position: absolute; top: 50%; width: 30px; height: 30px; border-radius: 50%; background: var(--red); transform: translate(-50%, -50%); transition: left .5s; border: 4px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.scale-ends { display: flex; justify-content: space-between; color: var(--ink-2); font-size: .95rem; margin-top: 6px; }

.waiting { flex: 1; display: grid; place-items: center; text-align: center; color: var(--ink-2); font-size: 1.4rem; }
.countdown { font-family: var(--serif); font-size: clamp(3rem, 8vw, 7rem); font-weight: 700; color: var(--red); }
.board { list-style: none; padding: 0; margin: 0 auto; width: min(720px, 100%); }
.board li { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; margin: 8px 0; font-size: 1.35rem; animation: pop .35s ease-out both; }
.board .rank { font-family: var(--serif); font-weight: 700; width: 2em; color: var(--ink-2); }
.board li:first-child .rank { color: var(--gold); }
.board .name { flex: 1; font-weight: 600; }
.board .score { font-weight: 700; }

@media (max-width: 760px) {
  .stage-body { grid-template-columns: 1fr; padding: 16px; }
  .stage-side { width: auto; flex-direction: row; justify-content: center; }
  .qr { width: 110px; height: 110px; }
  .stage-head { padding: 10px 16px; }
}
.mt { margin-top: 1.5em; } .center { text-align: center; }
.row-inline { display: flex; flex-wrap: wrap; gap: 8px; }
.title-input { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; border-color: transparent; background: transparent; padding-left: 0; }
.title-input:hover, .title-input:focus { border-color: var(--line); background: var(--surface); padding-left: .8em; }
.pw-input { max-width: 220px; }
.narrow-field { max-width: 220px; }
.stage-content { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.board-wrap { flex: 1; overflow: auto; }
.quiz-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(820px, 90vw); margin: 18px auto 0; }
.quiz-preview .quiz-btn { min-height: 70px; display: grid; place-items: center; font-size: clamp(1rem, 1.8vw, 1.5rem); }
.timerbar.wide { width: min(820px, 90vw); margin: 10px auto; height: 12px; }
@media (max-width: 760px) { .topbar { flex-wrap: wrap; gap: 8px; } }
.center-block { display: block; text-align: center; text-decoration: none; }
.word-input { margin: 6px 0; font-size: 1.15rem; }
.s-row-head { display: flex; justify-content: space-between; gap: 10px; }
.mini-row { margin: 8px 0; }
.mini-label { display: flex; justify-content: space-between; font-size: .9rem; }
.mini-row .timerbar { margin: 4px 0 0; }
.small-board li { font-size: 1.05rem; padding: 10px 14px; }
/* Schüleransicht vertikal zentrieren */
body:has(main.pt) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main.pt { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: center; }
main.pt .p-question { text-align: center; margin-top: 0; }
main.pt .status { padding: 2vh 0; }

/* ---------- Hell/Dunkel-Schalter ---------- */
.theme-btn { border: 0; background: transparent; color: inherit; width: 40px; height: 40px; border-radius: 10px; font-size: 1.15rem; cursor: pointer; }
.theme-btn:hover { background: var(--card); } .stage-head .theme-btn:hover { background: rgba(255,255,255,.12); }
.head-tools { display: flex; align-items: center; gap: 8px; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

/* ---------- Bewegung ---------- */
body, .topbar, .stage-foot, .sticky-start, .ed-q, .card, .choice, .board li, .input { transition: background-color .35s ease, border-color .35s ease, color .35s ease; }
.btn, .icon-btn { transition: transform .12s ease, filter .15s ease, background-color .25s ease; }
.btn:active:not(:disabled), .choice:active, .quiz-btn:active:not(:disabled) { transform: scale(.97); }
.choice { transition: border-color .2s, background-color .2s, transform .12s; }
.choice .dot { transition: background-color .2s, border-color .2s, transform .2s; } .choice.selected .dot { transform: scale(1.12); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
@keyframes popin { 0% { opacity: 0; transform: scale(.85) } 60% { opacity: 1; transform: scale(1.04) } 100% { transform: none } }
@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
@keyframes pulse { 0%, 100% { transform: scale(1) } 50% { transform: scale(1.12) } }
@keyframes shake { 0%, 100% { transform: none } 25% { transform: translateX(-7px) } 75% { transform: translateX(7px) } }
.enter > * { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.enter > *:nth-child(2) { animation-delay: .07s } .enter > *:nth-child(3) { animation-delay: .14s } .enter > *:nth-child(4) { animation-delay: .21s }
.choices > *, .board li { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.quiz-grid > *, .quiz-preview > * { animation: popin .45s cubic-bezier(.2,.8,.2,1) both; }
.choices > *:nth-child(2), .quiz-grid > *:nth-child(2), .quiz-preview > *:nth-child(2), .board li:nth-child(2) { animation-delay: .1s }
.choices > *:nth-child(3), .quiz-grid > *:nth-child(3), .quiz-preview > *:nth-child(3), .board li:nth-child(3) { animation-delay: .16s }
.choices > *:nth-child(4), .quiz-grid > *:nth-child(4), .quiz-preview > *:nth-child(4), .board li:nth-child(4) { animation-delay: .22s }
.choices > *:nth-child(n+5), .quiz-grid > *:nth-child(n+5), .quiz-preview > *:nth-child(n+5), .board li:nth-child(n+5) { animation-delay: .28s }
.status .big-emoji { display: inline-block; animation: popin .5s cubic-bezier(.2,.8,.2,1) both; }
.status.wait .big-emoji { animation: popin .5s both, bob 2.4s ease-in-out .5s infinite; }
.feedback.ok { animation: popin .55s cubic-bezier(.2,.8,.2,1) both; } .feedback.no { animation: shake .4s ease both; }
.countdown.hurry { animation: pulse 1s ease-in-out infinite; }
.timerbar.hurry > div { background: var(--gold); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.theme-corner { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); right: calc(10px + env(safe-area-inset-right, 0px)); z-index: 6; }
.stage-head .logo { margin-left: auto; }
.ed-q, .card, .choice, .board li { box-shadow: 0 1px 2px rgba(40, 25, 20, .08), 0 2px 8px rgba(40, 25, 20, .06); }
.stage-q { text-align: center; }

/* ---------- Eingerahmte, kompakte Darstellung ---------- */
.stage-body { align-self: center; justify-self: center; width: min(1180px, calc(100% - 48px)); height: min(600px, calc(100% - 48px)); padding: 32px 36px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 2px 6px rgba(40, 25, 20, .08), 0 12px 32px rgba(40, 25, 20, .10); }
.stage-side { border-left: 1px solid var(--line); padding-left: 24px; justify-content: center; }
.frame { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px 20px; box-shadow: 0 2px 6px rgba(40, 25, 20, .08), 0 12px 32px rgba(40, 25, 20, .10); }
.frame .choice, .frame .card, .frame .board li, .frame .input { background: var(--paper); box-shadow: none; }
.frame .p-question { margin-bottom: 16px; }
@media (max-width: 760px) {
  .stage-body { width: calc(100% - 24px); height: auto; padding: 20px; }
  .stage-side { border-left: 0; padding-left: 0; }
}

/* ---------- Editor größer ---------- */
.ed-q { padding: 20px; font-size: 1.08rem; }
.ed-q-head b { font-family: var(--serif); font-size: 1.5rem; }
.ed-q .tag { font-size: .95rem; padding: .3em .7em; border-radius: 8px; }
.ed-q label.field > span, .ed-q > span.muted.small { font-size: .98rem; font-weight: 600; color: var(--ink-2); }
.ed-q .input { font-size: 1.1rem; min-height: 50px; }
.ed-q .icon-btn { width: 44px; height: 44px; font-size: 1.15rem; }
.title-input { font-size: 2rem; }
.add-bar .btn { font-size: 1.05rem; }

.linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

/* =====================================================================
   Kompass-Design (wie Kompass und Teams): Weinrot als Leitfarbe, Kopfleiste in Weinrot,
   weiße Karten mit „mittlerem“ Schatten auf hellem Grund, Wortmarke in Versalien.
   ===================================================================== */
:root {
  --ink: #221a1d; --ink-2: #5b4a50; --paper: #f6f3f4; --card: #ece5e7; --line: #ded2d6;
  --red: #8b1d3f; --red-soft: #f4e2e7; --green: #2e7d5b; --green-soft: #dbeee5; --gold: #9d7a12;
  --dark: #8b1d3f; --surface: #ffffff; --head-fg: #ffffff;
  --schatten: 0 1px 2px rgba(34,26,29,.06), 0 8px 24px -16px rgba(34,26,29,.35);
  --schatten-gross: 0 2px 6px rgba(34,26,29,.08), 0 18px 40px -22px rgba(34,26,29,.45);
  --radius: 12px;
  --serif: "IBM Plex Serif", Georgia, "Iowan Old Style", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --c0: #8b1d3f; --c1: #2e7d5b; --c2: #b45a1c; --c3: #3f5aa8; --c4: #7a3d8f; --c5: #1f7f9a; --c6: #9d7a12; --c7: #5b4a50;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ink: #f0e7e9; --ink-2: #c0abb1; --paper: #14100f; --card: #2a2024; --line: #3b2f34; --surface: #1e1719;
  --red: #e08ba3; --red-soft: #3a1c26; --green: #5cbb8c; --green-soft: #1b3a2c; --gold: #cfa93f; --dark: #6d1631; --head-fg: #f7eaee;
  --schatten: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -18px rgba(0,0,0,.8);
  --schatten-gross: 0 2px 6px rgba(0,0,0,.4), 0 18px 40px -20px rgba(0,0,0,.9);
  --c0: #c94a6c; --c1: #3f9c75; --c2: #d07a3c; --c3: #6d84d6; --c4: #a96bbd; --c5: #3fa3c0; --c6: #c2a03a; --c7: #8f7a80; } }
:root[data-theme="dark"] {
  --ink: #f0e7e9; --ink-2: #c0abb1; --paper: #14100f; --card: #2a2024; --line: #3b2f34; --surface: #1e1719;
  --red: #e08ba3; --red-soft: #3a1c26; --green: #5cbb8c; --green-soft: #1b3a2c; --gold: #cfa93f; --dark: #6d1631; --head-fg: #f7eaee;
  --schatten: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -18px rgba(0,0,0,.8);
  --schatten-gross: 0 2px 6px rgba(0,0,0,.4), 0 18px 40px -20px rgba(0,0,0,.9);
  --c0: #c94a6c; --c1: #3f9c75; --c2: #d07a3c; --c3: #6d84d6; --c4: #a96bbd; --c5: #3fa3c0; --c6: #c2a03a; --c7: #8f7a80; }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .btn.green { color: #1e1719; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary, :root:not([data-theme="light"]) .btn.green { color: #1e1719; } }
body { font-size: 15.5px; }
h1, h2, h3 { font-weight: 600; }

/* Kopfleiste in Weinrot mit Wortmarke */
.topbar { background: var(--dark); color: var(--head-fg); border-bottom: 1px solid rgba(255,255,255,.18); min-height: 58px; padding: 0 18px; position: sticky; top: 0; z-index: 20; }
.topbar .muted, .stage-head .muted { color: inherit; opacity: .85; }
.logo { font-family: var(--serif); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-size: 1.1rem; }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; background: #fff url("icon.svg") center / 100% no-repeat; color: transparent; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.topbar .theme-btn:hover, .stage-head .theme-btn:hover { background: rgba(255,255,255,.14); }
#title { text-transform: none; letter-spacing: 0; }
.hero .logo { color: var(--red); font-size: 1.4rem; }
.hero .logo-mark { width: 44px; height: 44px; border-radius: 11px; }

/* Karten mit Schatten (Kompass „mittel“) */
.card, .ed-q, .frame, .board li, .choice { border-color: var(--line); box-shadow: var(--schatten); }
.stage-body, .frame { box-shadow: var(--schatten-gross); border-color: var(--line); }
.frame .choice, .frame .card, .frame .board li, .frame .input { background: var(--surface); box-shadow: var(--schatten); }
.btn { border-radius: 10px; }
.btn:not(.primary):not(.green):not(.ghost) { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(34,26,29,.06); }
.btn.ghost { background: transparent; }
.sticky-start, .stage-foot { box-shadow: 0 -8px 24px -18px rgba(34,26,29,.4); }
.tag-scale { background: #e4e8f6; color: #3f5aa8; } .tag-quiz { background: #f7ecd3; color: #8a6a0e; }
:root[data-theme="dark"] .tag-scale { background: #1f2540; color: #9fb0ec; } :root[data-theme="dark"] .tag-quiz { background: #35290f; color: #e0c26a; }

/* ---------- Medien (Bild, Ton, Video) ---------- */
.media-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 4px; }
.media-bar .btn { min-height: 40px; padding: .45em .9em; font-size: .98rem; }
.media-prev { display: flex; gap: 12px; align-items: center; margin: 8px 0; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; background: var(--paper); }
.media-prev img { max-width: 160px; max-height: 110px; border-radius: 8px; display: block; }
.media-prev audio { max-width: 280px; }
.media-prev .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.stage-media { display: flex; justify-content: center; margin: 0 0 14px; min-height: 0; }
.stage-media img { max-width: 100%; max-height: 34vh; border-radius: 12px; box-shadow: var(--schatten); cursor: zoom-in; object-fit: contain; }
.stage-media.gross img { max-height: 52vh; }
.stage-media iframe { width: min(100%, calc(42vh * 16 / 9)); aspect-ratio: 16 / 9; border: 0; border-radius: 12px; box-shadow: var(--schatten); }
.stage-media audio { width: min(520px, 100%); }
.media-zoom { position: fixed; inset: 0; z-index: 50; background: rgba(20,16,15,.88); display: grid; place-items: center; cursor: zoom-out; }
.media-zoom img { max-width: 94vw; max-height: 92vh; border-radius: 10px; }
.p-media { display: flex; justify-content: center; margin: 0 0 14px; }
.p-media img { max-width: 100%; max-height: 32vh; border-radius: 12px; box-shadow: var(--schatten); }
.p-hint { text-align: center; margin: -6px 0 12px; }
.topbar .btn, .topbar .btn.ghost { background: transparent; color: var(--head-fg); border: 1px solid rgba(255,255,255,.4); box-shadow: none; min-height: 38px; padding: .4em .9em; }
.topbar .btn:hover { background: rgba(255,255,255,.14); filter: none; }
