/* ============================================================
   POLIS – GPB 5A Lernakademie
   Designsystem: dunkles „Akademie“-Theme mit Gold, Serif und Glas
   ============================================================ */

:root {
  --bg: #0a101c;
  --bg-2: #0f1828;
  --surface: rgba(20, 31, 50, 0.82);
  --surface-solid: #141f32;
  --surface-2: #18253b;
  --surface-3: #1e2e48;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #f5f1e6;
  --text-soft: #d7d4c8;
  --muted: #9aa8bd;
  --muted-2: #73839a;
  --gold: #e9b949;
  --gold-2: #f7d77e;
  --gold-deep: #b8872b;
  --teal: #45c4b0;
  --sky: #5aa9e6;
  --rose: #e8798a;
  --violet: #a78bfa;
  --green: #6ee7a8;
  --red: #f87171;
  --orange: #f0a35e;
  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 26px 70px -30px rgba(0, 0, 0, 0.8);
  --shadow-soft: 0 12px 32px -18px rgba(0, 0, 0, 0.6);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1000px 640px at 8% -8%, rgba(233, 185, 73, 0.1), transparent 60%),
    radial-gradient(900px 560px at 100% 0%, rgba(69, 196, 176, 0.08), transparent 55%),
    radial-gradient(700px 500px at 50% 110%, rgba(167, 139, 250, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 80%);
}

::selection {
  background: rgba(233, 185, 73, 0.28);
  color: #fff;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.12;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--gold);
  color: #171207;
  font-weight: 700;
}

.skip-link:focus {
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- Akzentfarben ---------- */

.accent-amber {
  --accent: #e9b949;
  --accent-2: #f7d77e;
  --accent-soft: rgba(233, 185, 73, 0.14);
}
.accent-sky {
  --accent: #5aa9e6;
  --accent-2: #8fc8f5;
  --accent-soft: rgba(90, 169, 230, 0.14);
}
.accent-teal {
  --accent: #45c4b0;
  --accent-2: #7adccc;
  --accent-soft: rgba(69, 196, 176, 0.14);
}
.accent-rose {
  --accent: #e8798a;
  --accent-2: #f3a5b1;
  --accent-soft: rgba(232, 121, 138, 0.14);
}
.accent-orange {
  --accent: #f0a35e;
  --accent-2: #f6c48e;
  --accent-soft: rgba(240, 163, 94, 0.14);
}
.accent-violet {
  --accent: #a78bfa;
  --accent-2: #c4b1fd;
  --accent-soft: rgba(167, 139, 250, 0.14);
}
.accent-gold {
  --accent: #d9a441;
  --accent-2: #f3ce86;
  --accent-soft: rgba(217, 164, 65, 0.14);
}
.accent-red {
  --accent: #ef7b72;
  --accent-2: #f7a79f;
  --accent-soft: rgba(239, 123, 114, 0.14);
}
.accent-green {
  --accent: #6ee7a8;
  --accent-2: #a7f3c9;
  --accent-soft: rgba(110, 231, 168, 0.14);
}

/* ---------- Grundlayout ---------- */

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1240px, calc(100% - 56px));
  margin-inline: auto;
}

.page {
  flex: 1;
  padding: 34px 0 90px;
  animation: page-in 0.4s ease both;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.gold {
  color: var(--gold-2);
}

.muted {
  color: var(--muted);
}

.serif {
  font-family: var(--serif);
}

.nowrap {
  white-space: nowrap;
}

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 16, 28, 0.8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  color: var(--gold);
  background:
    radial-gradient(circle at 30% 20%, rgba(247, 215, 126, 0.24), transparent 60%),
    #101a2b;
  border: 1px solid rgba(233, 185, 73, 0.35);
  box-shadow: inset 0 0 20px rgba(233, 185, 73, 0.08);
}

.brand-mark .icon {
  width: 25px;
  height: 25px;
}

.brand-title {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.14em;
  line-height: 1;
  color: var(--text);
}

.brand-sub {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.18s, background 0.18s;
}

.nav-link .icon {
  width: 17px;
  height: 17px;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--gold-2);
  background: rgba(233, 185, 73, 0.09);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.pill .icon {
  width: 16px;
  height: 16px;
}

.pill-streak .icon {
  color: var(--orange);
}

.pill-xp .icon {
  color: var(--gold);
}

.pill-xp strong {
  color: var(--gold-2);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  transition: 0.18s;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.07);
}

.avatar-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 12px 0 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  transition: 0.18s;
}

.avatar-chip:hover {
  border-color: rgba(233, 185, 73, 0.4);
  background: rgba(233, 185, 73, 0.06);
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #1b1407;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
}

.avatar-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.avatar-lvl {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}

.mobile-nav {
  display: none;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 26px;
  color: var(--muted-2);
  font-size: 12.5px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.footer a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
  text-underline-offset: 3px;
}

.footer a:hover {
  color: var(--gold-2);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
  white-space: nowrap;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #1a1305;
  box-shadow: 0 12px 28px -12px rgba(233, 185, 73, 0.55);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -12px rgba(233, 185, 73, 0.7);
}

.btn-ghost {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(233, 185, 73, 0.45);
  background: rgba(233, 185, 73, 0.07);
}

.btn-soft {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  border-color: transparent;
}

.btn-soft:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.btn-danger {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
  color: #fda4a4;
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.15);
}

.btn-sm {
  min-height: 36px;
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 10px;
}

.btn-lg {
  min-height: 54px;
  padding: 14px 30px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-2);
  font-size: 13.5px;
  font-weight: 600;
}

.link .icon {
  width: 15px;
  height: 15px;
  transition: transform 0.18s;
}

.link:hover .icon {
  transform: translateX(3px);
}

