:root {
  --ink: #3b3148;
  --muted: #7a7188;
  --paper: #fffaf1;
  --line: rgba(59, 49, 72, 0.15);
  --pink: #ff7ea8;
  --yellow: #ffd05d;
  --green: #67d9a5;
  --blue: #72b8ff;
  --violet: #a88bff;
  --dock: rgba(255, 250, 241, 0.92);
  font-family: ui-rounded, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

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

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  color: var(--ink);
  background: #c8f0ed;
  user-select: none;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app,
.start-screen,
.game-screen {
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
}

.app {
  display: grid;
  place-items: stretch center;
}

.start-screen {
  display: grid;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,0.9) 0 8%, transparent 9%),
    radial-gradient(circle at 82% 22%, rgba(255,216,104,0.8) 0 10%, transparent 11%),
    linear-gradient(180deg, #ffeff6 0%, #dff9ff 55%, #fff1c7 100%);
}

.start-panel {
  width: min(100%, 390px);
  padding: 24px 16px 20px;
  border: 3px solid rgba(255,255,255,0.9);
  border-radius: 24px;
  background: rgba(255,250,241,0.92);
  box-shadow: 0 16px 0 rgba(59,49,72,0.08), 0 24px 48px rgba(80,63,93,0.2);
  text-align: center;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 38px;
  line-height: 1.02;
  letter-spacing: 0;
}

.start-panel p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
}

.egg-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.egg-card {
  min-width: 0;
  height: 112px;
  border-radius: 22px;
  border: 2px solid rgba(59,49,72,0.1);
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: inset 0 -8px rgba(59,49,72,0.05), 0 8px 0 rgba(59,49,72,0.1);
  transition: transform 0.16s ease;
}

.egg-card:active,
.dock-press {
  transform: translateY(5px) scale(0.96);
}

.egg-card.selected {
  border-color: var(--pink);
  transform: translateY(-5px);
}

.egg {
  width: 54px;
  height: 76px;
  border-radius: 50% 50% 46% 46%;
  position: relative;
  overflow: hidden;
  box-shadow: inset -9px -12px rgba(59,49,72,0.1), 0 9px 14px rgba(59,49,72,0.16);
}

.egg::before,
.egg::after {
  content: "";
  position: absolute;
  left: -10px;
  right: -10px;
  height: 15px;
  background: rgba(255,255,255,0.58);
}

.egg::before {
  top: 22px;
  transform: rotate(-8deg);
}

.egg::after {
  bottom: 15px;
  transform: rotate(9deg);
}

.egg.tap {
  animation: tap 0.18s ease;
}

.egg.hatching {
  animation: hatch 0.75s ease-in-out 2;
}

.hatch-hint {
  min-height: 30px;
  margin-top: 18px;
  color: #ee5d89;
  font-weight: 1000;
}

.game-screen {
  max-width: 430px;
  margin: 0 auto;
  background: #bfeee8;
}

.room {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  padding: max(8px, env(safe-area-inset-top)) 12px max(112px, calc(102px + env(safe-area-inset-bottom)));
  isolation: isolate;
}

