:root {
  --schrift: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --schrift-titel: ui-rounded, "SF Pro Rounded", "Baloo 2", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #FFF7EC;
  --flaeche: #FFFFFF;
  --ink: #2B2440;
  --leise: #7A7290;
  --linie: #EFE4D6;
  --gold: #F5B82E;
  --gold-dunkel: #D0941A;

  --morgen: #FF9F68; --morgen-dunkel: #E07B44; --morgen-hell: #FFE8DA;
  --mittag: #2EC4A6; --mittag-dunkel: #1E9C84; --mittag-hell: #D9F5EE;
  --abend: #7B6CF6; --abend-dunkel: #5948D6; --abend-hell: #E8E4FF;

  --akzent: #F5B82E; --akzent-dunkel: #D0941A; --akzent-hell: #FFF1C9;
  --r: var(--akzent); --r-dunkel: var(--akzent-dunkel); --r-hell: var(--akzent-hell);
  --nav-hoehe: 76px;
}
body[data-char="funki"] { --akzent: #FF7A3D; --akzent-dunkel: #D85A22; --akzent-hell: #FFE3D5; }
body[data-char="emmi"] { --akzent: #C77DFF; --akzent-dunkel: #A35BDB; --akzent-hell: #F4E6FF; }
body[data-char="pino"] { --akzent: #5DBB63; --akzent-dunkel: #3E9645; --akzent-hell: #E3F6E0; }
body[data-char="leo"] { --akzent: #6E8BD6; --akzent-dunkel: #4D69B3; --akzent-hell: #E4EAFB; }
body[data-char="rosalie"] { --akzent: #FF8FC7; --akzent-dunkel: #E06AA6; --akzent-hell: #FFE4F1; }
body[data-char="marina"] { --akzent: #2EC4C4; --akzent-dunkel: #1D9C9C; --akzent-hell: #DDF6F6; }

* { box-sizing: border-box; }
html { height: 100%; background: var(--bg); }
body {
  min-height: 100%;
  margin: 0;
  font-family: var(--schrift);
  font-weight: 600;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, .zahl { font-family: var(--schrift-titel); margin: 0; line-height: 1.1; }
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0; }
.leise { color: var(--leise); }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px calc(env(safe-area-inset-bottom, 0px) + 28px);
}
#app.mit-nav { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--nav-hoehe) + 28px); }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--akzent); outline-offset: 3px; }

/* Dicke, drückbare Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 58px; padding: 0 26px;
  border-radius: 18px;
  font-weight: 800; font-size: 1.12rem; letter-spacing: .01em;
  background: var(--knopf, var(--akzent));
  color: #fff;
  box-shadow: 0 5px 0 var(--knopf-dunkel, var(--akzent-dunkel));
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--knopf-dunkel, var(--akzent-dunkel)); }
.btn-breit { width: 100%; }
.btn-hell { --knopf: var(--flaeche); --knopf-dunkel: var(--linie); color: var(--ink); border: 2px solid var(--linie); }
.btn-klein { min-height: 44px; padding: 0 16px; font-size: .95rem; border-radius: 14px; box-shadow: 0 3px 0 var(--knopf-dunkel, var(--akzent-dunkel)); }
.btn[disabled] { --knopf: #E9E2D8; --knopf-dunkel: #D6CCBE; color: #A79E91; cursor: default; }
.btn[disabled]:active { transform: none; }

/* Kopfzeile */
.oben { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex: none;
  border: 3px solid var(--akzent); background: var(--akzent-hell);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.oben .hallo { flex: 1; min-width: 0; }
.oben .hallo small { display: block; color: var(--leise); font-size: .85rem; }
.oben .hallo strong { font-family: var(--schrift-titel); font-size: 1.25rem; font-weight: 800; }
.funken {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 8px; border-radius: 99px;
  background: var(--flaeche); border: 2px solid var(--linie);
  font-family: var(--schrift-titel); font-weight: 800; font-size: 1.1rem;
}
.muenze {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #FFF6D6, var(--gold) 55%, var(--gold-dunkel));
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.12);
}
.rund-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--flaeche); border: 2px solid var(--linie);
}
.rund-btn svg { width: 22px; height: 22px; }

/* Szene mit Begleiter */
.szene {
  position: relative; display: block; width: 100%;
  height: 250px; border-radius: 28px; overflow: hidden;
  background: var(--akzent-hell);
  box-shadow: 0 10px 24px -12px rgba(43,36,64,.35);
  text-align: left; margin-bottom: 22px;
}
.szene > img.hinter { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.szene {
  background:
    radial-gradient(circle at 85% 30%, rgba(255,255,255,.9) 0 60px, transparent 61px),
    radial-gradient(circle at 12% 88%, rgba(255,255,255,.55) 0 48px, transparent 49px),
    radial-gradient(circle at 60% 110%, var(--akzent) 0 110px, transparent 111px),
    linear-gradient(160deg, var(--akzent-hell), #FFFFFF 85%);
  border: 2px solid var(--linie);
}
.szene .funkeln { position: absolute; width: 10px; height: 10px; border-radius: 2px; transform: rotate(45deg); background: var(--akzent); opacity: .5; animation: funkeln 2.8s ease-in-out infinite; }
.szene .figur { position: absolute; right: 8px; bottom: 62px; width: 160px; height: 160px; z-index: 2; }
.szene .blase {
  position: absolute; left: 14px; top: 14px; z-index: 2;
  max-width: 62%; padding: 10px 14px; border-radius: 18px 18px 18px 4px;
  background: var(--flaeche); color: var(--ink); font-size: .95rem;
  box-shadow: 0 4px 0 rgba(43,36,64,.12);
}
.szene .stufe-info { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 3; color: var(--ink); padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.88); }
.szene .stufe-info .zeile { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 6px; }
.szene .stufe-info .zeile span { color: var(--leise); }

.balken { height: 12px; border-radius: 99px; background: var(--linie); overflow: hidden; }
.balken.dunkel { background: var(--linie); }
.balken > span { display: block; height: 100%; border-radius: inherit; background: var(--gold); transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* Tagesplan (Zeitleiste) */
.tag-kopf { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 12px; }
.tag-kopf span { color: var(--leise); font-size: .9rem; }
.zeitleiste { position: relative; display: grid; gap: 14px; padding-left: 26px; }
.zeitleiste::before { content: ""; position: absolute; left: 9px; top: 18px; bottom: 18px; width: 4px; border-radius: 4px; background: var(--linie); }
.block {
  position: relative; display: grid; grid-template-columns: 56px 1fr 52px; align-items: center; gap: 14px;
  width: 100%; padding: 14px; border-radius: 22px; text-align: left;
  background: var(--r-hell); border: 2px solid transparent;
}
.block::before {
  content: ""; position: absolute; left: -24px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  border-radius: 50%; background: var(--flaeche); border: 4px solid var(--r);
}
.block.jetzt { border-color: var(--r); background: var(--flaeche); box-shadow: 0 6px 0 var(--r-hell); }
.block.jetzt::after {
  content: "Jetzt"; position: absolute; top: -10px; right: 14px; padding: 1px 10px; border-radius: 99px;
  background: var(--r); color: #fff; font-size: .75rem; font-weight: 800;
}
.block .kachel {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.8rem;
  background: var(--r); box-shadow: inset 0 -4px 0 var(--r-dunkel);
}
.block small { display: block; color: var(--leise); font-size: .82rem; }
.block.fertig { opacity: .8; }
.ring { width: 52px; height: 52px; }
.ring .spur { stroke: rgba(43,36,64,.1); }
.ring .wert { stroke: var(--r); stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring text { font-family: var(--schrift-titel); font-weight: 800; font-size: 15px; fill: var(--ink); }
.haken-kreis { width: 52px; height: 52px; border-radius: 50%; background: var(--r); color: #fff; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; }

/* Navigationsleiste */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 8px);
  background: var(--flaeche); border-top: 2px solid var(--linie);
}
.nav-innen { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.nav button { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px; color: var(--leise); font-size: .74rem; font-weight: 800; }
.nav button svg { width: 26px; height: 26px; }
.nav button[aria-current="page"] { color: var(--akzent-dunkel); background: var(--akzent-hell); }

/* Figuren */
.figur { position: relative; }
.figur img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(43,36,64,.28)); }
.figur.gerahmt img { inset: 4%; width: 92%; height: 92%; object-fit: cover; border-radius: 50%; filter: none; box-shadow: 0 0 0 4px var(--k, var(--akzent)); }
.figur.schwebt { animation: schweben 3.6s ease-in-out infinite; }
.figur.huepft { animation: huepfen .9s ease-in-out infinite; }
.figur-platzhalter { position: absolute; inset: 10%; border-radius: 50%; display: grid; place-items: center; text-align: center; font-weight: 800; background: var(--akzent-hell); border: 3px dashed var(--akzent); color: var(--akzent-dunkel); }
@keyframes schweben { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes huepfen { 0%,100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-16px) scale(1.04); } }

/* Figurenwahl */
.wahl-titel { text-align: center; margin: 18px 0 20px; }
.wahl-titel p { margin-top: 6px; color: var(--leise); }
.wahl-liste { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wahl-karte {
  display: grid; justify-items: center; gap: 6px; padding: 12px 6px 14px;
  border-radius: 22px; background: var(--flaeche); border: 3px solid var(--linie);
  box-shadow: 0 5px 0 var(--linie); transition: transform .12s ease;
}
.wahl-karte .figur { width: 92px; height: 92px; }
.wahl-karte h3 { font-size: 1.15rem; }
.wahl-karte[aria-pressed="true"] { border-color: var(--k); box-shadow: 0 5px 0 var(--k); transform: translateY(-3px); background: var(--k-hell); }
.wahl-info { min-height: 3em; text-align: center; color: var(--leise); margin: 16px 6px 0; }
.feld { display: grid; gap: 8px; margin: 18px 0 22px; }
input[type="text"], input[type="number"] {
  font: inherit; color: var(--ink); width: 100%; min-height: 54px; padding: 0 16px;
  background: var(--flaeche); border: 2px solid var(--linie); border-radius: 16px;
}

/* Routine-Modus */
body.routine-modus { background: var(--r-hell); }
body.routine-modus html { background: var(--r-hell); }
.r-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.punkte { flex: 1; display: flex; gap: 6px; }
.punkte span { flex: 1; height: 10px; border-radius: 99px; background: rgba(43,36,64,.12); }
.punkte span.erledigt { background: var(--r); }
.punkte span.aktiv { background: var(--r); opacity: .45; }
.karte-schritt {
  background: var(--flaeche); border-radius: 30px; padding: 22px 20px 24px;
  display: grid; justify-items: center; gap: 12px; text-align: center;
  box-shadow: 0 8px 0 rgba(43,36,64,.08);
  animation: rein .4s cubic-bezier(.2,.8,.2,1);
}
@keyframes rein { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
.karte-schritt .nr { color: var(--leise); font-size: .9rem; }
.zeitkreis { position: relative; width: 210px; height: 210px; }
.zeitkreis svg { position: absolute; inset: 0; }
.zeitkreis .symbol { position: absolute; inset: 50px; border-radius: 50%; background: var(--flaeche); display: grid; place-items: center; font-size: 3.8rem; box-shadow: 0 4px 12px rgba(43,36,64,.15); }
.zeit { font-family: var(--schrift-titel); font-size: 1.35rem; font-weight: 800; color: var(--r-dunkel); font-variant-numeric: tabular-nums; }
.karte-schritt h1 { font-size: 1.9rem; max-width: 15ch; }
.begleiter { display: grid; grid-template-columns: 96px 1fr; align-items: end; gap: 6px; margin: 16px 0 14px; }
.begleiter .figur { width: 96px; height: 96px; }
.begleiter .blase { padding: 12px 14px; border-radius: 18px 18px 18px 4px; background: var(--flaeche); box-shadow: 0 4px 0 rgba(43,36,64,.08); margin-bottom: 20px; }
.r-aktionen { display: grid; gap: 12px; }
.r-aktionen .zeile2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Welt */
.welt { position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 9 / 13; background: var(--akzent-hell); margin-bottom: 18px; box-shadow: 0 10px 24px -12px rgba(43,36,64,.4); }
.welt img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: filter 1.4s ease; }
.welt .lichter span { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #FFF4C2; box-shadow: 0 0 12px 3px #FFE38A; animation: funkeln 2.6s ease-in-out infinite; }
@keyframes funkeln { 0%,100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.1); } }
.welt .schild { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 12px 16px; border-radius: 18px; background: rgba(255,255,255,.92); }
.weltplatzhalter { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; color: var(--akzent-dunkel); }
.stufenpfad { display: flex; align-items: center; justify-content: space-between; margin: 4px 6px 20px; }
.stufenpfad span { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--schrift-titel); font-weight: 800; background: var(--flaeche); border: 3px solid var(--linie); color: var(--leise); }
.stufenpfad span.an { background: var(--akzent); border-color: var(--akzent-dunkel); color: #fff; }
.stufenpfad i { flex: 1; height: 4px; background: var(--linie); }
.stufenpfad i.an { background: var(--akzent); }

/* Wünsche */
.wunsch-liste { display: grid; gap: 12px; }
.wunsch { padding: 16px; border-radius: 22px; background: var(--flaeche); border: 2px solid var(--linie); display: grid; gap: 10px; }
.wunsch .kopfz { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wunsch .preis { display: inline-flex; align-items: center; gap: 6px; font-family: var(--schrift-titel); font-weight: 800; }
.wunsch .muenze { width: 18px; height: 18px; }
.leer { padding: 24px; text-align: center; color: var(--leise); border: 2px dashed var(--linie); border-radius: 22px; }

/* Dialoge, Partikel, Toast */
#overlay:empty { display: none; }
#overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: rgba(43,36,64,.45); }
.dialog { width: min(400px, 100%); padding: 24px 22px; border-radius: 30px; background: var(--flaeche); text-align: center; display: grid; gap: 12px; animation: plopp .4s cubic-bezier(.2,1.4,.4,1); }
@keyframes plopp { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.dialog .figur { width: 180px; height: 180px; margin: -90px auto 0; }
.dialog .gewinn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; font-family: var(--schrift-titel); font-size: 1.8rem; font-weight: 800; color: var(--gold-dunkel); }
.dialog .gewinn .muenze { width: 28px; height: 28px; }
.fehler { color: #D9534F; font-size: .9rem; min-height: 1.2em; }
.partikel { position: fixed; z-index: 30; width: 11px; height: 11px; border-radius: 3px; pointer-events: none; animation: fliegen 1.4s cubic-bezier(.15,.7,.3,1) forwards; }
@keyframes fliegen { from { opacity: 1; transform: translate(0,0) rotate(0); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(540deg); } }
#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + var(--nav-hoehe) + 16px); transform: translate(-50%, 40px); opacity: 0; z-index: 40; max-width: 90%; padding: 12px 18px; border-radius: 16px; background: var(--ink); color: #fff; pointer-events: none; transition: transform .3s ease, opacity .3s ease; }
#toast.zeigen { transform: translate(-50%, 0); opacity: 1; }

/* Elternbereich */
.e-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.e-block { padding: 18px; border-radius: 22px; background: var(--flaeche); border: 2px solid var(--linie); margin-bottom: 14px; display: grid; gap: 12px; }
.e-block > p { color: var(--leise); font-size: .92rem; }
details.routine-edit { border-top: 2px solid var(--linie); padding-top: 10px; }
details.routine-edit summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 40px; }
details.routine-edit summary::after { content: "▾"; color: var(--leise); }
details.routine-edit[open] summary::after { content: "▴"; }
.zeile-e { display: grid; grid-template-columns: 52px 1fr 66px 40px; gap: 8px; align-items: center; margin-top: 8px; }
.zeile-e.w { grid-template-columns: 1fr 80px 40px; }
.zeile-e input { min-height: 44px; padding: 0 10px; border-radius: 12px; }
.zeile-e .sym { text-align: center; font-size: 1.3rem; }
.spalten { display: grid; grid-template-columns: 52px 1fr 66px 40px; gap: 8px; font-size: .75rem; color: var(--leise); }
.loeschen { width: 40px; height: 40px; border-radius: 12px; background: #FDE7E4; color: #D9534F; font-size: 1.2rem; font-weight: 800; }
.figur-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.figur-mini button { padding: 10px 6px; border-radius: 14px; border: 2px solid var(--linie); font-weight: 800; }
.figur-mini button[aria-pressed="true"] { border-color: var(--akzent); background: var(--akzent-hell); }

/* Gefühle */
.gefuehl-raster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.gefuehl {
  display: grid; justify-items: center; gap: 4px; padding: 12px 4px 10px; border-radius: 18px;
  background: var(--flaeche); border: 2px solid var(--linie); box-shadow: 0 4px 0 var(--linie);
  font-size: .74rem; font-weight: 800; transition: transform .08s ease; hyphens: manual; text-align: center;
}
.gefuehl:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--linie); }
.g-emoji { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; background: color-mix(in srgb, var(--g) 22%, #fff); }
.tool-liste { display: grid; gap: 12px; }
.tool { display: grid; grid-template-columns: 56px 1fr 32px; align-items: center; gap: 14px; width: 100%; padding: 14px; border-radius: 22px; text-align: left; background: var(--r-hell); }
.tool .kachel { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.8rem; background: var(--r); box-shadow: inset 0 -4px 0 var(--r-dunkel); }
.tool small { display: block; color: var(--leise); font-size: .85rem; }
.tool-status { font-size: 1.4rem; font-weight: 800; color: var(--r-dunkel); text-align: center; }
.vk-titel { flex: 1; font-size: 1.3rem; }
.atem-kreis {
  width: 150px; height: 150px; margin: 20px 0; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 40%, var(--r-hell) 70%, transparent 72%);
  box-shadow: 0 0 0 10px var(--r-hell), 0 0 40px var(--r);
  display: grid; place-items: center; transition: transform 4s ease-in-out;
}
.atem-kreis.gross { transform: scale(1.45); }
.atem-figur .figur { width: 100px; height: 100px; }
.vulkan { width: 100%; max-width: 260px; }
#lava { transition: y .8s ease, height .8s ease; }
#rauch { transition: opacity .8s ease; }
.puste { position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.puste-balken { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255,255,255,.35); }
.puste-text { position: relative; }
.gross-emoji { font-size: 5rem; line-height: 1.2; margin: 8px 0; }
.sinn-punkte { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 6px; }
.sinn-punkt { width: 54px; height: 54px; border-radius: 50%; border: 3px dashed var(--r); background: var(--flaeche); transition: transform .15s ease; }
.sinn-punkt.an { background: var(--r); border-style: solid; transform: scale(1.08); }
.g-uebersicht { display: flex; flex-wrap: wrap; gap: 8px; }
.g-uebersicht span { padding: 6px 12px; border-radius: 99px; background: var(--bg); border: 2px solid var(--linie); }
.schalter { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.schalter input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--akzent); }

/* Spiele */
.sperre { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 22px; border-radius: 26px; background: var(--flaeche); border: 2px solid var(--linie); }
.sperre-figur .figur { width: 130px; height: 130px; }
.spiel-info { display: flex; justify-content: space-between; margin: 0 4px 12px; font-family: var(--schrift-titel); font-weight: 800; font-size: 1.15rem; }
.spiel-hinweis { text-align: center; color: var(--leise); margin-top: 16px; }
.memory { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mkarte { position: relative; aspect-ratio: 3 / 4; perspective: 600px; }
.mkarte > span { position: absolute; inset: 0; border-radius: 16px; display: grid; place-items: center; backface-visibility: hidden; transition: transform .35s ease; }
.mhinten { background: var(--r); box-shadow: inset 0 -5px 0 var(--r-dunkel); color: #fff; font-family: var(--schrift-titel); font-size: 2.2rem; font-weight: 800; }
.mvorne { background: var(--flaeche); transform: rotateY(180deg); padding: 8px; }
.mvorne img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; }
.mkarte.auf .mhinten { transform: rotateY(-180deg); }
.mkarte.auf .mvorne { transform: rotateY(0); }
.mkarte.weg { opacity: .35; transition: opacity .4s ease .2s; }
.fang-feld { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.loch { aspect-ratio: 1; border-radius: 50%; background: var(--flaeche); box-shadow: inset 0 6px 0 rgba(43,36,64,.08); display: grid; place-items: center; }
.loch.da > * { animation: plopp .25s cubic-bezier(.2,1.4,.4,1); }
.loch .muenze.gross { width: 58%; height: 58%; box-shadow: 0 0 18px var(--gold); }
.loch .wolke { font-size: 2.6rem; }
.loch.treffer { background: #FFF1C9; }
.loch.ups { background: #FDE7E4; }
.folge { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ftaste { aspect-ratio: 1; border-radius: 26px; font-size: 3rem; transition: transform .1s ease, filter .1s ease; filter: saturate(.75) brightness(.95); }
.ftaste.morgen { background: var(--morgen); box-shadow: 0 6px 0 var(--morgen-dunkel); }
.ftaste.mittag { background: var(--mittag); box-shadow: 0 6px 0 var(--mittag-dunkel); }
.ftaste.abend { background: var(--abend); box-shadow: 0 6px 0 var(--abend-dunkel); }
.ftaste.gold { background: var(--gold); box-shadow: 0 6px 0 var(--gold-dunkel); }
.ftaste.leuchtet { filter: saturate(1.3) brightness(1.2); transform: translateY(4px) scale(1.03); box-shadow: 0 0 0 6px #fff, 0 0 30px rgba(255,255,255,.9); }

/* Hausaufgaben-Helfer */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 10px 14px; border-radius: 99px; background: var(--r-hell); border: 2px solid transparent; font-weight: 800; font-size: .92rem; }
.chip:active { transform: scale(.96); }
.ha-liste { display: grid; gap: 8px; }
.ha-aufgabe { display: grid; grid-template-columns: 40px 1fr auto 40px; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--bg); }
.ha-emoji { font-size: 1.6rem; text-align: center; }
.ha-name small { display: block; color: var(--leise); font-size: .8rem; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; background: var(--flaeche); border: 2px solid var(--linie); font-weight: 800; font-size: 1.1rem; }
.segment { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segment button { padding: 12px 6px; border-radius: 14px; border: 2px solid var(--linie); font-weight: 800; }
.segment button[aria-pressed="true"] { border-color: var(--r); background: var(--r-hell); }
.pausen-ideen { display: grid; gap: 8px; width: 100%; margin-top: 6px; }
.pausen-ideen span { padding: 10px 14px; border-radius: 14px; background: var(--r-hell); font-weight: 700; }
.tipps { text-align: left; margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.geparkt { text-align: left; padding: 12px 14px; border-radius: 16px; background: var(--bg); }
.geparkt ul { margin: 6px 0 0; padding-left: 20px; }
#app > .tool { margin-bottom: 8px; }

/* Einschlafwelt (Nachtmodus) */
body.nacht {
  --bg: #151332; --flaeche: #221F4A; --ink: #ECE8FF; --leise: #A9A3CF; --linie: #312D63;
  --r: #7B6CF6; --r-dunkel: #5948D6; --r-hell: #2A2660;
  --akzent: #9C8FFF; --akzent-dunkel: #6E5FE0; --akzent-hell: #2A2660;
  background: radial-gradient(120% 70% at 50% 0%, #2A2660, #151332 60%) fixed, #151332;
}
body.nacht::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 14%, #fff8, transparent), radial-gradient(1px 1px at 82% 9%, #fff7, transparent),
    radial-gradient(1.5px 1.5px at 66% 30%, #fff6, transparent), radial-gradient(1px 1px at 24% 58%, #fff5, transparent),
    radial-gradient(1.5px 1.5px at 90% 66%, #fff5, transparent), radial-gradient(1px 1px at 44% 84%, #fff4, transparent);
}
body.nacht .karte-schritt, body.nacht .begleiter .blase { box-shadow: none; }
body.nacht .btn { --knopf: #7B6CF6; --knopf-dunkel: #4D3EC4; }
body.nacht .btn-hell { --knopf: var(--flaeche); --knopf-dunkel: #0E0C24; color: var(--ink); border-color: var(--linie); }
.ritual-start {
  display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 14px; width: 100%;
  padding: 16px; border-radius: 22px; text-align: left; margin-bottom: 22px;
  background: linear-gradient(135deg, #3B3285, #24205A); border: 2px solid #4C43A8;
}
.ritual-mond { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; background: #FFE9A8; box-shadow: 0 0 24px #FFE9A880; }
.ritual-start small, .g-karte small { display: block; color: var(--leise); font-size: .85rem; }
.g-liste { display: grid; gap: 12px; }
.g-karte { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 14px; width: 100%; padding: 12px; border-radius: 20px; text-align: left; background: var(--flaeche); border: 2px solid var(--linie); }
.g-figur .figur { width: 72px; height: 72px; }
.g-technik { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 99px; background: var(--r-hell); color: #C9C1FF; font-size: .75rem; font-weight: 800; }
.schoen-raster { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; width: 100%; }
.schoen { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--r-hell); border: 2px solid transparent; font-weight: 800; text-align: left; }
.schoen span { font-size: 1.4rem; }
.schoen[aria-pressed="true"] { border-color: #FFE9A8; background: #3B3285; }
.nachtkreis { box-shadow: 0 0 0 10px #2A2660, 0 0 50px #7B6CF6; background: radial-gradient(circle, #3B3285 0 45%, #2A2660 72%, transparent 74%); }
.geschichte { padding-bottom: 110px; }
.geschichte h1 { text-align: center; font-size: 1.7rem; margin: 6px 0 4px; }
.geschichte > .g-technik { display: block; width: max-content; margin: 0 auto 18px; }
.g-kopfbild { display: grid; place-items: center; }
.g-kopfbild .figur { width: 150px; height: 150px; }
.geschichte p[data-a] { font-size: 1.22rem; line-height: 1.7; font-weight: 600; margin: 0 0 18px; padding: 6px 10px; border-radius: 14px; transition: background .5s ease, color .5s ease; color: #D9D4F5; }
.geschichte p.aktiv { background: #2A2660; color: #FFFFFF; }
.g-ende { text-align: center; color: var(--leise); font-weight: 800; }
.vorlese-leiste { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 18px calc(env(safe-area-inset-bottom, 0px) + 14px); background: linear-gradient(transparent, #151332 35%); }
.vorlese-leiste .btn { max-width: 444px; margin: 0 auto; display: flex; }
.tool.abend-tipp { box-shadow: 0 0 0 2px var(--abend); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
body.routine-modus #toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); }
body.nacht .punkte span { background: #FFFFFF22; }
body.nacht .punkte span.erledigt { background: #9C8FFF; }
body.nacht .punkte span.aktiv { background: #9C8FFF; opacity: .5; }

/* Premium */
.premium-liste { text-align: left; margin: 0; padding-left: 4px; list-style: none; display: grid; gap: 6px; font-size: .92rem; }
.premium-block { border-color: var(--akzent); background: linear-gradient(160deg, var(--akzent-hell), var(--flaeche) 70%); }
.angebot-link { text-align: center; color: var(--akzent-dunkel); font-weight: 800; }
.rechtliches { text-align: center; font-size: .85rem; color: var(--leise); margin-top: 18px; }
.rechtliches a { color: var(--leise); }

/* ===== Animationen ===== */
.figur.schwebt { animation: schweben 3.6s ease-in-out infinite, atmen 2.8s ease-in-out infinite; }
@keyframes atmen { 0%, 100% { scale: 1; } 50% { scale: 1.035; } }
.figur.tipp { animation: tippSprung .6s cubic-bezier(.3,1.6,.5,1) !important; }
@keyframes tippSprung {
  0% { transform: translateY(0) scale(1, 1); }
  20% { transform: translateY(4px) scale(1.12, .86); }
  55% { transform: translateY(-26px) scale(.94, 1.08) rotate(-4deg); }
  80% { transform: translateY(0) scale(1.06, .95) rotate(2deg); }
  100% { transform: translateY(0) scale(1, 1); }
}
.figur.huepft img { animation: wackeln 1.8s ease-in-out infinite; }
@keyframes wackeln { 0%, 100% { rotate: 0deg; } 25% { rotate: -4deg; } 75% { rotate: 4deg; } }
.rein { animation: reinHoch .55s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 90ms + 80ms); }
@keyframes reinHoch { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.szene, .tool, .wunsch, .gefuehl, .g-karte { animation: reinHoch .5s cubic-bezier(.2,.8,.2,1) both; }
.tool:nth-child(2), .wunsch:nth-child(2), .gefuehl:nth-child(2), .g-karte:nth-child(2) { animation-delay: .06s; }
.tool:nth-child(3), .wunsch:nth-child(3), .gefuehl:nth-child(3), .g-karte:nth-child(3) { animation-delay: .12s; }
.tool:nth-child(4), .wunsch:nth-child(4), .gefuehl:nth-child(4), .g-karte:nth-child(4) { animation-delay: .18s; }
.gefuehl:nth-child(n+5), .g-karte:nth-child(n+5) { animation-delay: .24s; }
.btn, .block, .tool, .gefuehl, .wahl-karte, .g-karte { transition: transform .12s ease, box-shadow .12s ease; }
.block:active, .tool:active, .g-karte:active { transform: scale(.97); }
.flieg-muenze { position: fixed; left: 0; top: 0; z-index: 60; width: 24px; height: 24px; margin: -12px 0 0 -12px; pointer-events: none; }
.funken.pop { animation: funkenPop .45s cubic-bezier(.3,1.8,.5,1); }
@keyframes funkenPop { 0% { transform: scale(1); } 40% { transform: scale(1.22); background: #FFF1C9; } 100% { transform: scale(1); } }
.haken-blitz { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; pointer-events: none; }
.haken-blitz span {
  width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center;
  font-size: 5rem; font-weight: 800; color: #fff; background: var(--r, var(--akzent));
  box-shadow: 0 0 0 14px rgba(255,255,255,.7), 0 18px 40px -10px rgba(43,36,64,.4);
  animation: hakenPop .85s cubic-bezier(.2,1.5,.4,1) forwards;
}
@keyframes hakenPop { 0% { transform: scale(.2); opacity: 0; } 35% { transform: scale(1.08); opacity: 1; } 70% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
.dialog { position: relative; overflow: visible; }
.dialog::before {
  content: ""; position: absolute; left: 50%; top: -60px; width: 300px; height: 300px; margin-left: -150px; z-index: -1;
  background: repeating-conic-gradient(from 0deg, rgba(245,184,46,.28) 0deg 12deg, transparent 12deg 30deg);
  border-radius: 50%; animation: drehen 14s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 35%, transparent 70%); mask: radial-gradient(circle, #000 35%, transparent 70%);
}
body.nacht .dialog::before { display: none; }
@keyframes drehen { to { transform: rotate(360deg); } }
.partikel { border-radius: 2px; }
.partikel:nth-child(3n) { border-radius: 50%; }
.partikel:nth-child(3n+1) { clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); width: 16px; height: 16px; }
.code-anzeige { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.2rem; font-weight: 800; letter-spacing: .06em; padding: 10px; border-radius: 12px; background: var(--akzent-hell); word-break: break-all; }
.welt .lichter span { animation: funkeln 2.6s ease-in-out infinite, schweben 5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .figur.schwebt, .figur.huepft img, .rein { animation: none !important; } }

/* 3D-Emojis */
.emo { width: 1.15em; height: 1.15em; vertical-align: -0.22em; object-fit: contain; display: inline-block; pointer-events: none; }
.kachel .emo, .g-emoji .emo, .symbol .emo, .gross-emoji .emo, .ftaste .emo, .ritual-mond .emo, .ha-emoji .emo { width: 1.25em; height: 1.25em; vertical-align: middle; filter: drop-shadow(0 3px 4px rgba(43,36,64,.18)); }
.block .kachel, .tool .kachel { background: var(--flaeche); box-shadow: inset 0 -4px 0 var(--r-hell), 0 0 0 3px var(--r); }
.zeitkreis .symbol .emo { width: 1.1em; height: 1.1em; }

.pruefer { margin-top: 6px; font-size: .85rem; color: var(--leise); }
.pruefer summary { cursor: pointer; padding: 6px 0; }
.pruefer input { margin: 8px 0; }

/* Weltenauswahl */
.welt-ersatz { position: absolute; inset: 0; display: grid; place-items: center; font-size: 7rem; background: radial-gradient(circle at 50% 40%, #fff, color-mix(in srgb, var(--wf, var(--akzent)) 45%, #fff)); }
.welten-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 10px; }
.weltkarte { display: grid; gap: 6px; padding: 8px 8px 12px; border-radius: 20px; background: var(--flaeche); border: 3px solid var(--linie); text-align: left; box-shadow: 0 4px 0 var(--linie); }
.weltkarte.aktiv { border-color: var(--wf); box-shadow: 0 4px 0 var(--wf); }
.weltkarte.zu .wk-bild { filter: grayscale(.6) brightness(.85); }
.wk-bild { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; }
.wk-bild img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wk-ersatz { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.6rem; background: radial-gradient(circle at 50% 40%, #fff, color-mix(in srgb, var(--wf) 45%, #fff)); }
.wk-name { font-weight: 800; font-size: .92rem; line-height: 1.2; padding: 0 4px; }
.wk-info { font-size: .8rem; color: var(--leise); padding: 0 4px; }
.wk-sterne { color: var(--gold-dunkel); letter-spacing: 1px; }

/* Bewohner der Welten */
.bewohner { position: absolute; left: 4%; bottom: 96px; width: 46%; z-index: 2; display: grid; justify-items: center; animation: bewohnerRein .7s .3s cubic-bezier(.2,1.5,.4,1) both; }
.bewohner img { width: 100%; filter: drop-shadow(0 12px 14px rgba(0,0,0,.45)); animation: huepfen 2.8s ease-in-out infinite; }
.bewohner.tipp img { animation: tippSprung .6s cubic-bezier(.3,1.6,.5,1); }
.bewohner-name { margin-top: -6px; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.92); font-size: .75rem; font-weight: 800; color: var(--ink); white-space: nowrap; }
@keyframes bewohnerRein { from { opacity: 0; transform: translateY(30px) scale(.7); } to { opacity: 1; transform: none; } }
.wk-bewohner { position: absolute !important; inset: auto 4px 2px auto !important; width: 42% !important; height: auto !important; object-fit: contain !important; filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); }
.welt .schild { z-index: 2; }
.bewohner { left: auto; right: 3%; bottom: 112px; width: 40%; z-index: 3; }
.welt .bewohner img { position: static; inset: auto; width: 100%; height: auto; object-fit: contain; }
.bewohner-name { white-space: normal; text-align: center; max-width: 100%; font-size: .7rem; line-height: 1.2; }

/* 7 Figuren */
.wahl-liste { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.wahl-karte { position: relative; }
.wahl-karte.zu .figur img { filter: saturate(.55) brightness(.92); }
.wahl-schloss { position: absolute; top: 6px; right: 6px; font-size: 1rem; background: #fff; border-radius: 99px; padding: 2px 6px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.wk-welt { font-size: .75rem; color: var(--leise); padding: 0 4px; margin-top: -4px; }
.figur-mini { flex-wrap: wrap; }
.figur-mini button:disabled { opacity: .5; }