/* ---------- Chips / Karten / Progress ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.tag .icon {
  width: 13px;
  height: 13px;
}

.tag-accent {
  background: var(--accent-soft, rgba(233, 185, 73, 0.12));
  color: var(--accent-2, var(--gold-2));
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 40%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.progress {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent, var(--gold)), var(--accent-2, var(--gold-2)));
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.stars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.star {
  width: 15px;
  height: 15px;
  color: rgba(255, 255, 255, 0.16);
  fill: currentColor;
  stroke: none;
}

.star.on {
  color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(233, 185, 73, 0.4));
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 44px;
  align-items: center;
  padding: 38px 0 44px;
  min-width: 0;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
  margin-bottom: 20px;
  color: var(--gold-2);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--gold);
}

.hero h1 {
  max-width: 15ch;
  font-size: clamp(42px, 5.1vw, 70px);
  line-height: 1.03;
  letter-spacing: -0.025em;
}

.hero h1 em {
  font-style: normal;
  color: var(--gold-2);
}

.hero-lead {
  max-width: 58ch;
  margin-top: 20px;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted-2);
  font-size: 12.5px;
}

.hero-note .icon {
  width: 15px;
  height: 15px;
  color: var(--teal);
}

/* Passkarte */

.pass-card {
  position: relative;
  padding: 26px;
  border-radius: 26px;
  border: 1px solid rgba(233, 185, 73, 0.26);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(233, 185, 73, 0.14), transparent 52%),
    radial-gradient(80% 80% at 0% 100%, rgba(69, 196, 176, 0.08), transparent 60%),
    linear-gradient(160deg, #17233a, #0e1727);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
  min-width: 0;
}

.pass-card::before {
  content: "Α";
  position: absolute;
  right: -14px;
  bottom: -86px;
  z-index: -1;
  font-family: var(--serif);
  font-size: 260px;
  line-height: 1;
  color: rgba(233, 185, 73, 0.055);
}

.pass-card::after {
  content: "";
  position: absolute;
  inset: 9px;
  z-index: -1;
  border: 1px solid rgba(233, 185, 73, 0.09);
  border-radius: 19px;
  pointer-events: none;
}

.pass-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pass-avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--gold-2), var(--gold-deep));
  color: #1b1407;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  box-shadow: 0 10px 24px -10px rgba(233, 185, 73, 0.6);
}

.pass-name {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.2;
}

.pass-rank {
  margin-top: 2px;
  color: var(--gold-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pass-level-label {
  margin-left: auto;
  text-align: right;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pass-level-label strong {
  display: block;
  color: var(--text);
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: 0;
}

.pass-progress {
  margin-top: 24px;
}

.pass-progress-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.pass-progress-top strong {
  color: var(--gold-2);
}

.pass-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.pass-stat {
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.16);
}

.pass-stat .k {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pass-stat .k .icon {
  width: 12px;
  height: 12px;
}

.pass-stat .v {
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.1;
}

.pass-badges {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
}

.pass-badge {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(233, 185, 73, 0.24);
  background: rgba(233, 185, 73, 0.08);
  color: var(--gold);
}

.pass-badge .icon {
  width: 15px;
  height: 15px;
}

.pass-badge.locked {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-2);
}

.pass-badges-more {
  margin-left: 2px;
  color: var(--muted-2);
  font-size: 11.5px;
}

/* Hauptbereich */

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 30px;
  align-items: start;
  margin-top: 8px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-head h2 {
  font-size: clamp(26px, 3vw, 34px);
}

.section-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.level-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(110% 110% at 100% 0%, var(--accent-soft), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 45%),
    var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
  overflow: hidden;
}

.level-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.8;
}

.level-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 26px 50px -28px rgba(0, 0, 0, 0.8);
}

.level-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.level-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  background: var(--accent-soft);
  color: var(--accent-2);
}

.level-icon .icon {
  width: 23px;
  height: 23px;
}

.level-titles {
  min-width: 0;
  flex: 1;
}

.level-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.level-title {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.2;
}

.level-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.level-num {
  position: absolute;
  top: 14px;
  right: 18px;
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.06);
}

.level-source {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.4;
}

.level-source .icon {
  width: 12px;
  height: 12px;
}

.level-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.level-foot .progress {
  flex: 1;
}

.level-score {
  min-width: 42px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.level-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-2);
  font-size: 11px;
  white-space: nowrap;
}

.level-state .icon {
  width: 13px;
  height: 13px;
}

.level-state.done {
  color: var(--green);
}

.level-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
}

.level-cta .link {
  font-size: 12.5px;
}

/* Prüfungsbanner */

.exam-banner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin-top: 22px;
  padding: 26px 30px;
  border-radius: 22px;
  border: 1px solid rgba(233, 185, 73, 0.3);
  background:
    radial-gradient(100% 140% at 100% 50%, rgba(233, 185, 73, 0.18), transparent 55%),
    linear-gradient(135deg, #1c2434, #101827);
  overflow: hidden;
}

.exam-banner::after {
  content: "ΔΟΚΙΜΗ";
  position: absolute;
  right: 120px;
  bottom: -12px;
  font-family: var(--serif);
  font-size: 66px;
  letter-spacing: 0.08em;
  color: rgba(233, 185, 73, 0.05);
  pointer-events: none;
}

.exam-banner h3 {
  font-size: 26px;
}

.exam-banner p {
  max-width: 62ch;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13.5px;
}

.exam-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.exam-seal {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1px solid rgba(233, 185, 73, 0.4);
  background: rgba(233, 185, 73, 0.1);
  color: var(--gold);
}

.exam-seal .icon {
  width: 28px;
  height: 28px;
}

/* Aside */

.aside {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 50%),
    var(--surface);
  box-shadow: var(--shadow-soft);
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 17px;
}

.panel-title .icon {
  width: 16px;
  height: 16px;
  color: var(--gold);
}

.daily {
  display: flex;
  align-items: center;
  gap: 16px;
}

