@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;

  font-family: "Fredoka", sans-serif;

  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(255, 180, 225, 0.55),
      transparent 28%
    ),
    radial-gradient(
      circle at 85% 25%,
      rgba(180, 200, 255, 0.6),
      transparent 30%
    ),
    radial-gradient(
      circle at 50% 100%,
      rgba(220, 205, 255, 0.5),
      transparent 35%
    ),
    linear-gradient(
      135deg,
      #fff6fc,
      #f1f5ff
    );

  color: #514764;

  overflow-x: hidden;
}


/* MAIN */

.app {
  width: min(1050px, 94%);

  min-height: 100vh;

  margin: auto;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  gap: 28px;

  padding: 35px 0;
}


/* =========================
   BITZ AREA
========================= */

.robot-area {
  position: relative;

  text-align: center;

  width: 100%;

  padding-top: 10px;
}


/* ROBOT */

.robot {
  position: relative;

  width: 250px;
  height: 285px;

  margin: auto;

  animation: floating 3s ease-in-out infinite;
}


/* BODY */

.robot-body {
  position: absolute;

  width: 195px;
  height: 215px;

  left: 27px;
  top: 15px;

  border-radius:
    95px
    95px
    70px
    70px;

  background:
    linear-gradient(
      145deg,
      #ffffff 5%,
      #f7edff 48%,
      #e6dbff 100%
    );

  border: 4px solid white;

  box-shadow:

    0 18px 40px
    rgba(130, 105, 180, 0.22),

    inset
    0 7px 18px
    rgba(255,255,255,0.95);

  z-index: 3;
}


/* BODY SHINE */

.robot-body::before {
  content: "";

  position: absolute;

  width: 35px;
  height: 90px;

  left: 25px;
  top: 20px;

  border-radius: 50%;

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

  transform: rotate(20deg);

  filter: blur(3px);
}


/* DIGITAL SCREEN */

.face-screen {
  position: absolute;

  width: 135px;
  height: 108px;

  left: 27px;
  top: 46px;

  border-radius: 28px;

  background:
    linear-gradient(
      145deg,
      #302d48,
      #201f34
    );

  border: 4px solid #aaa2c8;

  box-shadow:

    inset
    0 0 20px
    rgba(255,255,255,0.07),

    0 6px 14px
    rgba(80,70,110,0.22);

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  gap: 8px;

  z-index: 5;
}


/* SCREEN PIXELS */

.face-screen::after {
  content: "";

  position: absolute;

  inset: 7px;

  border-radius: 20px;

  border: 1px solid
    rgba(255,255,255,0.06);

  pointer-events: none;
}


/* HEART EYES */

.eyes {
  display: flex;

  gap: 30px;

  position: relative;
}

.heart-eye {
  position: relative;

  font-size: 32px;

  line-height: 1;

  color: #ff8fc9;

  text-shadow:
    0 0 5px #ffb8df,
    0 0 12px rgba(255,145,202,0.8);

  animation: eyeGlow 2.5s ease-in-out infinite;
}


/* LITTLE PIXEL SPARK */

.eye-spark {
  position: absolute;

  left: 9px;
  top: 2px;

  font-size: 8px;

  color: white;

  text-shadow:
    0 0 5px white;
}


/* MOUTH */

.smile {
  display: flex;

  align-items: center;

  gap: 3px;

  height: 12px;
}

.smile span {
  width: 7px;
  height: 7px;

  background: #ff91ca;

  box-shadow:
    0 0 5px #ff91ca;
}

.smile span:first-child {
  transform: translateY(-3px);
}

.smile span:last-child {
  transform: translateY(-3px);
}


/* ARMS */

.arm {
  position: absolute;

  width: 44px;
  height: 16px;

  top: 128px;

  border-radius: 20px;

  background:
    linear-gradient(
      180deg,
      #f2eaff,
      #dcd0ff
    );

  box-shadow:
    0 6px 12px
    rgba(120,100,160,0.18);

  z-index: 2;

  overflow: visible;
}

.left-arm {
  left: -38px;

  transform: rotate(21deg);
  transform-origin: right center;
}

.right-arm {
  right: -29px;

  transform: rotate(-21deg);
  transform-origin: left center;
}


/* HANDS */

