:root {
  color-scheme: light;
  --ink: #173c40;
  --muted: #627579;
  --paper: #fff8df;
  --panel: rgba(255, 255, 255, .78);
  --line: rgba(32, 84, 82, .16);
  --leaf: #78d49a;
  --leaf-dark: #2c8f70;
  --water: #7ddaf0;
  --sun: #ffd86d;
  --berry: #ff8f8f;
  --violet: #8383ef;
  --shadow: 0 18px 50px rgba(43, 92, 81, .16);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 232, 126, .46), transparent 27rem),
    radial-gradient(circle at 80% 0%, rgba(125, 218, 240, .35), transparent 24rem),
    linear-gradient(135deg, #fff8df 0%, #f4ffe9 48%, #eafaff 100%);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.app-shell {
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.screen {
  width: min(1160px, 100%);
  margin: 0 auto;
}

.onboarding-screen {
  min-height: calc(100vh - 36px);
  display: grid;
  place-items: center;
}

.onboarding-layout {
  width: min(720px, 100%);
}

.brand-lockup,
.topbar,
.status-strip,
.panel-heading,
.mini-score,
.inventory-row,
.level-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-lockup {
  justify-content: flex-start;
  margin-bottom: 18px;
}

.brand-icon {
  width: 74px;
  height: 74px;
  filter: drop-shadow(0 12px 22px rgba(48, 116, 92, .18));
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2.25rem, 7vw, 4.6rem);
  line-height: .92;
}

h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.intro-copy {
  max-width: 550px;
  margin-bottom: 22px;
  color: #36595c;
  font-size: 1.08rem;
  line-height: 1.55;
}

.setup-panel,
.tool-panel,
.log-panel,
.inventory-panel,
.trait-panel,
.game-panel,
.stats-panel,
.companion-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.setup-panel {
  padding: 18px;
}

.field-label,
legend {
  color: #315a5d;
  font-size: .9rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 48px;
  margin: 8px 0 16px;
  border: 1px solid rgba(37, 98, 88, .22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .84);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--leaf-dark);
  box-shadow: 0 0 0 4px rgba(120, 212, 154, .22);
}