.daily-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--p, 0) * 1%), rgba(255, 255, 255, 0.08) 0);
}

.daily-ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #121d2e;
}

.daily-ring span {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: 18px;
}

.daily-copy strong {
  display: block;
  font-size: 14px;
}

.daily-copy p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.rank-list {
  display: flex;
  flex-direction: column;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.rank-row:first-child {
  border-top: 0;
}

.rank-pos {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted-2);
  font-family: var(--serif);
  font-size: 12px;
}

.rank-row:nth-child(1) .rank-pos {
  background: rgba(233, 185, 73, 0.15);
  color: var(--gold-2);
}

.rank-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
}

.rank-name small {
  display: block;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 400;
}

.rank-score {
  color: var(--gold-2);
  font-family: var(--serif);
  font-size: 14px;
}

.badge-mini-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
}

.badge-mini {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid rgba(233, 185, 73, 0.22);
  background: rgba(233, 185, 73, 0.07);
  color: var(--gold);
}

.badge-mini .icon {
  width: 17px;
  height: 17px;
}

.badge-mini.locked {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 255, 255, 0.18);
}

.empty-state {
  padding: 20px 8px;
  color: var(--muted-2);
  font-size: 12.5px;
  text-align: center;
  line-height: 1.6;
}

/* ---------- Lernstoff ---------- */

.learn-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  padding: 22px 0 30px;
}

.learn-hero h1 {
  font-size: clamp(36px, 4.4vw, 54px);
}

.learn-hero p {
  max-width: 66ch;
  margin-top: 12px;
  color: var(--muted);
}

.learn-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.learn-topic {
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(100% 140% at 100% 0%, var(--accent-soft), transparent 50%),
    var(--surface);
  overflow: hidden;
}

.learn-topic summary {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.learn-topic summary::-webkit-details-marker {
  display: none;
}

.learn-topic summary:hover {
  background: rgba(255, 255, 255, 0.025);
}

.learn-topic .level-icon {
  width: 40px;
  height: 40px;
}

.learn-topic-title {
  min-width: 0;
  flex: 1;
}

.learn-topic-title strong {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.25;
}

.learn-topic-title span {
  color: var(--muted-2);
  font-size: 11.5px;
}

.learn-topic summary .chev {
  width: 18px;
  height: 18px;
  color: var(--muted-2);
  transition: transform 0.2s;
}

.learn-topic[open] summary .chev {
  transform: rotate(180deg);
}

.learn-topic-body {
  padding: 0 20px 22px;
  border-top: 1px solid var(--border);
}

.learn-section {
  padding-top: 18px;
}

.learn-section h4 {
  color: var(--accent-2);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.learn-points {
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.learn-points li {
  position: relative;
  padding-left: 20px;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.55;
}

.learn-points li::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.8;
}

.learn-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.learn-source {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-size: 11px;
}

.learn-source .icon {
  width: 13px;
  height: 13px;
}

/* ---------- Rangliste ---------- */

.scores-hero {
  padding: 22px 0 28px;
}

.scores-hero h1 {
  font-size: clamp(36px, 4.4vw, 54px);
}

.scores-hero p {
  max-width: 66ch;
  margin-top: 10px;
  color: var(--muted);
}

.scores-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.score-section {
  padding: 22px;
  min-width: 0;
}

.score-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}

.score-row:first-of-type {
  border-top: 0;
}

.score-row .rank-pos {
  width: 22px;
  height: 22px;
}

.score-title {
  min-width: 0;
}

.score-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.score-title small {
  display: block;
  color: var(--muted-2);
  font-size: 10.5px;
}

.score-run {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.score-points {
  min-width: 54px;
  color: var(--gold-2);
  font-family: var(--serif);
  font-size: 16px;
  text-align: right;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.badge-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(233, 185, 73, 0.18);
  border-radius: 13px;
  background: rgba(233, 185, 73, 0.05);
}

.badge-card.locked {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.badge-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(233, 185, 73, 0.12);
  color: var(--gold);
}

.badge-icon .icon {
  width: 19px;
  height: 19px;
}

.badge-card.locked .badge-icon {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-2);
}

.badge-name {
  font-size: 12.5px;
  font-weight: 700;
}

.badge-desc {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.4;
}

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

.quiz-wrap {
  width: min(940px, calc(100% - 56px));
  margin-inline: auto;
}

.quiz-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0 16px;
}

.quiz-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.quiz-back:hover {
  color: var(--text);
}

.quiz-back .icon {
  width: 16px;
  height: 16px;
}

.quiz-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.quiz-head .level-icon {
  width: 42px;
  height: 42px;
}

.quiz-title {
  min-width: 0;
}

.quiz-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.2;
}

.quiz-title span {
  color: var(--muted-2);
  font-size: 11px;
}

.quiz-xp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(233, 185, 73, 0.25);
  background: rgba(233, 185, 73, 0.08);
  color: var(--gold-2);
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
}

.quiz-xp .icon {
  width: 14px;
  height: 14px;
}

.combo-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(240, 163, 94, 0.3);
  background: rgba(240, 163, 94, 0.1);
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.combo-pill .icon {
  width: 14px;
  height: 14px;
}

.segments {
  display: flex;
  gap: 4px;
  width: 100%;
  margin-bottom: 22px;
}

.segment {
  height: 5px;
  flex: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.segment.done {
  background: var(--accent, var(--gold));
}

.segment.current {
  background: rgba(255, 255, 255, 0.22);
}

.segment.current::after {
  content: "";
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent, var(--gold));
  animation: segment-pulse 1.8s ease-in-out infinite;
}

@keyframes segment-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.question-card {
  position: relative;
  padding: clamp(22px, 3.4vw, 38px);
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(120% 100% at 100% 0%, var(--accent-soft, rgba(233, 185, 73, 0.08)), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 38%),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.question-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(22px, 3.4vw, 38px);
  right: clamp(22px, 3.4vw, 38px);
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent, var(--gold)), transparent);
  opacity: 0.7;
}

