* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #25204a, #080b18 70%);
  color: white;
  font-family: Arial, sans-serif;
}

.luna-app {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: auto;
  padding: 25px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* =========================
   LUNA'S FACE
   ========================= */

.luna-face {
  position: relative;
  width: 235px;
  height: 270px;
  flex-shrink: 0;

  border-radius: 48% 48% 46% 46%;

  background:
    radial-gradient(
      circle at 35% 30%,
      #fff1eb 0%,
      #f2c9c4 38%,
      #d99fa8 100%
    );

  box-shadow:
    0 0 25px rgba(210, 190, 255, 0.45),
    0 0 70px rgba(130, 100, 255, 0.18),
    inset 0 -12px 25px rgba(120, 60, 90, 0.12);

  animation: gentleFloat 4s ease-in-out infinite;
}

/* Hair */

.luna-hair {
  position: absolute;
  top: -42px;
  left: -18px;

  width: 271px;
  height: 155px;

  background:
    radial-gradient(circle at 50% 80%, #302552, #121020 72%);

  border-radius: 52% 52% 45% 45%;

  box-shadow:
    inset 0 -12px 20px rgba(110, 85, 170, 0.18);
}

/* Hair side pieces */

.luna-hair::before,
.luna-hair::after {
  content: "";
  position: absolute;
  top: 65px;
  width: 48px;
  height: 150px;
  background: #171329;
  border-radius: 50%;
}

.luna-hair::before {
  left: -10px;
  transform: rotate(7deg);
}

.luna-hair::after {
  right: -10px;
  transform: rotate(-7deg);
}

/* =========================
   EYES
   ========================= */

.luna-eyes {
  position: absolute;
  top: 103px;
  left: 31px;

  width: 173px;

  display: flex;
  justify-content: space-between;
}

.eye {
  width: 56px;
  height: 62px;

  position: relative;

  background: #fffdfd;
  border-radius: 50%;

  overflow: hidden;

  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.65),
    inset 0 -5px 8px rgba(120, 80, 120, 0.12);

  animation: blink 6s infinite;
}

/* Iris / pupil */

.pupil {
  position: absolute;

  width: 29px;
  height: 38px;

  top: 13px;
  left: 14px;

  border-radius: 50%;

  background:
    radial-gradient(
      circle at 50% 45%,
      #9b83d9 0%,
      #5b438f 38%,
      #21183f 72%
    );

  box-shadow:
    0 0 7px rgba(120, 90, 200, 0.7);

  animation: eyeLook 5s ease-in-out infinite;
}

.pupil::after {
  content: "";

  position: absolute;

  width: 9px;
  height: 12px;

  top: 5px;
  left: 5px;

  background: white;
  border-radius: 50%;

  opacity: 0.9;
}

/* =========================
   NOSE
   ========================= */

.luna-mouth::before {
  content: "";

  position: absolute;

  width: 18px;
  height: 10px;

  left: 15px;
  top: -52px;

  border-bottom: 2px solid rgba(130, 70, 90, 0.35);

  border-radius: 50%;
}

/* =========================
   MOUTH
   ========================= */

.luna-mouth {
  position: absolute;

  width: 50px;
  height: 22px;

  left: 92px;
  top: 194px;

  border-bottom: 4px solid #98516d;

  border-radius: 0 0 50% 50%;

  transition:
    height 0.15s ease,
    width 0.15s ease,
    border-radius 0.15s ease;

  animation: gentleSmile 4s ease-in-out infinite;
}

/* =========================
   NAME + STATUS
   ========================= */

h1 {
  margin: 22px 0 4px;

  font-size: 37px;

  letter-spacing: 3px;

  text-shadow:
    0 0 15px rgba(190, 170, 255, 0.45);
}

#lunaStatus {
  margin: 0 0 15px;

  font-size: 16px;

  opacity: 0.85;
}

/* =========================
   BUTTONS
   ========================= */

button {
  display: block;
  visibility: visible;
  opacity: 1;

  position: relative;
  z-index: 10;

  border: none;
  border-radius: 30px;

  padding: 15px 28px;
  margin: 6px;

  font-size: 17px;
  font-weight: bold;

  color: white;

  background: #6751d8;

  box-shadow:
    0 7px 20px rgba(0, 0, 0, 0.35);

  cursor: pointer;

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

button:active {
  transform: scale(0.95);
}

#stopButton {
  background: #9a3f61;
}

/* =========================
   CONVERSATION
   ========================= */

#conversation {
  width: 100%;

  margin-top: 18px;
  padding: 15px;

  border-radius: 18px;

  background: rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(8px);
}

#lunaMessage {
  font-size: 16px;
  line-height: 1.5;
}

/* =========================
   LISTENING EFFECT
   ========================= */

.luna-app.listening .luna-face {
  box-shadow:
    0 0 35px rgba(100, 220, 255, 0.65),
    0 0 85px rgba(100, 180, 255, 0.22);
}

.luna-app.listening .luna-mouth {
  width: 38px;
  height: 18px;
  left: 98px;
  border: none;
  border-radius: 50%;
  background: #98516d;
}

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

@keyframes gentleFloat {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

@keyframes gentleSmile {
  0%, 100% {
    transform: scaleX(1);
  }

  50% {
    transform: scaleX(1.08);
  }
}

@keyframes blink {
  0%, 43%, 46%, 100% {
    transform: scaleY(1);
  }

  44%, 45% {
    transform: scaleY(0.08);
  }
}

@keyframes eyeLook {
  0%, 30%, 100% {
    transform: translateX(0);
  }

  40% {
    transform: translateX(4px);
  }

  55% {
    transform: translateX(-3px);
  }
}

/* =========================
   SMALL PHONE SCREENS
   ========================= */

@media (max-height: 650px) {

  .luna-app {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .luna-face {
    width: 200px;
    height: 230px;
  }

  .luna-hair {
    width: 230px;
    height: 130px;
  }

  .luna-eyes {
    top: 88px;
    left: 27px;
    width: 146px;
  }

  .eye {
    width: 47px;
    height: 53px;
  }

  .pupil {
    width: 24px;
    height: 32px;
    left: 12px;
    top: 11px;
  }

  .luna-mouth {
    left: 77px;
    top: 166px;
  }
}