fieldset {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.species-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.species-card,
.shop-card,
.achievement-card {
  min-width: 0;
  border: 1px solid rgba(37, 98, 88, .16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .72);
  color: var(--ink);
}

.species-card {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 166px;
  padding: 14px 10px;
  text-align: center;
}

.species-card.active {
  border-color: var(--leaf-dark);
  box-shadow: inset 0 0 0 2px rgba(120, 212, 154, .36);
}

.species-card small,
.shop-card p,
.achievement-card p,
.panel-heading p,
.log-panel li,
.inventory-panel p {
  color: var(--muted);
  line-height: 1.35;
}

.mini-sprout {
  width: 58px;
  height: 68px;
  border-radius: 48% 48% 40% 40%;
  background: linear-gradient(#fffbd5, #85db92 55%, #2f9a75);
  position: relative;
}

.mini-sprout::before,
.mini-sprout::after {
  content: "";
  position: absolute;
  top: -16px;
  width: 32px;
  height: 24px;
  border-radius: 90% 20% 90% 20%;
  background: #79d988;
}

.mini-sprout::before {
  left: 2px;
  transform: rotate(-30deg);
}

.mini-sprout::after {
  right: 2px;
  transform: rotate(30deg) scaleX(-1);
}

.mini-sprout.glintbud {
  background: linear-gradient(#fffbd5, #8bd7ff 50%, #5967e8);
}

.mini-sprout.glintbud::before,
.mini-sprout.glintbud::after {
  background: #ffd36f;
}

.mini-sprout.pebblepop {
  background: linear-gradient(#fffbd5, #ffb06e 55%, #ca6b58);
}

.mini-sprout.pebblepop::before,
.mini-sprout.pebblepop::after {
  background: #8ee0cb;
}

.primary-button,
.action-grid button,
.shop-card button,
.inventory-row button,
.tabbar button,
.icon-button {
  min-height: 44px;
  border-radius: var(--radius);
  background: #205c57;
  color: #fffdf1;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(32, 92, 87, .18);
}

.primary-button {
  width: 100%;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  margin-bottom: 12px;
  padding: 10px 0;
  backdrop-filter: blur(14px);
}

.topbar h1 {
  font-size: clamp(2rem, 8vw, 3.4rem);
  text-align: center;
}

.icon-button {
  flex: 0 0 44px;
  width: 44px;
  font-size: 1.35rem;
}

.install-button {
  font-size: 1.55rem;
}

.install-button.install-ready {
  background: #167b70;
  box-shadow: 0 0 0 4px rgba(125, 218, 240, .28), 0 10px 20px rgba(32, 92, 87, .2);
}

.install-button[hidden] {
  display: block;
  visibility: hidden;
}

.danger-soft {
  background: #fff1ed;
  color: #9d3d37;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: 12px;
}

.companion-panel {
  overflow: hidden;
}

.companion-scene {
  min-height: 342px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 251, 214, .85), rgba(232, 253, 255, .9)),
    radial-gradient(circle at 50% 75%, rgba(120, 212, 154, .25), transparent 18rem);
}

.pet-scene {
  position: relative;
  width: min(330px, 78vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.sky-dot {
  position: absolute;
  border-radius: 50%;
  background: #fff3a3;
  box-shadow: 0 0 20px rgba(255, 216, 109, .55);
}

.dot-a {
  width: 18px;
  height: 18px;
  top: 12%;
  left: 20%;
}

.dot-b {
  width: 12px;
  height: 12px;
  top: 28%;
  right: 16%;
}

.dot-c {
  width: 10px;
  height: 10px;
  bottom: 30%;
  left: 12%;
}

.pet-shadow {
  position: absolute;
  bottom: 13%;
  width: 48%;
  height: 9%;
  border-radius: 50%;
  background: rgba(35, 111, 87, .19);
}

.sproutling {
  position: relative;
  width: 46%;
  height: 55%;
  border: 8px solid #26755e;
  border-radius: 48% 48% 40% 40%;
  background: linear-gradient(#fffbe0, #85db92 55%, #2f9a75);
  animation: bob 3.5s ease-in-out infinite;
  transform-origin: 50% 100%;
}

.sproutling[data-species="glintbud"] {
  border-color: #4454c6;
  background: linear-gradient(#fffbe0, #8bd7ff 50%, #5967e8);
}

.sproutling[data-species="pebblepop"] {
  border-color: #a95449;
  background: linear-gradient(#fffbe0, #ffb06e 55%, #ca6b58);
}

.sproutling[data-stage="egg"] {
  height: 46%;
  border-radius: 56% 56% 48% 48%;
}

.sproutling[data-stage="baby"] {
  width: 42%;
  height: 48%;
}

.sproutling[data-stage="juvenile"] {
  width: 48%;
  height: 58%;
}

.sproutling[data-stage="adult"],
.sproutling[data-stage="special"] {
  width: 54%;
  height: 64%;
}

.sproutling[data-stage="special"] {
  box-shadow: 0 0 0 8px rgba(255, 216, 109, .22), 0 0 45px rgba(125, 218, 240, .5);
}

.bud,
.leaf,
.spark,
.aura,
.face {
  position: absolute;
}

.aura {
  inset: -20%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 243, 163, .4), transparent 62%);
}

.bud {
  top: -35px;
  left: 50%;
  width: 28px;
  height: 40px;
  border-radius: 90% 20% 90% 20%;
  background: #79d988;
  transform: translateX(-50%) rotate(45deg);
}

.sproutling[data-species="glintbud"] .bud {
  background: #ffd36f;
  clip-path: polygon(50% 0, 66% 35%, 100% 45%, 70% 63%, 78% 100%, 50% 76%, 22% 100%, 30% 63%, 0 45%, 34% 35%);
}

.sproutling[data-species="pebblepop"] .bud {
  background: #8ee0cb;
  border-radius: 30% 70% 55% 45%;
}

.leaf {
  top: -16px;
  width: 45px;
  height: 32px;
  border: 6px solid #26755e;
  border-radius: 90% 20% 90% 20%;
  background: #8fe899;
}

.leaf-left {
  left: 14px;
  transform: rotate(-30deg);
}

.leaf-right {
  right: 14px;
  transform: rotate(30deg) scaleX(-1);
}

.face {
  inset: 34% 18% auto;
  height: 32%;
}

.eye {
  position: absolute;
  top: 0;
  width: 18px;
  height: 22px;
  border-radius: 50%;
  background: #174f4d;
}

.eye-left {
  left: 0;
}

.eye-right {
  right: 0;
}

.mouth {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 42px;
  height: 22px;
  border-bottom: 7px solid #174f4d;
  border-radius: 0 0 60px 60px;
  transform: translateX(-50%);
}

.spark {
  width: 14px;
  height: 14px;
  background: #fff3a3;
  clip-path: polygon(50% 0, 63% 36%, 100% 50%, 63% 64%, 50% 100%, 37% 64%, 0 50%, 37% 36%);
}

.spark-one {
  top: 16%;
  left: -28%;
}

.spark-two {
  right: -22%;
  bottom: 24%;
}

.equipped-star-pin .accessory-slot::after,
.equipped-tiny-cape .accessory-slot::after,
.equipped-cloud-hat .accessory-slot::after {
  content: "";
  position: absolute;
}

.equipped-star-pin .accessory-slot::after {
  width: 20px;
  height: 20px;
  right: -24px;
  top: 38px;
  background: #ffd86d;
  clip-path: polygon(50% 0, 61% 36%, 98% 36%, 68% 57%, 79% 92%, 50% 70%, 21% 92%, 32% 57%, 2% 36%, 39% 36%);
}

.equipped-tiny-cape .accessory-slot::after {
  left: -60px;
  top: 78px;
  width: 95px;
  height: 80px;
  border-radius: 60% 0 60% 40%;
  background: rgba(131, 131, 239, .78);
  z-index: -1;
}

.equipped-cloud-hat .accessory-slot::after {
  left: -22px;
  top: -18px;
  width: 74px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 18px 2px 0 2px #fff, 36px 0 0 -2px #fff;
}

.sproutling[data-reaction="play"],
.sproutling[data-reaction="win"] {
  animation: bounce .55s ease-in-out infinite alternate;
}

.sproutling[data-reaction="sleep"] .eye {
  height: 6px;
  top: 10px;
}

.sproutling[data-reaction="eat"] .mouth {
  width: 24px;
  height: 24px;
  border: 7px solid #174f4d;
  border-radius: 50%;
}

.speech {
  margin: -18px 14px 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .9);
}

.speech p {
  margin: 0;
  color: #315a5d;
  font-weight: 750;
  line-height: 1.4;
}

.status-strip {
  padding: 0 14px 14px;
  flex-wrap: wrap;
}

.status-strip span,
.mini-score span,
.achievement-card span,
.shop-card span {
  border-radius: 999px;
  background: rgba(120, 212, 154, .18);
  color: #236a5d;
  padding: 6px 10px;
  font-size: .78rem;
  font-weight: 900;
}

.stats-panel,
.tool-panel,
.log-panel,
.inventory-panel,
.trait-panel,
.game-panel {
  padding: 14px;
}

.stats-panel {
  display: grid;
  gap: 10px;
}

.level-card {
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.level-card .bar {
  flex: 1 0 100%;
}

.stat-row {
  display: grid;
  gap: 7px;
}

.stat-row > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .9rem;
}

.bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(32, 92, 87, .11);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--leaf), var(--water));
}

.bar.hunger span {
  background: linear-gradient(90deg, #ffb06e, #ffd86d);
}

.bar.health span {
  background: linear-gradient(90deg, #78d49a, #2c8f70);
}

.bar.energy span,
.bar.dreamy span {
  background: linear-gradient(90deg, #8383ef, #7ddaf0);
}

.bar.cleanliness span,
.bar.tidy span {
  background: linear-gradient(90deg, #7ddaf0, #c5f5ff);
}

.bar.happiness span,
.bar.playful span {
  background: linear-gradient(90deg, #ff8f8f, #ffd86d);
}

.tabbar {
  position: sticky;
  z-index: 18;
  bottom: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.tabbar button {
  min-width: 0;
  background: transparent;
  color: #315a5d;
  box-shadow: none;
}

.tabbar button.active {
  background: #205c57;
  color: #fffdf1;
}

.panel-slot {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: 12px;
  padding-bottom: 10px;
}

.feed-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
  align-items: center;
}

.feed-row select {
  margin: 0;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.action-grid button:nth-child(1) {
  background: #5967e8;
}

.action-grid button:nth-child(2) {
  background: #2c8f70;
}

.action-grid button:nth-child(3) {
  background: #6c5e95;
}

.log-panel ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.log-panel li {
  border-bottom: 1px solid rgba(37, 98, 88, .1);
  padding-bottom: 8px;
}

.shop-grid,
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.shop-card,
.achievement-card {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
}

.shop-card p,
.achievement-card p {
  min-height: 38px;
  margin: 0;
  font-size: .9rem;
}

.shop-card button,
.inventory-row button {
  box-shadow: none;
}

.item-orb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb06e, #ffd86d);
}

.item-orb.toy {
  background: conic-gradient(from 45deg, #5967e8, #7ddaf0, #ffd86d, #5967e8);
}

.item-orb.accessory {
  border-radius: 42% 58% 45% 55%;
  background: linear-gradient(135deg, #8383ef, #ff8f8f);
}

.inventory-list {
  display: grid;
  gap: 9px;
}

.inventory-row {
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.inventory-row button {
  width: 98px;
  min-height: 36px;
  background: #fff1ed;
  color: #9d3d37;
}

.game-panel {
  grid-column: 1 / -1;
}

.play-field {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  display: grid;
  place-items: center;
  margin-top: 12px;
  border: 1px solid rgba(37, 98, 88, .15);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 255, 255, .52) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .52) 1px, transparent 1px),
    linear-gradient(135deg, rgba(120, 212, 154, .34), rgba(125, 218, 240, .28));
  background-size: 34px 34px, 34px 34px, auto;
}

.glow-target {
  position: absolute;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 20%, #ffd86d 21% 55%, #ff8f8f 56%);
  box-shadow: 0 0 24px rgba(255, 216, 109, .9);
  transform: translate(-50%, -50%);
  animation: pulse .8s ease-in-out infinite alternate;
}

.start-game {
  max-width: 260px;
}

.achievement-card {
  opacity: .64;
}

.achievement-card.earned {
  opacity: 1;
  border-color: rgba(44, 143, 112, .4);
  background: rgba(244, 255, 233, .84);
}

.trait-panel {
  display: grid;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  max-width: min(520px, calc(100vw - 28px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #173c40;
  color: #fffdf1;
  font-weight: 800;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes bob {
  0%, 100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-9px) rotate(1deg);
  }
}

@keyframes bounce {
  from {
    transform: translateY(3px) scaleY(.97);
  }
  to {
    transform: translateY(-16px) scaleY(1.02);
  }
}

@keyframes pulse {
  from {
    transform: translate(-50%, -50%) scale(.9);
  }
  to {
    transform: translate(-50%, -50%) scale(1.1);
  }
}

@media (max-width: 840px) {
  .dashboard-grid,
  .panel-slot {
    grid-template-columns: 1fr;
  }

  .stats-panel {
    order: -1;
  }

  .shop-grid,
  .achievement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-inline: 10px;
  }

  .species-grid,
  .shop-grid,
  .achievement-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .species-card {
    min-height: 124px;
  }

  .feed-row {
    grid-template-columns: 1fr;
  }

  .companion-scene {
    min-height: 286px;
  }

  .topbar h1 {
    max-width: 58vw;
    overflow-wrap: anywhere;
  }

  .tabbar {
    gap: 5px;
  }

  .tabbar button {
    font-size: .88rem;
  }
}

/* Approved companion art: premium crystal cat and heartlight puppy. */
.species-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.species-card {
  min-height: 230px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(14, 31, 53, .96), rgba(24, 47, 73, .93));
  color: #f7fbff;
}

.species-card.active {
  border-color: #68d7ff;
  box-shadow: inset 0 0 0 2px rgba(104, 215, 255, .58), 0 14px 30px rgba(44, 92, 140, .18);
}

.species-card small {
  color: #c5d5e9;
}

.species-portrait {
  width: min(150px, 100%);
  height: 140px;
  display: grid;
  place-items: end center;
}

.species-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .28));
  transition: transform .2s ease;
}

.species-card:hover .species-portrait img,
.species-card.active .species-portrait img {
  transform: translateY(-3px) scale(1.04);
}

.companion-scene {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 25%, rgba(255, 190, 113, .42), transparent 19%),
    radial-gradient(circle at 25% 72%, rgba(60, 177, 255, .2), transparent 25%),
    linear-gradient(145deg, #1d2941 0%, #273f59 45%, #17243b 100%);
}

.companion-scene::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(9, 17, 31, .46));
}