.q-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.q-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft, rgba(233, 185, 73, 0.12));
  color: var(--accent-2, var(--gold-2));
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.q-type .icon {
  width: 12px;
  height: 12px;
}

.q-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.q-source .icon {
  width: 12px;
  height: 12px;
}

.q-prompt {
  max-width: 64ch;
  font-family: var(--serif);
  font-size: clamp(21px, 2.7vw, 28px);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.q-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.022);
  text-align: left;
  transition: transform 0.16s, border-color 0.16s, background 0.16s;
}

.option:hover:not(:disabled) {
  border-color: rgba(233, 185, 73, 0.42);
  background: rgba(233, 185, 73, 0.06);
  transform: translateX(2px);
}

.option.selected {
  border-color: var(--gold);
  background: rgba(233, 185, 73, 0.1);
  box-shadow: inset 0 0 0 1px rgba(233, 185, 73, 0.35);
}

.option.correct {
  border-color: rgba(110, 231, 168, 0.6);
  background: rgba(110, 231, 168, 0.09);
}

.option.wrong {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(248, 113, 113, 0.08);
}

.option.dim {
  opacity: 0.5;
}

.option:disabled {
  cursor: default;
}

.option-letter {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 12px;
  transition: 0.16s;
}

.option.selected .option-letter {
  border-color: var(--gold);
  background: var(--gold);
  color: #1a1305;
}

.option.correct .option-letter {
  border-color: var(--green);
  background: var(--green);
  color: #082016;
}

.option.wrong .option-letter {
  border-color: var(--red);
  background: var(--red);
  color: #2a0b0b;
}

.option-text {
  padding-top: 1px;
  font-size: 14.5px;
  line-height: 1.5;
}

.option-mark {
  margin-left: auto;
  padding-top: 2px;
  color: var(--green);
}

.option-mark .icon {
  width: 18px;
  height: 18px;
}

/* Freitext */

.answer-area {
  margin-top: 24px;
}

.answer-box {
  display: block;
  width: 100%;
  min-height: 190px;
  padding: 17px 18px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.65;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.answer-box::placeholder {
  color: var(--muted-2);
}

.answer-box:focus {
  outline: none;
  border-color: rgba(233, 185, 73, 0.55);
  box-shadow: 0 0 0 4px rgba(233, 185, 73, 0.08);
}

.answer-box:disabled {
  opacity: 0.7;
}

.answer-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.answer-tools .ok {
  color: var(--green);
}

.word-count {
  font-variant-numeric: tabular-nums;
}

/* Action bar */

.action-bar {
  position: static;
  z-index: 20;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(13, 21, 35, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
}

.action-bar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.action-hint {
  flex: 1;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.4;
}

.action-bar .btn {
  min-width: 160px;
}

/* Professor lädt */

.professor-thinking {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(233, 185, 73, 0.22);
  border-radius: 15px;
  background: rgba(233, 185, 73, 0.05);
}

.prof-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(233, 185, 73, 0.4);
  background: radial-gradient(circle at 30% 20%, #3a2b14, #171f30);
  color: var(--gold-2);
  font-family: var(--serif);
  font-size: 21px;
}

.professor-thinking strong {
  display: block;
  font-size: 13.5px;
}

.professor-thinking p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.thinking-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.thinking-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  animation: dot 1.2s infinite ease-in-out;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.thinking-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes dot {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* Feedback */

.feedback {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  padding: 20px;
  animation: feedback-in 0.35s ease both;
}

@keyframes feedback-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.feedback.good {
  border-left-color: var(--green);
  background: linear-gradient(90deg, rgba(110, 231, 168, 0.07), transparent 55%);
}

.feedback.partial {
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(233, 185, 73, 0.07), transparent 55%);
}

.feedback.bad {
  border-left-color: var(--red);
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.06), transparent 55%);
}

.feedback-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.feedback-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.feedback.good .feedback-icon {
  background: rgba(110, 231, 168, 0.12);
  color: var(--green);
}

.feedback.partial .feedback-icon {
  background: rgba(233, 185, 73, 0.12);
  color: var(--gold);
}

.feedback.bad .feedback-icon {
  background: rgba(248, 113, 113, 0.12);
  color: var(--red);
}

.feedback-title {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.2;
}

.feedback-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.feedback-xp {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(233, 185, 73, 0.1);
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.feedback-xp .icon {
  width: 13px;
  height: 13px;
}

.feedback-body {
  margin-top: 14px;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.65;
}

.feedback-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
  width: 100%;
  color: var(--muted-2);
  font-size: 10.5px;
}

.feedback-source .icon {
  width: 12px;
  height: 12px;
}

.prof-quote {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(233, 185, 73, 0.18);
  border-radius: 14px;
  background: rgba(233, 185, 73, 0.045);
}

.prof-quote blockquote {
  margin: 0;
  color: var(--text-soft);
  font-family: var(--serif);
  font-size: 14.5px;
  font-style: italic;
  line-height: 1.65;
}

.prof-quote cite {
  display: block;
  margin-top: 6px;
  color: var(--muted-2);
  font-family: var(--sans);
  font-size: 10.5px;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.grade-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(233, 185, 73, 0.4);
  background: rgba(233, 185, 73, 0.1);
  color: var(--gold-2);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
}

.grade-badge small {
  display: block;
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.feedback-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.feedback-col {
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.14);
}

.feedback-col h5 {
  margin: 0 0 7px;
  color: var(--muted-2);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.feedback-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.feedback-col li {
  position: relative;
  padding-left: 17px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-soft);
}

.feedback-col li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  color: var(--green);
  font-size: 11px;
}

