:root {
  --bg: #f6f5fb;
  --card: #ffffff;
  --ink: #23213a;
  --muted: #6e6b85;
  --line: #e6e3f2;
  --brand: #5b5bd6;
  --brand-2: color-mix(in srgb, var(--brand) 62%, #ffffff);
  --brand-soft: color-mix(in srgb, var(--brand) 13%, #ffffff);
  --ok: #1f9d6b;
  --ok-bg: #e3f7ee;
  --bad: #d2604f;
  --bad-bg: #fdecea;
  --warn: #c98a12;
  --warn-bg: #fff4dc;
  --gold: #e3a50f;
  --radius: 18px;
  --shadow: 0 2px 10px rgba(40, 30, 90, .07);
  --b0: #d4d1e0; --b1: #f08a7a; --b2: #f5b062; --b3: #f2d45c; --b4: #9bd77a; --b5: #3fb37f; --b6: #e3a50f;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); min-height: 100vh; }
body.focus { padding-bottom: 0; }
body.focus #nav, body.focus #top { display: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
a { color: var(--brand); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

#top { position: sticky; top: 0; z-index: 10; background: rgba(246,245,251,.92); backdrop-filter: blur(8px); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 10px; }
#top .title { font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#top .pill { background: var(--card); border-radius: 99px; padding: 4px 10px; font-weight: 600; box-shadow: var(--shadow); font-size: .9rem; }
#app { max-width: 720px; margin: 0 auto; padding: 8px 16px 24px; }

#nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 10; }
#nav a { text-decoration: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; font-size: .72rem; padding: 4px 10px; border-radius: 12px; }
#nav a span { font-size: 1.4rem; line-height: 1.2; }
#nav a.active { color: var(--brand); background: var(--brand-soft); }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 12px 18px; background: var(--brand); color: #fff; font-weight: 650; cursor: pointer; text-decoration: none; min-height: 48px; transition: transform .08s; }
.btn:active { transform: scale(.97); }
.btn.big { width: 100%; font-size: 1.15rem; padding: 16px; min-height: 60px; border-radius: 18px; }
.btn.ghost { background: var(--brand-soft); color: var(--brand); }
.btn.plain { background: transparent; color: var(--muted); }
.btn.ok { background: var(--ok); }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.sm { padding: 6px 12px; min-height: 36px; font-size: .9rem; border-radius: 10px; }
.btn:disabled { opacity: .5; }
.iconbtn { border: 0; background: var(--card); border-radius: 12px; width: 42px; height: 42px; font-size: 1.2rem; box-shadow: var(--shadow); cursor: pointer; }

label.field { display: block; font-weight: 600; font-size: .92rem; }
label.field > input, label.field > select, label.field > textarea { display: block; width: 100%; margin-top: 6px; font-weight: 400; }
input[type=text], input[type=number], input[type=time], input:not([type]), select, textarea { border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; min-height: 46px; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.switch input { width: 48px; height: 28px; accent-color: var(--brand); }

/* Profile */
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-top: 16px; }
.profile-tile { background: var(--card); border-radius: 22px; padding: 22px 10px; text-align: center; box-shadow: var(--shadow); cursor: pointer; border: 0; }
.profile-tile .av { font-size: 3.4rem; line-height: 1; }
.profile-tile .nm { font-weight: 700; font-size: 1.15rem; margin-top: 8px; }
.avatars { display: flex; flex-wrap: wrap; gap: 8px; }
.avatars button { font-size: 1.8rem; border: 2px solid transparent; background: var(--card); border-radius: 14px; width: 54px; height: 54px; cursor: pointer; }
.avatars button.sel { border-color: var(--brand); background: var(--brand-soft); }

/* Home */
.hero { display: flex; gap: 14px; align-items: center; }
.hero .av { font-size: 3rem; }
.level { height: 10px; background: #ebe9f6; border-radius: 99px; overflow: hidden; }
.level > div { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 99px; transition: width .6s; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: #f1f0f8; border-radius: 99px; padding: 4px 10px; font-size: .85rem; font-weight: 600; }
.chip.hot { background: #fff1e6; color: #c25a14; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.course-card { display: flex; gap: 14px; align-items: center; cursor: pointer; }
.course-card .flag { font-size: 2.4rem; }
.goal { height: 8px; background: #ebe9f6; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.goal > div { height: 100%; background: var(--ok); }

/* Lektionen & Häppchen */
.lesson summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.lesson summary::-webkit-details-marker { display: none; }
.lesson summary::before { content: '▸'; color: var(--muted); transition: transform .2s; }
.lesson[open] summary::before { transform: rotate(90deg); }
.chunk { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.chunk:first-of-type { border-top: 0; }
.dots { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.dot { width: 13px; height: 13px; border-radius: 50%; background: var(--b0); }
.b1 { background: var(--b1); } .b2 { background: var(--b2); } .b3 { background: var(--b3); } .b4 { background: var(--b4); } .b5 { background: var(--b5); } .b6 { background: var(--b6); }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }

/* Import */
.tabs { display: flex; background: #ebe9f6; border-radius: 14px; padding: 4px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 11px; font-weight: 600; cursor: pointer; }
.tabs button.on { background: #fff; box-shadow: var(--shadow); }
.photo-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2.5px dashed #c9c5e6; border-radius: 20px; padding: 28px 12px; text-align: center; cursor: pointer; background: #fbfaff; }
.photo-drop .ic { font-size: 2.6rem; }
.preview { max-width: 100%; max-height: 220px; border-radius: 12px; display: block; margin: 0 auto; }
.vrows { display: flex; flex-direction: column; gap: 8px; }
.vrow { display: grid; grid-template-columns: 24px 1fr 1fr 40px; gap: 6px; align-items: center; background: #fff; border-radius: 12px; padding: 8px; border: 1.5px solid var(--line); }
.vrow.sel { border-color: var(--bad); background: #fff6f5; }
.vrow .pick { width: 20px; height: 20px; accent-color: var(--bad); }
.rowtools { margin: 8px 0 4px; gap: 8px; }
.selall { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; }
.selall input { width: 20px; height: 20px; }
.vrow.incomplete { border-color: var(--warn); background: var(--warn-bg); }
.vrow input { min-height: 40px; padding: 8px; font-size: .95rem; }
.vrow .ex { grid-column: 2 / 4; font-size: .85rem; color: var(--muted); }
.vrow .del { border: 0; background: var(--bad-bg); border-radius: 10px; height: 40px; font-size: 1.1rem; cursor: pointer; }
.spinner { width: 42px; height: 42px; border: 4px solid #e2dff3; border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; margin: 10px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Training */
.train { max-width: 560px; margin: 0 auto; padding-top: calc(10px + env(safe-area-inset-top)); }
.train-top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.progress { flex: 1; height: 14px; background: #e6e3f2; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--ok), #5fd39b); border-radius: 99px; transition: width .4s; }
.combo { font-weight: 800; color: #d9661c; min-width: 52px; text-align: right; }
.qcard { background: var(--card); border-radius: 26px; box-shadow: 0 6px 24px rgba(40,30,90,.09); padding: 28px 20px; text-align: center; min-height: 190px; display: flex; flex-direction: column; justify-content: center; gap: 8px; position: relative; }
.qcard .hint { color: var(--muted); font-size: .9rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.qcard .word { font-size: 2rem; font-weight: 750; word-break: break-word; }
.qcard .word.de { color: #3d3a5c; }
.qcard .sub { font-size: 1.35rem; color: var(--brand); font-weight: 650; }
.qcard .example { color: var(--muted); font-style: italic; }
.qcard .speak { position: absolute; top: 12px; right: 12px; }
.qcard .newtag { position: absolute; top: 14px; left: 14px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .78rem; border-radius: 99px; padding: 3px 10px; }
.options { display: grid; gap: 10px; margin-top: 16px; }
.opt { border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 16px; font-size: 1.12rem; font-weight: 600; cursor: pointer; text-align: center; min-height: 60px; }
.opt.right { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.answer-input { width: 100%; font-size: 1.3rem; text-align: center; margin-top: 16px; min-height: 60px; border-radius: 16px; }
.feedback { margin-top: 14px; padding: 14px; border-radius: 16px; text-align: center; font-weight: 650; }
.feedback.ok { background: var(--ok-bg); color: var(--ok); }
.feedback.bad { background: var(--bad-bg); color: var(--bad); }
.feedback.warn { background: var(--warn-bg); color: var(--warn); }
.feedback .sol { font-size: 1.3rem; color: var(--ink); margin-top: 4px; }
.qcard .word { font-size: 2.3rem; }
.opt { font-size: 1.2rem; min-height: 66px; }
.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.94); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.slidein { animation: slidein .3s ease; }
@keyframes slidein { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

.mission { text-align: center; padding-top: 30px; }
.mission .big-emoji { font-size: 4.5rem; }
.result-xp { font-size: 2.6rem; font-weight: 800; color: var(--brand); }
.badge-pop { display: flex; gap: 12px; align-items: center; background: linear-gradient(135deg, #fff7dc, #ffeec2); border-radius: 16px; padding: 12px 14px; margin-top: 10px; }
.badge-pop .ic { font-size: 2.2rem; }
.break-card { background: linear-gradient(135deg, #e7f6ff, #eef0ff); border-radius: 20px; padding: 18px; text-align: center; }
.break-card .ex { font-size: 1.4rem; font-weight: 700; margin: 6px 0; }
.countdown { font-size: 2.4rem; font-weight: 800; color: var(--brand); }

/* Paare-Spiel */
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 12px 8px; min-height: 70px; font-weight: 650; cursor: pointer; font-size: 1rem; word-break: break-word; }
.tile.de { background: #fbfaff; }
.tile.sel { border-color: var(--brand); background: var(--brand-soft); }
.tile.done { visibility: hidden; }
.tile.bad { border-color: var(--bad); background: var(--bad-bg); }

/* Abzeichen */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge { background: var(--card); border-radius: 18px; padding: 14px; text-align: center; box-shadow: var(--shadow); }
.badge .ic { font-size: 2.6rem; }
.badge .nm { font-weight: 700; margin-top: 4px; }
.badge.locked { opacity: .45; filter: grayscale(1); }

/* Statistik */
.heat { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; max-width: 420px; }
.heat .col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heat .c { aspect-ratio: 1; border-radius: 4px; background: #ebe9f6; }
.heat .l1 { background: #c9c3f5; } .heat .l2 { background: #9d93ee; } .heat .l3 { background: #6f62e0; } .heat .l4 { background: #4636c4; }
.bars .bar { display: grid; grid-template-columns: 90px 1fr 40px; gap: 8px; align-items: center; font-size: .88rem; margin: 6px 0; }
.bars .track { height: 12px; background: #ebe9f6; border-radius: 99px; overflow: hidden; }
.bars .fill { height: 100%; border-radius: 99px; }
table.list { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.list td, table.list th { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; }

/* Modal & Toast */
#modal { position: fixed; inset: 0; background: rgba(25, 20, 50, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
#modal .sheet { background: var(--bg); width: 100%; max-width: 560px; border-radius: 24px 24px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto; animation: up .25s ease; }
@media (min-width: 700px) { #modal { align-items: center; } #modal .sheet { border-radius: 24px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 60; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Belohnungen ---------- */
#nav a { padding: 4px 6px; }
.glow { animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 184, 0, .0); } 50% { box-shadow: 0 0 0 6px rgba(255, 184, 0, .35); } }
.floating { position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 20; width: auto !important; }
.trophy-gain { font-size: 2.8rem; font-weight: 900; color: #d38a00; text-shadow: 0 2px 0 #ffe7a8; }
.rankup { display: inline-flex; gap: 12px; align-items: center; background: #fff; border: 3px solid var(--rc); border-radius: 18px; padding: 10px 18px; margin: 8px 0; text-align: left; }
.rankup .ic { font-size: 2.4rem; }
.rank-card { border: 3px solid var(--rc); background: linear-gradient(180deg, #fff, #fbf9ff); }
.chip.on { background: var(--brand); color: #fff; }
.filter { margin-bottom: 12px; }
.filter .chip { text-decoration: none; color: inherit; }

.road { padding: 8px 14px; }
.road-step { display: flex; align-items: center; gap: 12px; padding: 12px 0; position: relative; opacity: .7; }
.road-step.reached { opacity: 1; }
.road-t { width: 58px; text-align: right; font-weight: 800; font-size: 1.05rem; }
.road-t small { font-size: .7rem; margin-left: 2px; }
.road-dot { width: 18px; height: 18px; border-radius: 50%; background: #d8d4ea; border: 3px solid #fff; box-shadow: 0 0 0 2px #d8d4ea; flex-shrink: 0; }
.road-step.reached .road-dot { background: #f2b400; box-shadow: 0 0 0 2px #f2b400; }
.road-step::before { content: ''; position: absolute; left: 78px; top: 0; bottom: 0; width: 4px; background: #ebe8f6; z-index: -1; }
.road-step.reached::before { background: #ffd970; }
.road-you { margin: 6px 0 6px 50px; background: var(--brand); color: #fff; font-weight: 700; padding: 8px 12px; border-radius: 12px; display: inline-block; }

.album { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 560px) { .album { grid-template-columns: repeat(4, 1fr); } }
.tcard { --c1: #888; --c2: #ddd; position: relative; aspect-ratio: 5 / 7; border-radius: 14px; padding: 6%; display: flex; flex-direction: column;
  background: linear-gradient(160deg, var(--c1), var(--c2)); border: 4px solid #cfd3db; box-shadow: 0 4px 12px rgba(30, 20, 80, .18); color: #1d1b2e; overflow: hidden; cursor: pointer; font-size: 10px; }
.tcard.lg { width: min(78vw, 300px); margin: 0 auto; font-size: 17px; border-width: 6px; border-radius: 22px; }
.tc-top { display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, .8); border-radius: 8px; padding: 2px 6px; font-weight: 800; }
.tc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-pow { color: #c0392b; margin-left: 4px; }
.tc-art { flex: 1; display: flex; align-items: center; justify-content: center; margin: 6% 0; border-radius: 10px; background: radial-gradient(circle, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .35) 60%, transparent 75%); }
.tc-art span { font-size: 4.2em; line-height: 1; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .25)); }
.tc-type { font-weight: 700; font-size: .9em; background: rgba(255, 255, 255, .65); border-radius: 99px; padding: 1px 8px; align-self: flex-start; }
.tc-text { font-size: .85em; line-height: 1.25; margin-top: 4%; min-height: 2.5em; background: rgba(255, 255, 255, .6); border-radius: 6px; padding: 3px 5px; }
.tcard.sm .tc-text { display: none; }
.tcard.sm .tc-art span { font-size: 3.4em; }
.tc-bot { display: flex; justify-content: space-between; margin-top: 4%; font-weight: 800; }
.tc-gems { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); letter-spacing: 1px; }
.tc-lvl { color: #ffb400; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); }
.tc-new { position: absolute; top: 18%; right: -28%; transform: rotate(35deg); background: #ff3d6e; color: #fff; font-weight: 900; padding: 2px 34%; font-size: .9em; }
.tc-new.up { background: #1f9d6b; }
.r-common { border-color: #cfd3db; }
.r-rare { border-color: #3b8fe6; }
.r-epic { border-color: #9b4dd8; box-shadow: 0 0 14px rgba(155, 77, 216, .5); }
.r-legendary { border-color: #f0a500; box-shadow: 0 0 18px rgba(240, 165, 0, .65); }
.r-mythic { border-color: transparent; background: linear-gradient(160deg, var(--c1), var(--c2)) padding-box, linear-gradient(90deg, #ff4d6d, #ffbe0b, #3fb37f, #3b8fe6, #9b4dd8, #ff4d6d) border-box; background-size: 100% 100%, 300% 100%; animation: rainbow 3s linear infinite; box-shadow: 0 0 22px rgba(255, 77, 109, .5); }
@keyframes rainbow { to { background-position: 0 0, 300% 0; } }
.r-legendary::after, .r-mythic::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .55) 45%, transparent 60%); background-size: 250% 100%; animation: shine 2.6s ease-in-out infinite; pointer-events: none; }
@keyframes shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.tcard.locked { background: repeating-linear-gradient(45deg, #ecebf3, #ecebf3 8px, #e4e2ee 8px, #e4e2ee 16px); border-color: #dcd9e8; align-items: center; justify-content: center; box-shadow: none; }
.lock-q { font-size: 3.5em; font-weight: 900; color: #c4c0d8; }
.lock-n { color: #aaa6c0; font-weight: 700; }

.packs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pack { border: 0; border-radius: 20px; padding: 18px 10px; color: #fff; cursor: pointer; box-shadow: 0 6px 16px rgba(30, 20, 80, .2); }
.pack .pk-ic { font-size: 3rem; }
.pk-src { opacity: .85; margin-top: 4px; }
.pk-standard { background: linear-gradient(160deg, #5b8def, #8fb7ff); }
.pk-super { background: linear-gradient(160deg, #9b4dd8, #d19bff); }
.pk-mega { background: linear-gradient(160deg, #f08a00, #ffd04d); }
.opening { text-align: center; padding-top: calc(30px + env(safe-area-inset-top)); max-width: 520px; margin: 0 auto; }
.pk-big { width: 190px; height: 230px; margin: 30px auto 16px; border-radius: 28px; display: flex; align-items: center; justify-content: center; font-size: 6rem; cursor: pointer; box-shadow: 0 10px 30px rgba(30, 20, 80, .3); transition: transform .15s; user-select: none; }
.wobble { animation: wobble .5s ease; }
@keyframes wobble { 25% { rotate: -6deg; } 50% { rotate: 6deg; } 75% { rotate: -3deg; } }
.burst { animation: burst .35s ease forwards; }
@keyframes burst { to { transform: scale(1.8); opacity: 0; filter: brightness(2); } }
.reveal { animation: flipin .6s cubic-bezier(.2, .8, .3, 1.2); margin: 14px 0; }
.reveal-big { animation: flipin 1s cubic-bezier(.2, .8, .3, 1.2); }
@keyframes flipin { from { transform: rotateY(90deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.rarity-label { font-weight: 800; font-size: 1.1rem; }
.rarity-label.rl-rare { color: #3b8fe6; } .rarity-label.rl-epic { color: #9b4dd8; } .rarity-label.rl-legendary { color: #e09400; } .rarity-label.rl-mythic { color: #ff4d6d; }
.rarity-label.rl-common { color: var(--muted); }

/* Saison, Serien, Meilensteine */
.dotbadge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: #ff3d6e; color: #fff; font-size: .75rem; line-height: 20px; }
.season-card { background: linear-gradient(135deg, #fff8e6, #f3efff); }
.season-bar { height: 16px; background: #ebe8f6; border-radius: 99px; overflow: hidden; margin: 12px 0 8px; }
.season-bar > div { height: 100%; background: linear-gradient(90deg, #f2b400, #ff7a45); border-radius: 99px; }
.teaser { display: flex; gap: 14px; align-items: center; background: repeating-linear-gradient(45deg, #f6f4fc, #f6f4fc 10px, #efecf9 10px, #efecf9 20px); }
.tier { display: flex; gap: 14px; align-items: center; }
.tier-ic { position: relative; font-size: 2.2rem; width: 54px; text-align: center; }
.tier-lvl { position: absolute; right: -4px; bottom: -6px; background: var(--brand); color: #fff; font-size: .7rem; font-weight: 800; border-radius: 99px; padding: 1px 6px; }
.series-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x mandatory; }
.series { flex: 0 0 120px; scroll-snap-align: start; background: var(--card); border-radius: 16px; padding: 10px; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 2px; position: relative; border: 2px solid transparent; }
.series.on { border-color: var(--brand); }
.series .si { font-size: 1.8rem; }
.series .sn { font-weight: 700; font-size: .85rem; line-height: 1.2; }
.series .sc { font-size: .8rem; color: var(--muted); }
.series .snew { position: absolute; top: 8px; right: 8px; background: #ff7a45; color: #fff; font-size: .6rem; font-weight: 800; border-radius: 99px; padding: 1px 6px; }
.locked-series { opacity: .55; }
.holo-chip { background: linear-gradient(135deg, #fff6d5, #ffe6f2, #e2f3ff); }
.tcard.holo { border-color: #e8b923; }
.tcard.holo::before { content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(125deg, rgba(255, 0, 128, .45), rgba(255, 215, 0, .45), rgba(0, 255, 200, .45), rgba(80, 120, 255, .45), rgba(255, 0, 128, .45)); background-size: 300% 300%; animation: holo 4s linear infinite; }
@keyframes holo { to { background-position: 300% 300%; } }
.tabs button { white-space: nowrap; font-size: .95rem; padding: 10px 6px; }

/* Foto-Editor */
.editor { position: fixed; inset: 0; z-index: 80; background: #14121f; color: #fff; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.editor .muted { color: #b9b5cf; }
.editor .iconbtn { background: #2a2740; color: #fff; box-shadow: none; }
.ed-top { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.ed-center { margin: auto; text-align: center; }
.ed-stage { position: relative; flex: 1; min-height: 0; margin: 0 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.ed-stage img { max-width: 100%; max-height: 100%; display: block; -webkit-user-drag: none; }
.ed-stage svg { position: absolute; pointer-events: none; }
.ed-stage svg [data-h] { pointer-events: all; cursor: grab; }
.ed-stage .loupe { position: absolute; display: none; width: 150px; height: 150px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 6px 20px rgba(0,0,0,.5); pointer-events: none; }
.ed-bottom { display: flex; gap: 8px; padding: 10px 12px; }
.ed-bottom .btn.ghost { background: #2a2740; color: #fff; }
.ed-roles { display: flex; gap: 6px; padding: 0 12px 8px; overflow-x: auto; }
.role-chip { flex: 1; min-width: 92px; border: 2px solid var(--rc); background: color-mix(in srgb, var(--rc) 25%, #14121f); color: #fff; border-radius: 12px; padding: 6px; font-weight: 700; display: flex; flex-direction: column; align-items: center; font-size: .9rem; cursor: pointer; }
.role-chip .small { font-weight: 500; opacity: .75; font-size: .7rem; }
.vrow input { min-width: 0; width: 100%; }
.vrow input.pick { width: 20px; }

/* Profilbild & Farbe */
.avimg { width: 1em; height: 1em; border-radius: 50%; object-fit: cover; vertical-align: middle; display: inline-block; }
.iconbtn .avimg { width: 32px; height: 32px; }
.road-you .avimg { width: 1.4em; height: 1.4em; }
.profile-tile { border-bottom: 5px solid var(--pc, var(--brand)); }
.profile-tile .av .avimg { box-shadow: 0 0 0 4px var(--pc, var(--brand)); }
.av-btn { position: relative; border: 0; background: transparent; padding: 0; cursor: pointer; line-height: 1; font-size: 3rem; }
.av-btn .avimg { box-shadow: 0 0 0 3px var(--pc); }
.av-edit { position: absolute; right: -6px; bottom: -4px; font-size: .9rem; background: #fff; border-radius: 50%; padding: 3px; box-shadow: var(--shadow); }
.st-preview { display: flex; align-items: center; gap: 14px; margin: 12px 0; }
.st-av { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; background: color-mix(in srgb, var(--pc) 18%, #fff); box-shadow: 0 0 0 4px var(--pc); flex-shrink: 0; overflow: hidden; }
.st-av .avimg { width: 72px; height: 72px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; background: var(--sw); box-shadow: 0 0 0 2px #ddd; cursor: pointer; }
.swatch.sel { box-shadow: 0 0 0 3px var(--sw); transform: scale(1.1); }
.crop-circle { position: absolute; border-radius: 50%; box-shadow: 0 0 0 9999px rgba(10, 8, 25, .6); border: 3px solid #fff; cursor: grab; touch-action: none; }
/* Wörter bearbeiten */
.wrow .wmeta { grid-column: 2 / 5; display: flex; align-items: center; gap: 10px; }
.wrow .pg { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.wrow .pg input { width: 70px; min-height: 34px; padding: 4px 8px; }
.wrow input.saved { border-color: var(--ok); background: var(--ok-bg); transition: background .3s; }
.sticky-tools { position: sticky; top: calc(62px + env(safe-area-inset-top)); z-index: 5; background: var(--bg); padding: 8px 0; margin: 8px 0 6px; }
input[type=search] { border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; min-height: 46px; background: #fff; }
#modal .st-preview { position: sticky; top: -20px; z-index: 2; background: var(--bg); padding: 10px 0; margin: 0; }

/* Buchstaben-Puzzle */
.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 18px 0 14px; }
.slot { width: var(--sz, 38px); height: calc(var(--sz, 38px) * 1.28); border-radius: 10px; border: 2.5px dashed #c9c5e6; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: calc(var(--sz, 38px) * .62); font-weight: 800; color: var(--brand); }
.slot.next { border-style: solid; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.slot.filled { border-style: solid; border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.slot.revealed { border-style: solid; border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.slot.fixed { border: 0; background: transparent; width: auto; min-width: 14px; color: var(--muted); }
.gap { width: calc(var(--sz, 38px) * .45); }
#pzSlots { gap: 4px; flex-wrap: nowrap; }
.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ltile { width: 56px; height: 60px; border-radius: 14px; border: 0; background: linear-gradient(180deg, #fff, #f1efff); box-shadow: 0 4px 0 #cfcae9, 0 6px 14px rgba(40, 30, 90, .12); font-size: 1.7rem; font-weight: 800; color: var(--ink); cursor: grab; touch-action: none; user-select: none; position: relative; z-index: 1; transition: transform .08s; }
.ltile:active { transform: translateY(2px); box-shadow: 0 2px 0 #cfcae9; }
.ltile.dragging { z-index: 10; box-shadow: 0 12px 24px rgba(40, 30, 90, .3); transition: none; }
.ltile.used { visibility: hidden; }
.ltile.wrongtile { background: var(--bad-bg); color: var(--bad); }
.ltile.hint { animation: hintglow 1.2s ease 2; }
@keyframes hintglow { 50% { background: #fff3b0; box-shadow: 0 0 0 6px #ffd23f; transform: scale(1.12); } }
@media (max-width: 380px) { .ltile { width: 48px; height: 54px; font-size: 1.5rem; } }

/* Wort-Raten */
.balloons { display: flex; justify-content: center; gap: 6px; font-size: 2rem; margin: 14px 0 4px; }
.balloons span { display: inline-block; animation: float 2.4s ease-in-out infinite; }
.balloons span:nth-child(2n) { animation-delay: .6s; }
.balloons span.popped { animation: none; opacity: .5; }
@keyframes float { 50% { transform: translateY(-6px); } }
.slots.nowrap { flex-wrap: nowrap; gap: 4px; }
.gamebtn { flex-direction: column; gap: 2px; line-height: 1.2; }
.keyboard { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; margin-top: 8px; }
.key { border: 0; border-radius: 10px; min-height: 46px; background: #fff; box-shadow: 0 3px 0 #d8d4ea; font-size: 1.15rem; font-weight: 700; cursor: pointer; }
.key.hit { background: var(--ok-bg); color: var(--ok); box-shadow: none; }
.key.miss { background: #eceaf3; color: #aaa6c0; box-shadow: none; }

/* Erinnerungs-Tage, Fokus, Parkplatz, Buchstabieren */
.daychips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.daychips button { border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; font-weight: 700; cursor: pointer; min-width: 44px; }
.daychips button.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.focus-pick { margin-top: 16px; }
.focus-pick .daychips { justify-content: center; }
.ftime { min-width: 74px; font-variant-numeric: tabular-nums; color: var(--brand); }
.ftime.soon { color: #d9661c; animation: pop .6s ease infinite alternate; }
.progress.timed > div { background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width 1s linear; }
.iconbtn.park { font-size: 1.1rem; }
.focus-done { background: linear-gradient(135deg, #e9fff4, #eef3ff); border-radius: 16px; padding: 12px; margin-top: 10px; }
.park-list { text-align: left; background: #fff8e1; border-radius: 16px; padding: 12px 14px; margin-top: 12px; border: 2px dashed #f2c94c; }
.park-list ul { margin: 6px 0 0; padding-left: 20px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.note input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--ok); }
.note.done .grow { text-decoration: line-through; color: var(--muted); }
textarea { border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; }
.spellword { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; font-size: 2rem; font-weight: 800; margin-top: 8px; }
.spellword .sl { padding: 0 4px; border-radius: 8px; color: #b9b5d0; transition: all .15s; }
.spellword .sl.seen { color: var(--ink); }
.spellword .sl.cur { background: var(--brand); color: #fff; transform: scale(1.15); }
.bigletter { text-align: center; font-size: 5rem; font-weight: 900; color: var(--brand); margin: 6px 0 10px; min-height: 1.2em; }
.gapword { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 10px; }
.gapword .gl { width: 28px; height: 38px; border-bottom: 3px solid var(--brand); display: inline-flex; align-items: flex-end; justify-content: center; font-size: 1.6rem; font-weight: 800; }
.gapword .gl.shown { color: var(--ink); }

.timein { width: 150px; flex-shrink: 0; }

/* Illustrierte Karten (z. B. Muffins) */
.tc-art.has-img { padding: 4%; min-height: 0; }
.tc-art.has-img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,.22)); }
.tc-art.has-img.photo { padding: 0; overflow: hidden; border: 3px solid rgba(255,255,255,.85); background: #fff; }
.tc-art.has-img.photo img { object-fit: cover; filter: none; }
.avatars button .avimg { width: 40px; height: 40px; }

.dayinfo { font-size: .85rem; color: var(--muted); background: #f3f1fb; border-radius: 12px; padding: 8px 12px; margin: 6px auto; max-width: 420px; }
.dayinfo.full { background: #fff4dc; color: #8a5a00; }

/* ---------- Sternenstaub & Gold ---------- */
.chip.dust { background: linear-gradient(135deg, #ede7ff, #d9f2ff); color: #4b3aa8; font-weight: 700; }
.chip.goldchip { background: linear-gradient(135deg, #fff6d0, #ffe08a); color: #8a5a00; font-weight: 700; }
.dust-gain { margin-top: 8px; font-weight: 800; color: #6a4fd6; font-size: 1.1rem; }
.tcard.gold { --c1: #ffe680 !important; --c2: #c9900e !important; border-color: #d4a017 !important; box-shadow: 0 0 0 2px #ffd54f, 0 6px 22px rgba(212,160,23,.55) !important; position: relative; overflow: hidden; }
.tcard.gold::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.4) 45%, transparent 55%); background-size: 250% 100%; animation: goldshine 3.2s ease-in-out infinite; }
.tcard.gold .tc-name, .tcard.gold .tc-type { color: #5a3a00; }
.tcard.gold { --c1: #f7c948 !important; --c2: #a8740a !important; }
.tcard.gold .tc-art { background: radial-gradient(circle, rgba(255,250,220,.55), transparent 70%) !important; }
@keyframes goldshine { 0% { background-position: 150% 0; } 60%, 100% { background-position: -100% 0; } }
.goldbtn { background: linear-gradient(135deg, #ffd54f, #d4a017) !important; color: #4a2f00 !important; }
.learn-won { margin: 12px 0; padding: 10px; border-radius: 16px; background: color-mix(in srgb, #2e9d5b 12%, transparent); }
.learn-won .album { justify-content: center; margin: 8px 0; }

/* ---------- Titel & Rahmen ---------- */
.ptitle { display: inline-block; margin-top: 2px; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 800; letter-spacing: .02em;
  background: linear-gradient(135deg, #fff3c4, #ffd36b); color: #7a4b00; }
.frame { position: relative; display: inline-grid !important; place-items: center; width: 1.25em; height: 1.25em; border-radius: 50%; --fbg: var(--brand); }
.frame::before { content: ''; position: absolute; inset: -0.1em; border-radius: 50%; background: var(--fbg); pointer-events: none;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - .16em), #000 calc(100% - .15em)); mask: radial-gradient(farthest-side, transparent calc(100% - .16em), #000 calc(100% - .15em)); }
.frame > * { position: relative; }
.frame.f-feuer { --fbg: conic-gradient(#ff7043, #ffca28, #ff5722, #ffca28, #ff7043); filter: drop-shadow(0 0 4px #ff9800); }
.frame.f-wasser { --fbg: conic-gradient(#29b6f6, #b3e5fc, #0288d1, #b3e5fc, #29b6f6); }
.frame.f-natur { --fbg: conic-gradient(#43a047, #c5e1a5, #2e7d32, #c5e1a5, #43a047); }
.frame.f-blitz { --fbg: conic-gradient(#ffeb3b, #fff, #fbc02d, #fff, #ffeb3b); filter: drop-shadow(0 0 4px #fff176); }
.frame.f-eis { --fbg: conic-gradient(#e1f5fe, #81d4fa, #fff, #81d4fa, #e1f5fe); filter: drop-shadow(0 0 4px #b3e5fc); }
.frame.f-erde { --fbg: conic-gradient(#8d6e63, #d7ccc8, #5d4037, #d7ccc8, #8d6e63); }
.frame.f-luft { --fbg: conic-gradient(#eceff1, #fff, #cfd8dc, #fff, #eceff1); filter: drop-shadow(0 0 5px #fff); }
.frame.f-kosmos { --fbg: conic-gradient(#7e57c2, #b388ff, #4527a0, #b388ff, #7e57c2); filter: drop-shadow(0 0 5px #b388ff); }
.frame.f-rainbow { --fbg: conic-gradient(#f44336, #ff9800, #ffeb3b, #4caf50, #2196f3, #9c27b0, #f44336); }
.frame.f-gold, .frame.f-f-goldmuffin, .frame.f-f-goldschatz, .frame.f-goldmuffin, .frame.f-goldschatz {
  --fbg: conic-gradient(#fff3b0, #d4a017, #fff8d6, #a66f00, #ffe082, #c49000, #fff3b0); filter: drop-shadow(0 0 5px rgba(255,200,40,.85)); }
/* Galaxie-Rahmen: dreht sich langsam, mit Sternenpunkten */
.frame.f-galaxy { filter: drop-shadow(0 0 6px #7c4dff); }
.frame.f-galaxy::before { --fbg: radial-gradient(circle at 20% 30%, #fff 0 1.5%, transparent 2.5%), radial-gradient(circle at 75% 15%, #fff 0 1%, transparent 2%),
    radial-gradient(circle at 85% 70%, #fff 0 1.5%, transparent 2.5%), radial-gradient(circle at 30% 85%, #fff 0 1%, transparent 2%),
    conic-gradient(#1a0b4e, #7c4dff, #00e5ff, #ff4081, #311b92, #7c4dff, #1a0b4e);
  animation: framespin 12s linear infinite; }
@keyframes framespin { to { transform: rotate(360deg); } }
/* Rahmen-Studio */
.frame.f-custom.fp-solid { --fbg: var(--f1); }
.frame.f-custom.fp-verlauf { --fbg: conic-gradient(var(--f1), var(--f2), var(--f1)); }
.frame.f-custom.fp-streifen { --fbg: repeating-conic-gradient(var(--f1) 0 15deg, var(--f2) 15deg 30deg); }
.frame.f-custom.fp-punkte { --fbg: radial-gradient(circle, var(--f2) 0 28%, transparent 32%) 0 0 / .16em .16em, var(--f1); }
.frame.f-custom.fp-karo { --fbg: conic-gradient(var(--f1) 25%, var(--f2) 0 50%, var(--f1) 0 75%, var(--f2) 0) 0 0 / .16em .16em; }
.frame.f-custom.fp-funkeln { --fbg: conic-gradient(var(--f1), var(--f2), var(--f1), var(--f2), var(--f1)); filter: drop-shadow(0 0 5px var(--f2)); }
.frame.f-custom.fp-funkeln::before { animation: framespin 6s linear infinite; }
#fsPat .chip.on { background: var(--brand); color: #fff; }

/* ---------- Adventskalender ---------- */
.advent-teaser { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff !important; margin-top: 14px;
  background: linear-gradient(135deg, #b71c1c, #1b5e20) !important; }
.advent-teaser .adv-ic { font-size: 2.2rem; }
.advent-teaser .adv-go { background: #ffd54f; color: #5a3a00; font-weight: 800; padding: 6px 12px; border-radius: 999px; }
.advent-wrap { background: linear-gradient(180deg, #102a43, #1b4332); color: #fff; border-radius: 22px; padding: 16px; }
.advent-wrap .muted { color: #cfe3d4; }
.advent { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.door { aspect-ratio: 1; border-radius: 14px; border: 2px dashed rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: #fff;
  font-size: 1.4rem; font-weight: 800; display: grid; place-items: center; padding: 2px; transition: transform .2s; }
.door:disabled { opacity: .85; }
.door.open { background: #fff8e1; border: 2px solid #ffd54f; }
.door.open img { width: 100%; height: 100%; object-fit: contain; }
.door.next { background: linear-gradient(135deg, #e53935, #ff8f00); border: 2px solid #ffd54f; animation: doorpulse 1.2s ease-in-out infinite; }
.door.opening-door { transform: perspective(300px) rotateY(-70deg); }
@keyframes doorpulse { 50% { transform: scale(1.08); box-shadow: 0 0 18px #ffd54f; } }
.set-done { border: 2px solid var(--ok); }
.maxed-won { margin: 10px 0; padding: 10px 12px; border-radius: 16px; background: linear-gradient(135deg, #fff6d0, #ffe7a0); color: #6b4500; }
.biginput { font-size: 1.3rem; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line, #ddd); width: 100%; text-align: center; }
.login form { margin: 0 auto; }
/* ---------- Drachen-Muffins & Chancen ---------- */
.chance { margin-top: 6px; color: var(--muted, #667); }
.dragon-pull { background: radial-gradient(circle at 50% 40%, rgba(255,120,40,.35), transparent 65%); border-radius: 24px; }
.dragon-banner { font-weight: 900; font-size: 1.4rem; letter-spacing: .04em; color: #fff; padding: 6px 16px; border-radius: 999px; margin-bottom: 8px;
  background: linear-gradient(90deg, #b71c1c, #ff6f00, #ffd54f, #ff6f00, #b71c1c); background-size: 200% 100%; animation: dragonglow 1.6s linear infinite; }
@keyframes dragonglow { to { background-position: 200% 0; } }
table.odds { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .85rem; }
table.odds th, table.odds td { padding: 6px 4px; text-align: center; border-bottom: 1px solid var(--line, #eee); }
table.odds td:first-child { text-align: left; white-space: nowrap; }
table.odds .dragon-row td { font-weight: 800; color: #c62828; }
