/* ============================================================
   Lern-App — „Ruhiges Studienheft"
   Warmes, editoriales Interface · Terrakotta-Akzent · Fraunces + Hanken Grotesk
   ============================================================ */

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces-var.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('/fonts/hanken-grotesk-var.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

/* ---------- Farbthemen ---------- */
:root, [data-theme='light'] {
  --bg: #f3f0e9;
  --bg-2: #ece7dc;
  --surface: #fffdf8;
  --surface-2: #f4efe5;
  --ink: #221f1a;
  --ink-soft: #6f6659;
  --ink-faint: #a0968673;
  --line: #e6e0d3;
  --line-strong: #d8d0bf;

  --accent: #bf5c33;
  --accent-ink: #9c4a25;
  --accent-contrast: #fff;
  --accent-soft: #f6e6dc;

  --success: #4c7a54;
  --success-soft: #e7efe4;
  --danger: #b1473f;
  --danger-soft: #f6e3e0;

  --box1: #bd5238; --box2: #cd8340; --box3: #c6a63f; --box4: #7d9b55; --box5: #4c7a54;

  --shadow-sm: 0 1px 2px rgba(50, 40, 25, .06);
  --shadow-md: 0 2px 6px rgba(50, 40, 25, .07), 0 10px 26px rgba(50, 40, 25, .07);
  --shadow-lg: 0 4px 12px rgba(50, 40, 25, .09), 0 22px 48px rgba(50, 40, 25, .13);
  --ring-track: #e6e0d3;
}

[data-theme='dark'] {
  --bg: #17150f;
  --bg-2: #1f1c15;
  --surface: #232019;
  --surface-2: #2b271f;
  --ink: #ece6d9;
  --ink-soft: #a89e8c;
  --ink-faint: #776e5e99;
  --line: #34302a;
  --line-strong: #423d34;

  --accent: #e07d4f;
  --accent-ink: #ef8f62;
  --accent-contrast: #1a140f;
  --accent-soft: #33261d;

  --success: #7fae83;
  --success-soft: #23301f;
  --danger: #db7d72;
  --danger-soft: #331e1b;

  --box1: #cf6a4f; --box2: #d79357; --box3: #cbb15b; --box4: #8fae6c; --box5: #7fae83;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, .34), 0 12px 30px rgba(0, 0, 0, .4);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, .4), 0 26px 54px rgba(0, 0, 0, .55);
  --ring-track: #34302a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--bg);
  background-image:
    radial-gradient(120% 90% at 100% 0%, var(--bg-2) 0%, transparent 55%),
    radial-gradient(90% 80% at 0% 100%, var(--bg-2) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100dvh;
}

.hidden { display: none !important; }
button { font: inherit; cursor: pointer; color: inherit; }
input, textarea { font: inherit; }

h1, h2, h3 { font-family: 'Fraunces', ui-serif, Georgia, serif; font-weight: 560; line-height: 1.15; letter-spacing: -0.01em; margin: 0; }
.serif { font-family: 'Fraunces', ui-serif, Georgia, serif; }
.muted { color: var(--ink-soft); }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: .72rem 1.15rem;
  font-weight: 600;
  font-size: .95rem;
  background: var(--surface-2);
  color: var(--ink);
  transition: transform .12s cubic-bezier(.2,.8,.2,1), background .18s, box-shadow .18s, border-color .18s, color .18s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.99); }