.theme-mint {
  background:
    radial-gradient(circle at 16% 22%, rgba(255,255,255,0.52) 0 7px, transparent 8px),
    linear-gradient(180deg, #b8f2e6 0%, #e8fff8 56%, #f9dca9 57%, #e9b86f 100%);
}

.theme-berry {
  background:
    radial-gradient(circle at 18% 24%, rgba(255,255,255,0.55) 0 8px, transparent 9px),
    radial-gradient(circle at 80% 20%, rgba(255,126,168,0.28) 0 54px, transparent 55px),
    linear-gradient(180deg, #ffd7e8 0%, #fff5f7 56%, #cceeff 57%, #84c6eb 100%);
}

.theme-leaf {
  background:
    radial-gradient(ellipse at 16% 25%, rgba(77,168,96,0.18) 0 26px, transparent 27px),
    radial-gradient(ellipse at 78% 24%, rgba(77,168,96,0.18) 0 36px, transparent 37px),
    linear-gradient(180deg, #d6efbd 0%, #f6ffe4 56%, #e6c788 57%, #bb9155 100%);
}

.theme-night,
.room.sleeping {
  background:
    radial-gradient(circle at 18% 18%, #fff7ba 0 4px, transparent 5px),
    radial-gradient(circle at 58% 16%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 82% 27%, #fff 0 3px, transparent 4px),
    linear-gradient(180deg, #273d78 0%, #5967ad 56%, #746a84 57%, #4c4660 100%);
}

.room::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: 0;
  height: 43%;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.18) 1px, transparent 1px) 0 0 / 42px 100%,
    linear-gradient(180deg, rgba(255,255,255,0.2), transparent 28%),
    rgba(124,93,58,0.16);
  transform: perspective(340px) rotateX(20deg);
  transform-origin: bottom;
}

.room::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.time-morning::before {
  background: linear-gradient(180deg, rgba(255,226,151,0.22), transparent 42%);
}

.time-day::before {
  background: linear-gradient(180deg, rgba(255,255,255,0.12), transparent 42%);
}

.time-night::before {
  background: linear-gradient(180deg, rgba(28,35,84,0.36), rgba(20,18,45,0.22));
}

.topbar {
  position: relative;
  z-index: 20;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.stat-chip {
  height: 36px;
  min-width: 0;
  border-radius: 18px;
  padding: 4px 5px;
  display: grid;
  grid-template-columns: 22px 1fr;
  grid-template-rows: 1fr 12px;
  align-items: center;
  gap: 1px 3px;
  background: rgba(255,255,255,0.88);
  box-shadow: inset 0 -4px rgba(59,49,72,0.07), 0 3px 0 rgba(59,49,72,0.1);
  font-weight: 1000;
}

.stat-chip:active {
  transform: translateY(3px);
  box-shadow: inset 0 -2px rgba(59,49,72,0.07), 0 1px 0 rgba(59,49,72,0.1);
}

.stat-chip span {
  grid-row: 1 / 3;
  font-size: 18px;
  line-height: 1;
}

.stat-chip b {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(59,49,72,0.12);
}

.stat-chip i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transition: width 0.25s ease;
}

.stat-chip:nth-child(1) i { background: var(--yellow); }
.stat-chip:nth-child(2) i { background: var(--pink); }
.stat-chip:nth-child(3) i { background: var(--blue); }
.stat-chip:nth-child(4) i { background: var(--green); }

.stat-chip em {
  font-size: 10px;
  line-height: 1;
  font-style: normal;
}

.stat-detail {
  position: absolute;
  top: 44px;
  left: 8px;
  right: 8px;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 16px;
  background: rgba(255,250,241,0.94);
  box-shadow: 0 10px 24px rgba(59,49,72,0.18);
  font-size: 13px;
  font-weight: 1000;
  text-align: center;
}

.hud {
  position: relative;
  z-index: 14;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
}

.hud > span,
.icon-button,
.xp-track,
.heart-track {
  border: 2px solid rgba(255,255,255,0.72);
  background: rgba(255,250,241,0.86);
  box-shadow: inset 0 -4px rgba(59,49,72,0.06), 0 4px 0 rgba(59,49,72,0.09);
}

.hud > span {
  min-width: 70px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 17px;
  font-weight: 1000;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 1000;
}

.hud .icon-button:first-of-type {
  margin-left: auto;
}

.xp-track {
  position: relative;
  z-index: 13;
  height: 30px;
  margin-top: 8px;
  padding: 5px 9px;
  border-radius: 15px;
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  gap: 7px;
  align-items: center;
  font-size: 11px;
  font-weight: 1000;
}

.heart-track {
  position: relative;
  z-index: 13;
  height: 26px;
  margin-top: 7px;
  padding: 4px 9px;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 28px 1fr 44px;
  gap: 7px;
  align-items: center;
  color: #e34b7c;
  font-size: 11px;
  font-weight: 1000;
}

.heart-track b {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(59,49,72,0.12);
}

.heart-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9fbd, #ff5d8f);
  transition: width 0.3s ease;
}

.heart-track em {
  font-style: normal;
  text-align: right;
}

.xp-track b {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(59,49,72,0.12);
}

.xp-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffe05d, #ff7ea8, #8ad4ff);
  transition: width 0.3s ease;
}

.xp-track em {
  font-style: normal;
  text-align: right;
}

.window {
  position: absolute;
  top: 19%;
  right: 7%;
  width: 22%;
  max-width: 96px;
  aspect-ratio: 1.04;
  border: 7px solid #fff5db;
  border-radius: 24px;
  background:
    radial-gradient(circle at 68% 22%, #ffe674 0 13px, transparent 14px),
    linear-gradient(160deg, #79d3ff 0 52%, #a8e6ff 53%);
  box-shadow: inset 0 -7px rgba(59,49,72,0.07), 0 8px 0 rgba(59,49,72,0.1);
}

.room.sleeping .window,
.theme-night .window {
  background:
    radial-gradient(circle at 22% 26%, #fff7ba 0 12px, transparent 13px),
    radial-gradient(circle at 68% 34%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 78% 62%, #fff 0 3px, transparent 4px),
    linear-gradient(160deg, #17275d 0 52%, #3d4c91 53%);
}

.window span,
.window::before {
  content: "";
  position: absolute;
  background: rgba(255,255,255,0.9);
}

.window span {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 5px;
}

.window::before {
  top: 50%;
  left: 0;
  right: 0;
  height: 5px;
}

.floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  pointer-events: none;
}

.furniture-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.furniture {
  position: absolute;
}

.furniture svg {
  width: 100%;
  height: 100%;
  display: block;
}

.furniture-rug { left: 22%; bottom: 15%; width: 56%; }
.furniture-plant { left: 5%; bottom: 29%; width: 22%; }
.furniture-shelf { left: 9%; top: 24%; width: 35%; }
.furniture-poster { left: 14%; top: 35%; width: 20%; }
.furniture-lamp { right: 6%; bottom: 28%; width: 18%; }
.furniture-toybox { right: 8%; bottom: 16%; width: 27%; }
.furniture-clock { left: 42%; top: 19%; width: 16%; }
.furniture-cushion { left: 11%; bottom: 17%; width: 22%; }

.pet-wrap {
  position: absolute;
  left: 50%;
  bottom: 22%;
  width: min(74vw, 292px);
  height: min(74vw, 292px);
  display: grid;
  place-items: end center;
  transform: translateX(-50%);
  transform-origin: bottom center;
  animation: idleBounce 2.5s ease-in-out infinite, idleWalk 12s ease-in-out infinite;
  z-index: 8;
  touch-action: none;
}

.stage-badge {
  position: absolute;
  left: 50%;
  top: 5%;
  transform: translateX(-50%);
  z-index: 9;
  min-width: 48px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,250,241,0.92);
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 4px 0 rgba(59,49,72,0.1);
  font-size: 11px;
  font-weight: 1000;
  text-align: center;
}

.pet-wrap.sad {
  animation: idleBounce 2.5s ease-in-out infinite, sadShake 0.5s ease-in-out infinite;
}

.pet-wrap.joy {
  animation: hop 0.42s ease-out;
}

.pet-wrap.idle-act {
  animation: idleLook 1.5s ease-in-out;
}

.pet-wrap.chew .pet-image {
  animation: chew 0.62s ease-in-out 2;
}

.pet-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: bottom center;
  transition: filter 0.25s ease;
  filter: drop-shadow(0 17px 9px rgba(59,49,72,0.22));
  pointer-events: none;
}

.stage-baby .pet-image { transform: scale(0.55); }
.stage-child .pet-image { transform: scale(0.78); }
.stage-adult .pet-image { transform: scale(1); filter: hue-rotate(var(--echo-hue)) drop-shadow(0 17px 9px rgba(59,49,72,0.22)); }
.low-mood .pet-image { filter: grayscale(0.2) saturate(0.82) drop-shadow(0 17px 9px rgba(59,49,72,0.22)); }
.sleeping .pet-image { filter: brightness(0.72) saturate(0.8) drop-shadow(0 17px 9px rgba(59,49,72,0.24)); }

/* 일러스트에 눈이 이미 그려져 있어 가짜 눈 오버레이는 캐릭터마다 어긋남 → 미사용 */
.pet-face { display: none; }

.pet-mood {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translateX(-50%);
  font-size: 36px;
  z-index: 5;
  animation: wobble 1s ease-in-out infinite;
  pointer-events: none;
}

.hat {
  position: absolute;
  left: 50%;
  top: var(--hat-y, 15%);
  width: 82px;
  height: 54px;
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: none;
  filter: drop-shadow(0 5px 2px rgba(59,49,72,0.16));
}

.hat svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hat-two {
  left: 62%;
  top: calc(var(--hat-y, 15%) + 8%);
  width: 48px;
  height: 38px;
}

.stage-baby .hat { top: 25%; transform: translateX(-50%) scale(0.68); }
.stage-child .hat { top: 20%; transform: translateX(-50%) scale(0.84); }

.hat.ribbon::before,
.hat.ribbon::after {
  content: "";
  position: absolute;
  top: 14px;
  width: 38px;
  height: 29px;
  border-radius: 50% 13px 50% 13px;
  background: #ff5796;
}

.hat.ribbon::before {
  left: 2px;
  transform: rotate(28deg);
}

.hat.ribbon::after {
  right: 2px;
  transform: rotate(-28deg) scaleX(-1);
}

.hat.ribbon {
  background: radial-gradient(circle at 50% 56%, #ff267c 0 13px, transparent 14px);
}

.hat.crown {
  height: 48px;
  background: linear-gradient(135deg, transparent 0 18%, #ffe05d 19% 34%, transparent 35% 42%, #ffe05d 43% 58%, transparent 59% 66%, #ffe05d 67% 82%, transparent 83%);
}

.hat.crown::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 5px;
  height: 18px;
  border-radius: 7px;
  background: #eeb63e;
}

.hat.straw {
  top: 20%;
  width: 102px;
  height: 31px;
  border-radius: 50%;
  background: #d4a957;
  box-shadow: inset 0 -8px rgba(96,72,35,0.18);
}

.hat.straw::before {
  content: "";
  position: absolute;
  left: 30px;
  top: -19px;
  width: 42px;
  height: 35px;
  border-radius: 50% 50% 25% 25%;
  background: #ecc571;
}

.hat.beret,
.hat.headphones,
.hat.cap,
.hat.flower,
.hat.star,
.hat.streak,
.hat.heart,
.hat.moon {
  background: none;
}

.hat.ribbon,
.hat.crown,
.hat.straw {
  background: none;
  box-shadow: none;
}

.hat.ribbon::before,
.hat.ribbon::after,
.hat.crown::after,
.hat.straw::before {
  display: none;
}

.mood-mark {
  position: absolute;
  top: 18%;
  right: 14%;
  z-index: 7;
  font-size: 33px;
  animation: wobble 0.8s ease-in-out infinite;
  pointer-events: none;
}

.zzz {
  position: absolute;
  top: 5%;
  right: 8%;
  z-index: 7;
  color: #f8f0b8;
  font-size: 24px;
  font-weight: 1000;
  animation: floatUp 1.6s ease-in-out infinite;
  pointer-events: none;
}

.speech {
  position: absolute;
  left: 50%;
  bottom: calc(22% + min(52vw, 190px));
  z-index: 12;
  max-width: calc(100% - 48px);
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 20px;
  border: 2px solid rgba(255,255,255,0.78);
  background: rgba(255,250,241,0.92);
  box-shadow: 0 7px 0 rgba(59,49,72,0.08), 0 13px 28px rgba(59,49,72,0.12);
  font-size: 14px;
  font-weight: 1000;
  text-align: center;
}

.poop-layer {
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
}

.poop {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgba(255,255,255,0.74);
  box-shadow: 0 7px 0 rgba(59,49,72,0.1);
  pointer-events: auto;
  font-size: 27px;
}

.effects {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.spark,
.food-shot,
.coin-drop,
.bubble-heart {
  position: absolute;
  pointer-events: none;
}

.spark {
  font-size: 27px;
  animation: spark 0.9s ease-out forwards;
}

.food-shot {
  z-index: 31;
  font-size: 34px;
  animation: foodArc 0.72s cubic-bezier(.17,.72,.25,1) forwards;
}

.bubble-heart {
  z-index: 31;
  font-size: 22px;
  animation: heartPop 0.82s ease-out forwards;
}

.actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 22;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  padding: 12px 10px max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.42) 22%, rgba(255,250,241,0.88));
}

.actions button {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  background:
    radial-gradient(circle at 34% 22%, rgba(255,255,255,0.94) 0 13%, transparent 14%),
    linear-gradient(180deg, #fff 0%, #fff3dc 100%);
  border: 3px solid rgba(255,255,255,0.86);
  box-shadow: inset 0 -9px rgba(59,49,72,0.08), 0 8px 0 rgba(59,49,72,0.18), 0 12px 24px rgba(59,49,72,0.18);
  font-weight: 1000;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.actions button:active {
  transform: translateY(7px) scale(0.96);
  box-shadow: inset 0 -4px rgba(59,49,72,0.08), 0 2px 0 rgba(59,49,72,0.18), 0 8px 16px rgba(59,49,72,0.12);
}

.actions button:disabled {
  opacity: 0.52;
}

.actions span {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.actions em {
  font-size: 12px;
  line-height: 1;
  font-style: normal;
}

.actions b {
  position: absolute;
  right: -2px;
  top: -2px;
  min-width: 24px;
  height: 20px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ff5d8f;
  color: #fff;
  border: 2px solid #fff;
  font-size: 10px;
  line-height: 1;
  box-shadow: 0 3px 0 rgba(59,49,72,0.14);
}

.modal,
.sheet,
.evolve-overlay,
.daily-popup {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(36,31,48,0.34);
}

.mini-board,
.wash-pad,
.sheet-panel,
.daily-panel {
  width: min(100%, 390px);
  border-radius: 26px;
  border: 3px solid rgba(255,255,255,0.86);
  background: var(--paper);
  box-shadow: 0 18px 0 rgba(59,49,72,0.1), 0 28px 50px rgba(59,49,72,0.28);
}

.mini-board {
  height: min(78vh, 650px);
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  position: relative;
}

.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  font-size: 18px;
  font-weight: 1000;
}

.mini-menu {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 14px 12px;
}

.mini-menu button,
.mini-result button {
  min-height: 42px;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 -4px rgba(59,49,72,0.06), 0 4px 0 rgba(59,49,72,0.09);
  font-weight: 1000;
}

.bubble-field {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #dff8ff, #fff1c4);
}

.bubble {
  position: absolute;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff 0 10%, rgba(255,255,255,0.46) 11% 30%, rgba(105,207,255,0.46) 31% 100%);
  border: 2px solid rgba(83,175,225,0.36);
  animation: rise linear forwards;
}

.bubble.catch {
  display: grid;
  place-items: center;
  background: #fff7d2;
  font-size: 30px;
}

.bubble.mole {
  animation: molePop 0.95s ease-in forwards;
}

.bubble.pop {
  animation: pop 0.18s ease-out forwards;
}

.wash-pad {
  height: min(72vh, 560px);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  background:
    radial-gradient(circle at 22% 24%, rgba(255,255,255,0.9) 0 28px, transparent 29px),
    linear-gradient(180deg, #dffaff, #fff);
  font-size: 22px;
  font-weight: 1000;
  touch-action: none;
}

.wash-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.mini-result {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  padding: 20px;
  border-radius: 22px;
  background: rgba(255,250,241,0.96);
  box-shadow: 0 18px 38px rgba(59,49,72,0.24);
  text-align: center;
  font-weight: 1000;
}

.mini-result strong {
  display: block;
  font-size: 25px;
}

.mini-result p,
.mini-result b {
  display: block;
  margin-top: 9px;
}

.wash-pet {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.56);
  font-size: 74px;
  box-shadow: inset 0 -10px rgba(59,49,72,0.08);
}

.foam {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  box-shadow: 18px 4px rgba(255,255,255,0.78), 8px 18px rgba(207,244,255,0.9);
  animation: foam 1.4s ease-out forwards;
}

.foam.settle {
  animation: foamSettle 1.9s ease-out forwards;
}

.sheet {
  align-items: end;
}

.sheet-panel {
  max-height: 88vh;
  overflow: auto;
  padding: 16px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.shop-section {
  padding-top: 13px;
}

.shop-section h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.shop-section button,
.danger-button {
  min-height: 48px;
  border-radius: 18px;
  border: 2px solid rgba(59,49,72,0.1);
  background: #fff;
  box-shadow: inset 0 -5px rgba(59,49,72,0.06), 0 4px 0 rgba(59,49,72,0.09);
  font-weight: 1000;
}

.shop-section > button,
.danger-button {
  width: 100%;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.shop-grid button {
  min-width: 0;
  padding: 8px 4px;
}

.shop-grid svg {
  width: 42px;
  height: 32px;
  display: block;
  margin: 0 auto 3px;
}

.shop-grid span {
  display: block;
  font-size: 11px;
  line-height: 1.15;
}

.achievement-list {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.68);
  font-size: 12px;
  font-weight: 900;
}

.shop-grid button.owned {
  background: #eafbea;
}

.shop-grid button.active {
  outline: 3px solid var(--pink);
}

.danger-button {
  color: #a52d4b;
  background: #fff0f3;
}

.reset-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.evolve-overlay {
  overflow: hidden;
  background: radial-gradient(circle, rgba(255,255,255,0.94), rgba(255,224,93,0.62) 28%, rgba(66,45,105,0.52));
}

.evolve-beam {
  position: absolute;
  top: -12%;
  bottom: -12%;
  width: 116px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.95), transparent);
  animation: beamPulse 0.9s ease-in-out infinite;
}

.evolve-silhouette {
  width: 220px;
  height: 220px;
  background: rgba(58,45,70,0.8);
  mask: radial-gradient(circle at 50% 42%, #000 0 42%, transparent 43%);
  -webkit-mask: radial-gradient(circle at 50% 42%, #000 0 42%, transparent 43%);
  filter: blur(1px);
  animation: silhouette 1.6s ease-in-out forwards;
}

.evolve-overlay b {
  position: absolute;
  bottom: 22%;
  font-size: 32px;
  color: #fff;
  text-shadow: 0 4px rgba(59,49,72,0.26);
}

.daily-popup {
  z-index: 70;
}

.daily-panel {
  position: relative;
  overflow: hidden;
  padding: 24px 18px 18px;
  text-align: center;
}

.daily-panel strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.daily-panel p {
  margin-top: 9px;
  color: var(--muted);
  font-weight: 1000;
}

.daily-streak {
  margin-top: 10px;
  padding: 8px;
  border-radius: 14px;
  background: #fff4c9;
  font-weight: 1000;
}

.daily-panel button {
  width: 100%;
  height: 52px;
  margin-top: 18px;
  border-radius: 26px;
  background: linear-gradient(180deg, #ffe37d, #ffb84d);
  color: #5a3c0b;
  box-shadow: inset 0 -7px rgba(108,72,19,0.12), 0 7px 0 rgba(108,72,19,0.18);
  font-weight: 1000;
}

.coin-drop {
  top: -30px;
  font-size: 26px;
  animation: coinDrop 1.2s ease-in forwards;
}

@keyframes idleBounce {
  0%, 100% { transform: translateX(-50%) translateY(0) scaleY(1); }
  50% { transform: translateX(-50%) translateY(-9px) scaleY(1.015); }
}

@keyframes idleWalk {
  0%, 76%, 100% { margin-left: 0; }
  82% { margin-left: -24px; }
  90% { margin-left: 24px; }
}

@keyframes sadShake {
  0%, 100% { margin-left: 0; }
  25% { margin-left: -5px; }
  75% { margin-left: 5px; }
}

@keyframes hop {
  0% { transform: translateX(-50%) translateY(0) scale(1); }
  42% { transform: translateX(-50%) translateY(-44px) scale(1.06); }
  100% { transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes chew {
  0%, 100% { transform: scale(var(--stage-scale, 1)); }
  50% { transform: scale(calc(var(--stage-scale, 1) * 1.08), calc(var(--stage-scale, 1) * 0.94)); }
}

.stage-baby { --stage-scale: 0.6; }
.stage-child { --stage-scale: 0.8; }
.stage-adult { --stage-scale: 1; }

@keyframes blink {
  0%, 92%, 100% { transform: translateX(-50%) scaleY(1); }
  95% { transform: translateX(-50%) scaleY(0.1); }
}

@keyframes tap {
  50% { transform: scale(0.92) rotate(-3deg); }
}

@keyframes hatch {
  20% { transform: rotate(-8deg); }
  50% { transform: scale(1.08) rotate(8deg); }
  80% { transform: rotate(-5deg); }
}

@keyframes wobble {
  50% { transform: translateY(-5px) rotate(8deg); }
}

@keyframes floatUp {
  0% { opacity: 0; transform: translateY(10px); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-18px); }
}

@keyframes spark {
  0% { opacity: 1; transform: scale(0.6) translateY(0); }
  100% { opacity: 0; transform: scale(1.55) translateY(-58px); }
}

@keyframes heartPop {
  0% { opacity: 1; transform: translateY(0) scale(0.5); }
  100% { opacity: 0; transform: translateY(-54px) scale(1.35); }
}

@keyframes foodArc {
  0% { opacity: 1; transform: translate(0, 0) scale(0.74) rotate(0); }
  55% { transform: translate(calc(var(--food-x) * 0.55), calc(var(--food-y) * 0.55 - 90px)) scale(1.08) rotate(160deg); }
  100% { opacity: 0; transform: translate(var(--food-x), var(--food-y)) scale(0.36) rotate(340deg); }
}

@keyframes rise {
  from { transform: translateY(110%); }
  to { transform: translateY(-120%); }
}

@keyframes pop {
  to { opacity: 0; transform: scale(1.45); }
}

@keyframes molePop {
  0% { opacity: 0; transform: translateY(22px) scale(0.7); }
  20%, 78% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(16px) scale(0.76); }
}

@keyframes idleLook {
  0%, 100% { transform: translateX(-50%) rotate(0); }
  30% { transform: translateX(-50%) rotate(-4deg); }
  66% { transform: translateX(-50%) rotate(4deg); }
}

@keyframes foam {
  to { opacity: 0; transform: scale(1.9); }
}

@keyframes foamSettle {
  0% { opacity: 0; transform: scale(0.6); }
  18%, 82% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.55) translateY(-18px); }
}

@keyframes beamPulse {
  50% { transform: scaleX(1.6); opacity: 0.72; }
}

@keyframes silhouette {
  0%, 58% { transform: scale(0.74); opacity: 0.82; }
  100% { transform: scale(1.45); opacity: 0; }
}

@keyframes coinDrop {
  0% { opacity: 0; transform: translateY(0) rotate(0); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translateY(320px) rotate(360deg); }
}

@media (max-width: 360px) {
  .actions {
    gap: 5px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .actions span {
    font-size: 25px;
  }

  .actions em {
    font-size: 11px;
  }
}