.left-arm::before,
.right-arm::before {
  content: "";

  position: absolute;

  width: 18px;
  height: 18px;

  border-radius: 50%;

  background: #e4d9ff;

  top: -1px;
}

.left-arm::before {
  left: -5px;
}

.right-arm::before {
  right: -5px;
}


/* FLOATING BASE */

.floating-base {
  position: absolute;

  width: 112px;
  height: 38px;

  left: 69px;
  bottom: 5px;

  border-radius: 50%;

  background:
    linear-gradient(
      180deg,
      #dfd4ff,
      #b9a4ff
    );

  box-shadow:
    0 13px 28px
    rgba(145,115,230,0.4);

  z-index: 1;

  animation:
    baseFloat
    3s ease-in-out infinite;
}


/* BASE LIGHTS */

.base-light {
  position: absolute;

  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: white;

  box-shadow:
    0 0 8px white;
}

.light-1 {
  left: 25px;
  top: 14px;
}

.light-2 {
  left: 52px;
  top: 9px;
}

.light-3 {
  right: 23px;
  top: 14px;
}


/* =========================
   SPARKLES
========================= */

.sparkle {
  position: absolute;

  font-size: 25px;

  color: #9ebeff;

  animation:
    sparkleMove
    2.2s ease-in-out infinite;

  z-index: 4;
}

.sparkle-1 {
  left: calc(50% - 170px);
  top: 55px;
}

.sparkle-2 {
  left: calc(50% + 140px);
  top: 85px;

  color: #ff92ca;
}

.sparkle-3 {
  left: calc(50% - 140px);
  top: 220px;

  color: #ff92ca;
}

.sparkle-4 {
  left: calc(50% + 125px);
  top: 230px;
}


/* =========================
   INTERNET SIGNALS
========================= */

.signal {
  position: absolute;

  width: 45px;
  height: 35px;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: flex-end;

  gap: 3px;

  opacity: 0.8;

  animation:
    signalFloat
    2.5s ease-in-out infinite;
}

.signal span {
  display: block;

  height: 4px;

  border-radius: 10px;

  background:
    linear-gradient(
      90deg,
      #9bb8ff,
      #ff9bd3
    );

  box-shadow:
    0 0 7px
    rgba(150,160,255,0.7);
}

.signal span:nth-child(1) {
  width: 14px;
}

.signal span:nth-child(2) {
  width: 24px;
}

.signal span:nth-child(3) {
  width: 34px;
}

.signal-1 {
  left: calc(50% - 205px);
  top: 130px;

  transform: rotate(-35deg);
}

.signal-2 {
  left: calc(50% + 160px);
  top: 155px;

  transform: rotate(35deg);

  animation-delay: 0.7s;
}


/* WIFI SYMBOL */

.wifi-symbol {
  position: absolute;

  left: calc(50% + 175px);
  top: 45px;

  font-size: 38px;

  color: #a992ff;

  transform: rotate(-35deg);

  opacity: 0.75;

  animation:
    wifiPulse
    2s ease-in-out infinite;
}


/* =========================
   TITLE
========================= */

.robot-area h1 {
  margin: 0;

  font-size: 32px;

  font-weight: 700;

  color: #8068b5;

  letter-spacing: 0.5px;
}


/* ONLINE STATUS */

.online-status {
  display: flex;

  justify-content: center;

  align-items: center;

  gap: 7px;

  margin-top: 4px;

  color: #9b8ab7;

  font-size: 14px;
}

.online-dot {
  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: #72e6a5;

  box-shadow:
    0 0 8px
    rgba(70,220,130,0.7);

  animation:
    onlinePulse
    1.8s infinite;
}


/* =========================
   CHAT
========================= */

.chat-area {
  width: min(720px, 100%);

  padding: 18px;

  border-radius: 30px;

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

  border:
    2px solid
    rgba(255,255,255,0.9);

  box-shadow:
    0 18px 45px
    rgba(130,110,170,0.14);

  backdrop-filter: blur(15px);
}


/* CHAT HEADER */

.chat-header {
  display: flex;

  align-items: center;

  gap: 12px;

  padding: 3px 6px 14px;
}

.header-icon {
  width: 42px;
  height: 42px;

  display: flex;

  align-items: center;
  justify-content: center;

  border-radius: 14px;

  background:
    linear-gradient(
      135deg,
      #ffd4ec,
      #d9d0ff
    );

  font-size: 21px;
}

