/* Lernwelt · Exam Atelier */
:root {
  --bg: #07090f;
  --bg-2: #0f1420;
  --card: rgba(21, 27, 46, .92);
  --text: #f4f1ea;
  --muted: #9aa3b8;
  --gold: #C5A572;
  --gold-deep: #9a7840;
  --good: #34d399;
  --bad: #fb7185;
  --line: rgba(197, 165, 114, .22);
  --display: "Fraunces", Georgia, serif;
  --ui: "IBM Plex Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.atmosphere {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(80% 45% at 8% -6%, rgba(197, 165, 114, .14), transparent 62%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
}
#app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  animation: rise .45s var(--ease) both;
}
.screen.quiz { padding-bottom: 0; }

/* Leiste */
.bar { display: flex; justify-content: space-between; align-items: center; min-height: 48px; margin-bottom: 22px; }
.brand { font: 700 1.2rem var(--display); color: var(--gold); letter-spacing: -.01em; }
.link {
  background: none; border: 0; padding: 0; min-height: 44px;
  color: var(--muted); font: 500 14px var(--ui); cursor: pointer;
}
.back { display: inline-flex; align-items: center; gap: 6px; }
.ctx {
  max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 500 13px var(--ui); color: var(--gold);
}
.eyebrow { margin: 0 0 12px; font: 500 13px var(--ui); letter-spacing: .04em; color: var(--gold); }

/* Typografie */
.h1 {
  margin: 0 0 14px;
  font: 500 clamp(1.9rem, 8vw, 2.4rem)/1.12 var(--display);
  letter-spacing: -.025em;
  text-wrap: balance;
}
.lead { margin: 0; color: var(--muted); font-size: 1.05rem; }
.q {
  margin: 0 0 20px;
  font: 500 clamp(1.5rem, 6.4vw, 1.95rem)/1.28 var(--display);
  letter-spacing: -.015em;
  text-wrap: balance;
}