.feedback-col.gaps li::before {
  content: "→";
  color: var(--gold);
}

.kp-list {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  padding: 0;
  list-style: none;
}

.kp-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.12);
  font-size: 12.5px;
  line-height: 1.45;
}

.kp-item .icon {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.kp-item.hit .icon {
  color: var(--green);
}

.kp-item.miss .icon {
  color: var(--red);
}

.kp-item.miss {
  opacity: 0.82;
}

.kp-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.correction {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.correction summary {
  padding: 12px 14px;
  cursor: pointer;
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 700;
  list-style: none;
}

.correction summary::-webkit-details-marker {
  display: none;
}

.correction summary::after {
  content: "+";
  float: right;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1;
}

.correction[open] summary::after {
  content: "−";
}

.correction div {
  padding: 0 14px 14px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.65;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.offline-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(240, 163, 94, 0.25);
  border-radius: 10px;
  background: rgba(240, 163, 94, 0.06);
  color: #f0c49b;
  font-size: 11.5px;
  line-height: 1.5;
}

.offline-note .icon {
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

/* ---------- Drag & Drop ---------- */

.dnd {
  margin-top: 24px;
}

.dnd-tip {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.dnd-tip .icon {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.dnd-pool-wrap {
  padding: 13px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.14);
  transition: border-color 0.18s, background 0.18s;
}

.dnd-pool-wrap.over {
  border-color: var(--gold);
  background: rgba(233, 185, 73, 0.06);
}

.pool-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dnd-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
}

.dnd-pool:empty::after {
  content: "Alle Bausteine sind platziert.";
  color: var(--muted-2);
  font-size: 12px;
  font-style: italic;
}

.dnd-zones {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.dnd-zones.buckets {
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

.dnd-zones.slots {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 88px;
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.dropzone.over {
  border-color: var(--gold);
  background: rgba(233, 185, 73, 0.07);
  transform: translateY(-1px);
}

.dropzone.correct {
  border-style: solid;
  border-color: rgba(110, 231, 168, 0.45);
  background: rgba(110, 231, 168, 0.05);
}

.dropzone.wrong {
  border-style: solid;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.045);
}

.zone-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 9px;
}

.zone-label {
  flex: 1;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
}

.zone-hint {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 400;
}

.zone-count {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.zone-items {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 34px;
}

.empty-slot {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.2);
  font-size: 10.5px;
  text-align: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: linear-gradient(180deg, #22324e, #1a2740);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: border-color 0.16s, background 0.16s, transform 0.16s, opacity 0.16s;
  box-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.7);
}

.dnd-pool .chip {
  width: auto;
  max-width: 100%;
}

.chip:hover:not(.is-locked) {
  border-color: rgba(233, 185, 73, 0.5);
  background: linear-gradient(180deg, #2a3c5b, #1e2c47);
}

.chip.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(233, 185, 73, 0.22);
}

.chip.is-dragging {
  opacity: 0.3;
}

.chip.correct {
  border-color: rgba(110, 231, 168, 0.55);
  background: linear-gradient(180deg, rgba(110, 231, 168, 0.16), rgba(110, 231, 168, 0.07));
}

.chip.wrong {
  border-color: rgba(248, 113, 113, 0.55);
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.14), rgba(248, 113, 113, 0.06));
}

.chip.is-locked {
  cursor: default;
}

.chip-grip {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.25);
}

.chip-text {
  min-width: 0;
}

.drag-ghost {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  width: min(340px, 70vw);
  transform: rotate(1.5deg) scale(1.02);
  opacity: 0.96;
  box-shadow: 0 22px 40px -16px rgba(0, 0, 0, 0.9);
}

.dnd-result {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11.5px;
}

.dnd-result .icon {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

/* ---------- Ergebnis ---------- */

.result {
  width: min(840px, calc(100% - 56px));
  margin-inline: auto;
  padding: 26px 0 40px;
}

.result-card {
  position: relative;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(233, 185, 73, 0.25);
  border-radius: 26px;
  background:
    radial-gradient(100% 120% at 50% 0%, rgba(233, 185, 73, 0.14), transparent 55%),
    linear-gradient(180deg, #172337, #0f1828);
  box-shadow: var(--shadow);
  text-align: center;
  overflow: hidden;
}

.result-card::before {
  content: "ΝΙΚΗ";
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-size: 120px;
  letter-spacing: 0.1em;
  color: rgba(233, 185, 73, 0.035);
  pointer-events: none;
}

.result-eyebrow {
  position: relative;
  color: var(--gold-2);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.result h1 {
  position: relative;
  margin-top: 9px;
  font-size: clamp(32px, 4.6vw, 48px);
}

.result-sub {
  position: relative;
  max-width: 54ch;
  margin: 9px auto 0;
  color: var(--muted);
  font-size: 14px;
}

.score-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 168px;
  height: 168px;
  margin: 28px auto 0;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color, var(--gold)) calc(var(--p, 0) * 1%), rgba(255, 255, 255, 0.07) 0);
  box-shadow: 0 0 60px -18px rgba(233, 185, 73, 0.35);
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #101a2b;
}

.score-ring-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.score-ring-inner strong {
  display: block;
  font-family: var(--serif);
  font-size: 46px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.score-ring-inner strong small {
  font-size: 18px;
  letter-spacing: 0;
  color: var(--muted);
}

.score-ring-inner span {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 30px;
  text-align: left;
}

.result-stat {
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
}

.result-stat .k {
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-stat .v {
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.1;
}

.result-stat .v .icon {
  display: inline-block;
  width: 15px;
  height: 15px;
  color: var(--gold);
  vertical-align: -2px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.new-badges {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  text-align: left;
}

.new-badges h3 {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.new-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.new-badge {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(233, 185, 73, 0.26);
  border-radius: 12px;
  background: rgba(233, 185, 73, 0.06);
  animation: badge-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes badge-pop {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.new-badge .badge-icon {
  width: 34px;
  height: 34px;
}

.new-badge strong {
  display: block;
  font-size: 12.5px;
}

.new-badge span {
  color: var(--muted);
  font-size: 10.5px;
}

.best-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(110, 231, 168, 0.1);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.best-flag .icon {
  width: 13px;
  height: 13px;
}

/* ---------- Prüfung ---------- */

.exam-intro {
  width: min(960px, calc(100% - 56px));
  margin-inline: auto;
  padding: 26px 0 40px;
}

.exam-intro-card {
  padding: clamp(26px, 4vw, 44px);
  border: 1px solid rgba(233, 185, 73, 0.25);
  border-radius: 26px;
  background:
    radial-gradient(100% 130% at 100% 0%, rgba(233, 185, 73, 0.13), transparent 55%),
    linear-gradient(180deg, #172337, #0f1828);
  box-shadow: var(--shadow);
}

.exam-intro h1 {
  font-size: clamp(34px, 4.6vw, 52px);
}

.exam-intro-card > p {
  max-width: 66ch;
  margin-top: 12px;
  color: var(--muted);
}

.exam-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.exam-rule {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.16);
}

.exam-rule .icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--gold);
}

.exam-rule strong {
  display: block;
  font-size: 12.5px;
}

.exam-rule span {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.exam-grade-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.grade-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11px;
}

.grade-chip strong {
  color: var(--text);
  font-family: var(--serif);
  font-size: 14px;
}

.exam-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

.exam-timer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(233, 185, 73, 0.3);
  background: rgba(233, 185, 73, 0.08);
  color: var(--gold-2);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.exam-timer.warn {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.1);
  color: #fda4a4;
  animation: timer-pulse 1s infinite;
}

@keyframes timer-pulse {
  50% {
    opacity: 0.55;
  }
}

.exam-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(233, 185, 73, 0.1);
  color: var(--gold-2);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.exam-badge .icon {
  width: 11px;
  height: 11px;
}

.exam-question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.exam-progress-text {
  color: var(--muted-2);
  font-size: 11.5px;
}

.exam-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 18px;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid rgba(90, 169, 230, 0.24);
  background: rgba(90, 169, 230, 0.06);
  color: #b9d8f3;
  font-size: 11.5px;
  line-height: 1.5;
}

.exam-note .icon {
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

.exam-evaluating {
  padding: 34px;
  text-align: center;
}

.exam-evaluating h2 {
  margin-top: 14px;
  font-size: 28px;
}

.exam-evaluating p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.eval-progress {
  width: min(360px, 80%);
  height: 6px;
  margin: 22px auto 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.eval-progress div {
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 0.4s;
}

/* Zertifikat */

.certificate {
  position: relative;
  width: min(820px, 100%);
  margin: 26px auto 0;
  padding: clamp(28px, 5vw, 54px);
  border: 2px solid #c9a24a;
  border-radius: 8px;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(201, 162, 74, 0.1), transparent 55%),
    #f8f2e4;
  color: #1d2534;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  text-align: center;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.certificate::before,
.certificate::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201, 162, 74, 0.4);
  border-radius: 4px;
  pointer-events: none;
}

.certificate::after {
  inset: 14px;
  border-color: rgba(201, 162, 74, 0.18);
}

.cert-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #8a6a24;
}

.cert-title {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  color: #172033;
}

.cert-sub {
  margin-top: 6px;
  color: #5d6577;
  font-size: 12px;
}

.cert-seal {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin: 22px auto 0;
  border-radius: 50%;
  border: 2px solid #b78d35;
  background: radial-gradient(circle at 35% 25%, #f3d78f, #d2a63e);
  color: #3c2c0a;
  box-shadow: 0 6px 18px -8px rgba(120, 90, 20, 0.5);
}

.cert-seal .icon {
  width: 36px;
  height: 36px;
}

.cert-name {
  margin-top: 20px;
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.2;
  border-bottom: 1px solid rgba(29, 37, 52, 0.25);
  display: inline-block;
  padding: 0 24px 6px;
}

.cert-text {
  max-width: 58ch;
  margin: 16px auto 0;
  color: #495164;
  font-size: 13px;
  line-height: 1.65;
}

.cert-grade-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.cert-grade {
  text-align: center;
}

.cert-grade strong {
  display: block;
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1;
  color: #1b5e46;
}

.cert-grade span {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6d7585;
}

.cert-divider {
  width: 1px;
  height: 46px;
  background: rgba(29, 37, 52, 0.18);
}

.cert-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 30px;
  text-align: left;
}

.cert-meta div {
  padding: 10px 12px;
  border: 1px solid rgba(29, 37, 52, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.45);
}

.cert-meta span {
  display: block;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a8191;
}

.cert-meta strong {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: #222b3b;
}

.cert-table {
  width: 100%;
  margin-top: 24px;
  border-collapse: collapse;
  font-size: 11.5px;
  text-align: left;
}

.cert-table th {
  padding: 7px 9px;
  border-bottom: 1px solid rgba(29, 37, 52, 0.25);
  color: #6d7585;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cert-table td {
  padding: 7px 9px;
  border-bottom: 1px solid rgba(29, 37, 52, 0.1);
  color: #2b3446;
}

.cert-table td:last-child,
.cert-table th:last-child {
  text-align: right;
}

.cert-signature {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-top: 36px;
  text-align: left;
}

.cert-signature div {
  flex: 1;
  max-width: 240px;
  padding-top: 5px;
  border-top: 1px solid rgba(29, 37, 52, 0.3);
  color: #6d7585;
  font-size: 9.5px;
}

.cert-signature .sig {
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  color: #2b3446;
}

.cert-footer {
  margin-top: 28px;
  color: #8a8f9a;
  font-size: 8.5px;
  letter-spacing: 0.04em;
}

.cert-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* ---------- Onboarding ---------- */

.onboarding {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px 20px;
  overflow: hidden;
}

.onboarding::before {
  content: "ΠΟΛΙΣ";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--serif);
  font-size: clamp(180px, 26vw, 380px);
  letter-spacing: 0.1em;
  color: rgba(233, 185, 73, 0.035);
  pointer-events: none;
  white-space: nowrap;
}

.onboarding-card {
  position: relative;
  width: min(900px, 100%);
  padding: clamp(26px, 5vw, 54px);
  border: 1px solid rgba(233, 185, 73, 0.25);
  border-radius: 28px;
  background:
    radial-gradient(100% 130% at 100% 0%, rgba(233, 185, 73, 0.14), transparent 55%),
    linear-gradient(160deg, #162238, #0d1626);
  box-shadow: var(--shadow);
}

.onboarding-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 26px;
}

.onboarding h1 {
  max-width: 17ch;
  font-size: clamp(38px, 5.4vw, 62px);
  line-height: 1.02;
}

.onboarding h1 em {
  font-style: normal;
  color: var(--gold-2);
}

.onboarding-lead {
  max-width: 58ch;
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.onboarding-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 26px;
}

.onboarding-feature {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.16);
}

