/* ══ Lehrertools – gemeinsames Aussehen ══════════════════════════ */
:root {
  --bg: #fff; --ink: #111; --ink2: #333; --muted: #8a8a8a; --line: #e7e7e7; --soft: #f5f5f5; --panel: #fff; --shadow: rgba(0,0,0,.08);
  --inv-bg: #111; --inv-ink: #fff; --ok: #1f8a4c; --warn: #c98a00; --bad: #c2362b; --L: 38%; --S: 55%;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0b0b0b; --ink: #eee; --ink2: #ccc; --muted: #8a8a8a; --line: #262626; --soft: #151515; --panel: #121212; --shadow: rgba(0,0,0,.5);
  --inv-bg: #eee; --inv-ink: #111; --L: 70%; --S: 60%; color-scheme: dark; } }
:root[data-theme="dark"] { --bg: #0b0b0b; --ink: #eee; --ink2: #ccc; --muted: #8a8a8a; --line: #262626; --soft: #151515; --panel: #121212; --shadow: rgba(0,0,0,.5); --inv-bg: #eee; --inv-ink: #111; --L: 70%; --S: 60%; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); }

/* Knöpfe */
.btn { border: 1px solid var(--ink); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 9px 18px; min-height: 42px; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; justify-content: center; text-decoration: none; }
.btn.dark { background: var(--inv-bg); color: var(--inv-ink); border-color: var(--inv-bg); }
.btn.quiet { border-color: var(--line); }
.btn.small { min-height: 34px; padding: 5px 13px; font-size: 13.5px; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.go { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 13px; background: var(--bg); }

/* Unten: ? + ⚙ */
#dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 18px); z-index: 20; display: flex; align-items: center; gap: 22px; }
.fab { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--ink); display: grid; place-items: center; font-size: 22px; font-weight: 300; box-shadow: 0 6px 22px var(--shadow); }
.fab.main { width: 66px; height: 66px; font-size: 34px; background: var(--inv-bg); color: var(--inv-ink); border-color: var(--inv-bg); }
.fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.fab:disabled { opacity: .35; }
#menu { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 96px); z-index: 21; width: min(360px, calc(100vw - 24px)); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 10px; box-shadow: 0 10px 40px var(--shadow); animation: up .22s ease; }
#menu button, #menu a { display: flex; width: 100%; align-items: center; gap: 12px; border: 0; background: none; padding: 12px 12px; border-radius: 12px; font-size: 15px; text-decoration: none; text-align: start; }
#menu button:hover, #menu a:hover { background: var(--soft); }
@keyframes up { from { opacity: 0; transform: translate(-50%, 10px); } }

/* Fenster von unten */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.28); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet.open { opacity: 1; pointer-events: auto; }
.sheet .panel { width: min(640px, 100%); max-height: 92vh; max-height: 92dvh; overflow: auto; background: var(--panel); border-radius: 22px 22px 0 0; padding: 22px 20px calc(var(--safe-b) + 20px); transform: translateY(24px); transition: transform .25s; }
.sheet.open .panel { transform: none; }
.sheet h2 { font-weight: 400; font-size: 20px; margin: 0 0 12px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
textarea.inp, input.inp, select.inp { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 12px 14px; font-size: 16px; }
textarea.inp { min-height: 110px; resize: vertical; }
.inp:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.err { color: var(--bad); font-size: 14px; min-height: 1.2em; margin-top: 6px; }
#toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 14px); transform: translate(-50%, -30px); opacity: 0; transition: .25s; background: var(--inv-bg); color: var(--inv-ink); border-radius: 999px; padding: 9px 18px; font-size: 14px; z-index: 60; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ── Feuerschrift-Intro: 2 Sekunden ── */
#intro { position: fixed; inset: 0; z-index: 100; background: #050201; display: grid; place-items: center; animation: introOut .45s ease 1.6s forwards; }
#intro .fire { display: flex; flex-direction: column; align-items: center; gap: .1em; font-family: Georgia, "Times New Roman", serif; font-style: italic; }
#intro .fire span { font-size: clamp(26px, 7vw, 64px); line-height: 1.12; opacity: 0; letter-spacing: .01em;
  background: linear-gradient(0deg, #ff2a00 0%, #ff7a00 35%, #ffc400 65%, #fff3b0 100%); background-size: 100% 220%; -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 6px rgba(255,90,0,.75)) drop-shadow(0 -6px 16px rgba(255,40,0,.45));
  animation: ignite .5s ease-out forwards, flame .5s ease-in-out infinite alternate; }
#intro .fire span:nth-child(1) { animation-delay: 0s, 0s; } #intro .fire span:nth-child(2) { animation-delay: .16s, .1s; } #intro .fire span:nth-child(3) { animation-delay: .32s, .2s; }
#intro .fire span:nth-child(4) { animation-delay: .48s, .05s; } #intro .fire span:nth-child(5) { animation-delay: .64s, .15s; }
#intro .ember { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #ffb13b; box-shadow: 0 0 6px #ff6a00; opacity: 0; animation: ember 1.6s ease-out forwards; }
@keyframes ignite { 0% { opacity: 0; transform: translateY(14px) scale(.96); filter: blur(6px) drop-shadow(0 0 0 transparent); } 100% { opacity: 1; transform: none; } }
@keyframes flame { 0% { background-position: 0 0; } 100% { background-position: 0 100%; } }
@keyframes ember { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-38vh) translateX(var(--dx)); } }
@keyframes introOut { to { opacity: 0; visibility: hidden; } }
html.nointro #intro { display: none; }
@media (prefers-reduced-motion: reduce) { #intro .fire span { animation: none; opacity: 1; } #intro .ember { display: none; } }

/* ── Ergebnisse (Beamer, Lehrer, Schüler) ── */
.view { position: relative; width: 100%; height: 100%; }
.cloudCv { width: 100%; height: 100%; display: block; }
.cards { columns: 3 260px; column-gap: 14px; }
.card { break-inside: avoid; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid hsl(var(--h, 0) var(--S) var(--L)); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; font-size: 16px; overflow-wrap: anywhere; }
.card .meta { display: flex; gap: 10px; align-items: center; margin-top: 8px; font-size: 13px; color: var(--muted); }
.card .reply { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; font-size: 14.5px; }
.card.hidden, .card.review { opacity: .55; border-style: dashed; }
.likeBtn { border: 0; background: none; padding: 2px 4px; font-size: 14px; color: var(--muted); }
.likeBtn.on { color: var(--bad); }
.bars { display: grid; gap: 14px; max-width: 900px; margin: 0 auto; }
.bar .lbl { display: flex; justify-content: space-between; gap: 12px; font-size: 18px; margin-bottom: 5px; }
.bar .track { height: 18px; background: var(--soft); border-radius: 9px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--ink); border-radius: 9px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar.right .fill { background: var(--ok); } .bar.right .lbl b::after { content: "  ✓"; color: var(--ok); }
.bar.wrong .fill { opacity: .35; }
.cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 14px; overflow-x: auto; height: 100%; align-items: start; }
.col h3 { font-weight: 500; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; display: flex; justify-content: space-between; }
.col .card { margin-bottom: 10px; }
.big { font-size: clamp(22px, 3.2vw, 44px); font-weight: 300; line-height: 1.25; }
.prompt { font-size: clamp(19px, 2.4vw, 32px); font-weight: 300; line-height: 1.3; margin: 0 0 14px; }
.poem { break-inside: avoid; text-align: center; font-family: Georgia, "Times New Roman", serif; font-size: 19px; line-height: 1.5; padding: 22px 16px; margin: 0 0 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid hsl(var(--h, 0) var(--S) var(--L)); }
.story { font-family: Georgia, "Times New Roman", serif; font-size: clamp(18px, 2.2vw, 28px); line-height: 1.6; max-width: 980px; margin: 0 auto; }
.story .s { border-bottom: 3px solid hsl(var(--h, 0) var(--S) var(--L) / .55); padding-bottom: 1px; }
.story .s0 { font-style: italic; color: var(--muted); border: 0; }
.ampelBig { display: flex; gap: 4vw; justify-content: center; align-items: flex-end; height: 100%; }
.ampelBig .a { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: clamp(16px, 2vw, 26px); }
.ampelBig .dot { width: clamp(70px, 14vw, 190px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: clamp(22px, 3.4vw, 54px); font-weight: 300; transition: transform .5s; }
.g { background: #2e9e5b; } .y { background: #e6b400; } .r { background: #d9483b; }
.line { position: relative; height: 180px; margin: 20px 4% 10px; }
.line .axis { position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--ink); }
.line .dot { position: absolute; width: 18px; height: 18px; margin: -9px; border-radius: 50%; background: hsl(var(--h, 0) var(--S) var(--L)); border: 2px solid var(--bg); cursor: pointer; transition: left .6s, top .6s; }
.ends { display: flex; justify-content: space-between; font-size: 16px; color: var(--muted); margin: 0 4%; }
.line .avg { position: absolute; top: 12%; bottom: 12%; width: 2px; background: var(--bad); }
.line .avg::after { content: "Ø"; position: absolute; top: -20px; left: -4px; font-size: 13px; color: var(--bad); }
.timer { display: grid; place-items: center; height: 100%; }
.timer .t { font-size: clamp(64px, 18vw, 260px); font-weight: 200; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.timer.over .t { color: var(--bad); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.emptyState { display: grid; place-items: center; height: 100%; min-height: 160px; color: var(--muted); text-align: center; font-size: 18px; padding: 20px; }
.breath { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); margin: 18px auto; animation: breath 1.8s ease-in-out infinite; }
@keyframes breath { 50% { transform: scale(1.8); opacity: .35; } }
.twoCloud { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; height: 100%; }
.twoCloud > div { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
.twoCloud h3 { margin: 0 0 4px; font-weight: 400; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; }
.twoCloud canvas { flex: 1; min-height: 0; width: 100%; }
.diffRow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.diffRow b { font-weight: 500; margin-right: 4px; }
.estimate { position: relative; height: 150px; margin: 30px 5% 0; }
.estimate .axis { position: absolute; left: 0; right: 0; bottom: 30px; height: 2px; background: var(--ink); }
.estimate .dot { position: absolute; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: hsl(var(--h, 0) var(--S) var(--L)); }
.estimate .truth { position: absolute; bottom: 20px; top: 0; width: 3px; margin-left: -1.5px; background: var(--ok); }
.estimate .truth span { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); white-space: nowrap; color: var(--ok); font-weight: 600; }
.estimate .tick { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 13px; color: var(--muted); }
@media (max-width: 700px) { .twoCloud { grid-template-columns: 1fr; grid-auto-rows: minmax(220px, 1fr); } .cards { columns: 1; } }
