:root {
  --bg: #fbf3e4;
  --bg2: #f3e3c7;
  --ink: #3a2a1a;
  --muted: #8a7355;
  --card: #fffaf0;
  --primary: #e07a3a;
  --primary-d: #c4632a;
  --accent: #5f8a3e;
  --danger: #c0392b;
  --line: #e7d6b8;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(90, 60, 20, 0.12);
}

* { box-sizing: border-box; }

/* hidden muss immer gewinnen — sonst überschreibt z.B. .overlay{display:grid} das Attribut. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 50% -10%, #fff7e8 0%, var(--bg) 45%, var(--bg2) 100%) fixed;
  min-height: 100vh;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; max-width: 920px; margin: 0 auto;
}
.logo { height: 52px; }
.who { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.link { background: none; border: none; color: var(--muted); cursor: pointer; text-decoration: underline; font: inherit; }

#app { max-width: 920px; margin: 0 auto; padding: 12px 22px 60px; }

.screen { animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}
.card.sad { background: linear-gradient(180deg, #eef0f4, #e6e3ec); border-color: #d4cfe0; }

h1 { font-size: 2rem; margin: 0 0 6px; }
h2 { font-size: 1.6rem; margin: 0 0 6px; }
.brand, .badge { color: var(--primary); }
.muted { color: var(--muted); }
.error { color: var(--danger); font-weight: 700; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row.center { justify-content: center; }

input {
  flex: 1; min-width: 180px; padding: 12px 16px; font: inherit;
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
}
input:focus { outline: none; border-color: var(--primary); }

.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  padding: 12px 18px; border-radius: 14px;
  border: 2px solid var(--line); background: #fff; color: var(--ink);
  transition: transform .08s ease, box-shadow .15s ease, background .15s;
  box-shadow: 0 3px 0 rgba(90,60,20,.12);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary-d); }
.btn.primary:hover { background: var(--primary-d); }
.btn.big { font-size: 1.2rem; padding: 16px 26px; }

/* --- Wurf-Auswahl --- */
.litter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-top: 18px; }
.puppy {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-align: center; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s;
}
.puppy:hover { transform: translateY(-4px); border-color: var(--primary); }
.puppy .pup-dog { width: 120px; height: 120px; display: inline-block; }
.puppy h3 { margin: 6px 0 2px; }
.puppy .badge { display: inline-block; margin-top: 8px; font-size: .85rem; background: #fff0e2; border: 1px dashed var(--primary); padding: 3px 8px; border-radius: 999px; }
.mourning { background: #efeaf6; border: 2px solid #d4cfe0; border-radius: 12px; padding: 12px; margin: 12px 0; font-weight: 700; }

/* --- Pflege --- */
.care-stage {
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
  background: linear-gradient(180deg, #eaf6e0, #d9eecb);
  border: 2px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.dog-wrap { position: relative; width: 240px; height: 240px; display: grid; place-items: center; }
.dog-img { width: 220px; height: 220px; transition: transform .4s ease; transform-origin: bottom center; }
.dog-img svg { width: 100%; height: 100%; }
.pup-dog svg { width: 100%; height: 100%; }
.dog-shadow { position: absolute; bottom: 14px; width: 150px; height: 22px; background: rgba(0,0,0,.14); border-radius: 50%; filter: blur(2px); z-index: -1; }
.mood-bubble {
  position: absolute; top: 6px; right: 18px; background: #fff; border: 2px solid var(--line);
  border-radius: 14px; padding: 6px 10px; font-size: 1.5rem; box-shadow: var(--shadow);
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-6px); } }
.dog-meta h2 { margin: 0; }
.badge { display: inline-block; margin-top: 8px; background: #fff0e2; border: 1px dashed var(--primary); padding: 4px 10px; border-radius: 999px; font-weight: 700; }

.needs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 22px 0; }
.need { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.need .need-top { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 6px; }
.bar { height: 14px; background: #eee3cf; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; transition: width .4s ease, background .4s; }

.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.actions .action { font-size: 1.05rem; }

.diary { margin-top: 24px; }
.diary ul { list-style: none; padding: 0; margin: 0; }
.diary li { padding: 8px 12px; border-left: 3px solid var(--line); margin-bottom: 6px; background: #fffdf7; border-radius: 6px; color: var(--muted); }

/* --- Beerdigung --- */
.eulogy { font-size: 1.2rem; font-weight: 700; }
.burial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 16px; }
.burial-opt { background: #fff; border: 2px solid #d4cfe0; border-radius: var(--radius); padding: 16px; text-align: center; cursor: pointer; transition: transform .12s, border-color .12s; }
.burial-opt:hover { transform: translateY(-3px); border-color: var(--primary); }
.burial-opt img { width: 72px; height: 72px; }
.burial-opt span { display: block; margin-top: 8px; font-weight: 700; }

/* --- Minispiel-Overlay --- */
.overlay { position: fixed; inset: 0; background: rgba(40,25,10,.5); display: grid; place-items: center; z-index: 50; padding: 20px; }
.feed-game { max-width: 460px; width: 100%; text-align: center; }
.fill-track { position: relative; height: 38px; background: #eee3cf; border-radius: 999px; margin: 20px 0; overflow: hidden; border: 2px solid var(--line); }
.fill-optimal { position: absolute; left: 80%; right: 0%; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, #bfe3a3, #bfe3a3 8px, #aedb8c 8px, #aedb8c 16px); }
.fill-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: var(--primary); transition: width .08s linear; }
.fill-label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; color: var(--ink); }
.feed-result { font-weight: 800; font-size: 1.1rem; margin-top: 8px; }

/* --- Toast --- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-weight: 700; box-shadow: var(--shadow); z-index: 60; animation: pop .2s ease;
}

@media (max-width: 560px) {
  .care-stage { justify-content: center; text-align: center; }
}
