/* =============================== */
/* HABITAT BASE                    */
/* =============================== */

body {
  background-color: #111;
  color: #eee;
  margin: 0;
  padding: 0;
  text-align: center;
  font-family: "Georgia", serif;
}

.habitat-wrapper {
  padding: 3rem 1.5rem 4rem;
}

.habitat-intro h1 {
  margin-bottom: 0.5rem;
}

.habitat-lead {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

.habitat-sub {
  font-size: 0.95rem;
  opacity: 0.8;
  margin-bottom: 1.5rem;
}

.habitat-stone {
  margin-top: 1rem;
}

/* =============================== */
/* HABITAT BOX                     */
/* =============================== */

.habitat-box {
  margin-top: 2.5rem;
}

.habitat-ground {
  position: relative;
  margin: 0 auto;
  max-width: 480px;
  height: 260px;
  border-radius: 18px;
  overflow: hidden;

  /* Dark mossy ground */
  background-color: #0b0f0b;
  background-image:
    radial-gradient(circle at center, #1a261a 0%, #0b0f0b 80%),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.02) 0px,
      rgba(255, 255, 255, 0.02) 2px,
      rgba(0, 0, 0, 0.02) 2px,
      rgba(0, 0, 0, 0.02) 4px
    );
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.6),
    0 18px 40px rgba(0, 0, 0, 0.7);
}

/* =============================== */
/* CAPY CREATURE                   */
/* =============================== */

.capy {
  position: absolute;
  bottom: 18px;
  left: 50%;
  width: 120px;
  height: 80px;
  transform: translateX(-50%);
  border-radius: 40px;
  background: linear-gradient(145deg, #7b5a3a, #4f3521);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 10px 18px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
}

/* Head */
.capy::before {
  content: "";
  position: absolute;
  right: -26px;
  bottom: 20px;
  width: 52px;
  height: 46px;
  border-radius: 26px;
  background: linear-gradient(145deg, #8a6240, #5a3b25);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

/* Eye */
.capy::after {
  content: "";
  position: absolute;
  right: -10px;
  bottom: 40px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

/* Glow aura */
.capy-glow {
  box-shadow:
    0 0 18px rgba(180, 255, 200, 0.6),
    0 0 40px rgba(120, 255, 180, 0.4),
    0 10px 18px rgba(0, 0, 0, 0.7);
}

/* =============================== */
/* ANIMATIONS                      */
/* =============================== */

@keyframes capyAwaken {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes capyIdleWiggle {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-3px);
  }
}

@keyframes capyGlowPulse {
  0%, 100% {
    box-shadow:
      0 0 18px rgba(180, 255, 200, 0.4),
      0 0 40px rgba(120, 255, 180, 0.2),
      0 10px 18px rgba(0, 0, 0, 0.7);
  }
  50% {
    box-shadow:
      0 0 26px rgba(200, 255, 210, 0.8),
      0 0 60px rgba(150, 255, 200, 0.5),
      0 10px 18px rgba(0, 0, 0, 0.7);
  }
}

/* States */

.capy-awake {
  opacity: 1;
  pointer-events: auto;
  animation: capyAwaken 0.9s ease-out forwards;
}

.capy-idle-loop {
  animation: capyIdleWiggle 2.4s ease-in-out infinite;
}

.capy-glow-loop {
  animation: capyGlowPulse 3s ease-in-out infinite;
}

/* =============================== */
/* STATUS TEXT                     */
/* =============================== */

.habitat-status {
  margin-top: 2.5rem;
}

.habitat-text {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-bottom: 1rem;
}

.habitat-text-strong {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.habitat-mood {
  font-size: 0.95rem;
  opacity: 0.9;
  font-style: italic;
}

/* =============================== */
/* RESPONSIVE                      */
/* =============================== */

@media (max-width: 480px) {
  .habitat-wrapper {
    padding: 2.5rem 1rem 3rem;
  }

  .habitat-ground {
    height: 220px;
  }

  .capy {
    width: 100px;
    height: 70px;
  }
}