.onboarding-feature .icon {
  width: 19px;
  height: 19px;
  color: var(--gold);
}

.onboarding-feature strong {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
}

.onboarding-feature span {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.4;
}

.name-form {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  max-width: 540px;
}

.input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.input::placeholder {
  color: var(--muted-2);
}

.input:focus {
  outline: none;
  border-color: rgba(233, 185, 73, 0.55);
  box-shadow: 0 0 0 4px rgba(233, 185, 73, 0.08);
}

.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-right: 46px;
}

.input-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--muted);
}

.input-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.input-toggle .icon {
  width: 17px;
  height: 17px;
}

code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--gold-2);
  font-family: var(--mono);
  font-size: 0.92em;
}

.dropzone,
.dnd-pool-wrap {
  cursor: pointer;
}

.onboarding-hint {
  margin-top: 12px;
  color: var(--muted-2);
  font-size: 11px;
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 8, 15, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in 0.2s ease both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  width: min(660px, 100%);
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(233, 185, 73, 0.22);
  border-radius: 20px;
  background: linear-gradient(170deg, #172337, #0e1727);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
  animation: modal-in 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  flex: 1;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.15;
}

.modal-sub {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 9px;
  color: var(--muted);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
}

.field {
  margin-bottom: 15px;
}

.field > label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.field .hint {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: #101a2b;
  color: var(--text);
  font-size: 13.5px;
}

.select:focus {
  outline: none;
  border-color: var(--gold);
}

.settings-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
  font-size: 11.5px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted-2);
}

