/* ==========================================================================
   LERNPFAD – Stylesheet
   Schriften liegen lokal (DSGVO: keine Google-Fonts-Verbindung).
   ========================================================================== */

@font-face {
  font-family: 'Bricolage';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2-variations'),
       url('fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2');
  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+2074, U+20AC, U+2122, U+2191,
                 U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('fonts/bricolage-grotesque-latin-ext-wght-normal.woff2') format('woff2-variations'),
       url('fonts/bricolage-grotesque-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 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: 'Schibsted';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url('fonts/schibsted-grotesk-latin-wght-normal.woff2') format('woff2-variations'),
       url('fonts/schibsted-grotesk-latin-wght-normal.woff2') format('woff2');
  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+2074, U+20AC, U+2122, U+2191,
                 U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Schibsted';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url('fonts/schibsted-grotesk-latin-ext-wght-normal.woff2') format('woff2-variations'),
       url('fonts/schibsted-grotesk-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 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: 'JetBrains';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url('fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2-variations'),
       url('fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212;
}

/* ------------------------------------------------------------- Tokens ---- */

:root {
  --nacht:    #131a3c;
  --nacht-2:  #1a2352;
  --nacht-3:  #232e6d;
  --linie:    #2c3a86;
  --signal:   #ffd84d;
  --magenta:  #ff4d9d;
  --mint:     #56e0b0;
  --rot:      #ff6f61;
  --text:     #eceeff;
  --mute:     #949dd8;
  --papier:   #ffffff;

  --sans:    'Schibsted', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Bricolage', 'Schibsted', system-ui, sans-serif;
  --mono:    'JetBrains', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --r:    18px;
  --r-sm: 10px;
  --wrap: 760px;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 85% -12%, rgba(255, 77, 157, .16), transparent 60%),
    radial-gradient(900px 480px at 5% 0%, rgba(255, 216, 77, .1), transparent 55%),
    var(--nacht);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--signal); }

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--signal);
  color: var(--nacht);
  padding: .6rem 1rem;
  z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.5rem 1.1rem 5rem;
}

.mute  { color: var(--mute); font-size: .93rem; }
.empty { color: var(--mute); padding: 1.2rem 0; }
.count { color: var(--mute); font-family: var(--mono); font-size: .8em; font-weight: 400; }

/* ------------------------------------------------------------ Kopfzeile ---- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(19, 26, 60, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--linie);
}
.topbar-in {
  max-width: 1060px;
  margin: 0 auto;
  padding: .6rem 1rem;
  display: flex;
  align-items: center;
  gap: .8rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -.02em;
}
.brand-mark { filter: drop-shadow(0 0 8px rgba(255, 216, 77, .6)); }
.brand-text { font-size: 1.02rem; }

.mainnav {
  display: flex;
  gap: .2rem;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  color: var(--mute);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  padding: .4rem .6rem;
  border-radius: 99px;
  white-space: nowrap;
}
.mainnav a:hover { color: var(--text); }
.mainnav a.is-active { color: var(--nacht); background: var(--signal); }
.mainnav a.nav-admin { color: var(--magenta); }

.topbar-me {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.streak, .xp-chip {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  padding: .25rem .5rem;
  border-radius: 99px;
  border: 1px solid var(--linie);
  white-space: nowrap;
}
.xp-chip { color: var(--signal); }
.avatar  { font-size: 1.25rem; line-height: 1; }
.logout {
  font-size: .8rem;
  color: var(--mute);
  text-decoration: none;
  font-weight: 600;
}
.logout:hover { color: var(--rot); }

@media (max-width: 560px) {
  .brand-text, .streak { display: none; }
  .mainnav a { font-size: .84rem; padding: .4rem .45rem; }
  .topbar-in { gap: .5rem; padding: .5rem .7rem; }
  .wrap { padding-left: .9rem; padding-right: .9rem; }
}

/* -------------------------------------------------------------- Flash ------ */

.flash {
  max-width: var(--wrap);
  margin: 1rem auto -.4rem;
  padding: .8rem 1rem;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid var(--linie);
  background: var(--nacht-2);
}
.flash-ok  { border-color: var(--mint); color: var(--mint); }
.flash-err { border-color: var(--rot);  color: var(--rot); }

/* ------------------------------------------------------------ Typografie --- */

