@font-face { font-family: 'Bricolage Grotesque'; font-weight: 400; font-display: swap; src: url(../fonts/bricolage-grotesque-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 600; font-display: swap; src: url(../fonts/bricolage-grotesque-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 700; font-display: swap; src: url(../fonts/bricolage-grotesque-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600 700; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); }

/* GSN-Farben (aus dem Plakat Pädagogischer Tag) */
:root {
  --gsn-blue: #CFE4F3;
  --gsn-apricot: #FBD9BE;
  --gsn-blue-dark: #2C5878;
  --gsn-rust: #9A4A17;
  --bg: #FFFDFB;
  --card: #ffffff;
  --ink: #1F2A33;
  --muted: #4A5A66;
  --line: #E6E1DC;
  --primary: #2C5878;
  --primary-ink: #fff;
  --yellow: #F2B66D;
  --ok: #2f7d5b;
  --ok-bg: #e4f3ea;
  --warn: #9A4A17;
  --warn-bg: #FDEBDD;
  --gold: #E8A33D;
  --radius: 18px;
  --shadow: 0 1px 0 rgba(31,42,51,.04), 0 8px 24px rgba(44,88,120,.08);
  --display: 'Bricolage Grotesque', 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 17px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  line-height: 1.45; -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 980px; margin: 0 auto; padding: 16px 16px 40px; }
h1, h2, h3 { line-height: 1.15; margin: .2em 0 .4em; font-family: var(--display); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.25rem; }
section { margin-top: 28px; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.center { text-align: center; margin: 60px auto; max-width: 520px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.between { justify-content: space-between; } .right { text-align: right; }
.foot { text-align: center; padding: 20px; }

/* Buttons */
.btn { appearance: none; border: 0; border-radius: 12px; background: var(--primary); color: var(--primary-ink);
  font: inherit; font-weight: 600; padding: 12px 20px; cursor: pointer; min-height: 48px; }
.btn:hover { filter: brightness(1.05); } .btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: .9rem; }
.btn.big { width: 100%; margin-top: 14px; font-size: 1.1rem; }
.btn.danger { border-color: var(--warn); color: var(--warn); }
.chip { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; cursor: pointer; }

/* Kopfbereich */
.hero { background: var(--gsn-blue); box-shadow: none; display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.hen-btn { background: rgba(255,255,255,.7); border: 0; border-radius: 50%; padding: 4px; cursor: pointer; }
.level { margin-bottom: 6px; }
.bar { height: 12px; background: rgba(255,255,255,.8); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--gsn-blue-dark), #5B8DB3); border-radius: 99px; transition: width .6s; }
.hero-side { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.countdown { text-align: center; background: var(--gsn-apricot); border-radius: 14px; padding: 6px 12px; }
.countdown b { display: block; font-family: var(--display); font-size: 1.7rem; color: var(--gsn-rust); }
.countdown span { font-size: .75rem; color: var(--muted); }
@media (max-width: 600px) {
  .hero { grid-template-columns: auto 1fr; }
  .hero-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}

/* Themen */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.topic { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: inherit;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; box-shadow: var(--shadow); }
.topic:hover { border-color: var(--gsn-blue-dark); }
.topic.assigned { border-color: var(--gsn-rust); background: #FFF6EE; }
.topic.zp { border-color: var(--gsn-blue-dark); background: var(--gsn-blue); }
.topic.soon { opacity: .6; cursor: default; box-shadow: none; }
.t-title { font-family: var(--display); font-weight: 700; font-size: 1.12rem; }
.stars { color: var(--gold); font-size: 1.2rem; letter-spacing: 2px; text-shadow: 0 1px 0 #c79a1d33; }
.stars .off { color: #E6E1DC; }
.prio { position: absolute; top: 10px; right: 12px; font-weight: 800; color: var(--gsn-rust); }
.prio.p3 { color: #d64545; }

/* Figuren und Abzeichen */
.avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin: 16px 0; }
.avatar { display: flex; flex-direction: column; align-items: center; gap: 4px; font: inherit; color: inherit; background: #F6F9FC;
  border: 3px solid transparent; border-radius: var(--radius); padding: 10px; cursor: pointer; }
.avatar.sel { border-color: var(--primary); }
.avatar:disabled { cursor: default; opacity: .55; filter: grayscale(.8); }
.lock { font-size: .8rem; color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 16px 0; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px; border-radius: var(--radius); background: var(--gsn-apricot); }
.badge.locked { background: #f4f2ee; opacity: .7; }
.big { font-size: 2rem; }

/* Sprechblase der Henne */
.speech { display: flex; gap: 12px; align-items: center; background: #F6F9FC; border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; }
.speech p { margin: 0; }
.speech.ok { background: var(--ok-bg); }
.speech.warn { background: var(--warn-bg); }
.warn-text { color: var(--warn); font-weight: 600; }

/* Aufgabe */
.task { margin: 18px 0; }
.question { font-size: 1.25rem; line-height: 1.6; }
.fig { color: #6b5d45; max-width: 260px; } .fig svg { width: 100%; height: auto; }
.answer-row { display: flex; gap: 10px; }
.answer-row input { flex: 1; min-width: 0; font: inherit; font-size: 1.25rem; padding: 12px 14px; border: 2px solid var(--line);
  border-radius: 12px; background: #fff; }
.answer-row input:focus { outline: none; border-color: var(--gsn-blue-dark); box-shadow: 0 0 0 3px var(--gsn-blue); }
.keypad { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.key { font: inherit; font-size: 1.1rem; min-width: 48px; min-height: 44px; border-radius: 10px; border: 2px solid var(--line); background: #fff; cursor: pointer; }
details { margin-top: 10px; } summary { cursor: pointer; color: var(--muted); }
.solution { background: #F6F9FC; border-left: 4px solid var(--gsn-blue-dark); padding: 10px 14px; border-radius: 8px; margin-top: 8px; line-height: 1.7; }

/* Brüche */
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 2px; font-size: .9em; line-height: 1.1; }
.frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 3px; }

/* Ergebnisse */
.results { padding-left: 20px; } .results li { margin: 12px 0; padding: 10px; border-radius: 10px; }
.results li.ok { background: var(--ok-bg); } .results li.bad { background: var(--warn-bg); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); display: flex; gap: 12px; align-items: center;
  background: #2b2a33; color: #fff; padding: 12px 18px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transition: transform .35s ease; z-index: 50; max-width: 92vw; }
.toast.show { transform: translate(-50%, 0); }
.toast.gold { background: linear-gradient(135deg, var(--gsn-blue-dark), #3E7099); }

/* ---------- Lehrkraft-Bereich ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { font: inherit; border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.table-wrap { overflow-x: auto; }
table.matrix { border-collapse: separate; border-spacing: 3px; font-size: .85rem; }
.matrix th { font-weight: 600; text-align: left; padding: 4px 6px; white-space: nowrap; }
.matrix th.rot { writing-mode: vertical-rl; transform: rotate(180deg); height: 175px; vertical-align: bottom; }
.matrix td { min-width: 52px; height: 40px; text-align: center; border-radius: 8px; cursor: pointer; background: #f3efe6; position: relative; }
.matrix td.name { text-align: left; background: transparent; cursor: pointer; white-space: nowrap; min-width: 150px; }
.matrix td.asg { outline: 3px solid var(--gsn-rust); outline-offset: -3px; }
.matrix td .pr { position: absolute; top: 1px; right: 4px; font-size: .7rem; font-weight: 800; color: var(--gsn-rust); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; margin: 10px 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 18px; height: 14px; border-radius: 4px; display: inline-block; }
input.field { font: inherit; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; width: 100%; background: #fff; }
label.lbl { display: block; font-weight: 600; margin: 10px 0 4px; }
table.list { width: 100%; border-collapse: collapse; }
.list td, .list th { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.list input.field { padding: 6px 8px; }
.linkbox { font-family: ui-monospace, Menlo, monospace; font-size: .75rem; color: var(--muted); word-break: break-all; }
.note { background: var(--gsn-blue); border-radius: 12px; padding: 12px 14px; font-size: .9rem; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: #fff; box-shadow: -10px 0 30px rgba(0,0,0,.15);
  padding: 20px; overflow-y: auto; z-index: 40; }

/* Druckansicht: Zugangskarten */
.print-cards { display: none; }
@media print {
  body { background: #fff; }
  .no-print, .foot, .drawer, .toast { display: none !important; }
  .print-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10mm; }
  .pcard { border: 1px dashed #999; padding: 6mm; page-break-inside: avoid; display: flex; gap: 6mm; align-items: center; }
  .pcard svg.qr { width: 32mm; height: 32mm; }
}

/* Erklärseiten */
.speech.step { background: var(--gsn-blue); }
.lesson .lead { font-size: 1.05rem; }
.lpart { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.lpart h3 { font-size: 1.1rem; color: var(--gsn-blue-dark); }
.example { background: #F6F9FC; border: 2px dashed #A9C8DF; border-radius: 12px; padding: 10px 14px; margin: 8px 0; line-height: 1.9; }
.ex-label { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.example .ex-label, .solution .ex-label { display: block; }
.mistakes { background: var(--warn-bg); border-radius: 12px; padding: 12px 14px; border-top: 0; margin-top: 10px; }
.mistakes h3 { color: var(--warn); }
.mistakes ul { margin: 0; padding-left: 20px; } .mistakes li { margin: 6px 0; }
.lesson-drawer { width: min(560px, 100vw); }
code { background: #f2eee5; padding: 1px 5px; border-radius: 5px; }

/* Hennen-Bilder und Animationen */
img.hen { display: block; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.speech img.hen { flex-shrink: 0; }
img.hen.mood-happy { animation: hop .45s ease-out 2; }
img.hen.mood-sad { animation: shake .5s ease-in-out 1; }
.hen-btn img.hen { transition: transform .2s; } .hen-btn:hover img.hen { transform: rotate(-6deg) scale(1.05); }
.toast img.hen { animation: dance .8s ease-in-out 3; }
@keyframes hop { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-14px) rotate(-4deg); } 70% { transform: translateY(0) scaleY(.94); } }
@keyframes shake { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-9deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
@keyframes dance { 0%,100% { transform: rotate(0) translateY(0); } 25% { transform: rotate(-10deg) translateY(-6px); } 75% { transform: rotate(10deg) translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { img.hen { animation: none !important; } }

/* ---------- GSN-Rahmen: Kopfleiste, Abschnittsbanner, Startseite ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { height: 40px; width: auto; }
.brand .bt { display: flex; flex-direction: column; line-height: 1.1; }
.brand .bt b { font-family: var(--display); font-size: 1.15rem; }
.brand .bt span { font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
.kicker { display: block; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--gsn-blue-dark); }
.banner { border-radius: var(--radius); padding: 18px 20px 20px; margin-top: 24px; }
.banner.blue { background: var(--gsn-blue); } .banner.apricot { background: var(--gsn-apricot); }
.banner.apricot .kicker { color: var(--gsn-rust); }
.banner h2 { margin: 2px 0 4px; font-size: 1.5rem; } .banner > p { margin: 0 0 14px; color: var(--muted); }
.banner .topic { border-color: transparent; box-shadow: none; }
.banner .topic:hover { border-color: var(--gsn-blue-dark); }
.banner.apricot .topic.assigned { border-color: var(--gsn-rust); background: #fff; }
.banner .topic.zp { background: #fff; border-color: transparent; }

.cover { min-height: calc(100vh - 120px); display: grid; align-content: center; gap: 22px; }
.cover-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; background: var(--gsn-blue); border-radius: 28px; padding: 30px 34px; position: relative; overflow: hidden; }
.cover-head::after { content: ''; position: absolute; right: -80px; bottom: -110px; width: 320px; height: 320px; border-radius: 50%; background: var(--gsn-apricot); opacity: .7; }
.cover-head > * { position: relative; z-index: 1; }
.cover-head img.logo { height: 56px; width: auto; margin-bottom: 18px; }
.cover-head h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: .98; margin: 0 0 10px; }
.cover-head p { margin: 0; font-size: 1.1rem; color: var(--muted); max-width: 30em; }
.cover-head .count { display: inline-flex; align-items: baseline; gap: 8px; margin-top: 16px; background: #fff; border-radius: 999px; padding: 6px 16px; font-weight: 600; }
.cover-head .count b { font-family: var(--display); font-size: 1.4rem; color: var(--gsn-rust); }
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.role { display: flex; flex-direction: column; gap: 8px; text-align: left; font: inherit; color: inherit; border: 2px solid transparent; border-radius: 22px; padding: 22px 24px; cursor: pointer; text-decoration: none; transition: transform .15s, border-color .15s; }
.role:hover { transform: translateY(-2px); border-color: var(--gsn-blue-dark); }
.role.student { background: var(--gsn-apricot); } .role.teacher { background: #fff; border-color: var(--line); box-shadow: var(--shadow); }
.role .ri { font-size: 2rem; } .role b { font-family: var(--display); font-size: 1.45rem; }
.role span { color: var(--muted); }
.role .go { margin-top: 6px; font-weight: 600; color: var(--gsn-blue-dark); }
.role.student .go { color: var(--gsn-rust); }
.student-help { background: #fff; border-radius: 18px; padding: 16px 20px; border: 2px dashed var(--gsn-rust); }
@media (max-width: 640px) { .roles { grid-template-columns: 1fr; } .cover-head { grid-template-columns: 1fr; } .cover-head img.hen { justify-self: center; } }
.matrix td.name { display: flex; align-items: center; gap: 8px; height: 40px; }
.matrix td.name img.hen { width: 28px; height: 28px; }
.tabs { margin-top: 14px; }
.prio.p3 { color: #C0392B; }

/* ZP-Aufgaben */
.tags { display: flex; flex-wrap: wrap; gap: 6px; } .tag { font-size: .75rem; background: var(--gsn-blue); color: var(--gsn-blue-dark); border-radius: 999px; padding: 2px 10px; font-weight: 600; }
.zp-sheet .zp-title { font-size: 1.8rem; margin-top: 4px; }
.zp-intro { font-size: 1.08rem; line-height: 1.6; background: #F6F9FC; border-radius: 14px; padding: 14px 16px; }
.zp-fig { max-width: 420px; margin: 8px 0 4px; }
.zp-score { display: flex; flex-direction: column; align-items: flex-end; background: var(--gsn-apricot); border-radius: 14px; padding: 6px 14px; }
.zp-score b { font-family: var(--display); font-size: 1.4rem; color: var(--gsn-rust); }
.zp-part { border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 14px 0; }
.zp-part.done { border-color: #B9D8C7; background: #FAFDFB; }
.zp-label { display: flex; align-items: center; gap: 10px; }
.zp-label b { font-family: var(--display); font-size: 1.2rem; color: var(--gsn-blue-dark); }
.small-stars { font-size: 1rem; }
.pts { margin-left: auto; font-size: .85rem; font-weight: 600; color: var(--gsn-rust); background: var(--gsn-apricot); border-radius: 999px; padding: 2px 10px; }
.zp-q { font-size: 1.08rem; margin: 8px 0 10px; }
.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.zp-part textarea { margin-bottom: 8px; font: inherit; }
table.sheet { border-collapse: collapse; font-size: .9rem; background: #fff; }
.sheet th, .sheet td { border: 1px solid #C9D3DB; padding: 5px 9px; text-align: left; }
.sheet thead th, .sheet tbody th { background: #EEF3F7; color: var(--muted); font-weight: 600; text-align: center; }
.sheet td.q { background: #FFF6EE; color: var(--gsn-rust); font-weight: 700; text-align: center; }
.zp-fig:has(table) { max-width: none; overflow-x: auto; }