.pet-shadow {
  bottom: 8%;
  width: 58%;
  height: 8%;
  background: rgba(3, 10, 21, .45);
  filter: blur(7px);
}

.sky-dot {
  background: #8be8ff;
  box-shadow: 0 0 22px rgba(104, 215, 255, .82);
}

.sproutling,
.sproutling[data-stage="egg"],
.sproutling[data-stage="baby"],
.sproutling[data-stage="juvenile"],
.sproutling[data-stage="adult"],
.sproutling[data-stage="special"] {
  width: 88%;
  height: 88%;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  animation: none;
  display: grid;
  place-items: center;
}

.pet-character {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 88%;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .34));
  animation: pet-breathe 3.2s ease-in-out infinite;
}

.sproutling[data-stage="egg"] .pet-character {
  opacity: .16;
  transform: scale(.45);
  filter: saturate(.75) blur(1px);
}

.sproutling[data-stage="baby"] .pet-character {
  transform: scale(.68) translateY(10%);
}

.sproutling[data-stage="juvenile"] .pet-character {
  transform: scale(.84) translateY(5%);
}

.sproutling[data-stage="adult"] .pet-character {
  transform: scale(.98);
}

.sproutling[data-stage="special"] .pet-character {
  transform: scale(1.02);
  filter: drop-shadow(0 0 18px rgba(102, 220, 255, .9)) drop-shadow(0 18px 18px rgba(0, 0, 0, .3));
}