.page-title {
  font-family: var(--display);
  font-size: clamp(1.9rem, 6vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.02;
  margin: .2rem 0 .7rem;
}
.sec-title {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 2.4rem 0 .9rem;
  display: flex;
  align-items: baseline;
  gap: .5rem;
}
.back {
  display: inline-block;
  color: var(--mute);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.back:hover { color: var(--signal); }

/* --------------------------------------------------------------- Karten ---- */

.card {
  background: var(--nacht-2);
  border: 1px solid var(--linie);
  border-radius: var(--r);
  padding: 1.2rem;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .7rem;
  margin: 1.2rem 0;
}
.tile {
  background: var(--nacht-2);
  border: 1px solid var(--linie);
  border-radius: var(--r-sm);
  padding: .9rem;
}
.tile-value {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.03em;
}
.tile-label { color: var(--mute); font-size: .8rem; }
.tile-signal  .tile-value { color: var(--signal); }
.tile-magenta .tile-value { color: var(--magenta); }
.tile-mint    .tile-value { color: var(--mint); }

/* -------------------------------------------------------------- Buttons ---- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 700;
  padding: .7rem 1.2rem;
  border-radius: 99px;
  border: 1px solid var(--linie);
  background: var(--nacht-3);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover  { filter: brightness(1.15); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--nacht);
}
.btn-big   { width: 100%; padding: .95rem 1.4rem; font-size: 1.05rem; }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: var(--rot); color: var(--rot); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------------- Formulare --- */

.form label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: .9rem;
}
.form input,
.form textarea,
.form select {
  display: block;
  width: 100%;
  margin-top: .35rem;
  padding: .7rem .85rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  background: var(--nacht);
  border: 1px solid var(--linie);
  border-radius: var(--r-sm);
}
.form textarea { font-family: var(--mono); font-size: .9rem; line-height: 1.5; resize: vertical; }
.form input:focus, .form textarea:focus, .form select:focus { border-color: var(--signal); outline: none; }
.form .w-short { max-width: 140px; }
.form fieldset {
  border: 1px solid var(--linie);
  border-radius: var(--r-sm);
  padding: 1rem;
  margin: 0 0 1.1rem;
}
.form legend {
  font-family: var(--display);
  font-weight: 700;
  font-size: .95rem;
  padding: 0 .4rem;
}
.form .check {
  text-transform: none;
  letter-spacing: normal;
  font-size: .95rem;
  color: var(--text);
  font-weight: 500;
  display: flex;
  gap: .5rem;
  align-items: flex-start;
}
.form .check input { width: auto; margin: .25rem 0 0; }
.form .audbox { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; align-items: center; }
.form .audbox legend { font-size: .82rem; }
.form .audbox .check { margin-bottom: 0; }
.form .audbox .hint { width: 100%; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }
@media (max-width: 520px) { .form .row { grid-template-columns: 1fr; } }

.errbox {
  border: 1px solid var(--rot);
  background: rgba(255, 111, 97, .1);
  color: var(--rot);
  border-radius: var(--r-sm);
  padding: .8rem 1rem;
  margin-bottom: 1rem;
  font-size: .92rem;
  font-weight: 600;
}
.errbox p { margin: .2rem 0; }

/* ------------------------------------------------------ Setup und Login ---- */

body.plain {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.setup, .login {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 2.5rem 1.1rem 4rem;
}
.setup-title, .login-title {
  font-family: var(--display);
  font-size: clamp(2.1rem, 8vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: .98;
  margin: 0 0 .6rem;
}
.setup-sub, .login-sub { color: var(--mute); margin: 0 0 1.6rem; }
.login-emoji { font-size: 3rem; line-height: 1; margin-bottom: .6rem; }
.login-brand {
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .3em;
  color: var(--signal);
  margin-bottom: 1.4rem;
}
.login-form { margin-top: .4rem; }

/* ---------------------------------------------------------------- Hero ----- */

.hero { padding: .6rem 0 1.4rem; }
.hero-hello {
  font-family: var(--display);
  font-size: clamp(1.6rem, 5.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 0 0 1rem;
}

.levelbar { margin-bottom: .3rem; }
.levelbar-top {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  font-size: .82rem;
  margin-bottom: .4rem;
  flex-wrap: wrap;
}
.lvl-num  { font-family: var(--mono); font-weight: 700; color: var(--signal); }
.lvl-name { font-weight: 700; }
.lvl-next { margin-left: auto; color: var(--mute); font-family: var(--mono); font-size: .75rem; }

.track {
  display: block;
  height: 9px;
  background: var(--nacht-3);
  border-radius: 99px;
  overflow: hidden;
}
.track .fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--signal), var(--magenta));
  border-radius: 99px;
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
.track-inline { max-width: 320px; margin: .6rem 0 .3rem; }

/* -------------------------------------------------------- Weiter-Karte ----- */

.continue {
  display: grid;
  gap: .15rem;
  background: var(--signal);
  color: var(--nacht);
  border-radius: var(--r);
  padding: 1.3rem;
  text-decoration: none;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.continue::after {
  content: '';
  position: absolute;
  inset: auto -40px -70px auto;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .35);
}
.continue > * { position: relative; }
.continue-label {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .72;
}
.continue-title {
  font-family: var(--display);
  font-size: clamp(1.35rem, 4.6vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  position: relative;
}
.continue-meta { font-size: .87rem; opacity: .78; font-weight: 600; }
.continue-go {
  margin-top: .7rem;
  font-weight: 800;
  font-size: .95rem;
  position: relative;
}
.continue:hover .continue-go { text-decoration: underline; }
.continue-empty {
  background: var(--nacht-2);
  color: var(--text);
  border: 1px solid var(--linie);
  box-shadow: none;
}
.continue-empty::after { display: none; }

/* ---------------------------------------------------------------- Duell ---- */

.duel {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
  margin-top: .9rem;
  padding: .9rem 1.1rem;
  border: 1px solid var(--magenta);
  border-radius: var(--r);
  background: rgba(255, 77, 157, .08);
  color: var(--text);
  text-decoration: none;
}
.duel-side { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; }
.duel-vs   { color: var(--magenta); font-weight: 800; font-size: .8rem; letter-spacing: .1em; }
.duel-note { width: 100%; font-size: .85rem; color: var(--mute); }

/* --------------------------------------------------------------- Module ---- */

.modgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .8rem;
}
.modcard {
  display: grid;
  gap: .35rem;
  align-content: start;
  background: var(--nacht-2);
  border: 1px solid var(--linie);
  border-radius: var(--r);
  padding: 1.1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s ease, transform .15s ease;
}
.modcard:hover { border-color: var(--signal); transform: translateY(-2px); }
.modcard-emoji { font-size: 1.7rem; line-height: 1; }
.modcard-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.modcard-sub  { color: var(--mute); font-size: .85rem; margin-bottom: .5rem; }
.modcard-foot {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--mute);
  margin-top: .35rem;
  display: flex;
  gap: .5rem;
  align-items: center;
}

.module-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.4rem;
}
.module-emoji-xl { font-size: 2.8rem; line-height: 1; }
.module-sub { color: var(--mute); margin: 0; }

