@charset "UTF-8";
/* TastaturTrainer – Design */

:root {
  --bg: #eef3ff;
  --bg-a: #ffe9f3;
  --bg-b: #def4ff;
  --card: #ffffff;
  --card-2: #f5f7fd;
  --ink: #1c2240;
  --ink-2: #4c5578;
  --muted: #7c84a3;
  --line: #e2e6f3;
  --primary: #6a4cff;
  --primary-2: #8b73ff;
  --primary-ink: #ffffff;
  --primary-soft: #ece8ff;
  --accent: #ff8a3d;
  --good: #149a69;
  --good-soft: #dff7ec;
  --bad: #e5484d;
  --bad-soft: #ffe1e2;
  --warn-ink: #b26a00;
  --star: #ffb81c;
  --star-off: #dde2ee;
  --shadow: 0 10px 28px rgba(36, 48, 110, .10);
  --shadow-sm: 0 2px 8px rgba(36, 48, 110, .08);
  --radius: 22px;
  --f-pinky: #ffc4d6;
  --f-ring: #ffd9a8;
  --f-middle: #fff0a0;
  --f-index: #c1efcb;
  --f-thumb: #dcd3ff;
  --key-bg: #f3f5fb;
  --key-ink: #283055;
  --key-edge: #c9d0e3;
  --skin: #ffe1c9;
  --skin-edge: #e2b48e;
  --series-1: #2a78d6;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --heat-0: #fde3d6;
  --heat-1: #f9b99a;
  --heat-2: #f08a5d;
  --heat-3: #d9592b;
  --heat-4: #a83a17;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
  --text-size: 2.1rem;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #12152a;
  --bg-a: #2a1c42;
  --bg-b: #10283c;
  --card: #1c2039;
  --card-2: #242a48;
  --ink: #eef0ff;
  --ink-2: #bcc2df;
  --muted: #8a91b3;
  --line: #313858;
  --primary: #8f78ff;
  --primary-2: #a896ff;
  --primary-soft: #2f2a5c;
  --accent: #ff9a52;
  --good: #2cc28a;
  --good-soft: #173d31;
  --bad: #ff6b6f;
  --bad-soft: #4a2027;
  --warn-ink: #f2b24c;
  --star-off: #3a4064;
  --shadow: 0 10px 28px rgba(0, 0, 0, .35);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
  --f-pinky: #6c3048;
  --f-ring: #6b4822;
  --f-middle: #5f5522;
  --f-index: #255636;
  --f-thumb: #43387a;
  --key-bg: #2a304f;
  --key-ink: #e8ebff;
  --key-edge: #14172b;
  --skin: #c8997a;
  --skin-edge: #8a644a;
  --series-1: #3987e5;
  --grid: #2c2c2a;
  --axis: #383835;
  color-scheme: dark;
}

body[data-ts="s"] { --text-size: 1.7rem; }
body[data-ts="m"] { --text-size: 2.1rem; }
body[data-ts="l"] { --text-size: 2.7rem; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 0% -10%, var(--bg-a) 0%, transparent 60%),
    radial-gradient(900px 600px at 110% 0%, var(--bg-b) 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: 1.9rem; font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 800; }
p { margin: 0 0 .7em; }
b { font-weight: 700; }
kbd {
  display: inline-block; font: 600 .78em var(--font); padding: .1em .45em; border-radius: 6px;
  border: 1px solid currentColor; opacity: .75; vertical-align: .08em;
}

#app { max-width: 1200px; margin: 0 auto; padding: 0 20px 40px; }
#main { animation: fade-in .25s ease; }

/* ---------- Kopfzeile ---------- */
#topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; min-height: 70px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; font: 800 1.35rem var(--font); color: var(--ink);
  background: none; border: 0; padding: 4px; cursor: pointer;
}
div.brand { cursor: default; }
.brand-ic { font-size: 1.6rem; }
.tb-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--card); box-shadow: var(--shadow-sm); font-size: .95rem; white-space: nowrap;
}
.chip small { color: var(--muted); font-size: .8em; }
.chip.combo.hot { background: linear-gradient(135deg, #ffb443, #ff6a3d); color: #fff; }
.chip.combo.hot small { color: #fff; }
.tb-level { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow-sm); }
.lv-pill { font-weight: 800; color: var(--primary); }
.xpbar { display: inline-block; width: 90px; height: 10px; border-radius: 99px; background: var(--primary-soft); overflow: hidden; }
.xpbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), #c56bff); transition: width .6s ease; }
.xpbar.big { display: block; width: 100%; height: 14px; }
.icon-btn, .profile-btn {
  border: 0; background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); border-radius: 999px;
  height: 38px; cursor: pointer; font: 600 1rem var(--font);
}
.icon-btn { width: 38px; font-size: 1.1rem; }
.profile-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px 0 6px; }
.profile-btn .av { font-size: 1.5rem; }
.icon-btn:hover, .profile-btn:hover, .brand:hover { filter: brightness(1.04); transform: translateY(-1px); }
.reset-btn {
  border: 0; height: 38px; padding: 0 14px; border-radius: 999px; cursor: pointer; font: 700 .95rem var(--font);
  background: var(--card); color: var(--bad); box-shadow: var(--shadow-sm);
}
.reset-btn:hover { background: var(--bad-soft); transform: translateY(-1px); }
.storage-path { word-break: break-all; }
@media (max-width: 760px) { .reset-btn span { display: none; } }

