/* Pianolerner – Dark-Mode-Design (Schwarz · Grau · Weiß · Grün · Rot) */
:root {
  --bg: #09090a;
  --bg2: #0f0f11;
  --s1: #141417;
  --s2: #1b1b1f;
  --s3: #24242a;
  --line: #2b2b31;
  --line2: #3a3a42;
  --text: #f3f3f4;
  --text2: #c8c8cc;
  --muted: #8d8d95;
  --accent: #22c55e;
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, .14);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, .14);
  --gold: #eab308;
  --gold-soft: rgba(234, 179, 8, .13);
  --blue: #60a5fa;
  --tc: var(--accent);
  --r: 14px;
  --r-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", Consolas, "SF Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, rgba(34, 197, 94, .06), transparent 60%),
              radial-gradient(900px 500px at -10% 110%, rgba(239, 68, 68, .05), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.85rem; font-weight: 750; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 .8em; }
a { color: var(--accent); }
b, strong { color: var(--text); font-weight: 650; }
code { font-family: var(--mono); font-size: .88em; background: var(--s3); padding: .1em .38em; border-radius: 5px; color: #e9e9ec; }
kbd { font-family: var(--mono); font-size: .78em; background: var(--s3); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: .05em .4em; color: var(--text2); }
ul, ol { padding-left: 1.3em; margin: 0 0 .9em; }
li { margin: .2em 0; }
hr { border: 0; border-top: 1px solid var(--line); }
small { font-size: .82em; }
::selection { background: var(--accent); color: #000; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--s3); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.muted { color: var(--muted); }
.small { font-size: .85em; }
.center { text-align: center; }
.left { text-align: left; }
.grow { flex: 1; min-width: 0; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.wide { width: 100%; }
.boot { padding: 4rem; text-align: center; color: var(--muted); font-size: 1.2rem; }

/* ================= Formularelemente ================= */
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=url], input[type=search], input[type=number], input:not([type]), select, textarea {
  background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r-sm);
  padding: .5em .75em; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
select { cursor: pointer; }
select option, select optgroup { background: var(--s1); }
input[type=range] { accent-color: var(--accent); width: 100%; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; vertical-align: -3px; }
input.num { width: 5.2em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  background: var(--s3); border: 1px solid var(--line2); color: var(--text);
  padding: .55em 1.05em; border-radius: var(--r-sm); cursor: pointer; font-weight: 600;
  text-decoration: none; white-space: nowrap; user-select: none;
  transition: transform .08s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover:not(:disabled) { background: #2d2d34; border-color: #4a4a54; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04120a; box-shadow: 0 4px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.1); border-color: var(--accent); }
.btn.danger { background: var(--red-soft); border-color: rgba(239, 68, 68, .5); color: #fca5a5; }
.btn.danger:hover:not(:disabled) { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text2); }
.btn.ghost:hover:not(:disabled) { background: var(--s2); border-color: var(--line); }
.btn.ghost.on { color: var(--accent); border-color: var(--accent); }
.btn.small { padding: .3em .7em; font-size: .85em; }
.btn.big { padding: .78em 1.5em; font-size: 1.04rem; border-radius: 11px; }
.btn.wide { width: 100%; margin-top: .6em; }
.btn kbd { background: rgba(0, 0, 0, .25); border-color: rgba(0, 0, 0, .25); color: inherit; }

.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { background: transparent; border: 0; padding: .3em .75em; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: .85em; font-weight: 600; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--s3); color: var(--accent); }
.toggle { display: inline-flex; align-items: center; gap: .45em; cursor: pointer; font-size: .9em; color: var(--text2); font-weight: 500; }
label.inline { display: inline-flex; align-items: center; gap: .4em; color: var(--text2); font-size: .9em; }
.field { display: flex; flex-direction: column; gap: .35em; margin-bottom: 1em; }
.field > span { font-size: .85em; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.sel-row { display: flex; flex-wrap: wrap; gap: .5em; align-items: center; margin-bottom: .8em; }
.btn-col { display: flex; flex-direction: column; gap: .5em; align-items: stretch; }
.filters { display: flex; flex-wrap: wrap; gap: .7em; align-items: center; }

/* ================= Rahmen ================= */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 1.2rem; background: rgba(9, 9, 10, .82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; }
.logo { font-size: 1.5rem; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 50%, transparent)); }
.brand-name { font-size: 1.25rem; font-weight: 500; letter-spacing: -.02em; }
.brand-name b { color: var(--accent); font-weight: 800; }
.top-stats { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  display: inline-flex; align-items: center; gap: .4em; background: var(--s1); border: 1px solid var(--line);
  border-radius: 999px; padding: .28em .8em; font-size: .86rem; font-weight: 650; white-space: nowrap;
}
.pill small { color: var(--blue); margin-left: .3em; }
.pill.rank { color: var(--text2); }
.pill.lvl .bar { width: 64px; height: 6px; }
.pill.streak { color: var(--muted); }
.pill.streak.lit { color: #ffb347; border-color: rgba(255, 140, 0, .45); background: rgba(255, 120, 0, .1); text-shadow: 0 0 10px rgba(255, 120, 0, .6); }
.pill.goal { padding-left: .35em; }
.goal-ring { width: 22px; height: 22px; transform: rotate(-90deg); }
.gr-bg { fill: none; stroke: var(--s3); stroke-width: 4; }
.gr-fg { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .6s; }
.pill.coins { color: var(--gold); }
.pill.dbl { color: #000; background: var(--gold); border-color: var(--gold); animation: pulse 1.6s infinite; }
.pill.midi { opacity: .45; }
.pill.midi.on { opacity: 1; border-color: var(--green); background: var(--green-soft); }

.shell { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 57px); }
.nav {
  position: sticky; top: 57px; align-self: start; height: calc(100vh - 57px);
  display: flex; flex-direction: column; gap: 2px; padding: 1rem .6rem; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg2), var(--bg)); overflow-y: auto;
}
.nav-btn {
  display: flex; align-items: center; gap: .7em; width: 100%; padding: .62em .85em; border-radius: 10px;
  background: transparent; border: 1px solid transparent; color: var(--text2); cursor: pointer; text-align: left; font-weight: 550;
  transition: background .15s, color .15s;
}
.nav-btn:hover { background: var(--s1); color: var(--text); }
.nav-btn.on { background: var(--s2); border-color: var(--line); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav-ic { font-size: 1.15em; width: 1.4em; text-align: center; }
.main { padding: 1.6rem clamp(1rem, 3vw, 2.4rem) 4rem; max-width: 1280px; width: 100%; margin: 0 auto; min-width: 0; }
body.in-session .nav { pointer-events: none; opacity: .35; }

/* ================= Karten & Raster ================= */
.card {
  background: linear-gradient(180deg, var(--s1), #111114); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.2rem 1.3rem; margin-bottom: 1.1rem; min-width: 0;
}
.card-h {
  display: flex; align-items: center; gap: .6em; flex-wrap: wrap; font-weight: 700; font-size: .95rem;
  margin-bottom: .85em; color: var(--text);
}
.card-h .muted { font-weight: 500; font-size: .85em; }
.card-h > .btn, .card-h > .toggle, .card-h > .seg, .card-h > .pill { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.grid2 > .card, .grid3 > .card { margin-bottom: 0; }
.grid2, .grid3 { margin-bottom: 1.1rem; }
.kv { display: flex; justify-content: space-between; padding: .35em 0; border-top: 1px dashed var(--line); font-size: .92em; }
.kv span { color: var(--muted); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }

.bar { position: relative; height: 8px; background: var(--s3); border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, #000), var(--accent)); border-radius: inherit; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.bar.big { height: 12px; }
.bar.bad > div { background: linear-gradient(90deg, #7f1d1d, var(--red)); }

.tag { display: inline-flex; align-items: center; gap: .3em; font-size: .76rem; font-weight: 600; padding: .15em .6em; border-radius: 99px; background: var(--s3); color: var(--text2); border: 1px solid var(--line2); }
.tag.click { cursor: pointer; }
.tag.click:hover { border-color: var(--accent); color: var(--accent); }
.diff { color: var(--gold); letter-spacing: 1px; font-size: .85em; }

/* ================= Startseite ================= */
.hero-card {
  position: relative; overflow: hidden; border-radius: 18px; padding: 2rem 2.2rem; margin-bottom: 1.1rem;
  background: radial-gradient(600px 260px at 100% 0%, color-mix(in srgb, var(--tc) 22%, transparent), transparent 70%), linear-gradient(135deg, #17171b, #0e0e10);
  border: 1px solid color-mix(in srgb, var(--tc) 35%, var(--line));
}
.hero-card::after {
  content: ""; position: absolute; right: -40px; bottom: -30px; width: 340px; height: 120px; opacity: .08; transform: rotate(-8deg);
  background: repeating-linear-gradient(90deg, #fff 0 22px, #000 22px 24px);
}
.hero-card.done { --tc: var(--gold); }
.hero-card.exam { --tc: var(--red); }
.hero-kicker { color: var(--tc); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .4em; }
.hero-card h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); max-width: 30ch; }
.hero-card p { color: var(--text2); max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6em; margin-top: 1em; align-items: center; position: relative; z-index: 1; }
.hero-actions.center { justify-content: center; }
.hero-prog { margin-top: 1.4em; height: 6px; background: rgba(255, 255, 255, .08); border-radius: 9px; overflow: hidden; max-width: 420px; }
.hero-prog > div { height: 100%; background: var(--tc); }

.quest { display: flex; align-items: center; gap: .75em; padding: .65em .7em; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); margin-bottom: .5em; }
.quest.ready { border-color: var(--accent); background: var(--green-soft); animation: glow 2s infinite; }
.quest.claimed { opacity: .5; }
.q-ic { font-size: 1.35em; }
.q-body { flex: 1; min-width: 0; }
.q-lbl { font-size: .88em; font-weight: 600; margin-bottom: .3em; }
.q-n { font-size: .82em; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-done { color: var(--green); font-weight: 800; }
.chest-hint { font-size: .82em; color: var(--gold); text-align: center; margin-top: .6em; }
.streak-big { font-size: 3rem; font-weight: 800; text-align: center; color: var(--muted); line-height: 1.1; margin: .2em 0; }
.streak-big span { font-size: .9rem; font-weight: 600; margin-left: .3em; }
.streak-big.lit { color: #ffb347; text-shadow: 0 0 24px rgba(255, 120, 0, .55); }
.heat { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin: .9em 0; }
.hm { aspect-ratio: 1; border-radius: 4px; background: var(--s3); }
.hm.l1 { background: color-mix(in srgb, var(--accent) 30%, var(--s3)); }
.hm.l2 { background: color-mix(in srgb, var(--accent) 60%, var(--s3)); }
.hm.l3 { background: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); }
.weak { display: flex; justify-content: space-between; gap: .6em; padding: .45em 0; border-bottom: 1px dashed var(--line); font-size: .9em; }

.strip { display: flex; align-items: center; overflow-x: auto; padding: .4em .2em 1em; gap: 0; }
.strip-node {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: .15em; width: 92px; padding: .7em .3em;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--text2); transition: transform .15s, border-color .15s;
}
.strip-node:hover { transform: translateY(-2px); border-color: var(--tc); }
.strip-node.passed { border-color: color-mix(in srgb, var(--green) 60%, transparent); background: var(--green-soft); }
.strip-node.passed .sn-ic { color: var(--green); }
.strip-node.cur { border-color: var(--tc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 25%, transparent), 0 0 24px color-mix(in srgb, var(--tc) 30%, transparent); }
.strip-node.locked { opacity: .45; }
.sn-ic { font-size: 1.4em; }
.sn-n { font-size: .72em; color: var(--muted); font-weight: 700; }
.sn-r { font-size: .7em; text-align: center; line-height: 1.2; font-weight: 600; }
.strip-line { flex: 0 0 18px; height: 2px; background: var(--line2); }

.pod { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.2rem; align-items: center; }
.pod-info p { color: var(--text2); font-size: .93em; }

/* ================= Akkord-Chips & Piano-Roll ================= */
.chips { display: flex; flex-wrap: wrap; gap: .45em; margin: .4em 0 .8em; }
.chip-chord {
  display: inline-flex; flex-direction: column; align-items: center; min-width: 58px; padding: .35em .7em; border-radius: 10px;
  background: var(--bg2); border: 1px solid var(--line2); font-size: .88em; line-height: 1.25; transition: all .15s;
}
.chip-chord b { font-family: Georgia, "Times New Roman", serif; font-size: 1.05em; color: var(--accent); }
.chip-chord small { color: var(--muted); font-size: .76em; }
.chip-chord.click, .chips.big .chip-chord { cursor: pointer; }
.chip-chord.click:hover, .chips.big .chip-chord:hover { border-color: var(--accent); }
.chip-chord.on { background: var(--accent); border-color: var(--accent); color: #04120a; transform: translateY(-2px) scale(1.05); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 40%, transparent); }
.chip-chord.on b, .chip-chord.on small { color: #04120a; }
.chips.big .chip-chord { min-width: 84px; padding: .55em .9em; font-size: 1rem; }

.roll { width: 100%; height: auto; display: block; border-radius: 10px; background: #0c0c0e; border: 1px solid var(--line); margin: .4em 0 .8em; }
.roll-row-w { fill: #141417; }
.roll-row-b { fill: #0d0d0f; }
.roll-key-w { fill: #e9e9ec; }
.roll-key-b { fill: #1f1f24; }
.roll-lbl { fill: #555; font: 700 8px var(--font); }
.roll-oct { stroke: #2c2c33; stroke-width: 1; }
.roll-bar { stroke: #3a3a42; stroke-width: 1.2; }
.roll-beat { stroke: #1e1e23; stroke-width: 1; }
.roll-col { fill: transparent; transition: fill .15s; }
.roll-chord.on .roll-col { fill: color-mix(in srgb, var(--accent) 9%, transparent); }
.roll-note { fill: var(--accent); stroke: rgba(0, 0, 0, .35); stroke-width: 1; opacity: .85; transition: opacity .15s; }
.roll-bass { fill: var(--red); stroke: rgba(0, 0, 0, .35); stroke-width: 1; opacity: .85; }
.roll-chord.on .roll-note, .roll-chord.on .roll-bass { opacity: 1; filter: drop-shadow(0 0 4px rgba(255, 255, 255, .5)); }
.roll-sym { fill: var(--text2); font: 700 11px var(--font); }

/* ================= Klaviatur ================= */
.kb {
  position: relative; width: 100%; height: 150px; user-select: none; touch-action: none;
  background: #000; border-radius: 0 0 10px 10px; border-top: 4px solid #2a0f12; box-shadow: inset 0 6px 10px -6px rgba(0, 0, 0, .9);
  overflow: hidden;
}
.mini-kb.kb { height: 110px; }
.mid-kb.kb { height: 140px; margin: .6em 0; }
.big-kb.kb { height: 200px; }
#ses-kb.kb { height: 190px; }
.kb-key { position: absolute; top: 0; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; transition: background .06s, box-shadow .1s; }
.kb-key.white {
  height: 100%; background: linear-gradient(180deg, #e8e8ea 0%, #fafafa 70%, #ececee 100%);
  border: 1px solid #1a1a1a; border-top: 0; border-radius: 0 0 6px 6px; z-index: 1;
  box-shadow: inset 0 -5px 0 #cfcfd3;
}
.kb-key.black {
  height: 62%; background: linear-gradient(180deg, #2a2a2e, #0b0b0c 85%); border: 1px solid #000; border-top: 0;
  border-radius: 0 0 5px 5px; z-index: 2; box-shadow: inset 0 -4px 0 #3a3a40, 0 3px 4px rgba(0, 0, 0, .6);
}
.kb-lbl { font-size: 10px; font-weight: 700; color: #6b6b72; padding-bottom: 7px; pointer-events: none; font-family: var(--font); }
.kb-key.black .kb-lbl { color: #9a9aa0; font-size: 8px; }
.kb-key.white.down { background: linear-gradient(180deg, #cfd2d6, #e3e5e8); box-shadow: inset 0 -2px 0 #bbb; }
.kb-key.black.down { background: linear-gradient(180deg, #3b3b42, #1a1a1d); box-shadow: inset 0 -1px 0 #444; }
/* Markierungen */
.kb-key.white.m-chord { background: linear-gradient(180deg, #e8e8ea 0%, color-mix(in srgb, var(--accent) 55%, #fff) 100%); }
.kb-key.black.m-chord { background: linear-gradient(180deg, #2a2a2e, color-mix(in srgb, var(--accent) 80%, #000)); }
.kb-key.white.m-root { background: linear-gradient(180deg, #e8e8ea 0%, var(--accent) 100%); }
.kb-key.black.m-root { background: linear-gradient(180deg, #2a2a2e, var(--accent)); }
.kb-key.white.m-scale { background: linear-gradient(180deg, #e8e8ea 0%, #b9d9ff 100%); }
.kb-key.black.m-scale { background: linear-gradient(180deg, #2a2a2e, #2d5d9a); }
.kb-key.white.m-bass { background: linear-gradient(180deg, #e8e8ea 0%, #fca5a5 100%); }
.kb-key.black.m-bass { background: linear-gradient(180deg, #2a2a2e, #b91c1c); }
.kb-key.white.m-hint { background: linear-gradient(180deg, #e8e8ea 0%, #fde68a 100%); animation: hintPulse 1s infinite; }
.kb-key.black.m-hint { background: linear-gradient(180deg, #2a2a2e, #ca8a04); animation: hintPulse 1s infinite; }
.kb-key.white.m-ok { background: linear-gradient(180deg, #e8e8ea, var(--green)); }
.kb-key.black.m-ok { background: linear-gradient(180deg, #2a2a2e, var(--green)); }
.kb-key.white.m-bad { background: linear-gradient(180deg, #e8e8ea, var(--red)); }
.kb-key.black.m-bad { background: linear-gradient(180deg, #2a2a2e, var(--red)); }
.kb-key.m-chord .kb-lbl, .kb-key.m-root .kb-lbl { color: #04120a; }
.kb-key.f-ok { background: var(--green) !important; box-shadow: 0 0 18px var(--green) !important; }
.kb-key.f-bad { background: var(--red) !important; box-shadow: 0 0 18px var(--red) !important; animation: shakeX .3s; }

/* ================= Lernpfad ================= */
.tier { padding: 0; overflow: hidden; border-left: 4px solid var(--tc); transition: border-color .2s; }
.tier.locked { opacity: .62; }
.tier.passed { border-left-color: var(--green); }
.tier-head { display: flex; align-items: center; gap: 1.1rem; padding: 1.1rem 1.3rem; cursor: pointer; }
.tier-head:hover { background: rgba(255, 255, 255, .02); }
.tier-badge {
  flex: 0 0 auto; width: 58px; height: 58px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 1.5rem; background: color-mix(in srgb, var(--tc) 16%, var(--bg2)); border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); line-height: 1;
}
.tier-badge span { font-size: .62rem; font-weight: 800; color: var(--muted); margin-top: .35em; }
.tier.passed .tier-badge { color: var(--green); }
.tier-info { flex: 1; min-width: 0; }
.tier-rank { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--tc); }
.tier-title { font-size: 1.15rem; font-weight: 700; }
.tier-goal { font-size: .86rem; color: var(--muted); line-height: 1.45; margin-top: .2em; }
.tier.open .tier-goal { color: var(--text2); }
.tier:not(.open) .tier-goal { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tier-meta { flex: 0 0 190px; display: flex; flex-direction: column; gap: .35em; font-size: .78rem; color: var(--muted); text-align: right; }
.tier-body { padding: 0 1.3rem 1.3rem; }
.lessons { display: flex; flex-direction: column; gap: .4em; margin-bottom: 1em; }
.lesson-row {
  display: flex; align-items: center; gap: .9em; width: 100%; text-align: left; padding: .7em .9em; border-radius: 11px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--text); cursor: pointer; transition: border-color .15s, transform .1s;
}
.lesson-row:hover:not(:disabled) { border-color: var(--tc); transform: translateX(3px); }
.lesson-row:disabled { cursor: not-allowed; opacity: .6; }
.lesson-row.done { border-color: color-mix(in srgb, var(--green) 35%, var(--line)); }
.lr-n { flex: 0 0 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85em; background: var(--s3); color: var(--text2); }
.lesson-row.done .lr-n { background: var(--green); color: #04120a; }
.lr-t { flex: 1; min-width: 0; font-weight: 600; }
.lr-t small { display: block; font-weight: 400; color: var(--muted); font-size: .8em; line-height: 1.35; margin-top: .1em; }
.lr-m { flex: 0 0 auto; font-size: .8em; color: var(--gold); white-space: nowrap; }
.exam-box {
  display: flex; align-items: center; gap: 1.2rem; padding: 1.1rem 1.2rem; border-radius: 12px;
  background: linear-gradient(135deg, rgba(239, 68, 68, .1), rgba(239, 68, 68, .02)); border: 1px solid rgba(239, 68, 68, .35);
}
.exam-box > div { flex: 1; min-width: 0; }
.exam-box p { font-size: .9em; color: var(--text2); margin: .3em 0; }
.exam-box span { font-size: .8em; }
.exam-box.passed { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 45%, transparent); }

/* ================= Lektion ================= */
.lesson { max-width: 900px; margin: 0 auto; }
.lesson-top { display: flex; align-items: center; justify-content: space-between; gap: 1em; margin-bottom: 1em; font-size: .85em; }
.lesson h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); border-left: 4px solid var(--tc); padding-left: .55em; }
.lead { font-size: 1.12rem; color: var(--text2); margin-bottom: 1.6em; }
.blocks { font-size: 1.02rem; line-height: 1.72; }
.blocks > p, .blocks > ul { color: #dcdce0; }
.blocks h2 { margin-top: 1.8em; font-size: 1.32rem; color: var(--text); }
.blocks h2::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--tc); margin-right: .55em; vertical-align: .15em; }
.callout { display: flex; gap: .85em; padding: .95em 1.1em; border-radius: 12px; margin: 1.1em 0; border: 1px solid; font-size: .96em; line-height: 1.6; }
.callout > span { font-size: 1.3em; line-height: 1.2; }
.callout.tip { background: var(--gold-soft); border-color: rgba(234, 179, 8, .35); }
.callout.producer { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.callout.producer > div > b:first-child { color: var(--green); text-transform: uppercase; font-size: .8em; letter-spacing: .07em; }
.callout.warn { background: var(--red-soft); border-color: rgba(239, 68, 68, .4); }
.widget { margin: 1.3em 0; padding: 1em; border-radius: 14px; background: #0e0e10; border: 1px solid var(--line); }
.widget figcaption { display: flex; align-items: center; flex-wrap: wrap; gap: .5em; margin-top: .75em; font-size: .9em; color: var(--text2); }
.chord-sym { font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 700; color: var(--accent); margin-bottom: .2em; letter-spacing: .01em; }
.staff-box { background: #0b0b0d; border-radius: 10px; padding: .4em; }
.staff-svg { max-width: 100%; }
.table-wrap { overflow-x: auto; margin: 1em 0; border: 1px solid var(--line); border-radius: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92em; }
.tbl th { background: var(--s2); text-align: left; padding: .6em .85em; font-weight: 700; color: var(--text2); font-size: .85em; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.tbl td { padding: .55em .85em; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, .02); }
.lesson-end { margin-top: 2.4em; border-color: color-mix(in srgb, var(--tc) 40%, var(--line)); }
.lesson-notes { display: flex; flex-wrap: wrap; gap: .4em; margin-top: 1em; }
.note-mini { cursor: pointer; font-size: .85em; padding: .3em .7em; border-radius: 8px; background: var(--s2); border: 1px solid var(--line); }
.note-mini:hover { border-color: var(--accent); }

/* Quintenzirkel */
.circle-w { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 1.2rem; align-items: center; }
.circle5 { width: 100%; height: auto; display: block; }
.c5-seg { cursor: pointer; }
.c5-maj { fill: #18181c; stroke: #0a0a0b; stroke-width: 2; transition: fill .15s; }
.c5-min { fill: #121215; stroke: #0a0a0b; stroke-width: 2; transition: fill .15s; }
.c5-seg:hover .c5-maj { fill: #26262c; }
.c5-seg:hover .c5-min { fill: #1e1e23; }
.c5-near .c5-maj { fill: color-mix(in srgb, var(--accent) 22%, #18181c); }
.c5-near .c5-min { fill: color-mix(in srgb, var(--accent) 12%, #121215); }
.c5-sel .c5-maj { fill: var(--accent); }
.c5-sel .c5-min { fill: color-mix(in srgb, var(--accent) 55%, #000); }
.c5-t1 { fill: var(--text); font: 700 17px var(--font); text-anchor: middle; pointer-events: none; }
.c5-t2 { fill: var(--muted); font: 600 12px var(--font); text-anchor: middle; pointer-events: none; }
.c5-t3 { fill: #5c5c64; font: 600 10px var(--font); text-anchor: middle; pointer-events: none; }
.c5-sel .c5-t1 { fill: #04120a; }
.c5-sel .c5-t2 { fill: #fff; }
.c5-center { fill: #0b0b0d; stroke: var(--line2); }
.c5-ct { fill: var(--accent); font: 800 20px var(--font); text-anchor: middle; }
.c5-cs { fill: var(--muted); font: 600 10px var(--font); text-anchor: middle; }

/* ================= Übungs-Session ================= */
.session { max-width: 980px; margin: 0 auto; }
.ses-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.ses-title { flex: 0 1 auto; font-weight: 700; min-width: 0; max-width: 34%; line-height: 1.3; }
.ses-title span { display: block; font-size: .78em; color: var(--muted); font-weight: 600; }
.ses-bar { flex: 1; height: 12px; background: var(--s3); border-radius: 99px; overflow: hidden; }
.ses-bar > div { height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 60%, #000), var(--accent)); border-radius: inherit; transition: width .35s; box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent); }
.mode-exam .ses-bar > div { background: linear-gradient(90deg, #7f1d1d, var(--red)); box-shadow: 0 0 12px rgba(239, 68, 68, .6); }
.ses-combo { font-weight: 800; font-size: 1.05rem; color: var(--muted); min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.ses-combo small { color: var(--gold); }
.ses-combo.hot { color: var(--gold); text-shadow: 0 0 14px rgba(234, 179, 8, .7); }
.ses-combo.bump { animation: bump .3s; }
.ses-xp { font-weight: 800; color: var(--accent); min-width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.ses-body { background: linear-gradient(180deg, var(--s1), #0f0f12); border: 1px solid var(--line); border-radius: 18px; padding: 1.8rem; }
.ses-prompt { font-size: 1.35rem; font-weight: 650; text-align: center; margin-bottom: 1.1rem; line-height: 1.45; }
.ses-prompt b { color: var(--accent); }
.ses-staff { max-width: 560px; margin: 0 auto 1rem; background: #0b0b0d; border-radius: 12px; padding: .6em; border: 1px solid var(--line); }
.ses-audio { text-align: center; margin-bottom: 1rem; }
.ses-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem; margin: 1rem 0; }
.opt {
  display: flex; align-items: center; gap: .7em; padding: .95em 1.1em; border-radius: 12px; cursor: pointer; text-align: left;
  background: var(--bg2); border: 2px solid var(--line2); color: var(--text); font-weight: 600; font-size: 1rem; transition: all .12s;
}
.opt:hover { border-color: var(--text2); transform: translateY(-1px); }
.opt kbd { flex: 0 0 auto; }
.opt.right { border-color: var(--green); background: var(--green-soft); color: #bbf7d0; animation: pop .3s; }
.opt.wrong { border-color: var(--red); background: var(--red-soft); color: #fecaca; animation: shakeX .35s; }
.ses-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: .4em; margin-bottom: 1rem; }
.step { padding: .35em .85em; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line2); font-weight: 650; font-size: .92em; color: var(--muted); }
.step.cur { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.step.done { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.ses-kb-wrap { position: relative; }
.blindfold {
  position: absolute; left: 0; right: 0; top: 0; height: 58%; display: flex; align-items: center; justify-content: center; z-index: 5;
  background: rgba(0, 0, 0, .55); color: var(--text2); font-weight: 650; pointer-events: none; backdrop-filter: blur(2px); text-align: center; padding: 0 1em;
}
.ses-tools { display: flex; flex-wrap: wrap; gap: .6em; align-items: center; justify-content: space-between; margin-top: .8rem; font-size: .82em; }
.ses-feedback { min-height: 3.2rem; margin-top: 1rem; }
.fb { padding: .9em 1.1em; border-radius: 12px; font-weight: 650; animation: slideUp .25s; }
.fb.ok { background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 50%, transparent); color: #bbf7d0; }
.fb.bad { background: var(--red-soft); border: 1px solid rgba(239, 68, 68, .5); color: #fecaca; display: flex; flex-direction: column; gap: .6em; align-items: flex-start; }
.fb-exp { font-weight: 400; color: var(--text2); line-height: 1.55; font-size: .95em; }
.fb-exp b { color: var(--text); }
.session.blind .ses-body { border-color: #333; background: radial-gradient(500px 200px at 50% 0%, rgba(255, 255, 255, .04), transparent), #08080a; }
.session.blind .ses-title span { color: var(--gold); }

/* ================= Ergebnis ================= */
.result { max-width: 760px; margin: 0 auto; text-align: center; padding: 2rem; }
.result.pass { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.result.fail { border-color: rgba(239, 68, 68, .4); }
.res-stars { font-size: 3rem; letter-spacing: .15em; color: var(--s3); }
.res-stars span.on { color: var(--gold); text-shadow: 0 0 20px rgba(234, 179, 8, .6); display: inline-block; animation: starIn .5s backwards; }
.res-stars span.on:nth-child(2) { animation-delay: .15s; }
.res-stars span.on:nth-child(3) { animation-delay: .3s; }
.res-pct { font-size: 3.4rem; font-weight: 850; line-height: 1; margin: .2em 0; }
.res-sub { color: var(--text2); margin-bottom: 1.2em; }
.res-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6em; margin: 1.2em 0; }
.res-kpis > div, .kpis > div { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: .7em .4em; display: flex; flex-direction: column; }
.res-kpis b, .kpis b { font-size: 1.35rem; }
.res-kpis span, .kpis span { font-size: .75rem; color: var(--muted); }
.parts { text-align: left; margin: 1em 0; display: flex; flex-direction: column; gap: .5em; }
.part { display: grid; grid-template-columns: minmax(0, 1.4fr) 2fr 52px; gap: .8em; align-items: center; font-size: .88em; }
.part b { text-align: right; }
.res-mist { text-align: left; margin-top: 1.4em; }
.mist { background: var(--bg2); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 10px; padding: .7em .9em; margin-bottom: .5em; font-size: .9em; line-height: 1.55; }
details.mist summary { cursor: pointer; }
details.mist > div { margin-top: .4em; }
.res-actions { display: flex; flex-wrap: wrap; gap: .6em; justify-content: center; margin-top: 1.5em; }

/* ================= Training ================= */
.big-tile { cursor: pointer; text-align: center; padding: 1.8rem; transition: transform .15s, border-color .15s; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.big-tile:hover { transform: translateY(-3px); border-color: var(--accent); }
.big-tile.red { border-color: rgba(239, 68, 68, .35); }
.big-tile.red:hover { border-color: var(--red); }
.bt-ic { font-size: 2.6rem; }
.big-tile p { color: var(--text2); font-size: .92em; max-width: 46ch; margin: 0 auto 1em; }
.train-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem; }
.train-tile {
  display: flex; flex-direction: column; gap: .15em; text-align: left; padding: .8em .9em; border-radius: 11px; cursor: pointer;
  background: var(--bg2); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: .9em; transition: border-color .15s, transform .1s;
}
.train-tile small { color: var(--muted); font-weight: 500; }
.train-tile:hover:not(.locked) { border-color: var(--accent); transform: translateY(-1px); }
.train-tile.on { border-color: var(--accent); }
.train-tile.locked { opacity: .4; cursor: not-allowed; }
.skills { display: flex; flex-direction: column; gap: .45em; max-height: 420px; overflow-y: auto; padding-right: .3em; }
.skill { display: grid; grid-template-columns: minmax(0, 1.5fr) 1fr 48px; gap: .7em; align-items: center; font-size: .85em; }
.skill small { color: var(--muted); text-align: right; }

/* ================= Studio ================= */
.detect { min-height: 2.6em; padding: .55em .9em; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); margin-bottom: .8em; font-size: 1.05em; }
.det-chord { color: var(--accent); font-size: 1.15em; }
.studio-tools { display: flex; flex-wrap: wrap; gap: .8em; align-items: center; justify-content: space-between; margin-top: .7em; font-size: .85em; }
.circle-info h3 { color: var(--accent); }

/* ================= Akkordfolgen & Genres ================= */
.prog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .9rem; }
.prog-card {
  display: flex; flex-direction: column; gap: .35em; text-align: left; padding: 1.05rem 1.1rem; border-radius: var(--r); cursor: pointer;
  background: linear-gradient(180deg, var(--s1), #101013); border: 1px solid var(--line); color: var(--text); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.prog-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.prog-card h3 { margin: .2em 0 0; }
.prog-card.soft-lock { opacity: .6; }
.pc-top { display: flex; flex-wrap: wrap; gap: .35em; align-items: center; }
.pc-num { font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; color: var(--accent); font-weight: 700; }
.pc-sym { font-size: .86em; color: var(--text2); }
.pc-mood { font-size: .8em; color: var(--muted); font-style: italic; }
.pc-lock { font-size: .75em; color: var(--gold); margin-top: auto; }
.prog-detail > .btn.ghost { margin-bottom: .8em; }
.pd-head { display: flex; justify-content: space-between; gap: 1em; flex-wrap: wrap; align-items: flex-start; margin-bottom: .6em; }
.pd-head h1 { margin-bottom: .25em; }
.pd-key { display: flex; align-items: center; gap: .5em; color: var(--muted); font-size: .9em; }
.pd-ctrl { display: flex; flex-wrap: wrap; gap: .55em; align-items: center; margin-top: .4em; }
.genres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.genres > .card { margin: 0; }
.g-head { display: flex; align-items: center; gap: .8em; margin-bottom: .6em; }
.g-head h2 { margin: 0; }
.g-ic { font-size: 2.2rem; width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; }
.genre p { color: var(--text2); font-size: .93em; }
.g-chars { font-size: .88em; color: var(--text2); }
.g-chars li::marker { color: var(--accent); }
.g-progs { display: flex; flex-direction: column; gap: .4em; }
.g-prog {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .8em; align-items: center; text-align: left; padding: .55em .8em;
  border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); color: var(--text); cursor: pointer; font-size: .88em;
}
.g-prog:hover { border-color: var(--accent); }
.g-prog span:not(.diff) { font-family: Georgia, serif; color: var(--accent); }

/* ================= Erfolge & Shop ================= */
.level-card { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.lvl-big {
  width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 850;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 25%, #000), #0b0b0d); border: 3px solid var(--accent); box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 35%, transparent);
}
.lvl-title { font-size: 1.3rem; font-weight: 750; margin-bottom: .35em; }
.level-card .grow { min-width: 220px; }
.level-card .grow .muted { font-size: .85em; margin-top: .35em; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5em; text-align: center; min-width: 300px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5em; }
.ach { display: flex; gap: .7em; align-items: center; padding: .6em .7em; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); opacity: .5; filter: grayscale(1); }
.ach.on { opacity: 1; filter: none; border-color: rgba(234, 179, 8, .45); background: var(--gold-soft); }
.ach-ic { font-size: 1.6em; }
.ach b { display: block; font-size: .9em; }
.ach span { font-size: .76em; color: var(--muted); }
.shop-item { display: flex; align-items: center; gap: .9em; padding: .7em 0; border-bottom: 1px dashed var(--line); }
.shop-item .grow span { display: block; font-size: .82em; color: var(--muted); }
.si-ic { font-size: 1.6em; }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--line2); }

/* ================= Notizen ================= */
.notes-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 1.1rem; margin-bottom: 1.1rem; }
.notes-layout > .card { margin: 0; }
.notes-list { display: flex; flex-direction: column; gap: .45em; max-height: 72vh; overflow-y: auto; }
.notes-list input[type=search] { margin-bottom: .4em; }
.note-item { display: flex; flex-direction: column; gap: .1em; text-align: left; padding: .65em .8em; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.note-item:hover { border-color: var(--line2); }
.note-item.on { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.note-item span { font-size: .82em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item small { font-size: .72em; color: #6d6d75; }
.notes-export { margin-top: auto; padding-top: .6em; }
.note-edit { display: flex; flex-direction: column; gap: .6em; min-height: 520px; }
.note-title { font-size: 1.35rem !important; font-weight: 700; background: transparent !important; border-color: transparent !important; padding-left: 0 !important; }
.note-title:focus { border-bottom-color: var(--accent) !important; box-shadow: none !important; }
.note-meta { display: flex; gap: .5em; flex-wrap: wrap; }
.note-meta input { flex: 1; min-width: 180px; }
.note-meta select { flex: 1; min-width: 200px; }
.note-tb { display: flex; flex-wrap: wrap; gap: .3em; padding: .3em; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-sm); }
#note-body { flex: 1; min-height: 320px; resize: vertical; font-family: var(--mono); font-size: .92rem; line-height: 1.65; }
.note-actions { display: flex; flex-wrap: wrap; gap: .5em; align-items: center; }
.notion p { color: var(--text2); font-size: .93em; }
.notion details { margin-top: .9em; font-size: .9em; }
.notion details summary { cursor: pointer; color: var(--text2); }
.notion-frame { margin-top: .8em; }
.notion-frame iframe { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }

/* ================= Urkunde ================= */
.finale { max-width: 860px; margin: 0 auto; padding: 2rem; }
.cert {
  text-align: center; padding: 3rem 2.4rem; border-radius: 14px; position: relative;
  background: radial-gradient(500px 220px at 50% 0%, rgba(234, 179, 8, .1), transparent 70%), #0c0c0e;
  border: 2px solid rgba(234, 179, 8, .55); box-shadow: inset 0 0 0 8px #0c0c0e, inset 0 0 0 9px rgba(234, 179, 8, .3);
}
.cert-top { letter-spacing: .4em; font-weight: 800; color: var(--muted); font-size: .85rem; }
.cert-h { font-family: Georgia, serif; font-size: 3rem; font-weight: 700; color: var(--gold); margin: .2em 0 .4em; }
.cert-rank { font-family: Georgia, serif; font-size: 2.4rem; font-weight: 700; color: var(--accent); margin: .3em 0; text-shadow: 0 0 30px color-mix(in srgb, var(--accent) 40%, transparent); }
.cert-claim { font-size: 1.2rem; font-style: italic; color: var(--text); margin-top: 1em; }
.cert-foot { display: flex; justify-content: space-between; gap: 1em; flex-wrap: wrap; margin-top: 2.2em; padding-top: 1em; border-top: 1px solid rgba(234, 179, 8, .3); font-size: .85em; color: var(--muted); }

/* ================= Modal, Toasts, Konfetti, Truhe ================= */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 1rem; background: rgba(0, 0, 0, .72); backdrop-filter: blur(6px); }
.modal.open { display: flex; animation: fadeIn .2s; }
.modal-card {
  position: relative; width: min(520px, 100%); max-height: 90vh; overflow-y: auto; padding: 2rem; border-radius: 20px;
  background: linear-gradient(180deg, #19191d, #101013); border: 1px solid var(--line2); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); animation: popIn .3s cubic-bezier(.2, 1.4, .4, 1);
}
.modal-card.wide { width: min(820px, 100%); }
.modal-x { position: absolute; top: .8rem; right: .8rem; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line2); background: var(--s2); color: var(--text2); cursor: pointer; }
.modal-x:hover { color: var(--text); border-color: var(--text2); }
.celebrate, .exam-intro, .chest { text-align: center; }
.celebrate p, .exam-intro p { color: var(--text2); }
.celebrate ul.left, .exam-intro ul { text-align: left; color: var(--text2); font-size: .93em; }
.cel-icon { font-size: 3.6rem; line-height: 1.2; margin-bottom: .2em; animation: popIn .5s cubic-bezier(.2, 1.6, .4, 1); }
.exam-intro h2 { color: var(--text); }
.exam-intro .cel-icon { filter: drop-shadow(0 0 16px rgba(239, 68, 68, .5)); }
.chest-box { font-size: 5rem; line-height: 1.2; margin: .2em 0; display: inline-block; }
.chest-box.shake { animation: chestShake .9s; }
.chest-box.pop { animation: popIn .5s cubic-bezier(.2, 1.8, .4, 1); }
.chest-title { font-weight: 700; color: var(--text2); margin-bottom: 1em; }
.chest-hidden { visibility: hidden; height: 0; overflow: hidden; }
.chest-rarity { font-weight: 850; font-size: 1.3rem; text-transform: uppercase; letter-spacing: .14em; }
.chest-loot { font-size: 1.5rem; font-weight: 800; margin: .3em 0 .6em; }
.chest-extra { color: var(--blue); font-weight: 700; margin-bottom: .6em; }
.r-gewoehnlich .chest-rarity { color: var(--text2); }
.r-selten .chest-rarity { color: var(--blue); }
.r-episch .chest-rarity { color: #c084fc; text-shadow: 0 0 16px rgba(192, 132, 252, .6); }
.r-legendaer .chest-rarity { color: var(--gold); text-shadow: 0 0 20px rgba(234, 179, 8, .8); }
.r-legendaer .chest-box.pop { filter: drop-shadow(0 0 24px rgba(234, 179, 8, .8)); }
.chest > .btn { margin-top: .4em; }

.toasts { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 120; display: flex; flex-direction: column; gap: .5rem; align-items: flex-end; pointer-events: none; }
.toast {
  max-width: 380px; padding: .75em 1.05em; border-radius: 12px; background: #1b1b1f; border: 1px solid var(--line2); box-shadow: var(--shadow);
  font-size: .9em; font-weight: 550; animation: toastIn .35s cubic-bezier(.2, 1.3, .4, 1); transition: opacity .4s, transform .4s; border-left: 4px solid var(--line2);
}
.toast.out { opacity: 0; transform: translateX(30px); }
.toast.ok { border-left-color: var(--green); }
.toast.bad { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--gold); }
.toast.streak { border-left-color: #ff8c00; background: linear-gradient(90deg, rgba(255, 120, 0, .14), #1b1b1f); }
.toast.quest { border-left-color: var(--accent); background: linear-gradient(90deg, var(--green-soft), #1b1b1f); }
.toast.achv { border-left-color: var(--gold); background: linear-gradient(90deg, var(--gold-soft), #1b1b1f); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 150; }

/* ================= Animationen ================= */
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.85); } }
@keyframes pop { 50% { transform: scale(1.04); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.95); } }
@keyframes shakeX { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes bump { 50% { transform: scale(1.3); } }
@keyframes pulse { 50% { opacity: .7; } }
@keyframes glow { 50% { box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent); } }
@keyframes hintPulse { 50% { filter: brightness(1.25); } }
@keyframes starIn { from { opacity: 0; transform: scale(2.2) rotate(-25deg); } }
@keyframes chestShake { 10%, 50%, 90% { transform: rotate(-12deg) scale(1.05); } 30%, 70% { transform: rotate(12deg) scale(1.1); } 100% { transform: scale(1.2); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ================= Responsiv ================= */
@media (max-width: 1100px) {
  .grid3 { grid-template-columns: 1fr 1fr; }
  .grid3 > :last-child { grid-column: 1 / -1; }
  .pod { grid-template-columns: 1fr; }
  .genres { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 40; flex-direction: row; overflow-x: auto;
    padding: .35rem; border-right: 0; border-top: 1px solid var(--line); background: rgba(9, 9, 10, .95); backdrop-filter: blur(12px);
  }
  .nav-btn { flex-direction: column; gap: .1em; padding: .4em .55em; min-width: 66px; font-size: .68rem; text-align: center; }
  .nav-btn.on { box-shadow: inset 0 -3px 0 var(--accent); }
  .main { padding: 1rem 16px 6rem; }
  .top { padding: .5rem 16px; }
  .pill.rank, .pill.midi { display: none; }
  .grid2, .grid3, .notes-layout, .circle-w { grid-template-columns: 1fr; }
  .grid3 > :last-child { grid-column: auto; }
  .tier-meta { display: none; }
  .exam-box { flex-direction: column; align-items: stretch; }
  .ses-head { flex-wrap: wrap; gap: .6rem; }
  .ses-title { max-width: none; flex: 1 1 60%; }
  .ses-bar { order: 5; flex-basis: 100%; }
  .ses-body { padding: 1.1rem; }
  .ses-prompt { font-size: 1.12rem; }
  .res-kpis, .kpis { grid-template-columns: repeat(2, 1fr); min-width: 0; }
  .hero-card { padding: 1.4rem; }
  .big-kb.kb { height: 160px; }
  .toasts { bottom: 5rem; right: .6rem; left: .6rem; align-items: stretch; }
  .toast { max-width: none; }
}
@media (max-width: 520px) {
  .brand-name { display: none; }
  .pill.lvl .bar { display: none; }
  .part { grid-template-columns: 1fr 1fr 44px; }
}

/* ================= Druck (Urkunde) ================= */
@media print {
  body { background: #fff; color: #000; }
  .top, .nav, .toasts, .confetti, .hero-actions { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .finale.card { border: 0; background: #fff; }
  .cert { background: #fff; color: #000; box-shadow: none; border-color: #b8860b; }
  .cert p, .cert-claim, .cert-foot { color: #222; }
  .cert-rank { color: #166534; text-shadow: none; }
  .cert-h { color: #b8860b; }
}