.chat-header strong {
  display: block;

  color: #66557f;

  font-size: 17px;
}

.chat-header small {
  display: block;

  color: #a091b7;

  margin-top: 2px;

  font-size: 12px;
}


/* =========================
   IMAGE GENERATE BUTTON
========================= */

.image-generate-button {
  margin-left: auto;

  border: none;

  padding: 10px 14px;

  border-radius: 14px;

  background:
    linear-gradient(
      135deg,
      rgba(180, 216, 255, 0.92),
      rgba(214, 197, 255, 0.92)
    );

  color: #66557f;

  font-family: inherit;

  font-weight: 700;

  font-size: 12px;

  cursor: pointer;

  box-shadow:
    0 6px 18px
    rgba(150,145,220,0.16);

  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.image-generate-button:hover {
  transform: translateY(-2px);

  box-shadow:
    0 9px 22px
    rgba(150,145,220,0.22);
}

.image-generate-button:active {
  transform: translateY(0);
}


/* =========================
   IMAGE GENERATOR PANEL
========================= */

.image-generator {
  margin: 0 0 14px;

  padding: 15px;

  border-radius: 22px;

  background:
    linear-gradient(
      135deg,
      rgba(226, 243, 255, 0.75),
      rgba(239, 229, 255, 0.76)
    );

  border:
    1px solid
    rgba(255,255,255,0.95);

  box-shadow:
    0 10px 28px
    rgba(130,110,170,0.10),
    inset 0 1px 0 rgba(255,255,255,0.85);

  animation: generatorIn 0.25s ease;
}

.image-generator[hidden] {
  display: none !important;
}

.image-generator-title {
  display: flex;

  align-items: center;

  gap: 10px;

  margin-bottom: 12px;
}

.image-generator-title > span {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 13px;

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

  font-size: 19px;
}

.image-generator-title strong {
  display: block;

  color: #66557f;

  font-size: 15px;
}

.image-generator-title small {
  display: block;

  margin-top: 2px;

  color: #9c8eae;

  font-size: 11px;
}

.image-generator label {
  display: block;

  margin-bottom: 6px;

  color: #75668b;

  font-size: 12px;

  font-weight: 700;
}

#promptInput {
  width: 100%;

  min-height: 92px;

  resize: vertical;

  border: none;

  outline: none;

  padding: 13px 15px;

  border-radius: 17px;

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

  color: #514764;

  font-family: inherit;

  font-size: 14px;

  box-shadow:
    0 5px 18px
    rgba(130,110,170,0.08);
}

#promptInput::placeholder {
  color: #b7acbf;
}

.image-generator-actions {
  display: flex;

  gap: 9px;

  margin-top: 10px;
}

#generateButton,
.secondary-button {
  border: none;

  min-height: 44px;

  padding: 0 18px;

  border-radius: 15px;

  font-family: inherit;

  font-weight: 700;

  font-size: 13px;

  cursor: pointer;

  transition:
    transform 0.2s,
    box-shadow 0.2s,
    opacity 0.2s;
}

#generateButton {
  flex: 1;

  background:
    linear-gradient(
      135deg,
      #8fc8ff,
      #b99aff
    );

  color: white;

  box-shadow:
    0 7px 17px
    rgba(150,135,225,0.22);
}

#generateButton:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

#generateButton:disabled {
  opacity: 0.55;

  cursor: wait;
}

.secondary-button {
  background: rgba(255,255,255,0.8);

  color: #766987;
}


/* =========================
   MAGICAL IMAGE PANEL
========================= */

.image-panel {
  position: absolute;

  left: 52px;
  top: -112px;

  width: 164px;
  min-height: 104px;

  padding: 12px;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  gap: 7px;

  border-radius: 24px;

  background:
    linear-gradient(
      145deg,
      rgba(166, 222, 255, 0.76),
      rgba(195, 171, 255, 0.76)
    );

  border:
    1px solid
    rgba(255,255,255,0.92);

  box-shadow:
    0 0 14px
    rgba(121, 197, 255, 0.45),
    0 0 30px
    rgba(178, 148, 255, 0.36),
    inset 0 1px 0
    rgba(255,255,255,0.7);

  backdrop-filter: blur(12px);

  opacity: 0;

  transform:
    translateY(20px)
    rotate(21deg)
    scale(0.82);

  pointer-events: none;

  z-index: 30;

  overflow: hidden;
}