.pill-done, .pill-draft {
  font-family: var(--mono);
  font-size: .68rem;
  font-style: normal;
  padding: .15rem .5rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.pill-done  { background: rgba(86, 224, 176, .16); color: var(--mint); }
.pill-aud {
  font-family: var(--mono);
  font-size: .68rem;
  font-style: normal;
  padding: .15rem .5rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: rgba(255, 216, 77, .14);
  color: var(--signal);
  white-space: nowrap;
}
.pill-draft { background: rgba(255, 111, 97, .14); color: var(--rot); }

/* --------------------------------------------------------- Lektionsliste --- */

.lessonlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.lesson-row a {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .9rem 1rem;
  background: var(--nacht-2);
  border: 1px solid var(--linie);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--text);
}
.lesson-row a:hover { border-color: var(--signal); }
.lr-index {
  font-family: var(--mono);
  font-size: .9rem;
  color: var(--mute);
  font-weight: 700;
}
.lr-main { display: grid; gap: .1rem; flex: 1; min-width: 0; }
.lr-title { font-weight: 700; line-height: 1.25; }
.lr-teaser {
  color: var(--mute);
  font-size: .84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lr-side { display: grid; justify-items: end; gap: .1rem; }
.lr-min   { font-family: var(--mono); font-size: .7rem; color: var(--mute); }
.lr-state { font-size: 1.05rem; color: var(--mute); }
.lesson-row.is-fertig a { border-color: rgba(86, 224, 176, .45); }
.lesson-row.is-fertig .lr-state { color: var(--mint); }

/* -------------------------------------------------------------- Lektion ---- */

.lesson-crumb a { color: var(--mute); text-decoration: none; font-size: .88rem; font-weight: 600; }
.lesson-crumb a:hover { color: var(--signal); }
.lesson-title {
  font-family: var(--display);
  font-size: clamp(1.9rem, 6.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.02;
  margin: .5rem 0 .6rem;
}
.lesson-meta {
  display: flex;
  gap: .7rem;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--mute);
  margin: 0 0 1.2rem;
}
.lesson-teaser { color: var(--mute); font-size: 1.02rem; margin: 0 0 1.6rem; }
.lesson-body { display: grid; gap: 1.4rem; }

.b-text h3 {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 1.6rem 0 .5rem;
}
.b-text h4 { font-size: 1.05rem; font-weight: 700; margin: 1.2rem 0 .4rem; }
.b-text p  { margin: 0 0 .9rem; }
.b-text ul, .b-text ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.b-text li { margin-bottom: .4rem; }
.b-text code, .callout-body code {
  font-family: var(--mono);
  font-size: .85em;
  background: var(--nacht-3);
  padding: .12em .4em;
  border-radius: 5px;
}
.b-text strong { color: #fff; }

.b-video { margin: 0; }
.ratio {
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--r);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--linie);
}
.ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-empty {
  border: 2px dashed var(--linie);
  border-radius: var(--r);
  padding: 2rem 1.2rem;
  text-align: center;
  background: rgba(255, 255, 255, .02);
}
.video-empty-icon { font-size: 1.6rem; color: var(--mute); }
.video-empty p { margin: .3rem 0; }
.b-video figcaption, .b-image figcaption {
  color: var(--mute);
  font-size: .82rem;
  margin-top: .5rem;
}
.b-image { margin: 0; }
.b-image img { width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--linie); }

.b-callout {
  border-radius: var(--r);
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--signal);
  background: var(--nacht-2);
}
.b-callout.is-warnung { border-left-color: var(--rot); }
.b-callout.is-fakt    { border-left-color: var(--mint); }
.b-callout.is-praxis  { border-left-color: var(--magenta); }
.callout-head {
  font-family: var(--display);
  font-weight: 700;
  font-size: .98rem;
  margin-bottom: .35rem;
}
.callout-body p:last-child { margin-bottom: 0; }
.callout-body p { margin: 0 0 .6rem; font-size: .96rem; }

.b-code {
  border: 1px solid var(--linie);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #0d1330;
}
.code-head {
  font-family: var(--mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--mute);
  padding: .5rem .9rem;
  border-bottom: 1px solid var(--linie);
}
.b-code pre { margin: 0; padding: .9rem; overflow-x: auto; }
.b-code code { font-family: var(--mono); font-size: .84rem; line-height: 1.6; }

.b-link {
  display: grid;
  gap: .2rem;
  padding: .9rem 1.1rem;
  border: 1px solid var(--linie);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--text);
  background: var(--nacht-2);
}
.b-link:hover { border-color: var(--signal); }
.b-link-title { font-weight: 700; color: var(--signal); }
.b-link-text  { color: var(--mute); font-size: .87rem; }

/* -------------------------------------------------------------- Aufgabe ---- */

