@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url('/fonts/nunito-latin.woff2') format('woff2-variations'), url('/fonts/nunito-latin.woff2') format('woff2');
}

:root {
  color-scheme: light;
  --bg: #f6f4f0;
  --surface: #ffffff;
  --ink: #23262f;
  --ink-2: #5d6270;
  --ink-3: #9aa0ad;
  --line: #e8e4dd;
  --mathe: #4f7cff;
  --deutsch: #ff6b6b;
  --sachkunde: #18b98a;
  --mix: #a06bff;
  --gold: #f5b400;
  --good: #22c55e;
  --bad: #ef4444;
  --accent: #4f7cff;
  --radius: 22px;
  --shadow: 0 1px 0 rgba(30, 30, 40, 0.04), 0 8px 24px rgba(30, 30, 40, 0.06);
  --r-common: #cfd5de;
  --r-uncommon: #5fd39a;
  --r-rare: #5aa2ff;
  --r-epic: #b57bff;
  --r-legendary: #ffc93c;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
img { user-select: none; -webkit-user-drag: none; }
#app { min-height: 100%; }
.screen {
  max-width: 880px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ Bausteine */

.btn {
  --c: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 24px;
  border-radius: 18px;
  background: var(--c);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 70%, #000);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 70%, #000); }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: 0 4px 0 var(--line); border: 2px solid var(--line); }
.btn.ghost:active { box-shadow: 0 1px 0 var(--line); }
.btn[disabled] { filter: grayscale(1); opacity: 0.45; pointer-events: none; }
.btn.wide { width: 100%; }

.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 22px;
  flex: none;
}
.icon-btn:active { transform: scale(0.94); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.coin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3b0 0 18%, #ffd43b 40%, #f0a500 100%);
  box-shadow: inset 0 -2px 0 rgba(160, 90, 0, 0.35), 0 1px 2px rgba(160, 90, 0, 0.3);
  display: inline-grid;
  place-items: center;
  flex: none;
}
.coin::after { content: ''; width: 11px; height: 11px; border-radius: 50%; border: 2px solid rgba(180, 110, 0, 0.45); }
.coin.sm { width: 20px; height: 20px; }
.coin.sm::after { width: 8px; height: 8px; border-width: 1.5px; }
.chip.bump { animation: bump 0.35s ease; }
@keyframes bump { 40% { transform: scale(1.15); } }
.streak { color: #ff7a1a; }

.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.topbar .grow { flex: 1; min-width: 0; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who b { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar {
  --c: var(--accent);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 16%, #fff);
  border: 3px solid var(--c);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 22px;
  color: var(--c);
  overflow: hidden;
  flex: none;
}
.avatar img { width: 118%; height: 118%; object-fit: contain; }
.avatar.lg { width: 112px; height: 112px; font-size: 48px; border-width: 4px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.muted { color: var(--ink-2); }
.small { font-size: 15px; }
h1 { font-size: clamp(28px, 6vw, 38px); line-height: 1.1; margin: 4px 0 6px; font-weight: 900; letter-spacing: -0.5px; }
h2 { font-size: 22px; margin: 28px 0 12px; font-weight: 900; }

.progress { height: 12px; border-radius: 99px; background: #ece8e1; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--accent)); transition: width 0.5s cubic-bezier(.2,.8,.2,1); }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  z-index: 100;
  animation: fadeIn 0.2s;
}

/* ------------------------------------------------------ Profilauswahl */

.pick { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.pick h1 { margin-bottom: 4px; }
.profiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 28px; }
.profile {
  --c: var(--accent);
  padding: 28px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 3px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.profile:hover { border-color: color-mix(in srgb, var(--c) 40%, transparent); }
.profile:active { transform: scale(0.97); }
.profile .name { font-size: 30px; font-weight: 900; }
.profile .level { font-weight: 800; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); padding: 4px 12px; border-radius: 99px; font-size: 15px; }
.profile .meta { display: flex; gap: 16px; color: var(--ink-2); font-weight: 700; margin-top: 4px; }
.profile .meta span { display: inline-flex; align-items: center; gap: 6px; }

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

.hello { margin: 4px 0 18px; }
.daily {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  background: #fff8e1;
  border: 2px dashed #ffd770;
  border-radius: 18px;
  font-weight: 700;
}
.subjects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 720px) { .subjects { grid-template-columns: repeat(4, 1fr); } }
.subject {
  --c: var(--accent);
  position: relative;
  padding: 18px 16px 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 150px;
  border-bottom: 5px solid color-mix(in srgb, var(--c) 75%, #000 0%);
  transition: transform 0.1s;
}
.subject:active { transform: translateY(3px); }
.subject .ico {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: color-mix(in srgb, var(--c) 14%, #fff);
}
.subject b { font-size: 21px; margin-top: auto; }
.subject small { color: var(--ink-2); font-weight: 700; font-size: 14px; }

.big-links { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
@media (min-width: 640px) { .big-links { grid-template-columns: 1fr 1fr; } }
.big-link { display: flex; align-items: center; gap: 16px; padding: 16px; text-align: left; transition: transform 0.1s; }
.big-link:active { transform: scale(0.98); }
.big-link .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.big-link b { font-size: 20px; }
.big-link .art { width: 64px; height: 84px; flex: none; position: relative; }
.mini-pack { width: 100%; height: 100%; border-radius: 10px; }
.album-art { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 72px; height: 84px; }
.album-art span { border-radius: 6px; background: #eee9e1; display: grid; place-items: center; overflow: hidden; }
.album-art img { width: 100%; height: 100%; object-fit: contain; }

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

.quiz { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.quiz .topbar { margin-bottom: 14px; }
.steps { display: flex; gap: 5px; flex: 1; }
.steps i { flex: 1; height: 12px; border-radius: 99px; background: #e8e3db; transition: background 0.3s; }
.steps i.ok { background: var(--good); }
.steps i.no { background: var(--bad); }
.steps i.now { background: color-mix(in srgb, var(--c) 45%, #e8e3db); }

.task { flex: 1; display: flex; flex-direction: column; gap: 18px; animation: slideIn 0.3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.task-head { display: flex; align-items: flex-start; gap: 12px; }
.task-head .q { flex: 1; }
.topic { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c); margin-bottom: 4px; }
.prompt { font-size: clamp(22px, 4.6vw, 30px); font-weight: 800; line-height: 1.25; }
.speak { width: 52px; height: 52px; border-radius: 50%; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); font-size: 24px; display: grid; place-items: center; flex: none; }
.speak:active { transform: scale(0.92); }
.speak.on { animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--c) 18%, transparent); } }

.visual { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 18px 12px; min-height: 120px; flex: 1 1 auto; max-height: 460px; }
.visual:empty { display: none; }
.emoji-grid { display: grid; grid-template-columns: repeat(var(--per-row), auto); gap: 6px 10px; font-size: clamp(34px, 8vw, 50px); line-height: 1.1; justify-content: center; }
.emoji-grid .gone { opacity: 0.22; position: relative; filter: grayscale(1); }
.emoji-grid .gone::after { content: '✕'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--bad); font-size: 0.8em; font-weight: 900; filter: none; }
.sum-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.sum-row .op { font-size: 44px; font-weight: 900; color: var(--ink-3); }
.big-emoji { font-size: clamp(72px, 18vw, 110px); line-height: 1; }
.big-text { font-size: clamp(34px, 8vw, 54px); font-weight: 900; text-align: center; letter-spacing: 0.5px; text-wrap: balance; }
.big-text.letter { font-size: clamp(80px, 20vw, 120px); line-height: 1; }
.big-text.eq { font-variant-numeric: tabular-nums; }
.big-text.word { letter-spacing: 1px; }
.word-gap { font-size: clamp(30px, 7vw, 42px); font-weight: 900; letter-spacing: 1px; }
.gap, .blank {
  display: inline-block;
  min-width: 1.1em;
  padding: 0 0.15em;
  border-radius: 10px;
  background: color-mix(in srgb, var(--c) 14%, #fff);
  color: var(--c);
  text-align: center;
}
.letter-box { display: inline-grid; place-items: center; width: 1.3em; height: 1.4em; margin: 0 3px; border-radius: 10px; background: #f1ede6; }
.pattern { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; font-size: clamp(34px, 8vw, 48px); }
.pattern .q { color: var(--c); font-weight: 900; }
.nline { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.nline span { min-width: 64px; height: 64px; padding: 0 10px; border-radius: 16px; background: #f1ede6; display: grid; place-items: center; font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; }
.nline span.q { background: color-mix(in srgb, var(--c) 16%, #fff); color: var(--c); }
.text-card { font-size: clamp(19px, 3.6vw, 22px); line-height: 1.5; background: #fbf9f5; border-left: 5px solid var(--c); padding: 14px 18px; border-radius: 12px; max-width: 640px; font-weight: 600; }
.dice-face { fill: #fff; stroke: #d8d2c8; stroke-width: 3; }
.dice-dot { fill: var(--ink); }
.shape { filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.12)); }
.clock-face { fill: #fff; stroke: var(--ink); stroke-width: 2.5; }
.clock .tick { stroke: #b9b3a8; stroke-width: 0.8; }
.clock .tick-h { stroke: var(--ink); stroke-width: 1.8; }
.clock-num { font-size: 8.5px; font-weight: 900; text-anchor: middle; fill: var(--ink); font-family: inherit; }
.hand-h { stroke: var(--ink); stroke-width: 4.2; stroke-linecap: round; }
.hand-m { stroke: var(--c); stroke-width: 2.6; stroke-linecap: round; }
.clock-pin { fill: var(--ink); }
.money { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; max-width: 560px; }
.coin-m { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 15px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.coin-m.copper { background: radial-gradient(circle at 35% 30%, #f6c8a0, #c87533); color: #5a2e0c; width: 52px; height: 52px; }
.coin-m.gold { background: radial-gradient(circle at 35% 30%, #fff1b8, #e0b23a); color: #5c4300; }
.coin-m.bi { background: radial-gradient(circle at 50% 50%, #f3d77a 0 45%, #c9ced6 46%); color: #3c3f45; width: 68px; height: 68px; }
.note { padding: 18px 16px; min-width: 104px; text-align: center; border-radius: 8px; font-weight: 900; font-size: 20px; color: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15); }
.note.n500 { background: linear-gradient(135deg, #9aa3ad, #6f7884); }
.note.n1000 { background: linear-gradient(135deg, #e07a6b, #b84b3d); }
.note.n2000 { background: linear-gradient(135deg, #6f9fe0, #3d6db8); }
.pencil { display: block; }
.swatch { width: 44px; height: 44px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.12); display: block; }

.answers { display: grid; gap: 12px; margin-top: auto; padding-top: 8px; }
.answers.big { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.answers.grid { grid-template-columns: 1fr 1fr; }
.answers.emoji { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.answers.pictures { grid-template-columns: 1fr 1fr; }
.answers.list { grid-template-columns: 1fr; }
.opt {
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 3px solid var(--line);
  box-shadow: 0 4px 0 var(--line);
  font-weight: 800;
  font-size: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  transition: transform 0.08s, box-shadow 0.08s, border-color 0.15s, background 0.15s;
}
.opt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.answers.big .opt { font-size: clamp(30px, 7vw, 42px); min-height: 92px; }
.answers.list .opt { font-size: 20px; text-align: left; align-items: flex-start; }
.answers.pictures .opt { min-height: 150px; }
.answers.pictures .emoji-grid { font-size: clamp(26px, 6vw, 36px); }
.upper .opt { text-transform: uppercase; letter-spacing: 0.5px; }
.opt-emoji { font-size: clamp(40px, 10vw, 54px); line-height: 1.1; }
.opt-sub { font-size: 17px; font-weight: 800; color: var(--ink-2); }
.claps { font-size: 26px; letter-spacing: -2px; }
.opt.ok { border-color: var(--good); background: #eafbf0; box-shadow: 0 4px 0 #9fe3b8; }
.opt.no { border-color: var(--bad); background: #fdecec; box-shadow: 0 4px 0 #f5b0b0; animation: shake 0.4s; }
.opt.dim { opacity: 0.45; }
.answers.locked .opt { pointer-events: none; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.num-entry { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.num-display {
  height: 76px;
  border-radius: 20px;
  border: 3px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 40px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.num-display .ph { color: var(--ink-3); }
.num-display .unit { font-size: 22px; color: var(--ink-2); }
.num-display.ok { border-color: var(--good); background: #eafbf0; }
.num-display.no { border-color: var(--bad); background: #fdecec; animation: shake 0.4s; }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.numpad button { height: 60px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); font-size: 26px; font-weight: 900; }
.numpad button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.numpad .go { background: var(--good); color: #fff; border-color: transparent; box-shadow: 0 3px 0 #15803d; }
.numpad .del { color: var(--ink-2); }
@media (min-width: 700px) { .num-entry { max-width: 420px; width: 100%; margin-left: auto; margin-right: auto; } }

.feedback {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  background: #fff;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08);
  border-radius: 24px 24px 0 0;
  animation: up 0.25s ease;
  z-index: 20;
}
.feedback .in { max-width: 880px; margin: 0 auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.feedback .msg { flex: 1; min-width: 220px; }
.feedback .msg b { font-size: 22px; display: block; }
.feedback.no { background: #fff5f5; }
.feedback.no b { color: var(--bad); }
.feedback.ok { background: #f2fdf6; }
.feedback.ok b { color: #16a34a; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }

.float-delta {
  position: fixed;
  z-index: 60;
  font-weight: 900;
  font-size: 28px;
  pointer-events: none;
  animation: floatUp 1s ease forwards;
  display: flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 2px 0 #fff;
}
.float-delta.plus { color: #d99a00; }
.float-delta.minus { color: var(--bad); }
@keyframes floatUp { from { opacity: 0; transform: translateY(10px) scale(0.8); } 20% { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-60px); } }

/* ------------------------------------------------------- Rundenende */

.done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 30px; }
.stars { display: flex; gap: 10px; font-size: 64px; }
.stars span { filter: grayscale(1) opacity(0.25); transform: scale(0.6); transition: 0.4s cubic-bezier(.2,1.6,.4,1); }
.stars span.on { filter: none; transform: none; }
.earn { width: 100%; max-width: 420px; padding: 8px 18px; text-align: left; }
.earn div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.earn div:last-child { border: 0; font-size: 22px; font-weight: 900; }
.earn .v { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.done .actions { display: grid; gap: 12px; width: 100%; max-width: 420px; margin-top: 8px; }

/* ------------------------------------------------------------- Packs */

.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.pack-tile { padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.pack-tile .pk { width: 150px; height: 210px; }
.pack-tile h3 { margin: 0; font-size: 22px; font-weight: 900; }
.pack-tile p { margin: 0; color: var(--ink-2); font-weight: 600; font-size: 16px; }
.pack-tile .need { width: 100%; font-weight: 800; font-size: 15px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }

.pack {
  --p1: #4f7cff;
  --p2: #7aa2ff;
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.35), transparent 45%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 8px, transparent 8px 16px),
    linear-gradient(160deg, var(--p1), var(--p2));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25), 0 10px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.pack::before, .pack::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 7%;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 4px, rgba(255, 255, 255, 0.15) 4px 8px);
}
.pack::before { top: 0; }
.pack::after { bottom: 0; }
.pack .emblem { position: absolute; left: 50%; top: 42%; width: 58%; transform: translate(-50%, -50%); filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25)); }
.pack .emblem img { width: 100%; display: block; }
.pack .pname { position: absolute; left: 0; right: 0; bottom: 12%; text-align: center; color: #fff; font-weight: 900; font-size: clamp(12px, 9cqw, 22px); letter-spacing: 0.5px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2); }
.pack { container-type: inline-size; }
.pack .shine { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%); background-size: 250% 100%; animation: sweep 3.2s ease-in-out infinite; }
@keyframes sweep { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.pack.basis { --p1: #4f7cff; --p2: #49c6ff; }
.pack.glitzer { --p1: #b05cff; --p2: #ff6fb5; }
.pack.legenden { --p1: #f59e0b; --p2: #ffd84d; }
.pack.legenden .pname { color: #6b3a00; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); }

/* ------------------------------------------------------------- Karten */

.pcard {
  --frame: var(--r-common);
  --w: 240px;
  container-type: inline-size;
  position: relative;
  width: var(--w);
  aspect-ratio: 63 / 88;
  color: var(--ink);
  text-align: left;
  transition: transform 0.15s ease-out;
  user-select: none;
}
.pcard-frame {
  position: absolute;
  inset: 0;
  border-radius: 5.5cqw;
  padding: 3cqw;
  background: var(--frame);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06), 0 10px 26px rgba(30, 30, 50, 0.16);
  overflow: hidden;
}
.pcard.r-uncommon { --frame: linear-gradient(150deg, #7fe0b0, #3dbb7d); }
.pcard.r-rare { --frame: linear-gradient(150deg, #8fc2ff, #3b82f6); }
.pcard.r-epic { --frame: linear-gradient(150deg, #d4b0ff, #8b5cf6 60%, #c084fc); }
.pcard.r-legendary { --frame: linear-gradient(150deg, #fff1a8, #ffc93c 35%, #f59e0b 65%, #ffe27a); }
.pcard.f-gold { --frame: linear-gradient(150deg, #fff7c2, #e7b416 30%, #b8860b 55%, #ffe680 80%, #c9971a); }
.pcard.f-rainbow { --frame: linear-gradient(135deg, #ff9a9e, #fad0c4, #fbc2eb, #a1c4fd, #c2e9fb, #d4fc79, #96e6a1); }
.pcard-body {
  position: relative;
  height: 100%;
  border-radius: 3.4cqw;
  background: linear-gradient(180deg, #fff 0%, #fbfaf8 100%);
  display: flex;
  flex-direction: column;
  padding: 3.4cqw 4cqw 3.4cqw;
  gap: 2.5cqw;
}
.pcard-head { display: flex; justify-content: space-between; align-items: baseline; gap: 2cqw; }
.pcard-name { font-weight: 900; font-size: 9cqw; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-no { font-weight: 800; font-size: 5.2cqw; color: var(--ink-3); flex: none; }
.pcard-art {
  position: relative;
  flex: 1;
  border-radius: 3cqw;
  background:
    radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.85), transparent 62%),
    linear-gradient(160deg, color-mix(in srgb, var(--tc1) 38%, #fff), color-mix(in srgb, var(--tc2) 30%, #fff));
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: inset 0 0 0 1.2cqw rgba(255, 255, 255, 0.55);
}
.pcard-art img { width: 92%; height: 92%; object-fit: contain; filter: drop-shadow(0 2cqw 2cqw rgba(0, 0, 0, 0.18)); position: relative; z-index: 1; }
.pcard-foot { display: flex; justify-content: space-between; align-items: center; gap: 2cqw; }
.pcard-types { display: flex; gap: 1.6cqw; flex-wrap: wrap; }
.type { font-size: 4.8cqw; font-weight: 800; color: #fff; background: var(--c); padding: 0.8cqw 2.6cqw; border-radius: 99px; line-height: 1.3; }
.pcard-stars { font-size: 5.5cqw; letter-spacing: -0.3cqw; color: #f0b400; white-space: nowrap; text-shadow: 0 0.4cqw 0 rgba(0, 0, 0, 0.12); }
.pcard-genus { font-size: 4.6cqw; color: var(--ink-2); font-weight: 700; margin-top: -1.5cqw; }

/* Folien-Effekte */
.pcard-foil, .pcard-glare { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }
.pcard .pcard-foil { display: none; }
.pcard.f-holo .pcard-foil, .pcard.f-rainbow .pcard-foil, .pcard.f-gold .pcard-foil { display: block; }
.pcard.f-holo .pcard-art::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    repeating-linear-gradient(110deg, #ff7777 0%, #ffd977 6%, #a7ff83 12%, #79e0ff 18%, #b392ff 24%, #ff7ad9 30%, #ff7777 36%),
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.9) 0 0.6cqw, transparent 0.8cqw);
  background-size: 300% 300%, 9cqw 9cqw;
  background-position: var(--px, 50%) var(--py, 50%), 0 0;
  mix-blend-mode: color-dodge;
  opacity: 0.38;
  animation: foil 6s linear infinite;
}
.pcard.f-holo .pcard-foil {
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, transparent 66%);
  background-size: 260% 260%;
  background-position: var(--px, 50%) var(--py, 50%);
  mix-blend-mode: soft-light;
  animation: foil 5s linear infinite;
}
.pcard.f-rainbow .pcard-foil {
  background:
    repeating-linear-gradient(120deg, #ff6b6b 0%, #ffd93d 8%, #6bff95 16%, #4dd9ff 24%, #9b6bff 32%, #ff6bd6 40%, #ff6b6b 48%),
    repeating-radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.8) 0 0.5cqw, transparent 0.6cqw 4cqw);
  background-size: 400% 400%, 100% 100%;
  background-position: var(--px, 50%) var(--py, 50%), 0 0;
  mix-blend-mode: color-dodge;
  opacity: 0.5;
  animation: foil 7s linear infinite;
}
.pcard.f-gold .pcard-foil {
  background:
    linear-gradient(115deg, transparent 25%, rgba(255, 236, 160, 0.9) 45%, rgba(255, 255, 255, 0.9) 50%, rgba(255, 210, 90, 0.8) 55%, transparent 75%),
    radial-gradient(circle at 20% 20%, rgba(255, 245, 200, 0.9) 0 0.6cqw, transparent 0.8cqw);
  background-size: 300% 300%, 7cqw 7cqw;
  background-position: var(--px, 50%) var(--py, 50%), 0 0;
  mix-blend-mode: overlay;
  opacity: 0.8;
  animation: foil 4.5s linear infinite;
}
.pcard.f-gold .pcard-body { background: linear-gradient(180deg, #fffdf2, #fff6d6); }
.pcard.f-gold .pcard-name { color: #8a6100; }
.pcard.f-rainbow .pcard-body { background: linear-gradient(180deg, #fff, #fbf6ff); }
.pcard.interactive .pcard-foil, .pcard.interactive .pcard-art::after { animation: none; }
.pcard-glare { background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.55), transparent 50%); opacity: 0; transition: opacity 0.2s; mix-blend-mode: overlay; }
.pcard.interactive .pcard-glare { opacity: 1; }
@keyframes foil { 0% { background-position: 0% 0%, 0 0; } 50% { background-position: 100% 100%, 0 0; } 100% { background-position: 0% 0%, 0 0; } }

.finish-badge { position: absolute; top: -2px; right: -2px; z-index: 3; font-size: 4.6cqw; font-weight: 900; padding: 1cqw 3cqw; border-radius: 0 0 0 3cqw; color: #fff; background: linear-gradient(90deg, #ff6bd6, #6b8bff); }
.f-gold .finish-badge { background: linear-gradient(90deg, #d4a017, #f5c842); color: #4a3500; }

/* Kartenrückseite */
.pback {
  container-type: inline-size;
  width: var(--w, 240px);
  aspect-ratio: 63 / 88;
}
.pback-in {
  height: 100%;
  border-radius: 5.5cqw;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.18), transparent 50%),
    repeating-conic-gradient(from 0deg at 50% 50%, #2c3a8a 0 10deg, #34449c 10deg 20deg);
  border: 3.6cqw solid #1f2a66;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}
.pback .ball { width: 46%; aspect-ratio: 1; }

/* ------------------------------------------------------- Pack öffnen */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: radial-gradient(circle at 50% 40%, #2b3166 0%, #12152b 70%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: fadeIn 0.25s;
  padding: 16px;
}
.overlay .hint { position: absolute; bottom: max(32px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; font-weight: 800; font-size: 20px; opacity: 0.85; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; } }
.overlay .close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: none; z-index: 5; }
.rays {
  position: absolute;
  width: 160vmax;
  height: 160vmax;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.07) 0 8deg, transparent 8deg 20deg);
  animation: spin 30s linear infinite;
  pointer-events: none;
  mask-image: radial-gradient(circle, #000 0%, transparent 60%);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 60%);
}
.rays.hot { background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rc) 40%, transparent) 0 8deg, transparent 8deg 20deg); animation-duration: 12s; }
@keyframes spin { to { rotate: 360deg; } }
.stage { position: relative; display: grid; place-items: center; }
.opening-pack { width: min(62vw, 250px); aspect-ratio: 5 / 7; cursor: pointer; animation: hover 2.4s ease-in-out infinite; position: relative; }
.opening-pack .pack { position: absolute; inset: 0; }
.opening-pack.shake { animation: shakePack 0.5s ease-in-out; }
.opening-pack .top { position: absolute; inset: 0 0 auto 0; height: 16%; overflow: hidden; border-radius: 14px 14px 0 0; }
.opening-pack .top .pack { height: 625%; border-radius: 14px; }
.opening-pack .bottom { position: absolute; inset: 16% 0 0 0; overflow: hidden; border-radius: 0 0 14px 14px; }
.opening-pack .bottom .pack { top: -19%; height: 119%; border-radius: 0 0 14px 14px; }
.opening-pack.torn .top { animation: tearOff 0.6s ease-in forwards; }
.opening-pack.torn .bottom { animation: dropAway 0.7s 0.35s ease-in forwards; }
@keyframes hover { 50% { transform: translateY(-10px) rotate(-1deg); } }
@keyframes shakePack { 20% { transform: rotate(-6deg); } 40% { transform: rotate(6deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(4deg); } }
@keyframes tearOff { to { transform: translate(120px, -160px) rotate(35deg); opacity: 0; } }
@keyframes dropAway { to { transform: translateY(110vh); } }

.reveal-stack { position: relative; width: min(70vw, 300px); aspect-ratio: 63 / 88; cursor: pointer; }
.reveal-stack > * { position: absolute; inset: 0; }
.flip { --w: min(70vw, 300px); perspective: 1400px; animation: rise 0.45s cubic-bezier(.2,1.2,.4,1) backwards; }
.flip .faces { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(.3,1.3,.5,1); }
.flip.open .faces { transform: rotateY(180deg); }
.flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; }
.flip .face.front { transform: rotateY(180deg); }
.flip .pcard, .flip .pback { --w: min(70vw, 300px); }
.flip.charging .pback { animation: charge 0.7s ease-in-out; }
.flip.charging .pback-in { box-shadow: 0 0 0 4px var(--rc), 0 0 60px 10px var(--rc); }
@keyframes charge { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.04) rotate(-2deg); } 60% { transform: scale(1.06) rotate(2deg); } }
.flip.gone { animation: flyOut 0.4s ease-in forwards; }
@keyframes flyOut { to { transform: translateY(40vh) scale(0.3); opacity: 0; } }
@keyframes rise { from { transform: translateY(60px) scale(0.9); opacity: 0; } }
.glow-legendary { animation: glowL 1.6s ease-in-out infinite; }
@keyframes glowL { 50% { filter: drop-shadow(0 0 28px rgba(255, 210, 80, 0.9)); } }
.glow-epic { animation: glowE 1.6s ease-in-out infinite; }
@keyframes glowE { 50% { filter: drop-shadow(0 0 22px rgba(190, 130, 255, 0.85)); } }

.reveal-label { margin-top: 18px; min-height: 64px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.reveal-label .rname { font-size: 26px; font-weight: 900; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 99px; font-weight: 900; font-size: 16px; }
.tag.new { background: #22c55e; color: #fff; animation: pop 0.4s cubic-bezier(.2,1.6,.4,1); }
.tag.variant { background: linear-gradient(90deg, #ff6bd6, #6b8bff); color: #fff; animation: pop 0.4s cubic-bezier(.2,1.6,.4,1); }
.tag.dupe { background: rgba(255, 255, 255, 0.14); color: #fff; }
.tag.rar { background: var(--rc); color: #1b1d2a; }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }
.tray { position: absolute; bottom: max(84px, calc(env(safe-area-inset-bottom) + 70px)); left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.tray .slot { width: 38px; aspect-ratio: 63 / 88; border-radius: 6px; background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.15); overflow: hidden; display: grid; place-items: center; }
.tray .slot img { width: 90%; }
.tray .slot.filled { border-color: var(--rc); background: rgba(255, 255, 255, 0.92); animation: pop 0.3s; }

.pack-summary { width: 100%; max-width: 900px; max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px 0; }
.pack-summary h2 { margin: 0; color: #fff; font-size: 28px; text-align: center; }
.pack-summary .row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.pack-summary .pcard { --w: clamp(104px, 28vw, 150px); }
.pack-summary .item { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: rise 0.4s backwards; }
.pack-summary .actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.flash { position: fixed; inset: 0; background: #fff; z-index: 70; pointer-events: none; animation: flash 0.7s ease-out forwards; }
@keyframes flash { from { opacity: 0.95; } to { opacity: 0; } }

.confetti { position: fixed; top: -12px; width: 10px; height: 14px; z-index: 80; pointer-events: none; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); } }

/* --------------------------------------------------------- Sammlung */

.album-head { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.album-head .count { display: flex; align-items: baseline; gap: 8px; }
.album-head .count b { font-size: 40px; font-weight: 900; }
.rar-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.rar-counts span { font-size: 14px; font-weight: 800; padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--rc) 22%, #fff); color: #2a2d36; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 16px 2px 6px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; height: 42px; padding: 0 16px; border-radius: 99px; background: var(--surface); border: 2px solid var(--line); font-weight: 800; font-size: 16px; white-space: nowrap; }
.filters button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; margin-top: 12px; }
.album .pcard { --w: 100%; }
.album .pcard-frame { box-shadow: 0 2px 0 rgba(0, 0, 0, 0.05), 0 4px 12px rgba(30, 30, 50, 0.1); }
.album .slot { position: relative; aspect-ratio: 63 / 88; border-radius: 12px; background: #ece8e1; display: grid; place-items: center; overflow: hidden; }
.album .slot img { width: 78%; filter: brightness(0); opacity: 0.12; }
.album .slot .no { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-weight: 900; font-size: 14px; color: #b6afa3; }
.album .owned { position: relative; display: block; transition: transform 0.1s; }
.album .owned:active { transform: scale(0.96); }
.album .count-badge { position: absolute; top: -6px; right: -6px; z-index: 4; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); }
.empty { text-align: center; color: var(--ink-2); padding: 40px 0; font-weight: 700; }

.modal { position: fixed; inset: 0; z-index: 40; background: rgba(20, 22, 35, 0.72); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn 0.2s; overflow-y: auto; }
.detail { display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 420px; width: 100%; margin: auto; }
.detail .pcard { --w: min(78vw, 320px); }
.detail .info { width: 100%; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.detail .info h3 { margin: 0; font-size: 26px; font-weight: 900; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.detail .facts { display: flex; gap: 16px; flex-wrap: wrap; color: var(--ink-2); font-weight: 700; font-size: 15px; }
.detail .flavor { margin: 0; line-height: 1.5; font-size: 17px; }
.finishes { display: flex; gap: 8px; flex-wrap: wrap; }
.finishes button { height: 38px; padding: 0 12px; border-radius: 99px; border: 2px solid var(--line); background: #fff; font-weight: 800; font-size: 14px; }
.finishes button.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.finishes button[disabled] { opacity: 0.35; }

.voice-picker { width: 100%; max-width: 460px; margin: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.voice-picker h3 { margin: 0; font-size: 24px; font-weight: 900; }
.voice-picker p { margin: 0; }
.voice-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.voice-opt { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line); background: #fff; text-align: left; }
.voice-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, #fff); }
.voice-opt .vname { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.voice-opt .vname b { font-size: 18px; }
.voice-opt .vname small { color: var(--ink-2); font-weight: 700; font-size: 14px; }
.voice-opt .vbadge { font-size: 13px; font-weight: 900; color: #fff; background: var(--good); padding: 3px 10px; border-radius: 99px; flex: none; }
.voice-opt .vplay { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, #fff); color: var(--accent); flex: none; font-size: 14px; }
.voice-tip { font-size: 15px; line-height: 1.45; background: #fff8e1; border-radius: 14px; padding: 12px 14px; font-weight: 600; }

/* ------------------------------------------------- Tagesaufgaben & Co. */

.quests { margin-top: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.quests-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.quests-head b { font-size: 19px; }
.quest { display: flex; align-items: center; gap: 12px; }
.quest .qico { font-size: 24px; width: 32px; text-align: center; flex: none; }
.quest .qtxt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 16px; }
.quest .progress { height: 8px; }
.quest .qval { font-weight: 900; font-variant-numeric: tabular-nums; color: var(--ink-2); flex: none; }
.quest.done .qtxt > span:first-child { color: var(--ink-2); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, 0.25); }
.quest.done .qval { color: #16a34a; }
.badge { position: absolute; top: -8px; right: -8px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 14px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); z-index: 2; }
.pk { position: relative; }
.mission-art { display: grid; place-items: center; font-size: 46px; background: #fff4d6; border-radius: 14px; }

.celebrations { position: fixed; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.celebrate { background: #fff; border-radius: 18px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); border: 3px solid #fcd34d; font-weight: 800; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; animation: dropIn 0.35s cubic-bezier(.2,1.4,.4,1); transition: opacity 0.4s, transform 0.4s; }
.celebrate b { font-size: 18px; }
.celebrate span { display: inline-flex; align-items: center; gap: 4px; color: #b45309; }
.celebrate.out { opacity: 0; transform: translateY(-10px); }
@keyframes dropIn { from { opacity: 0; transform: translateY(-30px) scale(0.9); } }

.missions { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.mission { padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.mission .m-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.mission .m-main b { font-size: 17px; }
.mission .progress { height: 9px; }
.mission .m-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.mission.ready { border: 3px solid #fcd34d; background: #fffbeb; }
.mission.claimed { opacity: 0.6; }
.mission .m-done { font-size: 26px; color: var(--good); font-weight: 900; flex: none; }
.m-faces { display: flex; gap: 4px; flex-wrap: wrap; }
.m-faces img { width: 36px; height: 36px; object-fit: contain; background: #f3efe8; border-radius: 10px; }
.m-faces img.missing { filter: brightness(0); opacity: 0.18; }

.regions { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.regions::-webkit-scrollbar { display: none; }
.regions button { flex: none; display: flex; flex-direction: column; align-items: center; padding: 8px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; }
.regions button b { font-size: 15px; }
.regions button small { font-size: 12px; color: var(--ink-2); font-weight: 800; font-variant-numeric: tabular-nums; }
.regions button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.regions button.on small { color: #d1d5db; }

.gift-box { background: #fdf2f8; border: 2px dashed #f9a8d4; border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.gift-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.gift-btns .btn { min-height: 46px; font-size: 16px; padding: 0 16px; }
.gift-inbox { width: 100%; max-width: 520px; margin: auto; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.gift-inbox h3 { margin: 0; font-size: 24px; font-weight: 900; }
.gift-inbox .row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.gift-inbox .item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gift-inbox .pcard { --w: 130px; }

.trace-area { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: auto 0; }
.trace-box { position: relative; width: min(100%, 440px, 52vh); aspect-ratio: 1; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.trace-box canvas { position: absolute; inset: 0; }
.trace-ink { touch-action: none; cursor: crosshair; }
.trace-ink.done { filter: hue-rotate(80deg) saturate(1.4); }
.trace-hint { min-height: 24px; font-weight: 800; color: #b45309; text-align: center; }
.trace-actions { display: flex; gap: 12px; width: min(100%, 440px); }
.trace-actions .btn { flex: 1; }

/* -------------------------------------------------------- Elternbereich */

.parent-link { margin: 28px auto 0; padding: 10px 18px; border-radius: 99px; color: var(--ink-2); font-weight: 800; font-size: 16px; }
.parent-link:hover { background: rgba(0, 0, 0, 0.04); }
.parent-lock .pin-dots { display: flex; justify-content: center; gap: 16px; margin: 28px 0 8px; }
.pin-dots i { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--ink-3); transition: background 0.15s, border-color 0.15s; }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }
.pin-dots.shake { animation: shake 0.4s; }
.pin-msg { min-height: 26px; color: var(--bad); font-weight: 800; }
.pin-pad { width: 100%; max-width: 320px; margin: 10px auto 0; }
.kids { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.kid { padding: 18px; display: flex; flex-direction: column; gap: 14px; border-top: 5px solid var(--c); }
.kid-head { display: flex; align-items: center; gap: 12px; }
.kid-head b { font-size: 22px; display: block; }
.kid-head small { color: var(--c); font-weight: 800; }
.kid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.kid-stats div { background: #f7f4ef; border-radius: 14px; padding: 10px; display: flex; flex-direction: column; }
.kid-stats b { font-size: 20px; font-variant-numeric: tabular-nums; }
.kid-stats span { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.subj-wrap { overflow-x: auto; }
.subj { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.subj th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); padding: 0 4px 6px; white-space: nowrap; }
.subj td { padding: 8px 4px; border-top: 1px solid var(--line); font-weight: 700; white-space: nowrap; }
.subj th:first-child, .subj td:first-child { padding-left: 0; }
.kid-ctrl { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.ctrl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 16px; }
.ctrl-row select { font: inherit; font-weight: 800; padding: 6px 10px; border-radius: 10px; border: 2px solid var(--line); background: #fff; }
.switch { appearance: none; width: 50px; height: 30px; border-radius: 99px; background: #d6d1c8; position: relative; cursor: pointer; transition: background 0.2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.switch:checked { background: var(--good); }
.switch:checked::after { transform: translateX(20px); }
.coin-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.coin-btns button { padding: 6px 10px; border-radius: 10px; border: 2px solid var(--line); background: #fff; font-weight: 900; font-size: 15px; color: #16a34a; }
.coin-btns button.minus { color: var(--bad); }
.coin-btns button:active { transform: scale(0.95); }
.focus-picker { width: 100%; max-width: 560px; margin: auto; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.focus-picker h3 { margin: 0; font-size: 22px; font-weight: 900; }
.focus-picker h4 { margin: 12px 0 2px; font-size: 17px; }
.focus-picker p { margin: 0; }
.focus-list { display: flex; flex-direction: column; }
.focus-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; flex: none; }
.seg button { padding: 5px 9px; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.seg button + button { border-left: 2px solid var(--line); }
.seg button.on { background: var(--ink); color: #fff; }
.seg button.on[data-v="0"] { background: var(--bad); }
.seg button.on[data-v="3"] { background: var(--good); }
.focus-actions { display: flex; gap: 10px; margin-top: 12px; position: sticky; bottom: 0; background: #fff; padding-top: 8px; }
.focus-actions .btn { flex: 1; }
.setting { padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.setting > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.setting small { color: var(--ink-2); font-weight: 700; }

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