/* Login */
.hero { margin-top: 7vh; }
.brand-xl {
  margin: 0 0 16px;
  font: 700 clamp(3.4rem, 18vw, 4.8rem)/1 var(--display);
  letter-spacing: -.04em;
  color: var(--gold);
}
.form { margin-top: auto; padding-top: 40px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
input {
  width: 100%; min-height: 56px; padding: 14px 16px;
  background: rgba(8, 11, 20, .7);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  color: var(--text); font: 500 16px var(--ui);
  outline: 0; transition: border-color .2s;
}
input:focus { border-color: var(--gold); }
.note { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.err {
  margin: 0 0 14px; padding: 12px 14px;
  border-left: 3px solid var(--bad); border-radius: 0 12px 12px 0;
  background: rgba(251, 113, 133, .08); color: #ffc2cb; font-size: 15px;
}
.foot { display: flex; justify-content: center; gap: 22px; padding-top: 24px; }
.foot a { color: var(--muted); font-size: 13px; text-decoration: none; }

/* Home */
.today { margin: 0 0 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.today b { color: var(--gold); font: 600 1.15rem var(--display); }
.station {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  width: 100%; margin-bottom: 12px; padding: 18px 16px 18px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
  animation: rise .5s var(--ease) both;
  animation-delay: calc(var(--i) * 70ms + 140ms);
  transition: transform .15s, border-color .2s;
}
.station:hover { border-color: rgba(197, 165, 114, .5); }
.station:active { transform: scale(.985); }
.st-body { display: grid; gap: 4px; min-width: 0; }
.st-title { font: 500 1.2rem/1.25 var(--display); }
.st-desc { font-size: 14px; color: var(--muted); }
.st-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.st-due { color: var(--gold); font-weight: 600; }
.st-due.ok { color: var(--good); }
.ring { width: 56px; height: 56px; }
.ring circle { fill: none; stroke-width: 3; transform: rotate(-90deg); transform-box: fill-box; transform-origin: center; }
.rt { stroke: rgba(255, 255, 255, .08); }
.rg {
  stroke: var(--gold); stroke-linecap: round;
  stroke-dasharray: 138.23;
  stroke-dashoffset: calc(138.23 * (1 - var(--p) / 100));
  animation: fill 1.1s .3s var(--ease) both;
}
.ring text { fill: var(--gold); font: 600 12px var(--ui); }
.empty { color: var(--muted); }

/* Frage */
.stage { flex: 1; display: flex; flex-direction: column; padding: 2vh 0 18px; }
.stage.center { justify-content: center; }
.mark { width: 68px; height: 68px; margin-bottom: 24px; }
.mark circle, .mark path {
  fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 200; animation: draw 1s .2s var(--ease) both;
}
.dock {
  position: sticky; bottom: 0; display: grid; gap: 10px;
  margin: 0 -20px; padding: 24px 20px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--bg) 30%);
}
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 58px; padding: 14px 18px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
  color: var(--text); font: 600 16px var(--ui); cursor: pointer;
  transition: transform .12s, background .2s, border-color .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { cursor: default; opacity: .7; }
.btn.primary { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); border-color: transparent; color: #14100a; font-weight: 700; }
.btn.good { background: rgba(52, 211, 153, .14); border-color: rgba(52, 211, 153, .35); color: var(--good); }
.btn.bad { background: rgba(251, 113, 133, .12); border-color: rgba(251, 113, 133, .35); color: #ffb4c0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.opt {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 60px; padding: 12px 16px;
  background: var(--card); border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px;
  color: var(--text); font: 500 16px/1.35 var(--ui); text-align: left; cursor: pointer;
  transition: transform .12s, border-color .2s, background .2s, opacity .25s;
}
.opt:hover:not(:disabled) { border-color: rgba(197, 165, 114, .5); }
.opt:active:not(:disabled) { transform: scale(.985); }
.opt:disabled { cursor: default; }
.ltr {
  flex: 0 0 28px; height: 28px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  font: 600 12px var(--ui); color: var(--gold);
}
.opt.is-wait { border-color: var(--gold); }
.opt.is-good { border-color: var(--good); background: rgba(52, 211, 153, .12); animation: pulse .45s var(--ease); }
.opt.is-bad { border-color: var(--bad); background: rgba(251, 113, 133, .1); animation: pulse .45s var(--ease); }
.opt.is-dim { opacity: .38; }

/* Flashcard */
.flip { perspective: 1200px; margin-bottom: 8px; cursor: pointer; }
.flip-in { display: grid; transform-style: preserve-3d; transition: transform .65s var(--ease); }
.flip.on .flip-in { transform: rotateY(180deg); }
.face {
  grid-area: 1 / 1; min-height: 42vh; padding: 26px 22px;
  display: flex; flex-direction: column; justify-content: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.face.back { transform: rotateY(180deg); border-color: rgba(197, 165, 114, .5); }
.face .q { margin: 0; }
.face-l { margin-bottom: 14px; font: 500 13px var(--ui); color: var(--gold); }
.ans { margin: 0; font: 500 clamp(1.25rem, 5.4vw, 1.6rem)/1.4 var(--display); }

/* Feedback inline */
.fb {
  margin-top: 6px; padding: 16px 18px;
  border-left: 3px solid; border-radius: 0 16px 16px 0;
  animation: pulse .45s var(--ease) both;
}
.fb.ok { border-color: var(--good); background: rgba(52, 211, 153, .08); }
.fb.no { border-color: var(--bad); background: rgba(251, 113, 133, .08); }
.fb-t { display: block; font: 600 1.4rem var(--display); }
.ok .fb-t { color: var(--good); }
.no .fb-t { color: #ffb4c0; }
.fb-a { margin: 10px 0 0; font-weight: 600; }
.fb-a span { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
.fb-e { margin: 10px 0 0; color: rgba(244, 241, 234, .85); }

/* Moduswahl */
.modes { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.mode {
  text-align: left; width: 100%; padding: 18px 18px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  color: var(--text); cursor: pointer; font: inherit;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.mode:hover, .mode:focus-visible { border-color: var(--gold); transform: translateY(-1px); }
.mode strong {
  display: block; margin-bottom: 6px;
  font: 600 1.25rem/1.2 var(--display); color: var(--gold);
}
.mode span { display: block; color: var(--muted); font-size: .95rem; line-height: 1.45; }
.mode-badge {
  display: inline-block; margin: 0 0 14px;
  font: 500 12px var(--ui); letter-spacing: .03em;
  color: var(--gold); opacity: .9;
}
.exam-n { color: var(--muted); font-weight: 500; }
.btn.ghost {
  width: 100%; min-height: 48px; border-radius: 14px;
  background: transparent; border: 1px solid var(--line);
  color: var(--muted); font: 600 15px var(--ui); cursor: pointer;
}
.exam-wrong { margin: 8px 0 20px; }
.exam-item {
  padding: 14px 0; border-top: 1px solid var(--line);
}
.exam-q { margin: 0 0 8px; font: 500 1rem/1.35 var(--display); }
.exam-a { margin: 0; font-weight: 600; font-size: .95rem; }
.exam-a span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.exam-e { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { transform: scale(.97); opacity: .6; } 60% { transform: scale(1.015); } 100% { transform: scale(1); opacity: 1; } }
@keyframes fill { from { stroke-dashoffset: 138.23; } }
@keyframes draw { from { stroke-dashoffset: 200; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