.b-task {
  border: 2px solid var(--magenta);
  border-radius: var(--r);
  padding: 1.2rem;
  background: rgba(255, 77, 157, .07);
}
.task-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .16em;
}
.task-tag { color: var(--magenta); font-weight: 700; }
.task-xp  { color: var(--signal); }
.task-title {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: .5rem 0 .5rem;
}
.task-body p { margin: 0 0 .7rem; font-size: .97rem; }
.task-body ul, .task-body ol { margin: 0 0 .8rem; padding-left: 1.2rem; }
.task-form { display: grid; gap: .6rem; }
.task-input {
  width: 100%;
  padding: .75rem .9rem;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--text);
  background: var(--nacht);
  border: 1px solid var(--linie);
  border-radius: var(--r-sm);
}
.task-input:focus { border-color: var(--magenta); outline: none; }
.task-send { justify-self: start; }
.task-msg { margin: 0; font-size: .88rem; color: var(--mint); min-height: 1.2em; }
.task-state {
  margin-top: .8rem;
  padding: .8rem 1rem;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .2);
  font-size: .92rem;
}
.task-state p { margin: .25rem 0; }
.task-answer   { font-family: var(--mono); font-size: .85rem; word-break: break-word; }
.task-feedback { color: var(--text); }
.task-awarded  { color: var(--mint); font-weight: 700; }

/* ----------------------------------------------------------------- Quiz ---- */

.quiz {
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--linie);
}
.quiz-title {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 0 0 .3rem;
}
.quiz-sub { color: var(--mute); font-size: .92rem; margin: 0 0 1.4rem; }

.q {
  background: var(--nacht-2);
  border: 1px solid var(--linie);
  border-radius: var(--r);
  padding: 1.1rem;
  margin-bottom: .9rem;
}
.q-num {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mute);
}
.q-prompt {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.25;
  margin: .35rem 0 .9rem;
}
.q-opts { display: grid; gap: .5rem; }
.opt {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  text-align: left;
  padding: .7rem .85rem;
  font-family: var(--sans);
  font-size: .97rem;
  font-weight: 600;
  color: var(--text);
  background: var(--nacht);
  border: 1px solid var(--linie);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.opt:hover:not(:disabled) { border-color: var(--signal); }
.opt-key {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 700;
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--nacht-3);
  color: var(--mute);
}
.opt.is-picked { border-color: var(--signal); background: rgba(255, 216, 77, .1); }
.opt.is-picked .opt-key { background: var(--signal); color: var(--nacht); }
.opt.is-right  { border-color: var(--mint); background: rgba(86, 224, 176, .12); }
.opt.is-right .opt-key { background: var(--mint); color: var(--nacht); }
.opt.is-wrong  { border-color: var(--rot); background: rgba(255, 111, 97, .1); }
.opt.is-wrong .opt-key { background: var(--rot); color: #fff; }
.opt:disabled { cursor: default; opacity: 1; }

.q-text {
  width: 100%;
  padding: .75rem .9rem;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--text);
  background: var(--nacht);
  border: 1px solid var(--linie);
  border-radius: var(--r-sm);
}
.q-text:focus { border-color: var(--signal); outline: none; }
.q-hint { color: var(--mute); font-size: .8rem; margin: .5rem 0 0; }
.q-actions { margin-top: .8rem; }

.q-result {
  margin-top: .8rem;
  padding: .8rem 1rem;
  border-radius: var(--r-sm);
  background: var(--nacht);
  border-left: 3px solid var(--linie);
}
.q-result.is-right { border-left-color: var(--mint); }
.q-result.is-wrong { border-left-color: var(--rot); }
.q-verdict { font-family: var(--display); font-weight: 700; margin: 0 0 .2rem; }
.q-result.is-right .q-verdict { color: var(--mint); }
.q-result.is-wrong .q-verdict { color: var(--rot); }
.q-expl { margin: 0; font-size: .92rem; color: var(--text); }
.q-points {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--signal);
  margin: .3rem 0 0;
}

.lesson-finish {
  margin-top: 2.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--linie);
  display: grid;
  gap: .8rem;
  justify-items: stretch;
}
.finish-done { color: var(--mint); font-weight: 700; margin: 0; }

/* ------------------------------------------------------------ Belohnung ---- */

.reward {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(8, 12, 34, .8);
  backdrop-filter: blur(6px);
  animation: fade .2s ease;
}
.reward[hidden] { display: none; }
.reward-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
  background: var(--nacht-2);
  border: 1px solid var(--signal);
  border-radius: 24px;
  padding: 2rem 1.4rem;
  box-shadow: 0 30px 70px -30px #000;
  animation: pop .35s cubic-bezier(.2, 1.2, .3, 1);
}
.reward-emoji { font-size: 3.4rem; line-height: 1; }
.reward-title {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.04em;
  margin: .5rem 0 .3rem;
}
.reward-text { color: var(--mute); margin: 0 0 1.2rem; }
.reward-badges { display: grid; gap: .5rem; margin-bottom: 1.2rem; }
.reward-badge {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .8rem;
  border: 1px solid var(--signal);
  border-radius: var(--r-sm);
  background: rgba(255, 216, 77, .08);
  text-align: left;
  font-size: .9rem;
}
.reward-badge b { display: block; }

