/* ---------- konijnenkont theme ---------- */
:root {
  --sky-top: #bde9ff;
  --sky-bot: #e9fff2;
  --grass: #9ee37d;
  --grass-dark: #7bc95f;
  --card: #ffffff;
  --ink: #4a3b52;
  --pink: #ff9ec7;
  --pink-deep: #ff6fa5;
  --green: #6fcf6b;
  --orange: #ffb24d;
  --red: #ff7a7a;
  --shadow: 0 8px 0 rgba(0, 0, 0, .12);
  font-family: "Comic Sans MS", "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(var(--sky-top), var(--sky-bot));
  display: flex;
  justify-content: center;
  padding: 12px;
}

.game {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- title ---------- */
.title { text-align: center; }
.title h1 { margin: 4px 0; font-size: 2rem; text-shadow: 2px 2px 0 #fff; }
.subtitle { margin: 0; font-size: .95rem; opacity: .8; }

/* ---------- language switch ---------- */
.lang-switch {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 4px;
}
.lang-btn {
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-family: inherit;
  font-weight: bold;
  font-size: .85rem;
  color: var(--ink);
  background: rgba(255, 255, 255, .65);
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .1);
  transition: transform .08s, background .15s;
}
.lang-btn:active { transform: translateY(2px); }
.lang-btn.active {
  background: var(--pink);
  border-color: var(--pink-deep);
  color: #fff;
}

/* ---------- stats ---------- */
.stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.stat { display: grid; grid-template-columns: 110px 1fr 38px; align-items: center; gap: 8px; }
.stat-label { font-size: .85rem; font-weight: bold; }
.stat-num { font-size: .85rem; font-weight: bold; text-align: right; }
.bar { height: 16px; background: #eee; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 60%; border-radius: 999px; transition: width .4s ease; }
.bar-fill.fullness { background: linear-gradient(90deg, #ffd27a, var(--orange)); }
.bar-fill.happiness { background: linear-gradient(90deg, #ffb3d1, var(--pink-deep)); }
.bar-fill.health { background: linear-gradient(90deg, #b6f0a0, var(--green)); }

/* ---------- meadow ---------- */
.meadow {
  position: relative;
  background: linear-gradient(var(--sky-bot) 55%, var(--grass) 55%);
  border-radius: 22px;
  padding: 14px 14px 0;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 320px;
}

.speech {
  position: relative;
  margin: 4px auto 6px;
  background: #fff;
  border: 3px solid var(--pink);
  border-radius: 18px;
  padding: 8px 14px;
  max-width: 92%;
  text-align: center;
  font-weight: bold;
  box-shadow: 0 4px 0 rgba(0,0,0,.08);
}
.speech::after {
  content: "";
  position: absolute;
  bottom: -12px; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--pink);
}
.speech-emoji { font-size: 1.3rem; margin-right: 6px; }
.speech.pop { animation: pop .3s ease; }

/* ---------- school game (math quiz) ---------- */
.quiz {
  position: relative;
  margin: 0 auto 6px;
  background: #fff;
  border: 3px solid var(--green);
  border-radius: 18px;
  padding: 10px 14px 12px;
  max-width: 92%;
  text-align: center;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .08);
  animation: pop .3s ease;
}
.quiz[hidden] { display: none; }
.quiz-prompt { margin: 2px 0 10px; font-weight: bold; }
.quiz-intro { font-size: .85rem; opacity: .85; }
.quiz-text { font-size: 1.5rem; color: var(--pink-deep); }
.quiz-options { display: flex; gap: 8px; justify-content: center; }
.quiz-option {
  flex: 1;
  max-width: 90px;
  border: none;
  border-radius: 14px;
  padding: 12px 6px;
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--ink);
  background: #d8f7c8;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .12);
  transition: transform .08s, box-shadow .08s, background .15s;
}
.quiz-option:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .12); }
.quiz-option.wrong { background: #ffd0d0; opacity: .6; }

.rabbit-stage {
  position: relative;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.rabbit {
  width: 200px;
  height: auto;
  filter: drop-shadow(0 4px 3px rgba(0,0,0,.12));
  animation: bob 2.6s ease-in-out infinite;
  transform-origin: center bottom;
}
.rabbit.wiggle { animation: wiggle .5s ease; }
.rabbit.nom { animation: nom .5s ease; }

/* ---- Mochi rabbit parts (colors come from inline --vars on the <svg>) ---- */
.rabbit .shadow { fill: rgba(0,0,0,.06); }
.rabbit .ear, .rabbit .body, .rabbit .foot, .rabbit .arm {
  fill: var(--body); stroke: var(--outline); stroke-width: 2.4;
}
.rabbit .ear-in { fill: var(--ear-in); }
.rabbit .blush { fill: var(--blush); }
.rabbit .nose { fill: var(--nose); }
.rabbit .eye { fill: var(--eye); }
.rabbit .shine { fill: #fff; }
.rabbit .shine.sm { fill: #fff; opacity: .85; }
.rabbit .arc { fill: none; stroke: var(--eye); stroke-width: 3; stroke-linecap: round; }
.rabbit .brow { fill: none; stroke: var(--eye); stroke-width: 2.4; stroke-linecap: round; }
.rabbit .mouth { fill: none; stroke: var(--eye); stroke-width: 2.6; stroke-linecap: round; }
.rabbit .mouth-o { fill: var(--nose); }

/* expression fx colors */
.rabbit .fx-heart { fill: #ff7aa2; }
.rabbit .sparkle { fill: #fff3a6; }
.rabbit .sparkle.w { fill: #fff; }
.rabbit .tear, .rabbit .sweat { fill: #93d4ff; }
.rabbit .tear-s { fill: #fff; opacity: .8; }
.rabbit .green { fill: #9bd67e; opacity: .8; }
.rabbit .stink { fill: none; stroke: #b9b39a; stroke-width: 2; stroke-linecap: round; opacity: .8; }

/* hide alternate faces + all fx by default; each mood reveals what it needs */
.rabbit .b-eyes-happy,
.rabbit .b-eyes-sad,
.rabbit .b-eyes-sick,
.rabbit .b-mouth-open,
.rabbit .b-mouth-flat,
.rabbit .b-mouth-frown,
.rabbit .fx { display: none; }

/* HAPPY (default) -> base eyes + smile + a little sparkle */
.rabbit[data-mood="happy"] .fx-sparkle { display: inline; }

/* LOVE + EAT -> happy closed eyes, stronger blush */
.rabbit[data-mood="love"] .b-eyes-base,
.rabbit[data-mood="eat"]  .b-eyes-base { display: none; }
.rabbit[data-mood="love"] .b-eyes-happy,
.rabbit[data-mood="eat"]  .b-eyes-happy { display: inline; }
.rabbit[data-mood="love"] .blush,
.rabbit[data-mood="eat"]  .blush { fill: var(--blush-strong); }
.rabbit[data-mood="eat"]  .b-mouth-smile { display: none; }
.rabbit[data-mood="eat"]  .b-mouth-open { display: inline; }
.rabbit[data-mood="love"] .fx-hearts,
.rabbit[data-mood="love"] .fx-sparkle { display: inline; }

/* HUNGRY -> flat mouth + a worried sweat drop */
.rabbit[data-mood="hungry"] .b-mouth-smile { display: none; }
.rabbit[data-mood="hungry"] .b-mouth-flat { display: inline; }
.rabbit[data-mood="hungry"] .fx-sweat { display: inline; }

/* SAD -> sad eyes + frown + tear */
.rabbit[data-mood="sad"] .b-eyes-base { display: none; }
.rabbit[data-mood="sad"] .b-eyes-sad { display: inline; }
.rabbit[data-mood="sad"] .b-mouth-smile { display: none; }
.rabbit[data-mood="sad"] .b-mouth-frown { display: inline; }
.rabbit[data-mood="sad"] .fx-tear { display: inline; }

/* SICK -> x eyes + frown + green cheeks + a queasy body tint */
.rabbit[data-mood="sick"] .b-eyes-base { display: none; }
.rabbit[data-mood="sick"] .b-eyes-sick { display: inline; }
.rabbit[data-mood="sick"] .b-mouth-smile { display: none; }
.rabbit[data-mood="sick"] .b-mouth-frown { display: inline; }
.rabbit[data-mood="sick"] .fx-sick { display: inline; }
.rabbit[data-mood="sick"] .body { fill: #f3f8ec; }

/* DIRTY -> flat mouth + stink lines */
.rabbit[data-mood="dirty"] .b-mouth-smile { display: none; }
.rabbit[data-mood="dirty"] .b-mouth-flat { display: inline; }
.rabbit[data-mood="dirty"] .fx-stink { display: inline; }

/* ground + poops + hearts */
.ground { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; }
.poops { position: absolute; bottom: 6px; left: 0; right: 0; height: 40px; }
.poop { position: absolute; bottom: 0; font-size: 1.7rem; animation: drop .35s ease; }
.hearts { position: absolute; inset: 0; pointer-events: none; }
.heart { position: absolute; bottom: 90px; font-size: 1.5rem; animation: floatUp 1.1s ease forwards; }

/* ---------- care buttons ---------- */
.care { display: flex; gap: 10px; }
.care .btn { flex: 1; }

.btn {
  border: none;
  border-radius: 16px;
  padding: 14px 10px;
  font-size: 1.05rem;
  font-weight: bold;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0,0,0,.15);
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.15); }
.btn-pet { background: var(--pink); }
.btn-clean { background: #bfe3ff; }

/* ---------- food ---------- */
.food-area { display: flex; flex-direction: column; gap: 10px; }
.food-group {
  background: var(--card);
  border-radius: 18px;
  padding: 8px 12px 12px;
  box-shadow: var(--shadow);
}
.food-group h2 { margin: 4px 0 8px; font-size: 1rem; }
.food-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.food { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; }
.food .food-emoji { font-size: 1.7rem; }
.food .food-name { font-size: .7rem; }
.food.healthy { background: #d8f7c8; }
.food.snack { background: #ffe1b0; }

/* ---------- animations ---------- */
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
@keyframes nom { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08, .94); } }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes drop { 0% { transform: translateY(-30px) scale(.4); opacity: 0; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes floatUp { 0% { transform: translateY(0) scale(.6); opacity: 1; } 100% { transform: translateY(-90px) scale(1.2); opacity: 0; } }

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