.image-panel::before {
  content: "";

  position: absolute;

  inset: -30%;

  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(255,255,255,0.54),
      transparent 24%
    ),
    radial-gradient(
      circle at 75% 65%,
      rgba(166,221,255,0.38),
      transparent 28%
    );

  filter: blur(4px);

  pointer-events: none;

  animation: panelAura 3s ease-in-out infinite;
}

.image-panel.is-open {
  animation:
    panelMagicIn
    0.45s
    cubic-bezier(.2,.8,.2,1)
    forwards;

  pointer-events: auto;
}

.panel-status {
  position: relative;

  z-index: 2;

  color: #ffffff;

  font-size: 14px;

  font-weight: 700;

  text-shadow:
    0 1px 8px rgba(79,118,180,0.42);
}

.panel-hint {
  position: relative;

  z-index: 2;

  color: rgba(255,255,255,0.86);

  font-size: 10px;

  text-align: center;
}

.panel-preview {
  position: relative;

  z-index: 2;

  width: 100%;

  min-height: 30px;

  display: none;

  align-items: center;
  justify-content: center;

  border-radius: 15px;

  overflow: hidden;

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

  border: 1px solid rgba(255,255,255,0.48);
}

.panel-preview.has-image {
  display: flex;

  animation:
    imageReveal
    0.55s
    cubic-bezier(.2,.8,.2,1)
    both;
}

#generatedImage {
  display: block;

  width: 100%;
  height: auto;

  max-height: 140px;

  object-fit: cover;

  border-radius: 14px;

  cursor: zoom-in;
}

.panel-star {
  position: absolute;

  width: 8px;
  height: 8px;

  clip-path:
    polygon(
      50% 0,
      62% 38%,
      100% 50%,
      62% 62%,
      50% 100%,
      38% 62%,
      0 50%,
      38% 38%
    );

  background: white;

  box-shadow:
    0 0 8px white,
    0 0 14px rgba(129,211,255,0.85);

  opacity: 0.82;

  z-index: 4;

  animation:
    panelStarPulse
    1.2s
    ease-in-out
    infinite;
}

.panel-star-1 {
  top: 10px;
  left: 13px;
}

.panel-star-2 {
  top: 22px;
  right: 13px;

  animation-delay: 0.25s;
}

.panel-star-3 {
  bottom: 18px;
  left: 11px;

  animation-delay: 0.45s;
}

.panel-star-4 {
  bottom: 10px;
  right: 17px;

  animation-delay: 0.7s;
}

.glitter-layer {
  position: absolute;

  inset: 0;

  pointer-events: none;

  overflow: hidden;

  z-index: 5;
}

.glitter-dot {
  position: absolute;

  width: 4px;
  height: 4px;

  border-radius: 50%;

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

  box-shadow:
    0 0 5px rgba(255,255,255,0.96),
    0 0 10px rgba(153,220,255,0.92);

  opacity: 0;

  animation:
    glitterTwinkle
    0.95s
    ease-in-out
    var(--glitter-delay)
    infinite;
}

.eyes .glitter-layer {
  inset: -4px;

  z-index: 6;
}

.eyes .glitter-dot {
  width: 3px;
  height: 3px;

  box-shadow:
    0 0 4px white,
    0 0 7px rgba(255,143,201,0.9);
}

.image-spark-sweep {
  position: absolute;

  inset: 0;

  pointer-events: none;

  overflow: hidden;

  z-index: 6;

  opacity: 0;
}

.panel-preview.has-image .image-spark-sweep {
  animation: sweepContainer 0.9s ease-out 0.05s both;
}

.image-spark-sweep span {
  position: absolute;

  width: 8px;
  height: 8px;

  clip-path:
    polygon(
      50% 0,
      62% 38%,
      100% 50%,
      62% 62%,
      50% 100%,
      38% 62%,
      0 50%,
      38% 38%
    );

  background: white;

  box-shadow:
    0 0 6px white,
    0 0 12px rgba(147,214,255,0.95);

  transform: translateX(-30px) scale(0.5);
}

.image-spark-sweep span:nth-child(1) {
  top: 22%;
  left: 8%;
}