.btn.primary { background: var(--accent); color: var(--accent-contrast); box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 8px 20px -8px var(--accent); }
.btn.primary:hover { background: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.good { background: var(--success); color: #fff; }
.btn.bad { background: var(--danger); color: #fff; }
.btn.small { padding: .45rem .8rem; font-size: .85rem; border-radius: 9px; }
.btn.block { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }

.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); transition: color .18s, border-color .18s, transform .12s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 1.4rem; }
.auth-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-lg); padding: 2.1rem 1.9rem; width: 100%; max-width: 400px;
  animation: pop .5s cubic-bezier(.2,.8,.2,1) both;
}
.auth-brand { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: .9rem; }
.auth-title { font-size: 1.8rem; }
.auth-sub { color: var(--ink-soft); margin: .5rem 0 1.4rem; font-size: .95rem; }
.tabs { display: flex; gap: .25rem; background: var(--surface-2); padding: .28rem; border-radius: 12px; margin-bottom: 1.2rem; }
.tab { flex: 1; border: 0; background: transparent; padding: .58rem; border-radius: 9px; font-weight: 600; color: var(--ink-soft); transition: .18s; }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.field { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .9rem; }
.field input {
  width: 100%; margin-top: .35rem; padding: .74rem .85rem;
  border: 1px solid var(--line-strong); border-radius: 11px; font-size: 1rem;
  background: var(--surface-2); color: var(--ink); transition: border-color .18s, box-shadow .18s, background .18s;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.error { color: var(--danger); min-height: 1.2em; margin: 0 0 .7rem; font-size: .88rem; font-weight: 500; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .8rem;
  padding: .6rem clamp(.8rem, 4vw, 1.4rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .5rem; border: 0; background: transparent; padding: .2rem; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: var(--accent-contrast); font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.05rem;
}
.brand-word { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.12rem; letter-spacing: -.01em; }
.mainnav { display: flex; gap: .1rem; flex: 1; }
.mainnav button {
  display: inline-flex; align-items: center; gap: .45rem;
  border: 0; background: transparent; color: var(--ink-soft);
  padding: .5rem .8rem; border-radius: 10px; font-weight: 600; font-size: .92rem; white-space: nowrap;
  transition: color .18s, background .18s;
}
.mainnav button:hover { color: var(--ink); background: var(--surface-2); }
.mainnav button.active { color: var(--accent); background: var(--accent-soft); }
.mainnav .ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mainnav .lbl-short { display: none; }
.user-area { display: flex; align-items: center; gap: .55rem; }
.who { font-size: .88rem; color: var(--ink-soft); font-weight: 600; }

/* ---------- View-Layout ---------- */
.view { max-width: 820px; margin: 0 auto; padding: clamp(1rem, 3vw, 1.8rem) clamp(.8rem, 4vw, 1.4rem) 4rem; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-md); padding: 1.3rem; margin-bottom: 1.1rem;
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.section-head h2 { font-size: 1.28rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }

/* Begrüßung */
.greeting { margin: .2rem 0 1.3rem; }
.greeting h1 { font-size: clamp(1.7rem, 6vw, 2.3rem); letter-spacing: -.02em; }
.greeting p { color: var(--ink-soft); margin: .35rem 0 0; }

/* ---------- Modus-Kacheln ---------- */
.tiles { display: grid; grid-template-columns: 1fr; gap: .85rem; margin-bottom: 1.4rem; }
.tile {
  display: flex; align-items: flex-start; gap: 1rem; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 1.15rem 1.2rem; box-shadow: var(--shadow-sm); width: 100%;
  transition: transform .16s cubic-bezier(.2,.8,.2,1), box-shadow .18s, border-color .18s;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.tile-ico {
  flex: none; width: 48px; height: 48px; border-radius: 13px;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.tile-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile-body h3 { font-size: 1.18rem; margin-bottom: .15rem; }
.tile-body p { margin: 0; color: var(--ink-soft); font-size: .92rem; line-height: 1.5; }
.tile-arrow { margin-left: auto; align-self: center; color: var(--ink-faint); transition: transform .18s, color .18s; }
.tile:hover .tile-arrow { transform: translateX(3px); color: var(--accent); }
.tile-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Statistik-Streifen ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; }
.stat { background: var(--surface-2); border-radius: 14px; padding: .9rem .6rem; text-align: center; }
.stat b { display: block; font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.7rem; line-height: 1; letter-spacing: -.02em; }
.stat span { font-size: .74rem; color: var(--ink-soft); display: block; margin-top: .35rem; }

/* ---------- Fortschrittsringe pro Vorlesung ---------- */
.rings { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
.ring-card {
  display: flex; align-items: center; gap: .8rem;
  background: var(--surface-2); border-radius: 14px; padding: .75rem .85rem;
}
.ring { flex: none; width: 54px; height: 54px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--ring-track); }
.ring .fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'Fraunces', serif; font-weight: 600; font-size: .82rem; }
.ring-meta { min-width: 0; }
.ring-meta .lec { font-weight: 700; font-size: .95rem; }
.ring-meta .ttl { color: var(--ink-soft); font-size: .78rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring-meta .det { color: var(--ink-faint); font-size: .74rem; margin-top: .1rem; }

.legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .76rem; color: var(--ink-soft); margin-top: .9rem; }
.legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: .3rem; vertical-align: middle; }

/* Themen-Fortschritt (Details) */
.theme-line { margin: .55rem 0; }
.theme-line .lbl { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: .28rem; gap: .8rem; }
.theme-line .lbl .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; transition: width .9s cubic-bezier(.2,.8,.2,1); }
details.panel > summary { cursor: pointer; list-style: none; font-family: 'Fraunces', serif; font-size: 1.1rem; font-weight: 560; display: flex; justify-content: space-between; align-items: center; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: '▾'; color: var(--ink-faint); transition: transform .2s; }
details.panel[open] > summary::after { transform: rotate(180deg); }
details.panel > summary + * { margin-top: 1rem; }

/* Chips / Themen wählen */
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft);
  padding: .38rem .75rem; border-radius: 999px; font-size: .85rem; font-weight: 600; transition: .16s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