.sproutling[data-species="buddy-pup"] .aura {
  background: radial-gradient(circle, rgba(255, 190, 113, .4), transparent 64%);
}

.sproutling[data-stage="special"] .aura {
  inset: 4%;
  background: radial-gradient(circle, rgba(122, 227, 255, .42), rgba(145, 111, 255, .14) 44%, transparent 70%);
  animation: aura-pulse 1.6s ease-in-out infinite alternate;
}

.evolution-egg {
  display: none;
  position: absolute;
  z-index: 3;
  width: 47%;
  aspect-ratio: .78;
  border: 4px solid rgba(226, 250, 255, .84);
  border-radius: 52% 52% 46% 46%;
  background: linear-gradient(145deg, rgba(231, 250, 255, .95), rgba(102, 201, 255, .74) 47%, rgba(119, 87, 219, .88));
  box-shadow: inset -14px -16px 25px rgba(42, 49, 123, .28), inset 12px 12px 20px rgba(255, 255, 255, .5), 0 0 35px rgba(93, 211, 255, .65);
  animation: egg-rock 2.4s ease-in-out infinite;
}

.evolution-egg span {
  position: absolute;
  inset: 25% 21%;
  background: linear-gradient(135deg, transparent 45%, rgba(255, 255, 255, .78) 46% 53%, transparent 54%), linear-gradient(45deg, transparent 45%, rgba(255, 255, 255, .55) 46% 53%, transparent 54%);
}