.image-spark-sweep span:nth-child(2) {
  top: 55%;
  left: 32%;
  width: 6px;
  height: 6px;
}

.image-spark-sweep span:nth-child(3) {
  top: 36%;
  left: 58%;
  width: 7px;
  height: 7px;
}


/* =========================
   MESSAGES
========================= */

.messages {
  height: 270px;

  overflow-y: auto;

  padding: 15px;

  border-radius: 22px;

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

  border:
    1px solid
    rgba(255,255,255,0.9);
}

.message {
  max-width: 82%;

  padding: 12px 15px;

  margin-bottom: 12px;

  border-radius: 18px;

  line-height: 1.45;

  animation:
    messageIn
    0.25s ease;
}

.message p {
  margin: 4px 0 0;
}

.message-name {
  font-size: 12px;

  font-weight: 700;
}

.ai-message {
  background: #f1e8ff;

  margin-right: auto;
}

.user-message {
  background: #ffdfee;

  margin-left: auto;
}


/* INPUT */

.input-area {
  display: flex;

  gap: 10px;

  margin-top: 13px;
}

#messageInput {
  flex: 1;

  min-width: 0;

  border: none;

  outline: none;

  padding: 15px 18px;

  border-radius: 18px;

  background: white;

  color: #514764;

  font-family: inherit;

  font-size: 15px;

  box-shadow:
    0 5px 18px
    rgba(130,110,170,0.1);
}

#messageInput::placeholder {
  color: #b4a8c4;
}


#sendButton {
  border: none;

  padding: 0 24px;

  border-radius: 18px;

  background:
    linear-gradient(
      135deg,
      #ff9bd0,
      #a995ff
    );

  color: white;

  font-family: inherit;

  font-weight: 700;

  font-size: 14px;

  cursor: pointer;

  box-shadow:
    0 6px 15px
    rgba(180,130,220,0.2);

  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

#sendButton:hover {
  transform: translateY(-2px);

  box-shadow:
    0 9px 20px
    rgba(180,130,220,0.28);
}

#sendButton:active {
  transform: translateY(0);
}

#sendButton:disabled {
  opacity: 0.55;

  cursor: wait;
}


/* =========================
   IMAGE MODAL
========================= */

.image-modal {
  position: fixed;

  inset: 0;

  display: none;

  align-items: center;
  justify-content: center;

  padding: 20px;

  z-index: 1000;
}

.image-modal.is-open {
  display: flex;

  animation: modalIn 0.22s ease;
}

.image-modal-backdrop {
  position: absolute;

  inset: 0;

  background:
    rgba(67, 56, 93, 0.34);

  backdrop-filter: blur(10px);
}

.image-modal-content {
  position: relative;

  width: min(680px, 94vw);

  max-height: 92vh;

  overflow: auto;

  padding: 20px;

  border-radius: 28px;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,0.96),
      rgba(242,237,255,0.96)
    );

  border:
    2px solid
    rgba(255,255,255,0.98);

  box-shadow:
    0 25px 70px
    rgba(73,58,110,0.25);
}

.image-modal-close {
  position: absolute;

  top: 12px;
  right: 14px;

  width: 36px;
  height: 36px;

  border: none;

  border-radius: 50%;

  background: rgba(221,211,255,0.82);

  color: #66557f;

  font-family: inherit;

  font-size: 24px;

  line-height: 1;

  cursor: pointer;
}

.image-modal-title {
  padding-right: 46px;

  margin-bottom: 13px;

  color: #725c96;

  font-size: 18px;

  font-weight: 700;
}

#modalImage {
  display: block;

  width: 100%;
  height: auto;
  max-height: 68vh;

  object-fit: contain;

  border-radius: 20px;

  background: #f4efff;

  box-shadow:
    0 10px 30px
    rgba(115,95,150,0.13);
}