/* ---------- Grundbausteine ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-title { font-size: 1.2rem; margin-bottom: .5em; }
.muted { color: var(--muted); }
.page-head { margin: 6px 0 18px; }
.page-head p { color: var(--ink-2); font-size: 1.05rem; }
.sub-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 16px; }
.sub-head h1 { margin: 0; font-size: 1.6rem; }
.sub-head .game-stats { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { text-align: center; margin: 26px 0 16px; }
.lead { font-size: 1.15rem; color: var(--ink-2); }
.lead-sm { color: var(--ink-2); margin-bottom: 18px; }
.footnote { color: var(--muted); font-size: .9rem; margin-top: 18px; }
.center-wrap { max-width: 900px; margin: 0 auto; text-align: center; padding-top: 10px; }
.empty { padding: 30px; text-align: center; color: var(--muted); background: var(--card-2); border-radius: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 10px 18px; cursor: pointer;
  font: 700 1rem var(--font); color: var(--ink); background: var(--card-2);
  transition: transform .1s ease, box-shadow .15s ease, filter .15s ease; text-decoration: none;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.04); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .tile:focus-visible, .node:focus-visible, .profile-card:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink); box-shadow: 0 6px 16px rgba(106, 76, 255, .35); }
.btn.secondary { background: var(--primary-soft); color: var(--primary); }
:root[data-theme="dark"] .btn.secondary { color: #d8d0ff; }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover:not(:disabled) { background: var(--card-2); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.big { padding: 14px 24px; font-size: 1.1rem; border-radius: 16px; }
.btn.small { padding: 7px 12px; font-size: .9rem; border-radius: 10px; }
.btn kbd { border-color: currentColor; }
.link { background: none; border: 0; color: var(--primary); font: 700 1rem var(--font); cursor: pointer; text-decoration: underline; padding: 0; }

.mascot { display: inline-block; font-size: 3.4rem; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,.12)); }
.mascot.big, .welcome .mascot { font-size: 5rem; }
.bounce { animation: bounce 2.4s ease-in-out infinite; }
.bubble {
  position: relative; background: var(--card-2); border-radius: 18px; padding: 14px 18px; font-size: 1.12rem;
}
.bubble .tip { display: block; margin-top: 6px; color: var(--ink-2); font-size: .98rem; }
.bubble.small { font-size: .98rem; padding: 10px 14px; }

.kcap {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.9em; height: 1.9em; padding: 0 .4em;
  border-radius: 8px; background: var(--key-bg); color: var(--key-ink); font-weight: 800; box-shadow: 0 2px 0 var(--key-edge);
  vertical-align: middle; font-family: var(--font);
}
.kcap.wide { padding: 0 .8em; }
.kcap.big { flex-direction: column; min-width: 3.4em; height: auto; padding: .4em .6em; font-size: 1.4rem; }
.kcap.big small { font-size: .55em; font-weight: 600; color: var(--bad); }
.fc-pinky { background: var(--f-pinky); }
.fc-ring { background: var(--f-ring); }
.fc-middle { background: var(--f-middle); }
.fc-index { background: var(--f-index); }
.fc-thumb { background: var(--f-thumb); }
.stars { display: inline-flex; gap: 1px; letter-spacing: 0; }
.stars i { font-style: normal; color: var(--star-off); }
.stars i.on { color: var(--star); text-shadow: 0 1px 0 rgba(0,0,0,.08); }

/* ---------- Sprachwahl ---------- */
.lang-row { display: flex; justify-content: flex-end; }
.lang-switch button { font-size: .95rem; }
.lang-choices { display: grid; gap: 10px; margin-top: 10px; }
.lang-choice {
  display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer; padding: 12px 16px;
  border-radius: 16px; border: 3px solid transparent; background: var(--card-2); color: var(--ink); font-family: var(--font);
}
.lang-choice:hover { transform: translateY(-2px); }
.lang-choice.on { border-color: var(--primary); background: var(--primary-soft); }
.lang-choice b { display: block; font-size: 1.05rem; }
.lang-choice small { color: var(--muted); }
.lang-code {
  display: inline-grid; place-items: center; min-width: 2.2em; padding: 2px 6px; border-radius: 7px;
  font-size: .78em; font-weight: 800; letter-spacing: .04em; background: var(--primary); color: var(--primary-ink);
}
.lc-flag { font-size: 1.15rem; min-width: 2.8em; padding: 8px 6px; border-radius: 10px; }

/* ---------- Profile ---------- */
.welcome h1 { font-size: 2.3rem; margin-top: 8px; }
.profile-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.profile-card {
  width: 180px; padding: 22px 14px; border: 0; border-radius: var(--radius); background: var(--card); color: var(--ink);
  box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: var(--font); transition: transform .15s ease;
}
.profile-card:hover { transform: translateY(-4px) rotate(-1deg); }
.profile-card .av { font-size: 3.6rem; line-height: 1.1; }
.profile-card .pname { font-weight: 800; font-size: 1.2rem; }
.profile-card .psub { color: var(--muted); font-size: .9rem; }
.profile-card.new { background: transparent; border: 3px dashed var(--line); box-shadow: none; }
.profile-card.new .av { color: var(--primary); font-weight: 300; }

