@import url('https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,300..700;1,300..700&family=Fredoka:wght@300..700&family=Quintessential&display=swap');

body {
  margin: 0;
  font-family: 'Cormorant', sans-serif;
  color: #e9ecff;
  background: radial-gradient(1200px 600px at 50% -10%, #1a1940 0%, #0b0f1a 45%, #090d18 100%);
}

.app {
  max-width: 840px;
  margin: 0 auto;
  padding: 48px 20px 72px;
  text-align: center;
}

h1 {
  margin: 0 0 4px;
  font-family: 'Quintessential', cursive;
  font-size: clamp(22px, 3vw, 32px);
  color: #dbe2ff;
  text-shadow: 0 6px 40px rgba(60, 40, 160, 0.6);
}
h2 {
  margin: 0 0 18px;
  font-family: 'Cormorant', sans-serif;
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 500;
  color: #bfc8ff;
}

.ball {
  position: relative;
  width: min(60vmin, 520px);
  aspect-ratio: 1 / 1;
  margin: 10px auto 20px;
  border-radius: 50%;
  background:
    radial-gradient(70% 80% at 50% 35%, rgba(255,255,255,.18), rgba(167,139,250,.22) 40%, rgba(12,18,40,.55) 70%, rgba(0,0,0,.75) 100%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.06) inset,
    0 40px 120px -20px rgba(88,56,204,.55),
    0 0 160px 0 rgba(99,102,241,.35);
  overflow: hidden;
  display: grid;
  place-items: center;
  animation: breathe 5.5s ease-in-out infinite;
}
.glow {
  position: absolute; inset: -20%;
  background:
    radial-gradient(60% 60% at 50% 40%, rgba(255,255,255,.18), transparent 60%),
    radial-gradient(40% 40% at 60% 55%, rgba(99,102,241,.22), transparent 60%),
    radial-gradient(50% 50% at 40% 60%, rgba(94,234,212,.15), transparent 60%);
  filter: blur(6px);
}
.sheen {
  position: absolute; inset: 0;
  background:
    radial-gradient(40% 25% at 50% 22%, rgba(255,255,255,.28), transparent 60%),
    radial-gradient(25% 15% at 45% 20%, rgba(255,255,255,.35), transparent 60%);
  mix-blend-mode: screen;
  opacity: .75;
}
.hint {
  position: absolute; bottom: 7%;
  font-size: clamp(12px, 2vw, 16px);
  color: #cfd6ff;
  opacity: .66;
}
@keyframes breathe {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 35px 90px rgba(99,102,241,.35)); }
  50%      { transform: translateY(2px); filter: drop-shadow(0 35px 120px rgba(99,102,241,.55)); }
}

#ask-form {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 6px;
}

#question {
  flex: 1 1 360px;
  max-width: 520px;
  width: min(70vw, 520px);
  padding: 12px 14px;
  font-family: 'Cormorant', sans-serif;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: #eaf0ff;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
#question::placeholder { color: #c5cbed; opacity: .7; }
#question:focus {
  border-color: rgba(167,139,250,.8);
  background: rgba(255,255,255,.1);
  box-shadow: 0 0 0 3px rgba(167,139,250,.22);
}

#button {
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: linear-gradient(180deg, #ffeb7f 0%, #ffd84d 100%);
  color: #2b2b2b;
  font-family: 'Cormorant', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, filter .2s ease;
  box-shadow: 0 10px 24px rgba(255,216,77,.28);
}
#button:hover  { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(255,216,77,.40); }
#button:active { transform: translateY(0); }

.error {
  width: 100%;
  max-width: 520px;
  text-align: left;
  color: #ffb4bd;
  font-size: 14px;
}

#history-title {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: clamp(16px, 1.6vw, 20px);
  color: #e9ecff;
  font-family: 'Quintessential', serif;
  font-weight: 500;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.answers {
  width: 100%;
  max-width: 720px;
  margin: 16px auto 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.answers .row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}
.bubble {
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 80%;
  line-height: 1.45;
  font-size: 16px;
}
.me   { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.orby {
  background: linear-gradient(180deg, rgba(167,139,250,.20), rgba(167,139,250,.08));
  border: 1px solid rgba(167,139,250,.35);
  box-shadow: 0 12px 30px rgba(88,56,204,.22);
}

.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
  white-space: nowrap;
}

#overlay {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 700px;
  text-align: center;
  color: #e9ecff;
  font-size: clamp(22px, 3vw, 36px);
  text-shadow: 0 0 20px rgba(167,139,250,0.6);
  pointer-events: none;
  line-height: 1.6;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  font-family: 'Quintessential', cursive;
  z-index: 10;
}

#overlay * {
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

#overlay.show {
  opacity: 1;
}

#overlay .user {
  color: #d6dbff;
  margin-bottom: 4px;
}

#overlay .orby {
  color: #f1e9ff;
  font-style: italic;
  font-size: 1.1em;
}


@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -55%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