/* ---------- Lernkarte ---------- */
.study-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.study-head .count { font-weight: 700; color: var(--ink-soft); font-size: .92rem; }
.progress-track { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 1rem; }
.progress-track > i { display: block; height: 100%; background: var(--accent); transition: width .5s cubic-bezier(.2,.8,.2,1); }

.flash {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 1.5rem; min-height: 260px; display: flex; flex-direction: column;
  box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.flash::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 40%, transparent)); opacity: .85; }
.flash.is-enter { animation: cardIn .34s cubic-bezier(.2,.8,.2,1) both; }
.flash .meta { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.badge { font-size: .72rem; font-weight: 700; padding: .24rem .6rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); letter-spacing: .02em; }
.badge.lec { background: var(--accent-soft); color: var(--accent-ink); }
.badge.DEF { background: var(--accent-soft); color: var(--accent-ink); }
.badge.ZU { background: var(--success-soft); color: var(--success); }
.badge.ANW { background: color-mix(in srgb, var(--box3) 20%, var(--surface)); color: color-mix(in srgb, var(--box3) 80%, var(--ink)); }
.badge.box { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-soft); }
.flash .q { font-family: 'Fraunces', serif; font-size: 1.4rem; font-weight: 500; line-height: 1.32; letter-spacing: -.01em; }
.flash .grow { flex: 1; min-height: .6rem; }
.flash .anchor { margin-top: 1rem; font-size: .85rem; color: var(--ink-soft); display: flex; align-items: center; gap: .35rem; }
.flash .anchor b { color: var(--accent-ink); font-weight: 700; }
.flash-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: 1.15rem; }

/* Aktiver Abruf */
.recall { margin-top: 1.1rem; }
.recall-label, .cmp-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 700; display: block; margin-bottom: .35rem; }
.recall-input {
  width: 100%; padding: .8rem .9rem; border: 1px solid var(--line-strong); border-radius: 13px;
  font-size: 1rem; background: var(--surface-2); color: var(--ink); resize: vertical; min-height: 5.5rem; line-height: 1.5;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.recall-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.recall-compare { margin-top: 1.1rem; display: flex; flex-direction: column; gap: 1rem; }
.recall-compare > * { animation: revealIn .42s cubic-bezier(.2,.8,.2,1) both; }
.recall-compare > *:nth-child(2) { animation-delay: .05s; }
.recall-compare > *:nth-child(3) { animation-delay: .1s; }
.recall-compare > *:nth-child(4) { animation-delay: .14s; }
.cmp-mine { white-space: pre-wrap; background: var(--surface-2); border-left: 3px solid var(--ink-faint); border-radius: 10px; padding: .8rem .9rem; }
.cmp-mine.empty { color: var(--ink-soft); font-style: italic; }
.cmp-model { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 10px; padding: .85rem .95rem; font-size: 1.06rem; line-height: 1.55; }
.flash .anchor { animation: revealIn .42s cubic-bezier(.2,.8,.2,1) both; animation-delay: .12s; }
.flash-actions { animation: revealIn .42s cubic-bezier(.2,.8,.2,1) both; animation-delay: .18s; }

/* ---------- Zuordnen (Matching) ---------- */
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.match-col { display: flex; flex-direction: column; gap: .55rem; }
.match-item {
  text-align: left; border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 13px; padding: .75rem .8rem; font-size: .92rem; min-height: 3.1rem; line-height: 1.4;
  transition: border-color .16s, box-shadow .16s, background .16s, transform .1s;
}
.match-item:hover:not(:disabled) { border-color: var(--accent); }
.match-item.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--accent-soft); }
.match-item.ok { background: var(--success-soft); border-color: var(--success); color: var(--success); cursor: default; }
.match-item.err { background: var(--danger-soft); border-color: var(--danger); animation: shake .32s; }
@keyframes shake { 20%,60% { transform: translateX(-4px); } 40%,80% { transform: translateX(4px); } }

/* ---------- Probeklausur ---------- */
.quote { font-family: 'Fraunces', serif; font-size: 3rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.quote small { font-family: 'Hanken Grotesk', sans-serif; font-size: .95rem; font-weight: 600; color: var(--ink-soft); letter-spacing: 0; }
.exam-opts { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0 1.1rem; }

/* ---------- Sprint ---------- */
.sprint-hi { font-family: 'Fraunces', serif; font-size: clamp(1.4rem, 5vw, 1.9rem); font-weight: 500; letter-spacing: -.01em; margin: .2rem 0 .5rem; }
.sprint-times { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; margin: 1rem 0; }
.sprint-time {
  display: flex; flex-direction: column; align-items: center; gap: .1rem;
  padding: 1.05rem .6rem; border: 1px solid var(--line-strong); border-radius: 15px;
  background: var(--surface-2); color: var(--ink);
  transition: transform .14s cubic-bezier(.2,.8,.2,1), border-color .16s, box-shadow .16s, background .16s;
}
.sprint-time:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--surface); box-shadow: var(--shadow-md); }
.sprint-time b { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.9rem; line-height: 1; }
.sprint-time span { font-size: .78rem; color: var(--ink-soft); }

