:root {
  --bg: #f4f2fb;
  --card: #ffffff;
  --card-2: #f8f7fd;
  --ink: #1e1b3a;
  --muted: #6b6889;
  --line: #e3e0f2;
  --primary: #5b4bdb;
  --primary-ink: #ffffff;
  --primary-soft: #ebe8ff;
  --good: #1f9d63;
  --good-soft: #e1f6ea;
  --warn: #d98200;
  --warn-soft: #fff1d9;
  --bad: #d93f4c;
  --bad-soft: #fde6e8;
  --fire: #ff7a1a;
  --gold: #f5b400;
  --shadow: 0 1px 2px rgba(30, 27, 58, .06), 0 4px 16px rgba(30, 27, 58, .06);
  --radius: 18px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --box0: #c9c6dc; --box1: #e5484d; --box2: #f76b15; --box3: #f5b400; --box4: #9bc53d; --box5: #2fb36d; --box6: #13856b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14122b; --card: #1f1c3d; --card-2: #262349; --ink: #f1efff; --muted: #a4a0c8; --line: #34305c;
    --primary: #8b7dff; --primary-ink: #14122b; --primary-soft: #2d2860;
    --good: #3ccf8e; --good-soft: #173a2c; --warn: #ffb547; --warn-soft: #3d2f12; --bad: #ff6b76; --bad-soft: #43202a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    --box0: #4a4670;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.boot { display: grid; place-items: center; height: 100dvh; font-size: 3rem; animation: pulse 1s infinite alternate; }

/* ------------------------------------------------------------ Layout */
.page { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
.page.wide { max-width: 1040px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-top: env(safe-area-inset-top); }
.topbar .grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card, .card + .section, .section + .card, .section + .section { margin-top: 16px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 4px 10px; }
.section-title h2 { margin: 0; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty .big { font-size: 3rem; display: block; margin-bottom: 8px; }

/* ------------------------------------------------------------ Bottom nav */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; gap: 4px;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.nav a {
  flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: .75rem; font-weight: 600; padding: 6px 4px; border-radius: 12px;
}
.nav a .ico { font-size: 1.35rem; line-height: 1; }
.nav a.active { color: var(--primary); background: var(--primary-soft); }

/* ------------------------------------------------------------ Buttons */
.btn {
  appearance: none; border: 0; cursor: pointer; border-radius: 14px; padding: 12px 18px; font-weight: 700;
  background: var(--card-2); color: var(--ink); box-shadow: inset 0 -3px 0 rgba(0,0,0,.08);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  transition: transform .08s ease, filter .15s;
  text-decoration: none;
}
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.good { background: var(--good); color: #fff; }
.btn.bad { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .875rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.huge { min-height: 64px; font-size: 1.2rem; border-radius: 20px; width: 100%; }
.iconbtn { appearance: none; border: 0; background: transparent; font-size: 1.4rem; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; color: var(--muted); }
.iconbtn:hover { background: var(--card-2); }

/* ------------------------------------------------------------ Forms */
label.field { display: block; }
label.field > span { display: block; font-size: .85rem; font-weight: 700; color: var(--muted); margin: 0 0 4px 2px; }
.input, select.input, textarea.input {
  width: 100%; border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 12px; min-height: 46px;
  outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--primary); }
textarea.input { min-height: 140px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { width: 22px; height: 22px; accent-color: var(--primary); }

/* ------------------------------------------------------------ Login */
.login { max-width: 460px; margin: 0 auto; padding: 32px 16px; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
.logo { text-align: center; margin-bottom: 24px; }
.logo .mark { font-size: 3.5rem; display: block; }
.logo h1 { margin: 6px 0 0; font-size: 1.9rem; letter-spacing: -.01em; }
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.who button {
  appearance: none; border: 3px solid transparent; background: var(--card); border-radius: 20px; padding: 18px 8px; cursor: pointer;
  box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; font-size: 1.05rem;
}
.who button .av { font-size: 2.6rem; line-height: 1; }
.who button.sel { border-color: var(--primary); background: var(--primary-soft); }

/* ------------------------------------------------------------ Home */
.avatar { font-size: 2.2rem; width: 52px; height: 52px; display: grid; place-items: center; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); flex: none; }
.hello { font-size: 1.35rem; font-weight: 800; margin: 0; }
.chips { display: flex; 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); font-weight: 800; font-size: .95rem; white-space: nowrap; }
.chip.fire { color: var(--fire); }
.chip.fire.cold { color: var(--muted); filter: grayscale(1); }
.chip.lvl { color: var(--primary); }
.goal { display: flex; align-items: center; gap: 16px; }
.ring { --p: 0; --c: var(--good); width: 76px; height: 76px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--card); }
.ring span { position: relative; font-weight: 800; font-size: .95rem; }
.ring.sm { width: 52px; height: 52px; }
.ring.sm::before { inset: 6px; }
.ring.sm span { font-size: .75rem; }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .4s ease; }
.bar.good > i { background: var(--good); }
.start-card { background: linear-gradient(135deg, var(--primary), #9b5de5); color: #fff; }
.start-card .btn { background: #fff; color: #3b2fb0; }
.start-card h2 { color: #fff; }
.start-card p { margin: 0 0 14px; opacity: .9; }

.lesson { display: flex; gap: 14px; align-items: center; cursor: pointer; text-decoration: none; color: inherit; }
.lesson .flag { font-size: 2rem; flex: none; }
.lesson .body { flex: 1; min-width: 0; }
.lesson .title { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson .meta { font-size: .8rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin: 2px 0 6px; }
.stars { color: var(--gold); letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: var(--line); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 800; background: var(--primary-soft); color: var(--primary); }
.badge.due { background: var(--warn-soft); color: var(--warn); }
.badge.new { background: var(--good-soft); color: var(--good); }
.badge.t-vocab { background: var(--primary-soft); color: var(--primary); }
.badge.t-grammar { background: var(--warn-soft); color: var(--warn); }
.badge.t-order { background: var(--good-soft); color: var(--good); }
.badge.t-verb { background: var(--bad-soft); color: var(--bad); }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ Practice */
.practice { max-width: 640px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 16px; padding-top: env(safe-area-inset-top); }
.p-head { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.p-head .bar { flex: 1; height: 14px; }
.p-head .bar > i { background: var(--good); }
.combo { font-weight: 800; color: var(--fire); min-width: 48px; text-align: right; transition: transform .2s; }
.combo.pop { animation: pop .35s ease; }
.p-main { flex: 1; display: flex; flex-direction: column; gap: 14px; padding-bottom: 16px; }
.p-label { font-size: .85rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.question { font-size: 1.7rem; font-weight: 800; line-height: 1.25; word-break: break-word; }
.question .gap { display: inline-block; min-width: 3ch; border-bottom: 3px solid var(--primary); color: var(--primary); }
.hint { color: var(--muted); font-size: .95rem; }
.hint::before { content: "💡 "; }
.answer-input {
  width: 100%; font-size: 1.35rem; padding: 14px 16px; border-radius: 16px; border: 3px solid var(--line); background: var(--card);
  outline: none; min-height: 60px; caret-color: var(--primary);
}
.answer-input:focus { border-color: var(--primary); }
.answer-input.good { border-color: var(--good); background: var(--good-soft); }
.answer-input.almost { border-color: var(--warn); background: var(--warn-soft); }
.answer-input.bad { border-color: var(--bad); background: var(--bad-soft); }
.answer-input.shake { animation: shake .35s; }
.specials { display: flex; flex-wrap: wrap; gap: 6px; }
.specials button { min-width: 42px; min-height: 42px; border: 0; border-radius: 10px; background: var(--card); box-shadow: var(--shadow); font-size: 1.1rem; cursor: pointer; }
.choices { display: grid; gap: 10px; }
.choice {
  appearance: none; text-align: left; border: 3px solid var(--line); background: var(--card); border-radius: 16px; padding: 14px 16px;
  font-size: 1.15rem; font-weight: 700; cursor: pointer; min-height: 58px; display: flex; gap: 12px; align-items: center;
}
.choice.compact { min-height: 50px; padding: 8px 14px; font-size: 1.05rem; }
.choice.compact small { font-weight: 600; margin-left: 6px; }
.feedback .sol u { text-decoration-color: var(--bad); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.choice .k { width: 28px; height: 28px; border-radius: 8px; background: var(--card-2); display: grid; place-items: center; font-size: .85rem; color: var(--muted); flex: none; }
.choice.good { border-color: var(--good); background: var(--good-soft); }
.choice.bad { border-color: var(--bad); background: var(--bad-soft); }
.order-target { min-height: 72px; border: 3px dashed var(--line); border-radius: 16px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 52px; }
.token { appearance: none; border: 0; border-radius: 12px; padding: 10px 14px; font-size: 1.1rem; font-weight: 700; background: var(--card); box-shadow: var(--shadow), inset 0 -3px 0 rgba(0,0,0,.06); cursor: pointer; }
.token.used { visibility: hidden; }
.intro { text-align: center; padding: 28px 18px; }
.intro .tag { display: inline-block; background: var(--good-soft); color: var(--good); font-weight: 800; padding: 4px 12px; border-radius: 99px; font-size: .85rem; }
.intro .de { font-size: 1.3rem; color: var(--muted); margin-top: 18px; }
.intro .fx { font-size: 2.2rem; font-weight: 800; margin: 6px 0 14px; color: var(--primary); word-break: break-word; }
.intro .ex { font-style: italic; color: var(--muted); }
.p-foot { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: var(--bg); }
.feedback { border-radius: 20px; padding: 14px 16px; margin-bottom: 12px; animation: slideup .25s ease; }
.feedback.good { background: var(--good-soft); color: var(--good); }
.feedback.almost { background: var(--warn-soft); color: var(--warn); }
.feedback.bad { background: var(--bad-soft); color: var(--bad); }
.feedback .head { font-weight: 800; font-size: 1.2rem; display: flex; justify-content: space-between; gap: 8px; }
.feedback .sol { color: var(--ink); font-size: 1.15rem; font-weight: 700; margin-top: 6px; word-break: break-word; }
.feedback .sol mark { background: var(--warn); color: #fff; border-radius: 4px; padding: 0 1px; }
.feedback .sub { color: var(--ink); opacity: .75; font-size: .9rem; margin-top: 4px; }
.xp-fly { position: fixed; z-index: 50; font-weight: 800; color: var(--gold); font-size: 1.4rem; pointer-events: none; animation: fly 1s ease forwards; text-shadow: 0 1px 0 rgba(0,0,0,.15); }

/* Memory */
.memory { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 560px) { .memory { grid-template-columns: repeat(4, 1fr); } }
.mcard {
  appearance: none; border: 0; border-radius: 16px; aspect-ratio: 1 / .85; cursor: pointer; padding: 6px;
  background: linear-gradient(135deg, var(--primary), #9b5de5); color: #fff; box-shadow: var(--shadow);
  display: grid; place-items: center; font-size: 1.15rem; transition: transform .2s;
}
.mcard .back { font-size: 1.8rem; font-weight: 800; opacity: .8; }
.mcard .face { display: none; flex-direction: column; align-items: center; gap: 2px; word-break: break-word; }
.mcard .face small { font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.mcard.open, .mcard .face.long b { font-size: .88rem; }
.linkbtn { appearance: none; border: 0; background: transparent; color: inherit; opacity: .9; margin-top: 12px; font-size: .9rem; cursor: pointer; text-align: left; padding: 4px 0; }
.linkbtn b { text-decoration: underline; text-underline-offset: 3px; }
.switch input[type=radio] { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }
.switch input[type=checkbox] { flex: none; }
.mcard.done { background: var(--card); color: var(--ink); transform: rotateY(0) scale(1.02); }
.mcard.open .back, .mcard.done .back { display: none; }
.mcard.open .face, .mcard.done .face { display: flex; }
.mcard.done { background: var(--good-soft); outline: 3px solid var(--good); cursor: default; }

/* App-Tastatur */
.kbd { display: flex; flex-direction: column; gap: 6px; user-select: none; -webkit-user-select: none; touch-action: manipulation; margin-top: 4px; }
.kbd .krow { display: flex; gap: 4px; justify-content: center; }
.kbd button {
  flex: 1 1 0; min-width: 0; height: 46px; border: 0; border-radius: 9px; background: var(--card); box-shadow: 0 1px 0 rgba(0,0,0,.18);
  font-size: 1.2rem; padding: 0; cursor: pointer; touch-action: manipulation;
}
.kbd button.wide { flex-grow: 1.6; font-size: 1rem; }
.kbd button.space { flex-grow: 5; }
.kbd button.on { background: var(--primary); color: var(--primary-ink); }
.kbd button:active { background: var(--primary-soft); }
.kbd .krow.special button { background: var(--primary-soft); }

/* Ende */
.result { text-align: center; padding-top: 24px; }
.result .trophy { font-size: 4.5rem; animation: pop .6s ease; }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.stat { background: var(--card); border-radius: 16px; padding: 12px 6px; box-shadow: var(--shadow); text-align: center; }
.stat b { display: block; font-size: 1.5rem; }
.stat span { font-size: .78rem; color: var(--muted); font-weight: 700; }
.ach { display: flex; gap: 12px; align-items: center; text-align: left; }
.ach .ico { font-size: 2rem; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--warn-soft); flex: none; }
.ach.locked { opacity: .45; }
.ach.locked .ico { filter: grayscale(1); background: var(--card-2); }
.achgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

/* ------------------------------------------------------------ Statistik */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .d { aspect-ratio: 1; border-radius: 7px; background: var(--card-2); position: relative; font-size: .65rem; display: grid; place-items: center; color: var(--muted); }
.cal .d.l1 { background: color-mix(in srgb, var(--good) 30%, var(--card-2)); }
.cal .d.l2 { background: color-mix(in srgb, var(--good) 60%, var(--card-2)); color: #fff; }
.cal .d.l3 { background: var(--good); color: #fff; }
.cal .d.goal::after { content: "★"; position: absolute; top: -2px; right: 1px; font-size: .6rem; color: var(--gold); }
.cal .d.today { outline: 2px solid var(--primary); }
.cal .wd { font-size: .7rem; text-align: center; color: var(--muted); font-weight: 700; }
.boxes { display: flex; height: 26px; border-radius: 10px; overflow: hidden; background: var(--line); }
.boxes > i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.list th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 8px; border-bottom: 2px solid var(--line); }
table.list td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.given { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.boxpill { display: inline-block; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 6px; color: #fff; font-weight: 800; font-size: .75rem; }

/* ------------------------------------------------------------ Admin */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; }
.tabs a { white-space: nowrap; text-decoration: none; color: var(--muted); font-weight: 800; padding: 8px 14px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow); }
.tabs a.active { background: var(--primary); color: var(--primary-ink); }
.kid { display: block; text-decoration: none; color: inherit; }
.kid .top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.kid .name { font-weight: 800; font-size: 1.15rem; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: .88rem; }
.kv b { font-weight: 800; }
.dots { display: flex; gap: 4px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--good); }
.assign { display: flex; gap: 6px; flex-wrap: wrap; }
.assign button { appearance: none; border: 2px solid var(--line); background: var(--card); border-radius: 99px; padding: 4px 10px 4px 6px; cursor: pointer; font-weight: 700; font-size: .85rem; display: inline-flex; gap: 4px; align-items: center; opacity: .55; }
.assign button.on { border-color: var(--primary); background: var(--primary-soft); opacity: 1; }
.item-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item-row:last-child { border-bottom: 0; }
.item-row .txt { flex: 1; min-width: 0; word-break: break-word; }
.item-row .arrow { color: var(--muted); }
.help { font-size: .82rem; color: var(--muted); background: var(--card-2); border-radius: 12px; padding: 10px 12px; }
.help code { background: var(--card); padding: 1px 5px; border-radius: 5px; }
details.card > summary { cursor: pointer; font-weight: 800; list-style: none; }
details.card > summary::before { content: "＋ "; color: var(--primary); }
details.card[open] > summary::before { content: "－ "; }
details.card[open] > summary { margin-bottom: 12px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.emoji-grid button { font-size: 1.7rem; aspect-ratio: 1; border: 2px solid transparent; border-radius: 12px; background: var(--card-2); cursor: pointer; }
.emoji-grid button.sel { border-color: var(--primary); background: var(--primary-soft); }

/* ------------------------------------------------------------ Modal / Toast */
.modal-back { position: fixed; inset: 0; background: rgba(15, 12, 40, .45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal { background: var(--card); width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; border-radius: 22px 22px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); animation: slideup .2s ease; }
@media (min-width: 600px) { .modal-back { align-items: center; } .modal { border-radius: 22px; } }
#toasts { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 0; right: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-weight: 700; box-shadow: var(--shadow); animation: slidedown .25s ease; max-width: 100%; }
.toast.ach { background: linear-gradient(135deg, #ffcf3f, #ff9a1f); color: #3a2400; display: flex; gap: 10px; align-items: center; }
.toast.ach .i { font-size: 1.8rem; }
.toast.err { background: var(--bad); color: #fff; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes slideup { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slidedown { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes fly { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-60px); opacity: 0; } }
@keyframes pulse { from { transform: scale(.9); } to { transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
