:root {
  --bg-0: #07061a;
  --bg-1: #140d33;
  --violet: #a78bfa;
  --violet-deep: #6d28d9;
  --gold: #fcd34d;
  --ink: #ece9ff;
  --ink-dim: #a79fd6;
  --oracle-bubble: rgba(76, 29, 149, 0.28);
  --you-bubble: rgba(252, 211, 77, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 50% -10%, #241a52 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  min-height: 100%;
  display: flex;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  overflow-x: hidden;
}

/* Soft starfield built from layered radial gradients -- no images. */
.starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 70% 20%, #e9d5ff 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 70%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 60%, #fde68a 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 60% 85%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 10% 80%, #c4b5fd 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 35%, #fff 50%, transparent 51%);
  opacity: 0.5;
  animation: twinkle 7s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.35; }
  to   { opacity: 0.7; }
}

.stage {
  position: relative;
  width: min(680px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(16px, 3vw, 28px);
}

.stage__head {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.orb {
  width: clamp(140px, 32vw, 200px);
  aspect-ratio: 1;
  filter: drop-shadow(0 0 36px rgba(167, 139, 250, 0.55));
}

.orb__svg { width: 100%; height: 100%; display: block; }

.orb__halo { animation: pulse 4.5s ease-in-out infinite; transform-origin: center; }
.orb__iris { animation: iris 6s ease-in-out infinite; transform-origin: center; }
.orb__pupil { animation: pupil 6s ease-in-out infinite; transform-origin: center; }

@keyframes pulse {
  0%, 100% { opacity: 0.92; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.03); }
}
@keyframes iris {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}
@keyframes pupil {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(0.82); }
}

.title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(2rem, 7vw, 3.1rem);
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--gold), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  color: var(--ink-dim);
  font-style: italic;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1rem, 3.4vw, 1.2rem);
  max-width: 34ch;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 120px;
  padding: 4px;
}

.bubble {
  padding: 14px 18px;
  border-radius: 16px;
  line-height: 1.55;
  max-width: 92%;
  animation: rise 0.4s ease-out both;
  font-size: clamp(0.98rem, 2.6vw, 1.08rem);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bubble--oracle {
  align-self: flex-start;
  background: var(--oracle-bubble);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-top-left-radius: 4px;
}

.bubble--you {
  align-self: flex-end;
  background: var(--you-bubble);
  border: 1px solid rgba(252, 211, 77, 0.35);
  border-top-right-radius: 4px;
  color: var(--gold);
  font-weight: 500;
}

.bubble--guess {
  border-color: rgba(252, 211, 77, 0.55);
  box-shadow: 0 0 24px rgba(252, 211, 77, 0.14);
}

.bubble--solved {
  align-self: center;
  text-align: center;
  max-width: 100%;
  background: linear-gradient(135deg, rgba(252, 211, 77, 0.16), rgba(167, 139, 250, 0.16));
  border: 1px solid rgba(252, 211, 77, 0.55);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.1rem, 3.2vw, 1.4rem);
  box-shadow: 0 0 40px rgba(252, 211, 77, 0.2);
}

.bubble--thinking { color: var(--ink-dim); font-style: italic; }
.bubble--thinking::after {
  content: "";
  animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

.opener { display: flex; gap: 10px; flex-wrap: wrap; }

.opener__input {
  flex: 1 1 240px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(167, 139, 250, 0.4);
  background: rgba(10, 7, 32, 0.6);
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
}
.opener__input::placeholder { color: var(--ink-dim); font-style: italic; }
.opener__input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.2);
}

.answers {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.again { display: flex; justify-content: center; }

.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
  min-width: 96px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn--primary {
  background: linear-gradient(90deg, var(--violet-deep), var(--violet));
  box-shadow: 0 6px 24px rgba(109, 40, 217, 0.4);
}
.btn--yes {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.5);
  color: #a7f3d0;
}
.btn--no {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}
.btn--maybe {
  background: rgba(167, 139, 250, 0.16);
  border-color: rgba(167, 139, 250, 0.5);
  color: #ddd6fe;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .starfield, .orb__halo, .orb__iris, .orb__pupil { animation: none; }
  .bubble { animation: none; }
}
