:root {
  --cream: #fff8ef;
  --beige: #f3e3cc;
  --beige-d: #e2c9a6;
  --pink: #f9cbd8;
  --pink-d: #ec8fa8;
  --blue: #c4e5f6;
  --blue-d: #6fb6dc;
  --lav: #ddd2f7;
  --lav-d: #9d87dc;
  --yellow: #fde58a;
  --mint: #bfe8d4;
  --text: #5b4636;
  --text-soft: #8d7462;
  --card: #ffffff;
  --shadow: 0 6px 18px rgba(140, 100, 80, .14);
  --shadow-s: 0 3px 8px rgba(140, 100, 80, .12);
  --r: 22px;
  --font: "Nunito", "Quicksand", ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(180deg, #f7eefc 0%, #fdf3f6 40%, var(--cream) 100%) fixed;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; border: 0; background: none; }
button:disabled { cursor: default; }
.hidden { display: none !important; }

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 10px 14px calc(96px + env(safe-area-inset-bottom));
}

/* ---------- Kopfzeile ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 10px 12px; margin-bottom: 12px;
}
.tb-left { min-width: 0; }
.tb-name { font-weight: 900; font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-level { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.lv { white-space: nowrap; font-size: .78rem; font-weight: 800; background: var(--lav); color: #5d47a8; border-radius: 99px; padding: 1px 8px; }
.xpbar { width: 76px; height: 8px; border-radius: 99px; background: #f1eafb; overflow: hidden; }
.xpfill { height: 100%; width: 0; background: linear-gradient(90deg, var(--lav-d), #c9a8f5); border-radius: 99px; transition: width .5s; }
.tb-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pill { font-weight: 800; font-size: .88rem; background: var(--cream); border-radius: 99px; padding: 5px 10px; white-space: nowrap; }
.pill.coin { background: #fff4cc; }
.pill.coin.bump { animation: bump .4s; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--cream); font-size: 1.05rem; }

/* ---------- Zimmer ---------- */
.room {
  position: relative; height: clamp(340px, 46vh, 390px);
  border-radius: 30px; overflow: hidden; box-shadow: var(--shadow);
  isolation: isolate; user-select: none; -webkit-user-select: none;
}
.wall {
  position: absolute; inset: 0 0 26% 0;
  background-color: #fdf1f4;
  background-image:
    radial-gradient(circle at 12px 12px, rgba(236, 143, 168, .18) 3px, transparent 3.5px),
    radial-gradient(circle at 36px 36px, rgba(157, 135, 220, .16) 3px, transparent 3.5px);
  background-size: 48px 48px;
}
.wall::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: #f3d9c2; }
.floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 26%;
  background: repeating-linear-gradient(90deg, #ecd3b3 0 58px, #e6cba8 58px 60px);
}
.rug { position: absolute; left: 50%; bottom: 4%; width: 64%; height: 15%; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(ellipse at center, #e6dcfa 0 55%, #d4c5f5 56% 62%, #e6dcfa 63%); box-shadow: 0 3px 0 rgba(0,0,0,.04); }

.window { position: absolute; top: 9%; left: 6%; width: 25%; aspect-ratio: 1 / 1.05; border-radius: 18px 18px 8px 8px;
  border: 6px solid #fff; box-shadow: var(--shadow-s); overflow: hidden; }
.sky { position: absolute; inset: 0; background: linear-gradient(#a9dcf5, #dff3fc); transition: background 1s; }
.sun { position: absolute; width: 34%; aspect-ratio: 1; border-radius: 50%; background: var(--yellow); top: 14%; right: 14%; box-shadow: 0 0 14px #ffe9a0; transition: opacity 1s; }
.moon { position: absolute; width: 28%; aspect-ratio: 1; border-radius: 50%; top: 16%; right: 18%; opacity: 0; box-shadow: 6px -3px 0 0 #fff6c8; transition: opacity 1s; }
.cloud { position: absolute; width: 46%; height: 16%; background: #fff; border-radius: 99px; bottom: 26%; left: -10%; animation: cloud 14s linear infinite; }
.curtain { position: absolute; top: 0; bottom: 0; width: 24%; background: repeating-linear-gradient(90deg, var(--pink) 0 6px, #f6bccb 6px 9px); }
.curtain.l { left: 0; border-radius: 0 0 60% 0; }
.curtain.r { right: 0; border-radius: 0 0 0 60%; }
.room.is-night .sky { background: linear-gradient(#36386e, #5a5b9a); }
.room.is-night .sun { opacity: 0; }
.room.is-night .moon { opacity: 1; }
.room.is-night .cloud { opacity: .25; }

.portrait { position: absolute; top: 9%; right: 6%; width: 22%; max-width: 92px; aspect-ratio: 1 / 1.15; padding: 0;
  background: #fff; border: 6px solid #e9cfa9; border-radius: 14px; box-shadow: var(--shadow-s); overflow: visible; transform: rotate(3deg);
  transition: transform .2s; }
.portrait:hover, .portrait:focus-visible { transform: rotate(0) scale(1.05); }
.portrait-img { position: absolute; inset: 0; overflow: hidden; border-radius: 6px; background: linear-gradient(#e7f4fc, #f9e9ef); }
.portrait-img svg { width: 100%; height: 100%; display: block; }
.portrait-label { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); font-size: .7rem; font-weight: 900;
  background: var(--pink-d); color: #fff; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.portrait.call { animation: wiggle .5s ease-in-out 3; }

.deco-slot { position: absolute; top: 4%; left: 34%; right: 30%; height: 22%; display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; pointer-events: none; }
.deco-slot .lights { position: absolute; top: -6%; left: -60%; right: -50%; display: flex; justify-content: space-between; font-size: 1.1rem; }
.deco-slot .lights span { animation: twinkle 1.6s infinite; }
.deco-slot .lights span:nth-child(2n) { animation-delay: .8s; }
.furn-slot { position: absolute; left: 3%; bottom: 7%; font-size: 4rem; line-height: 1; pointer-events: none; filter: drop-shadow(0 4px 2px rgba(0,0,0,.08)); }
.toy-slot { position: absolute; right: 5%; bottom: 6%; font-size: 2.6rem; line-height: 1; pointer-events: none; filter: drop-shadow(0 3px 2px rgba(0,0,0,.08)); }
.toy-slot span { display: inline-block; animation: toybob 3s ease-in-out infinite; }

/* ---------- Teddy ---------- */
.teddy { position: absolute; left: calc(50% - 92px); bottom: 3%; width: 184px; height: 207px; padding: 0; z-index: 2; }
.teddy:focus-visible { outline: 3px dashed var(--lav-d); outline-offset: 4px; border-radius: 30px; }
.teddy.hidden-teddy { visibility: hidden; }
.teddy-body { width: 100%; height: 100%; transform-origin: 50% 100%; }
.teddy-body svg { width: 100%; height: 100%; display: block; overflow: visible; transform-origin: 50% 100%; animation: breathe 3.2s ease-in-out infinite; }
.teddy.sleeping .teddy-body svg { animation-duration: 5.5s; }
.teddy .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; }
.teddy .chomp { transform-box: fill-box; transform-origin: center; animation: chomp .28s ease-in-out infinite alternate; }
.teddy .tear { animation: tear 2.2s ease-in infinite; }
.teddy .arm { transform-box: fill-box; }
.teddy .arm-l { transform-origin: 80% 15%; }
.teddy .arm-r { transform-origin: 20% 15%; }
.teddy .head { transform-box: fill-box; transform-origin: 50% 90%; }
.teddy-body.wave .arm-r { animation: wave .35s ease-in-out 4 alternate; }
.teddy-body.wave .head { animation: tilt .7s ease-in-out 2 alternate; }
.teddy-body.bounce { animation: bounce .6s ease-out; }
.teddy-body.jump { animation: jump .5s ease-out; }
.teddy-body.shake { animation: shake .12s linear 4; }
.teddy-body.no { animation: no .5s ease-in-out; }
.teddy-body.wiggle { animation: wiggle .5s ease-in-out infinite; }
.teddy-body.lean-left { animation: leanL .55s ease-in-out; }
.teddy-body.lean-right { animation: leanR .55s ease-in-out; }
.teddy-body.sway { animation: sway 1.1s ease-in-out infinite; }
.teddy-body.sway .arm-l { animation: wave .55s ease-in-out infinite alternate; }
.teddy-body.sway .arm-r { animation: wave .55s ease-in-out infinite alternate-reverse; }

.bubble { position: absolute; left: 50%; bottom: calc(3% + 200px); transform: translateX(-50%); max-width: 76%;
  background: #fff; border-radius: 18px; padding: 7px 12px; font-weight: 800; font-size: .92rem; text-align: center;
  box-shadow: var(--shadow-s); z-index: 6; animation: pop .25s ease-out; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 3px; }

.night { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 70%, rgba(40, 40, 100, .25), rgba(26, 26, 72, .55));
  opacity: 0; pointer-events: none; transition: opacity 1.2s; z-index: 3; }
.room.sleeping .night { opacity: 1; }

.fx { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.fx .p { position: absolute; transform: translate(-50%, -50%); font-size: 1.6rem; line-height: 1; animation: floatUp 1.4s ease-out forwards; }
.fx .p.txt { font-weight: 900; font-size: 1rem; color: #fff; background: var(--pink-d); border-radius: 99px; padding: 2px 8px; }
.fx .p.txt.coin { background: #f2b93b; }
.fx .p.txt.xp { background: var(--lav-d); }
.fx .z { position: absolute; font-weight: 900; color: #fff; text-shadow: 0 2px 6px rgba(60,60,140,.5); animation: zzz 2.6s ease-out forwards; }
.fx .bub { position: absolute; border-radius: 50%; border: 2px solid rgba(255,255,255,.95);
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.95) 0 15%, rgba(196,229,246,.55) 16%); animation: bubble 1.8s ease-out forwards; }
.fx .bite { position: absolute; font-size: 2.4rem; transform: translate(-50%, -50%); animation: bite 1.5s ease-in forwards; }
.fx .tub { position: absolute; left: 50%; bottom: 0; width: 230px; height: 90px; transform: translateX(-50%); border-radius: 12px 12px 90px 90px;
  background: linear-gradient(#ffffff, #e9f5fc); border: 5px solid #fff; box-shadow: var(--shadow); animation: pop .3s ease-out; }
.fx .tub::before { content: ""; position: absolute; left: 6%; right: 6%; top: -6px; height: 22px; border-radius: 50%; background: #bfe3f6; }
.fx .brush { position: absolute; width: 64px; animation: brush 2s ease-in-out forwards; }

/* ---------- Mini-Spiele ---------- */
.play { position: absolute; inset: 0; z-index: 7; }
.play-hud { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.95); border-radius: 99px; padding: 5px 6px 5px 14px; font-weight: 900; box-shadow: var(--shadow-s); white-space: nowrap; z-index: 2; }
.play-stop { width: 30px; height: 30px; border-radius: 50%; background: var(--pink); font-size: .85rem; }
.play-area { position: absolute; inset: 0; }
.target { position: absolute; font-size: 2.8rem; width: 64px; height: 64px; line-height: 64px; text-align: center; padding: 0;
  transition: left .35s ease, top .35s ease; filter: drop-shadow(0 4px 3px rgba(0,0,0,.15)); }
.target.hit { animation: pop .25s; }
.hide-spot { position: absolute; bottom: 8%; width: 88px; height: 88px; transform: translateX(-50%); font-size: 4rem; line-height: 1;
  display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.hide-spot.miss { animation: no .45s; opacity: .5; }
.hide-spot .mini { width: 92px; animation: peek .5s ease-out; }
.hide-spot .mini svg { width: 100%; display: block; }
.dance-pad { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 10px; }
.dance-pad button { width: 62px; height: 62px; border-radius: 20px; background: #fff; font-size: 1.8rem; box-shadow: var(--shadow-s); transition: transform .1s, background .2s; }
.dance-pad button:disabled { opacity: .55; }
.dance-pad button.flash { background: var(--yellow); transform: scale(1.12); opacity: 1; }
.dance-pad button:active:not(:disabled) { transform: scale(.92); }

/* ---------- Status ---------- */
.stats { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 14px; margin: 12px 0; display: grid; gap: 7px; }
.stat { display: grid; grid-template-columns: 24px 88px 1fr 38px; align-items: center; gap: 6px; font-weight: 800; font-size: .88rem; }
.stat .ic { font-size: 1.05rem; text-align: center; }
.stat .val { text-align: right; color: var(--text-soft); font-size: .8rem; }
.bar { height: 14px; border-radius: 99px; background: #f6efe8; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.06); }
.bar > div { height: 100%; border-radius: 99px; transition: width .6s ease; position: relative; }
.bar > div::after { content: ""; position: absolute; left: 6px; right: 6px; top: 3px; height: 3px; border-radius: 99px; background: rgba(255,255,255,.55); }
.stat.low .bar > div { animation: lowpulse 1s ease-in-out infinite; }
.stat.low .val { color: #d4627e; }

/* ---------- Panel ---------- */
.panel { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
.panel h2 { margin: 0 0 10px; font-size: 1.1rem; font-weight: 900; }
.panel .sub { margin: -6px 0 12px; color: var(--text-soft); font-size: .88rem; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 420px) { .grid.g3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--cream); border-radius: 20px; padding: 12px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: var(--shadow-s); transition: transform .12s; position: relative; }
button.card:active:not(:disabled) { transform: scale(.96); }
button.card:disabled { opacity: .5; }
.card .big { font-size: 2.3rem; line-height: 1.1; }
.card .big svg { width: 2.4rem; height: 2.4rem; }
.card .nm { font-weight: 900; font-size: .95rem; }
.card .ds { font-size: .76rem; color: var(--text-soft); font-weight: 700; line-height: 1.25; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.chip { font-size: .7rem; font-weight: 800; padding: 1px 6px; border-radius: 99px; background: #fff; }
.chip.neg { color: #c4566f; }
.price { margin-top: 3px; font-weight: 900; font-size: .85rem; background: #fff4cc; border-radius: 99px; padding: 2px 10px; }
.price.free { background: var(--mint); }
.card.eq { outline: 3px solid var(--lav-d); }
.card .badge { position: absolute; top: 6px; right: 6px; font-size: .65rem; font-weight: 900; background: var(--lav-d); color: #fff; border-radius: 99px; padding: 1px 6px; }
.card.care-sick { outline: 3px solid var(--pink-d); animation: lowpulse 1.2s infinite; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex-shrink: 0; border-radius: 99px; padding: 7px 12px; font-weight: 800; font-size: .85rem; background: var(--cream); }
.tabs button.active { background: var(--lav); color: #4f3a9a; }

.papa-card { display: flex; gap: 12px; align-items: center; background: linear-gradient(120deg, #e7f4fc, #f9e9ef); border-radius: 20px; padding: 12px; margin-bottom: 12px; }
.papa-card .pp { width: 78px; height: 86px; flex-shrink: 0; border-radius: 16px; background: #fff; overflow: hidden; box-shadow: var(--shadow-s); }
.papa-card .pp svg { width: 100%; height: 100%; display: block; }
.papa-card p { margin: 0 0 8px; font-size: .88rem; font-weight: 700; line-height: 1.35; }
.btn { border-radius: 99px; padding: 9px 16px; font-weight: 900; background: var(--pink-d); color: #fff; box-shadow: 0 3px 0 #d0718c; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #d0718c; }
.btn.soft { background: var(--cream); color: var(--text); box-shadow: 0 3px 0 var(--beige-d); }
.btn.blue { background: var(--blue-d); box-shadow: 0 3px 0 #4f98c0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.story { background: var(--cream); border-radius: 18px; padding: 12px 14px; font-size: .88rem; line-height: 1.45; font-weight: 600; margin-bottom: 12px; }
.ach { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.ach div { background: var(--cream); border-radius: 16px; padding: 8px 4px; text-align: center; font-size: .66rem; font-weight: 800; line-height: 1.2; }
.ach div b { display: block; font-size: 1.6rem; margin-bottom: 2px; }
.ach div.locked { opacity: .45; filter: grayscale(1); }

/* ---------- Navigation ---------- */
.nav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-radius: 26px 26px 0 0; box-shadow: 0 -6px 20px rgba(140,100,80,.14); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
.nav button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0; border-radius: 18px; font-size: .72rem; font-weight: 800; color: var(--text-soft); transition: background .2s; }
.nav button span { font-size: 1.45rem; line-height: 1.2; transition: transform .2s; }
.nav button.active { background: var(--pink); color: var(--text); }
.nav button.active span { transform: translateY(-2px) scale(1.1); }

/* ---------- Dialog / Toast / Konfetti ---------- */
.dialog { position: fixed; inset: 0; z-index: 50; background: rgba(91, 70, 54, .35); display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
.dialog-card { width: 100%; max-width: 440px; background: #fff; border-radius: 28px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; box-shadow: 0 10px 40px rgba(91,70,54,.3); animation: slideUp .3s ease-out; }
.dialog-portrait { width: 96px; flex-shrink: 0; border-radius: 20px; overflow: hidden; background: linear-gradient(#e7f4fc, #f9e9ef); }
.dialog-portrait:empty { display: none; }
.dialog-portrait svg { width: 100%; display: block; }
.dialog-portrait .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4s infinite; }
.dialog-body { flex: 1; min-width: 0; }
.dialog-name { font-weight: 900; color: var(--pink-d); font-size: .9rem; }
.dialog-text { margin: 4px 0 12px; font-weight: 700; line-height: 1.45; }
.dialog-input { width: 100%; font: inherit; font-weight: 800; font-size: 1.1rem; border: 3px solid var(--lav); border-radius: 16px; padding: 8px 12px; margin-bottom: 12px; color: var(--text); outline: none; }
.dialog-input:focus { border-color: var(--lav-d); }
.dialog-buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60; background: #fff; border-radius: 99px; padding: 9px 16px;
  font-weight: 800; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; animation: slideDown .3s ease-out; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 55; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 3px; animation: fall linear forwards; }

/* ---------- Animationen ---------- */
@keyframes breathe { 0%,100% { transform: scale(1,1); } 50% { transform: scale(1.025,.975); } }
@keyframes blink { 0%,93%,100% { transform: scaleY(1); } 95.5% { transform: scaleY(.08); } }
@keyframes chomp { from { transform: scaleY(1); } to { transform: scaleY(.25); } }
@keyframes tear { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
@keyframes wave { from { transform: rotate(0); } to { transform: rotate(-38deg); } }
@keyframes tilt { from { transform: rotate(0); } to { transform: rotate(7deg); } }
@keyframes bounce { 0% { transform: translateY(0) scale(1); } 25% { transform: translateY(-26px) scale(.97,1.04); } 55% { transform: translateY(0) scale(1.05,.95); } 75% { transform: translateY(-8px); } 100% { transform: translateY(0); } }
@keyframes jump { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-42px); } }
@keyframes shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes no { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
@keyframes leanL { 0%,100% { transform: none; } 50% { transform: translateX(-22px) rotate(-14deg); } }
@keyframes leanR { 0%,100% { transform: none; } 50% { transform: translateX(22px) rotate(14deg); } }
@keyframes sway { 0%,100% { transform: rotate(-7deg) translateX(-6px); } 50% { transform: rotate(7deg) translateX(6px); } }
@keyframes pop { 0% { transform: translateX(-50%) scale(.6); opacity: 0; } 100% { transform: translateX(-50%) scale(1); opacity: 1; } }
.target.hit, .hide-spot .mini { animation-name: popc; }
@keyframes popc { 0% { transform: scale(.5); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes peek { 0% { transform: translateY(30px) scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes floatUp { 0% { transform: translate(-50%, -50%) scale(.5); opacity: 0; } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  100% { transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - 95px)) scale(1.1); opacity: 0; } }
@keyframes zzz { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(40px, -80px) scale(1.4); opacity: 0; } }
@keyframes bubble { 0% { transform: scale(.2); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(var(--dx, 0px), -70px) scale(1.1); opacity: 0; } }
@keyframes bite { 0% { transform: translate(-50%, 40px) scale(1.2); opacity: 0; } 20% { transform: translate(-50%, 0) scale(1); opacity: 1; }
  45% { clip-path: inset(0 0 0 0); } 65% { clip-path: inset(0 0 0 40%); } 85% { clip-path: inset(0 0 0 75%); opacity: 1; } 100% { clip-path: inset(0 0 0 100%); opacity: 0; } }
@keyframes brush { 0% { left: 25%; top: 35%; transform: rotate(-20deg); opacity: 0; } 10% { opacity: 1; } 30% { left: 60%; top: 45%; } 50% { left: 30%; top: 60%; transform: rotate(10deg); }
  70% { left: 62%; top: 68%; } 90% { opacity: 1; } 100% { left: 45%; top: 40%; opacity: 0; } }
@keyframes cloud { from { left: -50%; } to { left: 110%; } }
@keyframes twinkle { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes toybob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
@keyframes lowpulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes bump { 50% { transform: scale(1.18); } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideDown { from { transform: translate(-50%, -20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

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

/* ---------- Papa Milad (Spieler) & Mama Sara ---------- */
.tb-avatar { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; overflow: hidden; background: linear-gradient(#e7f4fc, #f9e9ef); box-shadow: var(--shadow-s); }
.tb-avatar svg { width: 100%; height: 100%; display: block; transform: scale(1.35) translateY(8%); }
.topbar { justify-content: flex-start; }
.tb-left { flex: 1; }
.mama-card { background: linear-gradient(120deg, #fdf3d9, #fbe6ee); }
.portrait-img .eyes, .papa-card .eyes { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }

/* ---------- Foto-Teddy: Ebenen & Boxen ---------- */
.teddy { left: calc(50% - 114px); width: 228px; height: 298px; bottom: 2%; }
.teddy-body { position: relative; }
.teddy-body svg { filter: drop-shadow(0 6px 5px rgba(110,70,50,.18)); }
.teddy .arm { transform-box: view-box; transition: transform .14s ease-out; }
.teddy .arm-l { transform-origin: 114px 228px; }
.teddy .arm-r { transform-origin: 310px 222px; }
.teddy .lids { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); animation: lidblink 4.6s infinite; }
.teddy .chomp { transform-box: fill-box; transform-origin: center; animation: chomp .28s ease-in-out infinite alternate; }
@keyframes lidblink { 0%, 93%, 100% { transform: scaleY(0); } 95.5% { transform: scaleY(1); } }
@keyframes wave { from { transform: rotate(0); } to { transform: rotate(-42deg); } }
@keyframes waveL { from { transform: rotate(0); } to { transform: rotate(42deg); } }
.teddy-body.sway .arm-l { animation: waveL .55s ease-in-out infinite alternate; }
.teddy-body.sway .arm-r { animation: wave .55s ease-in-out infinite alternate-reverse; }
.mood-badge { position: absolute; top: 40px; right: 4px; font-size: 1.7rem; background: #fff; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-s); animation: popc .3s ease-out; }
.bubble { bottom: calc(2% + 262px); }
.dialog-portrait img, .hide-spot .mini img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 4px; }
.hide-spot .mini { height: 118px; }

.teddy-body.boxing { animation: boxbob .42s ease-in-out infinite alternate; }
.teddy-body.boxing .arm-l { transform: rotate(52deg); }
.teddy-body.boxing .arm-r { transform: rotate(-52deg); }
.teddy-body.boxing.punch-l { animation: jabL .24s ease-out; }
.teddy-body.boxing.punch-r { animation: jabR .24s ease-out; }
.teddy-body.boxing.punch-l .arm-l { transform: rotate(4deg) scale(1.22); transition-duration: .06s; }
.teddy-body.boxing.punch-r .arm-r { transform: rotate(-4deg) scale(1.22); transition-duration: .06s; }
@keyframes boxbob { from { transform: translateY(0) rotate(-1.5deg); } to { transform: translateY(-6px) rotate(1.5deg); } }
@keyframes jabL { 0% { transform: none; } 40% { transform: translateX(-12px) rotate(-7deg); } 100% { transform: none; } }
@keyframes jabR { 0% { transform: none; } 40% { transform: translateX(12px) rotate(7deg); } 100% { transform: none; } }
.mitt { position: absolute; top: 57%; width: 74px; height: 74px; padding: 0; transform: translate(-50%, -50%); transition: transform .15s, filter .15s;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.15)); }
.mitt svg { width: 100%; height: 100%; display: block; }
.mitt-l { left: 21%; --kx: -12px; }
.mitt-r { left: 79%; --kx: 12px; }
.mitt.lit { transform: translate(-50%, -50%) scale(1.16); filter: drop-shadow(0 0 10px #fde58a) drop-shadow(0 0 4px #f6c34f); }
.mitt.hit { animation: mittHit .25s ease-out; }
@keyframes mittHit { 0% { transform: translate(-50%, -50%) scale(1.1); } 40% { transform: translate(calc(-50% + var(--kx)), -50%) scale(.88); } 100% { transform: translate(-50%, -50%); } }

/* =====================================================================
   DUNKLES DESIGN – überschreibt die Pastell-Werte von oben.
   Anthrazit, Rot (Akzent), Bernstein (Münzen/Highlights).
   ===================================================================== */
:root {
  --cream: #2a2d36; --beige: #2a2d36; --beige-d: #16171c;
  --pink: #3a1f22; --pink-d: #e5484d; --blue: #23344a; --blue-d: #3b82f6;
  --lav: #3a1f22; --lav-d: #e5484d; --yellow: #f5a524; --mint: #1d3a2b;
  --text: #ececf1; --text-soft: #a3a6b1; --card: #1d1f26;
  --shadow: 0 8px 22px rgba(0, 0, 0, .45); --shadow-s: 0 3px 10px rgba(0, 0, 0, .4);
  --red: #e5484d; --amber: #f5a524;
}
body { background: radial-gradient(ellipse at 50% -10%, #23252e 0%, #111216 60%) fixed #111216; }
.lv { background: #3a1f22; color: #ff8a8e; }
.xpbar { background: #2a2d36; }
.xpfill { background: linear-gradient(90deg, var(--red), var(--amber)); }
.pill.coin { background: #33290f; color: #ffd27a; }
.tb-avatar, .dialog-portrait, .portrait-img { background: linear-gradient(#3a3f4d, #262932); }
.papa-card .pp { background: linear-gradient(#3a3f4d, #262932); }

/* Zimmer → Boxkeller */
.wall { background-color: #2a2c35;
  background-image: linear-gradient(rgba(0,0,0,.28) 2px, transparent 2px), linear-gradient(90deg, rgba(0,0,0,.28) 2px, transparent 2px), linear-gradient(90deg, rgba(0,0,0,.28) 2px, transparent 2px);
  background-size: 64px 28px, 64px 56px, 64px 56px; background-position: 0 0, 0 0, 32px 28px; }
.wall::after { background: #17181d; height: 8px; }
.wall::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 55% 70% at 50% 0%, rgba(245, 165, 36, .22), transparent 70%); }
.floor { background: repeating-linear-gradient(90deg, #3a2c22 0 58px, #2c2119 58px 60px); }
.rug { background: radial-gradient(ellipse at center, #7d1f25 0 52%, #e9e9ee 53% 57%, #5d171c 58%); box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.window { border-color: #4a4d59; }
.curtain { background: repeating-linear-gradient(90deg, #5d171c 0 6px, #4a1216 6px 9px); }
.portrait { background: #262932; border-color: #6b5338; }
.portrait-label { background: var(--red); }
.bubble, .bubble::after { background: #f2f2f5; color: #17181d; }
.mood-badge { background: #262932; }
.play-hud { background: rgba(24, 25, 31, .95); color: var(--text); border: 1px solid #3a3d48; }
.play-stop { background: #3a1f22; color: #ff8a8e; }
.dance-pad button { background: #262932; border: 1px solid #3a3d48; }
.dance-pad button.flash { background: var(--amber); }
.fx .p.txt { background: var(--red); } .fx .p.txt.coin { background: #c98510; } .fx .p.txt.xp { background: #5b5fe0; }
.fx .tub { background: linear-gradient(#e9e9ee, #b9bcc8); border-color: #e9e9ee; }
.mitt.lit { filter: drop-shadow(0 0 12px #f5a524) drop-shadow(0 0 4px #ffd27a); }

/* Karten, Leisten, Panel */
.bar { background: #2a2d36; box-shadow: inset 0 1px 2px rgba(0,0,0,.5); }
.bar > div::after { background: rgba(255,255,255,.22); }
.stat.low .val { color: #ff8a8e; }
.card { background: #262932; border: 1px solid #33363f; }
.chip { background: #33363f; color: var(--text); } .chip.neg { color: #ff8a8e; }
.price { background: #33290f; color: #ffd27a; } .price.free { background: #1d3a2b; color: #7be0a4; }
.card.eq { outline-color: var(--amber); } .card .badge { background: var(--amber); color: #17181d; }
.card.care-sick { outline-color: var(--red); }
.tabs button { background: #262932; color: var(--text-soft); } .tabs button.active { background: var(--red); color: #fff; }
.papa-card { background: linear-gradient(120deg, #262932, #2d2630); border: 1px solid #33363f; }
.mama-card { background: linear-gradient(120deg, #26302f, #262932); }
.story, .ach div { background: #262932; }
.btn { background: var(--red); box-shadow: 0 3px 0 #9c2b2f; } .btn:active { box-shadow: 0 1px 0 #9c2b2f; }
.btn.soft { background: #33363f; color: var(--text); box-shadow: 0 3px 0 #17181d; }
.nav { background: rgba(22, 23, 28, .96); box-shadow: 0 -6px 20px rgba(0,0,0,.5); border-top: 1px solid #2a2d36; }
.nav button.active { background: #3a1f22; color: #fff; }
.icon-btn { background: #2a2d36; }
.dialog { background: rgba(0, 0, 0, .6); }
.dialog-card { background: #1d1f26; border: 1px solid #3a3d48; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.dialog-name { color: var(--amber); }
.dialog-input { background: #262932; border-color: #3a3d48; }
.toast { background: #262932; border: 1px solid #3a3d48; color: var(--text); }
.teddy:focus-visible { outline-color: var(--amber); }

/* Kampf */
.fight-bar { position: absolute; top: 52px; left: 8px; right: 8px; display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: .78rem; }
.fight-bar b { color: var(--amber); font-size: .9rem; }
.fight-bar .fb { flex: 1; } .fight-bar .fb:last-child { text-align: right; }
.fight-bar span { text-shadow: 0 1px 3px #000; }
.hp { height: 13px; border-radius: 99px; background: rgba(0,0,0,.55); border: 1px solid #4a4d59; overflow: hidden; display: flex; }
.hp i { display: block; height: 100%; width: 100%; border-radius: 99px; transition: width .25s; }
.hp-m i { background: linear-gradient(90deg, #3b82f6, #7fb0ff); }
.hp-t { justify-content: flex-end; } .hp-t i { background: linear-gradient(90deg, #f5a524, #e5484d); }
.fight-msg { position: absolute; top: 92px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-weight: 900; font-size: .9rem;
  background: rgba(24,25,31,.92); border: 1px solid #3a3d48; border-radius: 99px; padding: 5px 14px; }
.fight-msg.warn { border-color: var(--red); color: #ff8a8e; animation: lowpulse .35s infinite; }
.fight-msg.good { border-color: #2f9e5f; color: #7be0a4; }
.fight-msg.bad { border-color: var(--red); color: #ff8a8e; }
.fight-pad { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; gap: 8px; width: calc(100% - 16px); max-width: 380px; }
.fight-pad button { flex: 1; height: 62px; border-radius: 18px; background: rgba(38,41,50,.95); border: 2px solid #3a3d48; font-size: 1.5rem; line-height: 1.1; color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; transition: transform .08s, background .12s, border-color .12s; }
.fight-pad button small { font-size: .62rem; font-weight: 800; color: var(--text-soft); }
.fight-pad button:active { transform: scale(.93); }
.fight-pad button.flash { background: var(--amber); border-color: #fff; transform: scale(1.06); } .fight-pad button.flash small { color: #17181d; }
.fight-pad .hitbtn.flash { background: #2f9e5f; }
.room.hitshake { animation: hitshake .32s; }
@keyframes hitshake { 0%,100% { transform: none; filter: none; } 20% { transform: translate(-7px, 3px); filter: brightness(1.5) saturate(1.4); } 45% { transform: translate(6px, -3px); } 70% { transform: translate(-3px, 2px); } }
.room.rage::after { content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; box-shadow: inset 0 0 60px 12px rgba(229, 72, 77, .75); animation: lowpulse .5s infinite; }
.food-sub { margin-top: 16px !important; }
.card.food-bad { border-color: #4a2a2c; background: #2a2326; }
.tb-sub { font-size: .74rem; font-weight: 700; color: var(--text-soft); }