.sproutling[data-stage="egg"] .evolution-egg {
  display: block;
}

.reaction-fx {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
}

.sproutling[data-reaction="play"] .pet-character,
.sproutling[data-reaction="win"] .pet-character {
  animation: pet-bounce .55s ease-in-out infinite alternate;
}

.sproutling[data-reaction="eat"] .pet-character {
  animation: happy-nibble .42s ease-in-out infinite alternate;
}

.sproutling[data-reaction="clean"] .pet-character {
  animation: clean-wiggle .7s ease-in-out infinite alternate;
}

.sproutling[data-reaction="sleep"] .pet-character {
  animation: sleepy-breathe 3s ease-in-out infinite;
  filter: brightness(.76) saturate(.82) drop-shadow(0 18px 18px rgba(0, 0, 0, .34));
}

.sproutling[data-reaction="sleep"] .reaction-fx::after {
  content: "z  z  Z";
  position: absolute;
  top: 12%;
  right: 8%;
  color: #d7c6ff;
  font-size: 1.4rem;
  font-weight: 900;
  text-shadow: 0 0 15px #826dff;
  animation: sleep-float 2s ease-in-out infinite;
}

.sproutling[data-reaction="clean"] .reaction-fx::after {
  content: "✦  ·  ✦";
  position: absolute;
  inset: 14% 4% auto;
  color: #a9efff;
  font-size: 1.7rem;
  text-align: center;
  text-shadow: 0 0 15px #54d5ff;
  animation: aura-pulse .7s ease-in-out infinite alternate;
}