.status-dot.on {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(110, 231, 168, 0.12);
}

.status-dot.off {
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(240, 163, 94, 0.12);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}

.switch-row:first-child {
  border-top: 0;
}

.switch-copy strong {
  display: block;
  font-size: 12.5px;
}

.switch-copy span {
  display: block;
  color: var(--muted-2);
  font-size: 10.5px;
}

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s;
  pointer-events: none;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.switch input:checked + .switch-track {
  background: var(--gold);
}

.switch input:checked + .switch-track::after {
  transform: translateX(20px);
}

.danger-zone {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.danger-zone h4 {
  margin: 0 0 4px;
  color: #fda4a4;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.danger-zone p {
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.5;
}

.danger-zone .btn {
  margin-top: 10px;
}

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

.toast-root {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100% - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: rgba(18, 29, 47, 0.96);
  box-shadow: var(--shadow);
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.45;
  animation: toast-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: auto;
}

.toast .icon {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: var(--gold);
}

.toast.success {
  border-color: rgba(110, 231, 168, 0.3);
}

.toast.success .icon {
  color: var(--green);
}

.toast.warn {
  border-color: rgba(240, 163, 94, 0.35);
}

.toast.warn .icon {
  color: var(--orange);
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.4);
}

.toast.error .icon {
  color: var(--red);
}

.toast.out {
  animation: toast-out 0.25s ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- Konfetti ---------- */

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 400;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body.is-quizzing .mobile-nav,
body.is-quizzing .footer {
  display: none;
}

body.is-quizzing .page {
  padding-bottom: 54px;
}

/* ---------- Level-up ---------- */

.levelup {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 8, 15, 0.7);
  backdrop-filter: blur(7px);
  animation: fade-in 0.25s ease both;
}

.levelup-card {
  width: min(460px, 100%);
  padding: 34px 30px;
  border: 1px solid rgba(233, 185, 73, 0.4);
  border-radius: 24px;
  background:
    radial-gradient(100% 120% at 50% 0%, rgba(233, 185, 73, 0.2), transparent 60%),
    #131e31;
  text-align: center;
  box-shadow: var(--shadow);
  animation: modal-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.levelup-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(233, 185, 73, 0.5);
  background: rgba(233, 185, 73, 0.12);
  color: var(--gold);
  font-size: 34px;
}

.levelup-card h2 {
  margin-top: 18px;
  font-size: 32px;
}

.levelup-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
}