@keyframes pop  { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* --------------------------------------------------- Rangliste als SERP ---- */
/* Bewusster Bruch: Die Rangliste sieht aus wie eine Suchergebnisseite –
   das ist das Thema des Kurses und der Running Gag der Plattform.        */

.serp {
  background: var(--papier);
  color: #202124;
  border-radius: var(--r);
  padding: 1.4rem 1.2rem 2rem;
  box-shadow: var(--shadow);
}
.serp-bar {
  display: flex;
  align-items: center;
  gap: .7rem;
  border: 1px solid #dadce0;
  border-radius: 99px;
  padding: .7rem 1.1rem;
  box-shadow: 0 1px 6px rgba(32, 33, 36, .1);
}
.serp-icon  { font-size: .95rem; }
.serp-query { font-size: 1rem; color: #202124; }
.serp-count { color: #70757a; font-size: .8rem; margin: .8rem 0 1.2rem; }

.serp-featured {
  border: 1px solid #dadce0;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.6rem;
}
.serp-featured-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #70757a;
  margin-bottom: .6rem;
}
.serp-featured-body { display: flex; align-items: center; gap: .9rem; }
.serp-featured-emoji { font-size: 2.4rem; }
.serp-featured-answer {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 0;
  color: #202124;
}
.serp-featured-sub { margin: .1rem 0 0; color: #4d5156; font-size: .9rem; }

.serp-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6rem; }
.serp-result { display: flex; gap: .9rem; }
.serp-pos {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: #70757a;
  padding-top: .9rem;
  flex: 0 0 auto;
}
.serp-body { min-width: 0; }
.serp-url {
  font-size: .78rem;
  color: #5f6368;
  margin-bottom: .1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.serp-headline {
  font-family: var(--sans);
  font-size: 1.22rem;
  font-weight: 500;
  color: #1a0dab;
  margin: 0 0 .25rem;
  line-height: 1.3;
}
.serp-result:hover .serp-headline { text-decoration: underline; }
.serp-snippet { margin: 0; font-size: .92rem; color: #4d5156; line-height: 1.58; }
.serp-result.is-me .serp-headline { color: #1a0dab; }
.serp-result.is-me {
  background: #fff8e1;
  border-radius: 10px;
  padding: .6rem;
  margin: -.6rem;
}
.serp-related {
  margin: 2rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid #ebebeb;
  font-size: .86rem;
  color: #5f6368;
}

/* -------------------------------------------------------------- Profil ----- */

.profile-head { display: flex; align-items: center; gap: 1.1rem; margin-bottom: .4rem; }
.profile-emoji { font-size: 3rem; line-height: 1; }
.profile-meta { flex: 1; min-width: 0; }
.profile-name {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: .6rem;
}

.badgegrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .7rem;
}
.badge {
  border: 1px solid var(--linie);
  border-radius: var(--r-sm);
  padding: .9rem;
  text-align: center;
  background: var(--nacht-2);
}
.badge.not { opacity: .35; filter: grayscale(1); }
.badge.has { border-color: var(--signal); }
.badge-emoji { font-size: 1.8rem; line-height: 1; }
.badge-title { font-weight: 700; font-size: .92rem; margin-top: .3rem; }
.badge-desc  { color: var(--mute); font-size: .76rem; line-height: 1.35; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.timeline li {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  padding: .6rem .8rem;
  border-left: 2px solid var(--linie);
  background: rgba(255, 255, 255, .02);
  font-size: .9rem;
}
.tl-when { font-family: var(--mono); font-size: .72rem; color: var(--mute); flex: 0 0 auto; min-width: 82px; }
.tl-what { flex: 1; min-width: 0; }
.tl-xp   { font-family: var(--mono); font-size: .8rem; color: var(--signal); font-weight: 700; }

/* --------------------------------------------------------------- Admin ----- */

.adminbar {
  background: var(--nacht-2);
  border-bottom: 1px solid var(--linie);
}
.adminbar-in {
  max-width: 1060px;
  margin: 0 auto;
  padding: .55rem 1rem;
  display: flex;
  gap: .3rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.adminbar-in::-webkit-scrollbar { display: none; }
.adminbar a {
  color: var(--mute);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 600;
  padding: .35rem .7rem;
  border-radius: 99px;
  white-space: nowrap;
}
.adminbar a.is-active { background: var(--magenta); color: #fff; }

.wide { max-width: 1060px; }

.dtable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dtable th, .dtable td {
  text-align: left;
  padding: .6rem .7rem;
  border-bottom: 1px solid var(--linie);
  vertical-align: top;
}
.dtable th {
  font-family: var(--mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--mute);
  font-weight: 600;
}
.dtable tr:hover td { background: rgba(255, 255, 255, .02); }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.adm-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
  padding: .8rem 1rem;
  background: var(--nacht-2);
  border: 1px solid var(--linie);
  border-radius: var(--r-sm);
  margin-bottom: .5rem;
}
.adm-row-main { flex: 1; min-width: 200px; }
.adm-row-title { font-weight: 700; }
.adm-row-sub { color: var(--mute); font-size: .8rem; }
.adm-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.btn-xs { font-size: .78rem; padding: .35rem .7rem; }

.inline-form { display: inline; }

.blockcard {
  border: 1px solid var(--linie);
  border-radius: var(--r-sm);
  background: var(--nacht-2);
  padding: 1rem;
  margin-bottom: .7rem;
}
.blockcard-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .7rem;
  flex-wrap: wrap;
}
.blockcard-type {
  font-family: var(--mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--magenta);
  font-weight: 700;
}
.blockcard-head .spacer { flex: 1; }

.hint {
  color: var(--mute);
  font-size: .85rem;
  line-height: 1.55;
  margin: .3rem 0 1rem;
}
.hint code {
  font-family: var(--mono);
  font-size: .84em;
  background: var(--nacht-3);
  padding: .1em .35em;
  border-radius: 4px;
}

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 780px) { .split { grid-template-columns: 1fr; } }

.foot {
  text-align: center;
  color: var(--mute);
  font-size: .76rem;
  padding: 2rem 1rem 3rem;
  opacity: .6;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ==========================================================================
   v3 – Community, Animation, Feinschliff
   ========================================================================== */

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.linkbtn {
  background: none; border: 0; padding: 0;
  color: var(--mute); font: inherit; font-size: .85rem;
  text-decoration: underline; cursor: pointer;
}
.linkbtn:hover { color: var(--rot); }

/* ----------------------------------------------------------- Animationen -- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes grow   { from { width: 0; } }
@keyframes shine  { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(260%) skewX(-20deg); } }
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50%      { transform: scale(1.14) rotate(4deg); }
}
@keyframes popin  { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
@keyframes bob    { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes glow   { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 216, 77, 0); } 50% { box-shadow: 0 0 0 6px rgba(255, 216, 77, .18); } }

main { animation: fade .35s ease both; }

.reveal { animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 60ms); }

.track .fill { animation: grow 1.1s cubic-bezier(.2, .8, .2, 1) both; animation-delay: .25s; position: relative; overflow: hidden; }
.track .fill::after {
  content: ''; position: absolute; inset: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: shine 2.4s ease-in-out 1.4s infinite;
}

.btn { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 35%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: translateX(-120%) skewX(-20deg);
}
.btn-primary:hover::after { animation: shine .7s ease; }
.btn:hover { transform: translateY(-1px); }

.streak.is-lit .flame { display: inline-block; animation: flicker 1.6s ease-in-out infinite; transform-origin: 50% 80%; }

/* --------------------------------------------------------------- Avatare -- */

.ava {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  border-radius: 50%; overflow: hidden;
  background: var(--nacht-3);
  border: 2px solid var(--linie);
  line-height: 1; vertical-align: middle;
}
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava-emoji { background: linear-gradient(135deg, var(--nacht-3), var(--linie)); }
.me-link { display: inline-flex; border-radius: 50%; }
.me-link:hover .ava { border-color: var(--signal); }

/* ------------------------------------------------------- Mobile Tabbar ---- */

.tabbar { display: none; }
.dot {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 5px;
  border-radius: 99px; background: var(--magenta); color: #fff;
  font-family: var(--mono); font-size: .66rem; font-weight: 700;
  animation: popin .35s ease both;
}

@media (max-width: 720px) {
  .mainnav { display: none; }
  .topbar-me { margin-left: auto; }
  body.has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; z-index: 45;
    left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 6px; gap: 4px;
    background: rgba(26, 35, 82, .92);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--linie); border-radius: 22px;
    box-shadow: 0 16px 40px -16px rgba(0,0,0,.8);
  }
  .tabbar a {
    flex: 1; position: relative;
    display: grid; justify-items: center; gap: 2px;
    padding: 7px 2px 6px; border-radius: 16px;
    color: var(--mute); text-decoration: none;
    font-size: .68rem; font-weight: 700;
    transition: background .2s ease, color .2s ease, transform .15s ease;
  }
  .tabbar a:active { transform: scale(.94); }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.is-active { color: var(--nacht); background: var(--signal); }
  .tabbar .dot { position: absolute; top: 2px; right: calc(50% - 22px); margin: 0; }
  .foot { padding-bottom: 1rem; }
}

/* ----------------------------------------------------------------- Hero ---- */

.hero-row { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.hero-ava { border-radius: 50%; display: inline-flex; }
.hero-ava .ava { border-color: var(--signal); box-shadow: 0 0 0 4px rgba(255, 216, 77, .15); }
.hero-row .hero-hello { margin: 0; line-height: 1.05; }
.hero-xp {
  margin: .2rem 0 0; font-family: var(--mono); font-weight: 700;
  color: var(--signal); font-size: 1rem;
}

/* ---------------------------------------------------------------- Nudge ---- */

.nudge {
  display: flex; align-items: center; gap: .9rem;
  padding: .9rem 1.1rem; margin-bottom: .9rem;
  border: 1px dashed var(--signal); border-radius: var(--r);
  background: rgba(255, 216, 77, .06);
  color: var(--text); text-decoration: none;
  animation: rise .55s cubic-bezier(.2,.8,.2,1) both, glow 2.6s ease-in-out 1.2s infinite;
}
.nudge strong { display: block; }
.nudge .mute { font-size: .86rem; }
.nudge-ico { font-size: 1.8rem; animation: bob 2.2s ease-in-out infinite; }
.nudge-go { margin-left: auto; font-weight: 800; color: var(--signal); }

.continue { margin-bottom: 0; }
.continue::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: translateX(-120%) skewX(-20deg);
  animation: shine 3.2s ease-in-out 1.5s infinite;
  pointer-events: none;
}
.continue-empty::before { display: none; }
.continue:hover { transform: translateY(-2px); transition: transform .2s ease; }

/* ----------------------------------------------------------------- Duell --- */

.duel {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: .4rem .8rem; padding: 1.1rem;
}
.duel-player {
  display: grid; justify-items: center; gap: .25rem; text-align: center;
  position: relative; padding-top: .4rem;
}
.duel-player .ava { transition: transform .2s ease; }
.duel:hover .duel-player .ava { transform: scale(1.05); }
.duel-player.is-lead .ava { border-color: var(--signal); box-shadow: 0 0 0 4px rgba(255, 216, 77, .18); }
.duel-player.is-lead::before {
  content: '👑'; position: absolute; top: -10px; font-size: 1.1rem;
  animation: bob 2s ease-in-out infinite;
}
.duel-name { font-family: var(--display); font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; }
.duel-xp { font-family: var(--mono); font-size: .82rem; color: var(--mute); }
.duel-vs {
  font-family: var(--display); font-weight: 800; font-size: 1.4rem;
  color: var(--magenta); letter-spacing: .02em;
  text-shadow: 0 0 18px rgba(255, 77, 157, .5);
}
.duel-note { grid-column: 1 / -1; text-align: center; font-size: .88rem; color: var(--mute); }
.duel-week { display: block; margin-top: .3rem; font-family: var(--mono); font-size: .78rem; color: var(--signal); }

/* ------------------------------------------------- Meme & Tagesfrage ------ */

.daygrid {
  display: grid; gap: .9rem; margin-top: .9rem;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  align-items: start;
}
.card-kicker {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--signal); margin-bottom: .8rem;
}

.mm {
  background: var(--papier); color: #16181d;
  border-radius: 14px; padding: 1rem 1.1rem;
  font-size: 1.02rem; line-height: 1.45;
  box-shadow: 0 10px 24px -14px rgba(0,0,0,.8);
}
.mm p { margin: 0 0 .4rem; }
.mm p:last-child { margin-bottom: 0; }
.mm-dim { color: #8a8f98; }
.mm-pov p { font-weight: 700; font-size: 1.1rem; }
.mm-expect { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; padding: .7rem; }
.mm-expect > div { background: #f1f2f6; border-radius: 10px; padding: .7rem; }
.mm-tag {
  display: inline-block; font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  background: #d9f7ea; color: #127a52; padding: .15rem .45rem; border-radius: 6px; margin-bottom: .4rem;
}
.mm-tag-bad { background: #ffe1de; color: #b4261a; }
.mm-chat { display: grid; gap: .35rem; background: #eef0f5; }
.mm-bubble { max-width: 82%; padding: .45rem .75rem; border-radius: 16px; margin: 0; font-size: .97rem; }
.mm-a { justify-self: start; background: #fff; border-bottom-left-radius: 4px; }
.mm-b { justify-self: end; background: #2f6bff; color: #fff; border-bottom-right-radius: 4px; }
.mm-tweet .mm-tw-head { display: flex; gap: .6rem; align-items: center; margin-bottom: .5rem; line-height: 1.2; font-size: .9rem; }
.mm-tw-ava {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #ff4d9d, #ffd84d); color: #fff; font-weight: 800;
}
.mm-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .6rem; }
.mm-btns span {
  background: #e8312d; color: #fff; font-weight: 700; text-align: center;
  padding: .7rem .5rem; border-radius: 12px; font-size: .92rem;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.25);
}
.mm-sweat { font-style: italic; color: #5c6270; text-align: center; }
.mm-list ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.mm-list li { margin-bottom: .2rem; }
.mm-bar { display: grid; grid-template-columns: 42% 1fr; gap: .5rem; align-items: center; margin-top: .45rem; font-size: .88rem; }
.mm-bar-track { height: 14px; background: #eceef3; border-radius: 99px; overflow: hidden; }
.mm-bar-fill {
  display: block; height: 100%; width: var(--v);
  background: linear-gradient(90deg, #2f6bff, #ff4d9d); border-radius: 99px;
  animation: grow 1.2s cubic-bezier(.2,.8,.2,1) .5s both;
}

.reacts { display: flex; gap: .4rem; margin-top: .8rem; flex-wrap: wrap; }
.react {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .35rem .6rem; border-radius: 99px;
  background: var(--nacht); border: 1px solid var(--linie);
  color: var(--text); cursor: pointer; font-size: 1.05rem;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.react:hover { transform: translateY(-2px); border-color: var(--signal); }
.react.is-mine { background: rgba(255, 216, 77, .14); border-color: var(--signal); }
.react.is-pop .react-em { animation: popin .4s ease; }
.react-who { display: inline-flex; }
.react-who .ava { margin-left: -6px; border-width: 1.5px; }
.react-who .ava:first-child { margin-left: 0; }

.daily-card .q { background: none; border: 0; padding: 0; margin: 0; }
.daily-card .q-prompt { font-size: 1.05rem; margin-top: .2rem; }
.q-from { font-size: .78rem; margin: 0; }

/* -------------------------------------------------------- Modulkarten ----- */

.modcard { position: relative; overflow: hidden; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.modcard:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -20px rgba(0,0,0,.9); }
.modcard-emoji { transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); display: inline-block; }
.modcard:hover .modcard-emoji { transform: scale(1.2) rotate(-8deg); }
.modcard.is-done { border-color: rgba(86, 224, 176, .55); }
.lesson-row a { transition: border-color .2s ease, transform .15s ease; }
.lesson-row a:hover { transform: translateX(3px); }

/* ---------------------------------------------------------- Profilbild ---- */

.profile-head { align-items: flex-start; }
.ava-upload { margin: 0; }
.ava-pick { position: relative; display: inline-block; cursor: pointer; border-radius: 50%; }
.ava-pick .ava { border-width: 3px; border-color: var(--signal); transition: transform .2s ease, filter .2s ease; }
.ava-pick:hover .ava { transform: scale(1.04); filter: brightness(.85); }
.ava-cam {
  position: absolute; right: -2px; bottom: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: .9rem;
  background: var(--signal); border: 2px solid var(--nacht-2);
}
.ava-pick:focus-within { outline: 3px solid var(--signal); outline-offset: 4px; }
.ava-upload.is-busy .ava { animation: glow 1s ease-in-out infinite; opacity: .6; }
.ava-actions { display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap; margin-top: .6rem; font-size: .85rem; }

/* -------------------------------------------------------- Segment-Tabs ---- */

.seg {
  display: inline-flex; gap: 4px; padding: 4px; margin: .4rem 0 1rem;
  background: var(--nacht-2); border: 1px solid var(--linie); border-radius: 99px;
}
.seg a {
  padding: .45rem 1rem; border-radius: 99px;
  color: var(--mute); text-decoration: none; font-weight: 700; font-size: .9rem;
  transition: background .2s ease, color .2s ease;
}
.seg a.is-active { background: var(--signal); color: var(--nacht); }
.serp-fav { margin-right: .3rem; border-width: 1px; }
.serp-featured-body .ava { border-color: #dadce0; }

/* ----------------------------------------------------------------- Chat ---- */

.chat-wrap { padding-bottom: 7.5rem; }
.chat-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.chat-head .page-title { margin-bottom: .2rem; }
.chat-people { display: flex; }
.chat-person { position: relative; margin-left: -8px; }
.chat-person:first-child { margin-left: 0; }
.chat-person .ava { border-color: var(--nacht); }
.chat-person.is-online::after {
  content: ''; position: absolute; right: 0; bottom: 0;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--mint); border: 2px solid var(--nacht);
}

.chat-list { display: grid; gap: 2px; }
.chat-day {
  justify-self: center; margin: 1rem 0 .5rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--mute); background: var(--nacht-2); border: 1px solid var(--linie);
  padding: .2rem .7rem; border-radius: 99px;
}
.msg { display: flex; gap: .55rem; align-items: flex-end; margin-top: .55rem; position: relative; }
.msg.is-grouped { margin-top: 0; }
.msg-ava { width: 34px; flex: 0 0 34px; }
.msg-main { max-width: min(78%, 520px); display: grid; gap: .15rem; }
.msg-meta { font-size: .76rem; color: var(--mute); padding: 0 .3rem; }
.msg-meta b { color: var(--text); }
.msg-tag {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--magenta); border: 1px solid var(--magenta); border-radius: 5px; padding: 0 .3rem;
}
.msg-bubble {
  background: var(--nacht-2); border: 1px solid var(--linie);
  padding: .55rem .8rem; border-radius: 18px 18px 18px 6px;
  word-wrap: break-word; overflow-wrap: anywhere; line-height: 1.45;
}
.msg.is-grouped .msg-bubble { border-radius: 6px 18px 18px 6px; }
.msg-bubble a { color: var(--signal); }
.msg.is-me { flex-direction: row-reverse; }
.msg.is-me .msg-main { justify-items: end; }
.msg.is-me .msg-meta { text-align: right; }
.msg.is-me .msg-bubble {
  background: linear-gradient(135deg, #ffd84d, #ffbf3d); color: var(--nacht);
  border-color: transparent; border-radius: 18px 18px 6px 18px;
}
.msg.is-me.is-grouped .msg-bubble { border-radius: 18px 6px 6px 18px; }
.msg.is-me .msg-bubble a { color: var(--nacht); }
.msg.is-new { animation: popin .3s cubic-bezier(.2, 1.3, .4, 1) both; transform-origin: bottom left; }
.msg.is-me.is-new { transform-origin: bottom right; }
.msg.is-gone { opacity: 0; transform: scale(.9); transition: all .25s ease; }
.msg-del {
  align-self: center; opacity: 0; border: 0; background: none;
  color: var(--mute); font-size: 1.1rem; cursor: pointer; padding: .2rem .4rem;
  transition: opacity .15s ease;
}
.msg:hover .msg-del, .msg-del:focus { opacity: 1; }
@media (hover: none) { .msg-del { opacity: .45; } }

.chat-empty { text-align: center; padding: 3rem 1rem; }
.chat-empty-emoji { font-size: 3rem; animation: bob 2s ease-in-out infinite; }
.chat-empty p { margin: .3rem 0; }
.chat-more { display: block; margin: 0 auto 1rem; }
.chat-more, .chat-more:disabled { background: none; border: 1px solid var(--linie); color: var(--mute); border-radius: 99px; padding: .4rem 1rem; cursor: pointer; font: inherit; font-size: .85rem; }

.chat-form {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(calc(100% - 20px), 740px);
  display: flex; gap: .5rem; align-items: flex-end;
  padding: .5rem; border-radius: 24px;
  background: rgba(26, 35, 82, .94);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--linie);
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.8);
}
.chat-form textarea {
  flex: 1; resize: none; border: 0; outline: none;
  background: var(--nacht); color: var(--text);
  border-radius: 18px; padding: .7rem .95rem;
  font-family: var(--sans); font-size: 1rem; line-height: 1.35;
  max-height: 160px;
}
.chat-send { width: 46px; height: 46px; padding: 0; border-radius: 50%; display: grid; place-items: center; flex: 0 0 46px; }
.chat-send svg { width: 20px; height: 20px; fill: var(--nacht); }
.chat-form.is-busy .chat-send { opacity: .6; }
.chat-note { text-align: center; font-size: .75rem; margin-top: 1rem; }
@media (hover: none) { .chat-note { display: none; } }
@media (max-width: 720px) {
  .chat-form { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .chat-wrap { padding-bottom: 9rem; }
}
.chat-page .foot { display: none; }

/* ---------------------------------------------------------------- Toast ---- */

.toast {
  position: fixed; z-index: 80; left: 50%; top: 16px;
  transform: translate(-50%, -140%);
  display: flex; gap: .7rem; align-items: center;
  max-width: min(92vw, 420px);
  padding: .8rem 1rem; border-radius: 16px;
  background: var(--nacht-2); border: 1px solid var(--signal); color: var(--text);
  box-shadow: 0 20px 40px -18px #000;
  transition: transform .4s cubic-bezier(.2, 1.3, .4, 1);
  font-size: .9rem;
}
.toast.is-in { transform: translate(-50%, 0); }
.toast-em { font-size: 1.8rem; }

@media (prefers-reduced-motion: reduce) {
  .reveal, main, .nudge, .track .fill, .mm-bar-fill { animation: none !important; }
  .track .fill::after, .continue::before, .btn-primary::after { display: none; }
}