.download-button {
  width: 100%;

  margin-top: 14px;

  min-height: 48px;

  border: none;

  border-radius: 17px;

  background:
    linear-gradient(
      135deg,
      #ff9bd0,
      #9fb4ff
    );

  color: white;

  font-family: inherit;

  font-weight: 700;

  font-size: 14px;

  cursor: pointer;

  box-shadow:
    0 7px 18px
    rgba(170,135,220,0.23);

  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.download-button:hover {
  transform: translateY(-2px);

  box-shadow:
    0 10px 24px
    rgba(170,135,220,0.28);
}


/* =========================
   GENERATING STATE
========================= */

.robot.generating .right-arm {
  animation:
    bitzArmRaise
    0.58s
    cubic-bezier(.2,.8,.2,1)
    forwards;
}

.robot.generating .heart-eye {
  animation:
    eyeGlowStrong
    1.1s
    ease-in-out
    infinite;
}

.robot.generating .image-panel {
  animation:
    panelMagicIn
    0.45s
    cubic-bezier(.2,.8,.2,1)
    forwards;
}


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

@keyframes floating {

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

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


@keyframes baseFloat {

  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }

  50% {
    transform: scale(0.92);
    opacity: 0.65;
  }
}


@keyframes sparkleMove {

  0%, 100% {
    transform:
      translateY(0)
      rotate(0deg);

    opacity: 0.65;
  }

  50% {
    transform:
      translateY(-9px)
      rotate(18deg);

    opacity: 1;
  }
}


@keyframes signalFloat {

  0%, 100% {
    transform: translateY(0);
    opacity: 0.6;
  }

  50% {
    transform: translateY(-8px);
    opacity: 1;
  }
}


@keyframes wifiPulse {

  0%, 100% {
    opacity: 0.45;
    transform: rotate(-35deg) scale(1);
  }

  50% {
    opacity: 1;
    transform: rotate(-35deg) scale(1.12);
  }
}


@keyframes eyeGlow {

  0%, 100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.25);
  }
}

@keyframes eyeGlowStrong {

  0%, 100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.45);
  }
}


@keyframes onlinePulse {

  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.35);
    opacity: 1;
  }
}