.levelup-card .rank {
  display: inline-block;
  margin-top: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(233, 185, 73, 0.12);
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Fehlerseite ---------- */

.fatal {
  display: grid;
  place-items: center;
  min-height: 70vh;
  padding: 30px;
  text-align: center;
}

.fatal h1 {
  font-size: 36px;
}

.fatal p {
  max-width: 50ch;
  margin: 10px auto 20px;
  color: var(--muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 1120px) {
  .nav-link span {
    display: none;
  }
  .nav-link {
    padding: 9px 11px;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
    gap: 30px;
  }
  .home-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 22px;
  }
  .scores-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .container {
    width: min(1240px, calc(100% - 40px));
  }
  .nav {
    margin-left: 0;
  }
  .nav-link span {
    display: none;
  }
  .nav-link {
    padding: 9px 11px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 24px;
  }
  .hero h1 {
    max-width: 18ch;
  }
  .pass-card {
    max-width: 620px;
  }
  .home-layout {
    grid-template-columns: 1fr;
  }
  .aside {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .aside .panel:first-child {
    grid-column: span 2;
  }
  .dnd-zones.slots {
    grid-template-columns: 1fr;
  }
  .result-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }
  .container {
    width: calc(100% - 32px);
  }
  .page {
    padding: 22px 0 104px;
  }
  .topbar-inner {
    min-height: 64px;
    gap: 12px;
  }
  .brand-sub {
    display: none;
  }
  .brand-title {
    font-size: 19px;
  }
  .brand-mark {
    width: 38px;
    height: 38px;
  }
  .nav {
    display: none;
  }
  .pill-streak {
    display: none;
  }
  .avatar-name {
    display: none;
  }
  .avatar-chip {
    padding: 0 8px 0 4px;
  }
  .mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(13, 21, 35, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
  }
  .mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 4px;
    border-radius: 12px;
    color: var(--muted-2);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
  }
  .mobile-nav-link .icon {
    width: 19px;
    height: 19px;
  }
  .mobile-nav-link.active {
    background: rgba(233, 185, 73, 0.1);
    color: var(--gold-2);
  }
  .footer {
    padding-bottom: 96px;
  }
  .hero h1 {
    font-size: clamp(38px, 11vw, 52px);
  }
  .eyebrow {
    font-size: 10px;
    letter-spacing: 0.12em;
  }
  .hero-lead {
    font-size: 15px;
  }
  .btn {
    white-space: normal;
  }
  .hero-actions .btn {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .pass-badges {
    flex-wrap: wrap;
  }
  .pass-badges-more {
    flex-basis: 100%;
    margin-left: 0;
    margin-top: 4px;
  }
  .pass-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .pass-stat {
    padding: 9px;
  }
  .pass-stat .v {
    font-size: 18px;
  }
  .level-grid {
    grid-template-columns: 1fr;
  }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .exam-banner {
    grid-template-columns: 1fr;
    padding: 22px;
  }
  .exam-banner-actions {
    justify-content: flex-start;
  }
  .exam-seal {
    display: none;
  }
  .aside {
    grid-template-columns: 1fr;
  }
  .aside .panel:first-child {
    grid-column: auto;
  }
  .scores-grid {
    gap: 14px;
  }
  .score-section {
    padding: 16px;
  }
  .badge-grid {
    grid-template-columns: 1fr;
  }
  .quiz-wrap {
    width: calc(100% - 32px);
  }
  .quiz-top {
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 14px;
  }
  .quiz-head {
    order: 3;
    flex-basis: 100%;
  }
  .quiz-xp {
    margin-left: auto;
  }
  .question-card {
    padding: 20px 16px;
    border-radius: 18px;
  }
  .option {
    padding: 13px 14px;
  }
  .option-text {
    font-size: 13.5px;
  }
  .dnd-zones.buckets {
    grid-template-columns: 1fr;
  }
  .feedback-columns {
    grid-template-columns: 1fr;
  }
  .feedback-head {
    flex-wrap: wrap;
  }
  .feedback-xp {
    margin-left: 0;
  }
  .action-bar {
    bottom: 82px;
  }
  .action-bar-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .action-hint {
    text-align: center;
  }
  .action-bar .btn {
    width: 100%;
  }
  .result {
    width: calc(100% - 32px);
    padding-top: 16px;
  }
  .result-card {
    padding: 26px 18px;
  }
  .result-stats {
    gap: 8px;
  }
  .result-actions .btn {
    flex: 1;
    min-width: 140px;
  }
  .exam-intro {
    width: calc(100% - 32px);
    padding-top: 16px;
  }
  .exam-rules {
    grid-template-columns: 1fr;
  }
  .cert-meta {
    grid-template-columns: 1fr;
  }
  .certificate {
    padding: 26px 18px;
  }
  .cert-signature {
    flex-direction: column;
    gap: 20px;
  }
  .cert-signature div {
    max-width: none;
    width: 100%;
  }
  .onboarding-card {
    padding: 26px 20px;
  }
  .onboarding-features {
    grid-template-columns: 1fr;
  }
  .name-form {
    flex-direction: column;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .modal {
    max-height: 92vh;
  }
  .modal-head,
  .modal-body,
  .modal-actions {
    padding-left: 18px;
    padding-right: 18px;
  }
  .learn-hero {
    grid-template-columns: 1fr;
  }
  .learn-topic summary {
    padding: 15px;
  }
  .learn-topic-body {
    padding: 0 15px 18px;
  }
  .toast-root {
    bottom: 92px;
  }
  .levelup-card {
    padding: 28px 20px;
  }
}

@media (max-width: 420px) {
  .brand-title {
    display: none;
  }
  .hero-actions {
    flex-direction: column;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .pass-stats {
    grid-template-columns: 1fr;
  }
  .result-stats {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Druck ---------- */

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }
  body {
    background: #fff !important;
    color: #111 !important;
  }
  body::before,
  .topbar,
  .mobile-nav,
  .footer,
  .toast-root,
  .confetti-canvas,
  .cert-actions,
  .no-print {
    display: none !important;
  }
  .app-shell,
  .page,
  .container,
  .result {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    background: none !important;
  }
  .certificate {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-width: 2px !important;
    break-inside: avoid;
  }
  .result-card {
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .result-eyebrow,
  .result h1,
  .result-sub,
  .score-ring,
  .result-stats,
  .new-badges,
  .best-flag {
    display: none !important;
  }
}