.sproutling[data-reaction="eat"] .reaction-fx::after,
.sproutling[data-reaction="win"] .reaction-fx::after {
  content: "♥";
  position: absolute;
  top: 18%;
  right: 10%;
  color: #ff91c8;
  font-size: 1.8rem;
  text-shadow: 0 0 16px rgba(255, 95, 181, .8);
  animation: sleep-float 1.1s ease-in-out infinite;
}

@keyframes pet-breathe {
  0%, 100% { translate: 0 0; scale: 1; }
  50% { translate: 0 -5px; scale: 1.01; }
}

@keyframes pet-bounce {
  from { translate: 0 4px; rotate: -2deg; scale: .98; }
  to { translate: 0 -17px; rotate: 2deg; scale: 1.03; }
}

@keyframes happy-nibble {
  from { translate: 0 2px; scale: 1 .98; }
  to { translate: 0 -3px; scale: 1.025 1.015; }
}

@keyframes clean-wiggle {
  from { rotate: -2deg; translate: -2px 0; }
  to { rotate: 2deg; translate: 2px -3px; }
}

@keyframes sleepy-breathe {
  0%, 100% { translate: 0 7px; rotate: -1deg; scale: .99 .96; }
  50% { translate: 0 3px; rotate: 1deg; scale: 1 .99; }
}

@keyframes egg-rock {
  0%, 100% { rotate: -3deg; translate: 0 2px; }
  50% { rotate: 3deg; translate: 0 -5px; }
}

@keyframes aura-pulse {
  from { opacity: .55; scale: .96; }
  to { opacity: 1; scale: 1.04; }
}

@keyframes sleep-float {
  0%, 100% { opacity: .5; translate: 0 5px; }
  50% { opacity: 1; translate: 0 -6px; }
}

@media (max-width: 560px) {
  .species-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .species-card {
    min-height: 210px;
    padding-inline: 8px;
  }

  .species-portrait {
    height: 122px;
  }

  .species-card small {
    font-size: .76rem;
  }
}