/* ---------- Overlays ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(20, 22, 50, .45); backdrop-filter: blur(3px); animation: fade-in .2s ease;
}
.modal-card {
  width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; text-align: center;
  background: var(--card); border-radius: 26px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.3);
  animation: pop-in .3s cubic-bezier(.2, 1.4, .4, 1);
}
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.modal-actions.col { flex-direction: column; align-items: stretch; max-width: 320px; margin-left: auto; margin-right: auto; }
.big-emoji { font-size: 3.6rem; line-height: 1.1; margin-bottom: 6px; }
.field { display: flex; flex-direction: column; gap: 8px; text-align: left; margin: 14px 0; font-weight: 700; }
.field.center { align-items: center; text-align: center; }
.field input, .inline-form input {
  font: 600 1.15rem var(--font); padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--card-2); color: var(--ink); outline: none;
}
.field input:focus, .inline-form input:focus { border-color: var(--primary); }
.field.center input { width: 130px; text-align: center; font-size: 1.5rem; }
.gate-q { font-size: 1.8rem; font-weight: 800; }
.avatar-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.av-opt { font-size: 2.2rem; width: 62px; height: 62px; border-radius: 16px; border: 3px solid transparent; background: var(--card-2); cursor: pointer; }
.av-opt.sel { border-color: var(--primary); background: var(--primary-soft); transform: scale(1.06); }
.hint { font-weight: 400; color: var(--muted); font-size: .9rem; margin: 0; }

#toast-root { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 150; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--ink); color: var(--card); padding: 12px 20px; border-radius: 14px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(16px); transition: all .3s ease; font-size: 1rem; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: none; }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 200; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: confetti-fall linear forwards; }

/* ---------- Startseite ---------- */
.home-top { display: grid; grid-template-columns: 1fr 260px; gap: 18px; margin-bottom: 18px; }
.hero { display: flex; gap: 20px; align-items: center; }
.hero-mascot .mascot { font-size: 5.5rem; }
.hero-body { flex: 1; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.goal-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.ring { width: 120px; height: 120px; }
.ring-bg { fill: none; stroke: var(--primary-soft); stroke-width: 11; }
.ring-fg { fill: none; stroke: var(--primary); stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring-fg.full { stroke: var(--good); }
.ring text { font: 800 20px var(--font); fill: var(--ink); }
.goal-text { display: flex; flex-direction: column; }
.goal-text span, .goal-streak { color: var(--ink-2); }
.level-card { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.lv-badge {
  width: 70px; height: 70px; flex: none; border-radius: 22px; display: grid; place-items: center; font: 900 2rem var(--font);
  color: #fff; background: linear-gradient(135deg, #ffb443, #ff6a3d); box-shadow: 0 6px 14px rgba(255, 106, 61, .35);
}
.lv-body { flex: 1; }
.lv-title { font-weight: 800; font-size: 1.2rem; margin-bottom: 6px; }
.lv-sub { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.lv-side { display: flex; flex-direction: column; gap: 4px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tile {
  border: 0; text-align: left; cursor: pointer; background: var(--card); color: var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 4px; font-family: var(--font);
  transition: transform .15s ease;
}
.tile:hover { transform: translateY(-4px); }
.tile-ic { font-size: 2.2rem; }
.tile-t { font-weight: 800; font-size: 1.15rem; }
.tile-s { color: var(--muted); font-size: .92rem; }

/* ---------- Lernpfad ---------- */
.world { margin-bottom: 20px; border-top: 6px solid var(--wc); position: relative; overflow: hidden; }
.world::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--wc) 10%, transparent), transparent 60%); pointer-events: none; }
.world.locked { filter: grayscale(.7); opacity: .8; }
.world-head { display: flex; align-items: center; gap: 14px; position: relative; }
.world-icon { font-size: 2.8rem; }
.world-name { flex: 1; }
.world-name h2 { margin: 0; }
.world-name p { margin: 0; color: var(--ink-2); }
.world-stars { font-weight: 800; background: var(--card-2); padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.path { display: flex; justify-content: space-around; align-items: flex-start; gap: 8px; padding: 26px 0 6px; position: relative; flex-wrap: wrap; }
.path::before {
  content: ""; position: absolute; left: 8%; right: 8%; top: 68px; border-top: 5px dotted color-mix(in srgb, var(--wc) 50%, transparent);
}
.node {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer; width: 130px; display: flex;
  flex-direction: column; align-items: center; gap: 6px; font-family: var(--font); color: var(--ink); padding: 0;
}
.node:nth-child(even) { margin-top: 26px; }
.node-circle {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font: 900 1.9rem var(--font);
  background: var(--card); color: var(--wc); border: 5px solid var(--wc); box-shadow: var(--shadow-sm);
  transition: transform .15s ease;
}
.node:hover .node-circle { transform: scale(1.08); }
.node.done .node-circle { background: var(--wc); color: #fff; }
.node.current .node-circle { animation: pulse-ring 1.6s ease-out infinite; transform: scale(1.06); }
.node.locked { cursor: not-allowed; }
.node.locked .node-circle { border-color: var(--line); color: var(--muted); background: var(--card-2); font-size: 1.6rem; }
.node .stars { font-size: 1.3rem; }
.node-title { font-weight: 700; font-size: .95rem; text-align: center; }

/* ---------- Lektions-Einstieg ---------- */
.world-tag { font-weight: 700; padding: 6px 14px; border-radius: 999px; background: color-mix(in srgb, var(--wc) 18%, var(--card)); }
.best { color: var(--ink-2); font-weight: 600; }
.best .stars { font-size: 1.2rem; }
.intro-card { padding: 26px; }
.intro-top { display: flex; gap: 26px; align-items: center; margin-bottom: 14px; }
.bigkeys { display: flex; gap: 12px; flex-wrap: wrap; max-width: 300px; justify-content: center; }
.bigkey {
  width: 96px; height: 96px; border-radius: 22px; display: grid; place-items: center; font: 900 3rem var(--font);
  background: var(--card); color: var(--ink); border: 3px solid var(--accent); box-shadow: 0 6px 0 var(--key-edge), 0 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent);
  animation: float 3s ease-in-out infinite;
}
.bigkey:nth-child(2) { animation-delay: .4s; }
.bigkey:nth-child(3) { animation-delay: .8s; }
.bigkeys.many .bigkey { width: 52px; height: 52px; font-size: 1.6rem; border-radius: 14px; }
.bigkey.wide { width: auto; padding: 0 20px; font-size: 2.4rem; }
.intro-text { flex: 1; font-size: 1.1rem; }
.intro-text h1 { font-size: 2.1rem; }
.finger-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.finger-list.cols { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.finger-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.intro-visual { display: flex; gap: 20px; align-items: flex-end; justify-content: center; flex-wrap: wrap; }
.intro-kb { flex: 1 1 560px; max-width: 820px; }
.intro-hands { flex: 0 0 260px; }
.try-line { text-align: center; margin: 14px 0; padding: 10px; border-radius: 14px; background: var(--card-2); font-size: 1.05rem; min-height: 46px; }
.intro-bottom { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mascot-tip { display: flex; align-items: center; gap: 12px; flex: 1 1 340px; }
.intro-go { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.star-req { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; color: var(--ink-2); font-size: .92rem; }
.star-req .stars { font-size: 1rem; }

/* ---------- Bildschirm-Tastatur ---------- */
.kb { container-type: inline-size; width: 100%; padding: 12px; border-radius: 18px; background: var(--card-2); user-select: none; }
.kb-inner {
  --g: 0.55cqw;
  --u: calc((100cqw - 14 * var(--g)) / 15);
  --kh: calc(var(--u) * 0.92);
  display: flex; flex-direction: column; gap: var(--g);
}
.kb-row { display: flex; gap: var(--g); align-items: flex-start; }
.key {
  position: relative; flex: none;
  width: calc(var(--w, 1) * var(--u) + (var(--w, 1) - 1) * var(--g)); height: var(--kh);
  border-radius: calc(var(--u) * .16); background: var(--key-bg); color: var(--key-ink);
  box-shadow: 0 calc(var(--u) * .05) 0 var(--key-edge);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: calc(var(--u) * .36); font-weight: 700; line-height: 1;
  transition: transform .08s ease, background .15s ease, opacity .2s ease;
}
.key .k-top { font-size: .68em; opacity: .55; margin-bottom: .12em; }
.key .k-mod { font-size: .78em; font-weight: 600; opacity: .7; }
.key.seg1 { border-bottom-left-radius: 0; border-bottom-right-radius: 0; height: calc(var(--kh) + var(--g)); margin-bottom: calc(-1 * var(--g)); box-shadow: none; }
.key.seg2 { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: calc(-1 * var(--g)); height: calc(var(--kh) + var(--g)); }
.key.bump::after { content: ""; position: absolute; bottom: 16%; width: 26%; height: 3px; border-radius: 2px; background: currentColor; opacity: .55; }
.kb.colored .key.fc-pinky { background: var(--f-pinky); }
.kb.colored .key.fc-ring { background: var(--f-ring); }
.kb.colored .key.fc-middle { background: var(--f-middle); }
.kb.colored .key.fc-index { background: var(--f-index); }
.kb.colored .key.fc-thumb { background: var(--f-thumb); }
.kb.colored .key.mod.fc-pinky { background: color-mix(in srgb, var(--f-pinky) 55%, var(--key-bg)); }
.key.dim { opacity: .28; }
.key.new { opacity: 1; outline: 3px solid var(--accent); outline-offset: 1px; animation: new-glow 1.4s ease-in-out infinite; z-index: 1; }
.key.target {
  opacity: 1; z-index: 2; outline: 4px solid var(--primary); outline-offset: 1px; transform: translateY(-2px);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 25%, transparent), 0 6px 14px rgba(0,0,0,.18);
}
.key.hit { animation: key-hit .25s ease; }
.key.miss { background: var(--bad) !important; color: #fff !important; animation: key-miss .25s ease; }
.key.painted.dim { opacity: 1; }

/* ---------- Hände ---------- */
.hands { width: 100%; height: auto; display: block; }
.hands .palm { fill: var(--skin); stroke: var(--skin-edge); stroke-width: 2; }
.hands .finger { stroke: var(--skin-edge); stroke-width: 2; transition: opacity .2s ease; }
.hands .finger.fc-pinky { fill: var(--f-pinky); }
.hands .finger.fc-ring { fill: var(--f-ring); }
.hands .finger.fc-middle { fill: var(--f-middle); }
.hands .finger.fc-index { fill: var(--f-index); }
.hands .finger.fc-thumb { fill: var(--f-thumb); }
.hands.has-active .finger:not(.active) { opacity: .35; }
.hands .finger.active { stroke: var(--primary); stroke-width: 5; animation: finger-pulse 1s ease-in-out infinite; }
.hand-label { font: 700 13px var(--font); fill: var(--muted); }

/* ---------- Tippen ---------- */
.typing-screen { max-width: 1120px; margin: 0 auto; }
.ts-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ts-title { flex: 1; text-align: center; }
.ts-title h1 { font-size: 1.45rem; margin: 0; }
.ts-sub { color: var(--ink-2); font-weight: 600; }
.ts-right { display: flex; align-items: center; gap: 10px; }
.round-dots { display: flex; gap: 6px; }
.round-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
.round-dots i.done { background: var(--good); }
.round-dots i.cur { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.ts-foot { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 10px; }

.tv { display: flex; flex-direction: column; gap: 12px; }
.tv-bar { display: flex; align-items: center; gap: 14px; }
.progress { flex: 1; height: 14px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow-sm); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #36d39a, #24b3e6); border-radius: 99px; transition: width .15s ease; }
.tv-chips { display: flex; gap: 8px; }
.tv-chips b { min-width: 2.2ch; text-align: right; font-variant-numeric: tabular-nums; }
.caps-warn { background: var(--bad-soft); color: var(--bad); padding: 10px 14px; border-radius: 12px; text-align: center; font-weight: 600; }
.textbox {
  position: relative; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 28px; font-family: var(--mono); font-size: var(--text-size); line-height: 1.7;
  height: calc(var(--text-size) * 1.7 * 3 + 44px); overflow: hidden; user-select: none;
}
.text { white-space: pre-wrap; word-break: normal; overflow-wrap: break-word; }
.ch { position: relative; left: 0; color: var(--ink); border-radius: 6px; transition: color .1s ease; }
.ch.done { color: var(--good); }
.ch.done.fixed { color: var(--warn-ink); }
.ch.cur { background: var(--primary-soft); box-shadow: inset 0 -4px 0 var(--primary); color: var(--ink); }
.ch.sp.cur { background: color-mix(in srgb, var(--primary) 22%, transparent); }
.ch.err { background: var(--bad-soft) !important; box-shadow: inset 0 -4px 0 var(--bad) !important; color: var(--bad) !important; animation: shake-pos .28s ease; }
.combo-pop {
  position: absolute; right: 18px; top: 10px; font: 800 1.1rem var(--font); color: var(--accent);
  opacity: 0; pointer-events: none;
}
.combo-pop.show { animation: rise 1.4s ease forwards; }
.tv-hint { text-align: center; color: var(--ink-2); font-size: 1.05rem; min-height: 2em; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.hint-sep { color: var(--muted); }
.tv-kbwrap { display: flex; gap: 18px; align-items: flex-end; justify-content: center; flex-wrap: wrap; }
.tv-kb { flex: 1 1 560px; max-width: 800px; }
.tv-hands { flex: 0 0 240px; }
.chip-btn { border: 0; cursor: pointer; font: 600 .92rem var(--font); color: var(--ink-2); }
.chip-btn:hover { color: var(--primary); transform: translateY(-1px); }
.tv-blindnote { text-align: center; color: var(--good); background: var(--good-soft); border-radius: 14px; padding: 12px 16px; font-size: 1rem; }
.tv.compact .textbox { height: calc(var(--text-size) * 1.7 * 2 + 44px); }

/* ---------- Ergebnisse ---------- */
.rstats { display: flex; justify-content: center; gap: 12px; margin: 14px 0; flex-wrap: wrap; }
.rstat { background: var(--card-2); border-radius: 16px; padding: 12px 18px; min-width: 110px; display: flex; flex-direction: column; }
.rstat b { font-size: 1.7rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.rstat span { color: var(--muted); font-size: .88rem; }
.praise { font-size: 1.1rem; font-weight: 600; color: var(--ink-2); }
.result { max-width: 720px; margin: 0 auto; }
.result-card { text-align: center; padding: 30px; }
.result-card.win { border-top: 6px solid var(--good); }
.result-card.fail { border-top: 6px solid var(--accent); }
.result-mascot { font-size: 4.5rem; line-height: 1; }
.result-sub { color: var(--ink-2); font-weight: 600; }
.stars-big { display: flex; justify-content: center; gap: 10px; margin: 8px 0; }
.sb { font-size: 4.2rem; color: var(--star-off); line-height: 1; transform: scale(.85); transition: color .2s ease; }
.sb.on { color: var(--star); animation: star-pop .55s cubic-bezier(.2, 1.6, .4, 1) forwards; text-shadow: 0 4px 12px rgba(255, 184, 28, .5); }
.xp-gain { font-weight: 900; font-size: 1.4rem; color: var(--primary); margin: 10px 0; display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { font-size: .8rem; font-weight: 700; color: var(--good); background: var(--good-soft); padding: 4px 10px; border-radius: 999px; }
.reward { margin: 12px 0; padding: 12px; border-radius: 14px; background: var(--primary-soft); font-size: 1.05rem; }
.reward.levelup { background: linear-gradient(135deg, #fff1c7, #ffd9c2); color: #6b3a00; }
:root[data-theme="dark"] .reward.levelup { background: linear-gradient(135deg, #5c4417, #5c2f1d); color: #ffe3b0; }
.reward.record { background: var(--good-soft); color: var(--good); font-weight: 800; }
.reward-av { font-size: 1.6rem; vertical-align: middle; }
.reward-ach { margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.reward-ach h3 { font-size: 1.05rem; grid-column: 1 / -1; margin: 0; }
.ach-mini { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--card-2); border-radius: 14px; padding: 8px 12px; animation: pop-in .4s ease; }
.ach-mini .ach-ic { font-size: 1.8rem; }
.ach-mini small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.25; }
.result-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* ---------- Spiele ---------- */
.game-grid, .train-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.game-card, .train-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.game-card p, .train-card p { color: var(--ink-2); flex: 1; }
.game-card .btn, .train-card .btn { align-self: stretch; }
.game-icon, .tc-ic { font-size: 3rem; line-height: 1.1; }
.game-best { font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.game-card.locked, .train-card.locked { opacity: .65; }
.lock-note { font-weight: 700; color: var(--muted); padding: 10px 0; }
.game-kb { max-width: 820px; margin: 16px auto 0; }

.blitz-stage { text-align: center; position: relative; overflow: hidden; padding-top: 34px; }
.timebar { position: absolute; top: 0; left: 0; right: 0; height: 10px; background: var(--card-2); }
.timebar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ffb443, #ff5d5d); transition: width .1s linear; }
.blitz-letter {
  width: 170px; height: 170px; margin: 6px auto 14px; border-radius: 36px; display: grid; place-items: center;
  font: 900 6rem var(--mono); background: var(--card-2); color: var(--ink); box-shadow: 0 8px 0 var(--key-edge);
}
.blitz-letter.pop { animation: pop-in .25s cubic-bezier(.2, 1.6, .4, 1); }
.blitz-letter.shake { animation: shake .3s ease; background: var(--bad-soft); }
.blitz-msg { color: var(--ink-2); font-size: 1.1rem; min-height: 3em; }

.rain-field {
  position: relative; height: min(62vh, 560px); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  background: linear-gradient(180deg, #7fb6ff 0%, #b8dcff 55%, #e6f4ff 100%);
}
:root[data-theme="dark"] .rain-field { background: linear-gradient(180deg, #14234a 0%, #1c3366 60%, #284374 100%); }
.rain-field.hurt { animation: hurt .4s ease; }
.rain-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; background: linear-gradient(180deg, #6ccf6a, #3d9b45); }
.rain-ground::before { content: "🌷 🌱 🌼 🌱 🌷 🌱 🌼 🌱 🌷 🌱 🌼 🌱 🌷"; position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 1.4rem; letter-spacing: 1.5rem; white-space: nowrap; overflow: hidden; }
.drop {
  position: absolute; left: 0; top: 0; padding: 8px 16px; border-radius: 22px 22px 22px 6px; background: #fff; color: #1c2240;
  font: 700 1.6rem var(--mono); box-shadow: 0 6px 16px rgba(20, 40, 90, .2); white-space: nowrap; will-change: transform;
}
.drop::before { content: "💧"; font-size: .8em; margin-right: 6px; }
.drop .typed { color: var(--good); }
.drop.target { outline: 4px solid var(--primary); background: #f4f1ff; }
.drop.wrong { animation: shake .25s ease; outline-color: var(--bad); }
.drop.pop { animation: burst .4s ease forwards; }
.drop.splash { animation: splash .45s ease forwards; background: var(--bad-soft); }
.rain-banner {
  position: absolute; top: 40%; left: 0; right: 0; text-align: center; font: 900 3rem var(--font); color: #fff;
  text-shadow: 0 4px 14px rgba(0,0,0,.3); opacity: 0; pointer-events: none;
}
.rain-banner.show { animation: banner 1.6s ease forwards; }
.rain-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px; background: rgba(255, 255, 255, .82); backdrop-filter: blur(2px); color: #1c2240;
}
:root[data-theme="dark"] .rain-overlay { background: rgba(18, 21, 42, .85); color: var(--ink); }
.rain-overlay p { max-width: 520px; font-size: 1.08rem; }
.ov-keys { font-weight: 700; }

.racer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.racer {
  border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink);
  font-family: var(--font); text-align: center; transition: transform .15s ease;
}
.racer:hover:not(:disabled) { transform: translateY(-4px); }
.racer.won { outline: 3px solid var(--good); }
.racer.locked { opacity: .55; cursor: not-allowed; }
.racer-ic { font-size: 3.6rem; line-height: 1.1; }
.flip { display: inline-block; transform: scaleX(-1); }
.racer-speed { color: var(--ink-2); font-weight: 600; }
.racer-state { font-weight: 700; font-size: .92rem; color: var(--muted); }
.racer.won .racer-state { color: var(--good); }

.track { position: relative; padding: 18px 22px; margin-bottom: 16px; background: linear-gradient(180deg, var(--card), var(--card-2)); }
.lane { position: relative; height: 72px; border-bottom: 3px dashed var(--line); }
.lane:last-of-type { border-bottom: 0; }
.lane-label { position: absolute; left: 0; top: 4px; font-size: .85rem; font-weight: 700; color: var(--muted); }
.lane.me .lane-label { color: var(--primary); }
.runner { position: absolute; left: 0; bottom: 4px; font-size: 2.8rem; line-height: 1; will-change: transform; }
.finish { position: absolute; right: 0; bottom: 8px; font-size: 2rem; }
.countdown {
  position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--card) 70%, transparent);
  border-radius: var(--radius); font-size: 1.2rem; font-weight: 700;
}
.cd-num { font: 900 4rem var(--font); color: var(--primary); animation: pop-in .4s ease; }
.cd-num.go { color: var(--good); }

/* ---------- Anleitung ---------- */
.guide-card { max-width: 980px; margin: 0 auto; padding: 28px 32px; }
.guide-step { color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.guide-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.guide-head h2 { margin: 0; font-size: 1.8rem; }
.guide-icon { font-size: 3.2rem; }
.guide-body { font-size: 1.15rem; max-width: 780px; }
.guide-visual { margin: 18px 0 6px; display: flex; gap: 18px; align-items: flex-end; justify-content: center; flex-wrap: wrap; }
.gv-kb { flex: 1 1 560px; max-width: 760px; }
.gv-hands { flex: 0 0 240px; }
.guide-visual .tv { flex: 1 1 100%; }
.guide-done { background: var(--good-soft); color: var(--good); padding: 12px 16px; border-radius: 14px; }
.guide-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.dots { display: flex; gap: 8px; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 0; background: var(--line); cursor: pointer; padding: 0; }
.dot.on { background: var(--primary); transform: scale(1.25); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.cmp { border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.cmp.bad { background: var(--bad-soft); }
.cmp.good { background: var(--good-soft); }
.cmp-ic { font-size: 2.4rem; }
.cmp span:last-child { color: var(--ink-2); font-size: 1rem; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 14px; align-items: flex-start; background: var(--card-2); border-radius: 14px; padding: 12px 14px; }
.checklist li > span { font-size: 1.6rem; line-height: 1.1; width: 1.6em; text-align: center; flex: none; }
.legend, .heat-legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; align-items: center; }
.lg { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .95rem; }
.lg i { width: 20px; height: 20px; border-radius: 6px; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.lg i.nodata { background: var(--key-bg); opacity: .5; }
.hl-title { font-weight: 700; color: var(--ink-2); }

/* ---------- Training & Erfolge ---------- */
.weak-keys { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.av-tile {
  border: 3px solid transparent; background: var(--card-2); border-radius: 18px; padding: 10px 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); font-family: var(--font);
}
.av-tile .av { font-size: 2.6rem; line-height: 1.15; }
.av-tile small { color: var(--muted); font-weight: 600; }
.av-tile.sel { border-color: var(--primary); background: var(--primary-soft); }
.av-tile.locked { cursor: not-allowed; }
.av-tile.locked .av { filter: grayscale(1); opacity: .4; }
.av-tile:hover:not(:disabled) { transform: translateY(-2px); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; }
.ach { display: flex; gap: 14px; align-items: center; padding: 16px; }
.ach-ic { font-size: 2.6rem; width: 64px; height: 64px; flex: none; border-radius: 18px; display: grid; place-items: center; background: var(--card-2); }
.ach.got .ach-ic { background: linear-gradient(135deg, #fff1c7, #ffd9c2); }
:root[data-theme="dark"] .ach.got .ach-ic { background: linear-gradient(135deg, #5c4417, #5c2f1d); }
.ach.locked .ach-ic { filter: grayscale(1); opacity: .45; }
.ach.locked b { color: var(--ink-2); }
.ach-body p { margin: 2px 0; color: var(--ink-2); font-size: .92rem; }
.ach-body small { color: var(--good); font-weight: 700; }

/* ---------- Statistik ---------- */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-tile { display: flex; flex-direction: column; gap: 2px; padding: 18px; }
.st-ic { font-size: 1.6rem; }
.stat-tile b { font-size: 1.7rem; font-weight: 900; }
.stat-tile span:last-child { color: var(--muted); font-size: .9rem; }
.chart-card, .heat-card { position: relative; margin-bottom: 18px; }
.chart { display: flex; gap: 8px; height: 220px; margin-top: 14px; }
.chart-y { position: relative; width: 36px; flex: none; }
.chart-y span { position: absolute; right: 0; transform: translateY(50%); font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-plot { position: relative; flex: 1; }
.gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grid); }
.baseline { position: absolute; left: 0; right: 0; bottom: 0; border-top: 1px solid var(--axis); }
.bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; max-width: 60px; }
.bar { width: min(70%, 28px); background: var(--series-1); border-radius: 4px 4px 0 0; transition: filter .15s ease; }
.bar-col.hover .bar { filter: brightness(1.15); }
.chart-x { display: flex; justify-content: space-between; margin-left: 44px; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.chart-tip {
  position: absolute; transform: translate(-50%, -100%); background: var(--ink); color: var(--card); padding: 8px 12px;
  border-radius: 10px; font-size: .88rem; pointer-events: none; white-space: nowrap; z-index: 5; box-shadow: var(--shadow);
}
.table-view { margin-top: 14px; }
.table-view summary { cursor: pointer; color: var(--primary); font-weight: 700; }
.table-view table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .92rem; }
.table-view th, .table-view td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table-view .num { text-align: right; font-variant-numeric: tabular-nums; }
.heat-kb { max-width: 820px; margin: 10px auto; }
.weak-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; margin-top: 8px; }

/* ---------- Einstellungen ---------- */
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 18px; align-items: start; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: default; }
.set-row:last-of-type { border-bottom: 0; }
label.set-row { cursor: pointer; }
.set-l { display: flex; flex-direction: column; }
.set-l small { color: var(--muted); }
.switch { position: relative; width: 54px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .2s ease; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s ease; }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(24px); }
.switch input:focus-visible + i { outline: 3px solid var(--primary); outline-offset: 2px; }
.seg { display: inline-flex; background: var(--card-2); border-radius: 12px; padding: 3px; gap: 2px; flex: none; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font: 700 .92rem var(--font); color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--primary); box-shadow: var(--shadow-sm); }
.inline-form { display: flex; gap: 8px; }
.inline-form input { width: 170px; font-size: 1rem; padding: 7px 10px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Animationen ---------- */
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { 0% { opacity: 0; transform: scale(.7); } 100% { opacity: 1; transform: scale(1); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.shake { animation: shake .3s ease; }
@keyframes shake-pos { 0%, 100% { left: 0; } 25% { left: -4px; } 75% { left: 4px; } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--wc) 55%, transparent); } 100% { box-shadow: 0 0 0 18px transparent; } }
@keyframes new-glow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 0%, transparent); } }
@keyframes key-hit { 0% { transform: translateY(2px) scale(.94); filter: brightness(1.15); } 100% { transform: none; } }
@keyframes key-miss { 0%, 100% { transform: none; } 50% { transform: translateY(2px) scale(.94); } }
@keyframes finger-pulse { 0%, 100% { stroke-width: 4; } 50% { stroke-width: 8; } }
@keyframes star-pop { 0% { transform: scale(.3) rotate(-30deg); } 70% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes rise { 0% { opacity: 0; transform: translateY(10px); } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes confetti-fall { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); } }
@keyframes burst { 0% { transform-origin: center; } 100% { opacity: 0; filter: blur(2px); margin-top: -20px; scale: 1.4; } }
@keyframes splash { 100% { opacity: 0; scale: 1.2 .5; } }
@keyframes hurt { 0%, 100% { box-shadow: var(--shadow); } 30% { box-shadow: inset 0 0 0 6px var(--bad), var(--shadow); } }
@keyframes banner { 0% { opacity: 0; scale: .6; } 20% { opacity: 1; scale: 1.1; } 80% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1; } }

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

/* ---------- Niedrige Bildschirme (z. B. Laptops mit 1280×720) ---------- */
@media (max-height: 820px) {
  #topbar { min-height: 56px; padding: 8px 0; }
  .ts-head { margin-bottom: 6px; }
  .ts-title h1 { font-size: 1.25rem; }
  .tv { gap: 8px; }
  .textbox { padding: 12px 24px; line-height: 1.6; height: calc(var(--text-size) * 1.6 * 2 + 26px); }
  .tv.compact .textbox { height: calc(var(--text-size) * 1.6 * 2 + 26px); }
  .ts-foot { display: none; }
  .tv-kb { max-width: 720px; }
  .tv-hands { flex-basis: 210px; }
  .kb { padding: 8px; }
}

/* ---------- Kleinere Bildschirme ---------- */
@media (max-width: 900px) {
  .home-top { grid-template-columns: 1fr; }
  .intro-top { flex-direction: column; text-align: center; }
  .intro-go { align-items: stretch; }
  .star-req { justify-content: center; }
  .set-grid { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .tv-hands, .intro-hands, .gv-hands { flex-basis: 200px; }
}
@media (max-width: 640px) {
  #app { padding: 0 16px 30px; }
  .ts-head .btn span { display: none; }
  .hero { flex-direction: column; text-align: center; }
  .tb-level .xpbar { width: 50px; }
  .profile-btn .pn { display: none; }
  .level-card { flex-wrap: wrap; }
  .node { width: 100px; }
  .node-circle { width: 66px; height: 66px; font-size: 1.5rem; }
  .path::before { top: 58px; }
}