/* Vorab-Übersicht der Pausen (Startbildschirm) */
.break-plan { display: flex; gap: .75rem; align-items: center; margin-top: 1rem; padding: .8rem .9rem; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 14px; animation: revealIn .35s cubic-bezier(.2,.8,.2,1) both; }
.break-plan-ico { flex: none; width: 36px; height: 36px; display: grid; place-items: center; color: var(--accent); }
.break-plan-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.break-plan-title { font-weight: 700; font-size: .92rem; color: var(--accent-ink); }
.break-plan-txt { color: var(--ink-soft); font-size: .86rem; line-height: 1.45; }

/* Zeitbalken mit Pausen-Markern + Countdown */
.sprint-track { position: relative; height: 8px; border-radius: 999px; background: var(--line); margin-bottom: .5rem; }
.sprint-track .fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.sprint-track .marker { position: absolute; top: -3px; width: 3px; height: 14px; border-radius: 2px; background: var(--accent-ink); transform: translateX(-1.5px); opacity: .9; }
.sprint-track .marker.done { background: var(--ink-faint); opacity: .55; }
.next-break { font-size: .82rem; color: var(--ink-soft); font-weight: 600; margin-bottom: 1rem; font-variant-numeric: tabular-nums; }

.sprint-bar { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.sprint-clock-wrap { display: flex; flex-direction: column; line-height: 1; }
.sprint-clock { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.95rem; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sprint-clock-lbl { font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); font-weight: 700; margin-top: 2px; }
.sprint-count { margin-left: auto; font-size: .85rem; color: var(--ink-soft); font-weight: 600; }

.cheer {
  background: var(--accent-soft); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 13px; padding: .7rem 1rem; text-align: center; font-weight: 600; margin-bottom: .8rem;
  animation: cheerPop .4s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes cheerPop { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }

.sprint-break { text-align: center; animation: pop .4s cubic-bezier(.2,.8,.2,1) both; }
.break-emoji { font-size: 2.6rem; line-height: 1; margin-bottom: .4rem; }
.break-clock { font-family: 'Fraunces', serif; font-weight: 600; font-size: 2.7rem; color: var(--accent); font-variant-numeric: tabular-nums; margin: .7rem 0 1.1rem; }
.sprint-summary { animation: pop .45s cubic-bezier(.2,.8,.2,1) both; }

/* ---------- Untere Tab-Leiste (mobil) ---------- */
@media (max-width: 680px) {
  /* Kein backdrop-filter auf der Topbar: sonst wird sie zum Containing-Block
     für die fixierte Tab-Leiste und diese landet oben statt unten. */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: color-mix(in srgb, var(--bg) 94%, transparent); }
  .mainnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    gap: 0; justify-content: space-around;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(14px) saturate(1.3);
    border-top: 1px solid var(--line);
    padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom));
  }
  .mainnav button {
    flex: 1; flex-direction: column; gap: 3px; padding: .4rem .2rem; border-radius: 12px;
    font-size: .7rem; font-weight: 600;
  }
  .mainnav button:hover { background: transparent; }
  .mainnav button.active { background: transparent; color: var(--accent); }
  .mainnav button.active .ico { transform: translateY(-1px) scale(1.06); }
  .mainnav .ico { width: 22px; height: 22px; transition: transform .18s; }
  .mainnav .lbl-long { display: none; }
  .mainnav .lbl-short { display: inline; }
  .view { padding-bottom: 5.5rem; }
  .brand-word { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .flash .q { font-size: 1.28rem; }
}

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(1.3rem + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: var(--bg); padding: .65rem 1.05rem; border-radius: 11px;
  font-size: .9rem; font-weight: 500; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s; z-index: 60; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Animationen ---------- */
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes revealIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.dash-animate > * { animation: fadeUp .5s cubic-bezier(.2,.8,.2,1) both; }
.dash-animate > *:nth-child(1) { animation-delay: .02s; }
.dash-animate > *:nth-child(2) { animation-delay: .08s; }
.dash-animate > *:nth-child(3) { animation-delay: .14s; }
.dash-animate > *:nth-child(4) { animation-delay: .2s; }
.dash-animate > *:nth-child(5) { animation-delay: .26s; }
.dash-animate > *:nth-child(6) { animation-delay: .32s; }

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