@keyframes messageIn {

  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


@keyframes generatorIn {

  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


@keyframes panelMagicIn {

  from {
    opacity: 0;
    transform:
      translateY(24px)
      rotate(21deg)
      scale(0.72);
  }

  to {
    opacity: 1;
    transform:
      translateY(0)
      rotate(21deg)
      scale(1);
  }
}


@keyframes panelAura {

  0%, 100% {
    transform: translate3d(-1%, -1%, 0) scale(1);
    opacity: 0.8;
  }

  50% {
    transform: translate3d(2%, 2%, 0) scale(1.04);
    opacity: 1;
  }
}


@keyframes panelStarPulse {

  0%, 100% {
    opacity: 0.25;
    transform: scale(0.7) rotate(45deg);
  }

  50% {
    opacity: 0.95;
    transform: scale(1.12) rotate(45deg);
  }
}


@keyframes glitterTwinkle {

  0%, 100% {
    opacity: 0;
    transform: scale(0.45);
  }

  40% {
    opacity: var(--glitter-opacity, 0.7);
    transform: scale(1);
  }

  55% {
    opacity: calc(var(--glitter-opacity, 0.7) * 0.8);
    transform: scale(1.18);
  }

  78% {
    opacity: 0.05;
    transform: scale(0.65);
  }
}


@keyframes imageReveal {

  from {
    opacity: 0;
    transform: scale(0.82);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}


@keyframes sweepContainer {

  from {
    opacity: 0;
  }

  25% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.image-spark-sweep span:nth-child(1) {
  animation: imageSparkPass1 0.8s ease-out both;
}

.image-spark-sweep span:nth-child(2) {
  animation: imageSparkPass2 0.8s ease-out 0.06s both;
}

.image-spark-sweep span:nth-child(3) {
  animation: imageSparkPass3 0.8s ease-out 0.12s both;
}

@keyframes imageSparkPass1 {
  from {
    transform: translate(-30px, 12px) scale(0.35);
    opacity: 0;
  }

  45% {
    opacity: 1;
  }

  to {
    transform: translate(140px, -6px) scale(0.9);
    opacity: 0;
  }
}

@keyframes imageSparkPass2 {
  from {
    transform: translate(-25px, -4px) scale(0.3);
    opacity: 0;
  }

  45% {
    opacity: 1;
  }

  to {
    transform: translate(120px, -10px) scale(0.8);
    opacity: 0;
  }
}

@keyframes imageSparkPass3 {
  from {
    transform: translate(-20px, 9px) scale(0.3);
    opacity: 0;
  }

  45% {
    opacity: 1;
  }

  to {
    transform: translate(100px, 16px) scale(0.75);
    opacity: 0;
  }
}


@keyframes bitzArmRaise {

  from {
    transform: rotate(-21deg);
  }

  to {
    transform: rotate(-45deg);
  }
}


@keyframes modalIn {

  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}


/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

  .app {
    padding-top: 20px;
  }

  .robot {
    transform: scale(0.85);
    margin-bottom: -25px;
  }

  .sparkle-1 {
    left: 10%;
  }

  .sparkle-2 {
    left: 82%;
  }

  .sparkle-3 {
    left: 17%;
  }

  .sparkle-4 {
    left: 78%;
  }

  .signal-1 {
    left: 3%;
  }

  .signal-2 {
    left: 82%;
  }

  .wifi-symbol {
    left: 82%;
  }

  .messages {
    height: 235px;
  }

  .chat-header {
    flex-wrap: wrap;
  }

  .image-generate-button {
    width: 100%;

    margin-left: 0;
  }

  .input-area {
    flex-direction: column;
  }

  #sendButton {
    height: 48px;
  }

  .image-panel {
    left: 42px;
    top: -118px;
    width: 150px;
  }

  .image-modal-content {
    padding: 16px;
  }
}

/* =========================
   ACCOUNT + CHAT HISTORY
========================= */
.account-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.history-button,
.auth-button,
#newChatButton {
  border: 0;
  border-radius: 14px;
  padding: 10px 13px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: #f1eaff;
  color: #62527c;
  box-shadow: 0 6px 16px rgba(110, 87, 150, 0.10);
}

.auth-button {
  background: linear-gradient(135deg, #ffb7df, #cbbcff);
  color: #493d62;
}

.chat-history {
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(150,125,190,.14);
  box-shadow: 0 12px 30px rgba(90,70,130,.10);
}

.chat-history[hidden] { display: none; }

.chat-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.chat-history-header strong,
.chat-history-header small { display: block; }
.chat-history-header small { opacity: .65; margin-top: 2px; }

.chat-list { display: grid; gap: 6px; max-height: 180px; overflow: auto; }

.chat-list button {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  color: #554967;
  background: #faf7ff;
  cursor: pointer;
}
.chat-list button:hover { background: #f0eaff; }
.chat-list .empty-chat-list { padding: 10px; opacity: .65; font-size: .9rem; }

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-modal.is-open { display: flex; animation: modalIn .18s ease-out; }
.auth-backdrop { position: absolute; inset: 0; background: rgba(46,38,65,.35); backdrop-filter: blur(7px); }
.auth-card {
  position: relative;
  width: min(420px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(145deg, #fff, #f8f2ff);
  box-shadow: 0 25px 70px rgba(60,45,90,.25);
  border: 2px solid rgba(255,255,255,.9);
}
.auth-close {
  position: absolute; right: 14px; top: 10px; border: 0; background: transparent;
  font-size: 28px; color: #756783; cursor: pointer;
}
.auth-logo { font-size: 30px; }
.auth-card h2 { margin: 8px 0 5px; color: #4d4160; }
.auth-card > p { margin: 0 0 18px; color: #766b82; }
.auth-tabs { display: flex; gap: 7px; margin-bottom: 16px; }
.auth-tabs button { flex: 1; border: 0; border-radius: 12px; padding: 10px; font: inherit; cursor: pointer; background: #eee8f8; color: #756783; }
.auth-tabs button.active { background: #d9ccff; color: #4d4160; font-weight: 700; }
.auth-card form { display: grid; gap: 8px; }
.auth-card label { color: #5d526b; font-size: .9rem; }
.auth-card input { width: 100%; border: 1px solid #ddd2eb; border-radius: 12px; padding: 12px; font: inherit; outline: none; background: white; }
.auth-card input:focus { border-color: #bba7ee; box-shadow: 0 0 0 3px rgba(187,167,238,.16); }
.auth-submit { margin-top: 6px; border: 0; border-radius: 13px; padding: 12px; font: inherit; font-weight: 700; cursor: pointer; background: linear-gradient(135deg,#ffb7df,#c9b9ff); color: #493d62; }
.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-error { min-height: 20px; margin: 4px 0 0; color: #b24f78; font-size: .88rem; }

@media (max-width: 600px) {
  .account-actions { width: 100%; margin-left: 0; }
  .history-button, .auth-button { flex: 1; }
}
