/* ============================================================================
   Wizard — "Take me somewhere"
   A single calm panel over the diorama. It asks for a sentence and then shows how
   that sentence was read, because a scorer that hides its reasoning feels arbitrary.
   ========================================================================= */

.wizard {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: radial-gradient(120% 90% at 50% 35%, rgba(10, 18, 28, 0.55) 0%, rgba(6, 10, 16, 0.9) 75%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in 0.35s var(--ease) both;
}
.wizard[hidden] { display: none; }
.wizard.is-leaving { animation: fade-out 0.26s var(--ease) both; }

.wizard-card {
  position: relative;
  width: min(34rem, 100%);
  background: var(--glass-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 1.9rem 1.9rem 1.5rem;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.6);
  animation: rise 0.45s var(--ease) both;
  animation-delay: 0.05s;
}

.wizard-close {
  position: absolute;
  top: 0.85rem;
  right: 0.9rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--ink-faint);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.wizard-close:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }

.wizard-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
}

.wizard-blurb {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.4rem;
}

.wizard-form { display: block; }

.wizard-label {
  display: block;
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.45rem;
}

.wizard-input {
  font: inherit;
  font-size: 1rem;
  line-height: 1.55;
  width: 100%;
  resize: vertical;
  min-height: 3.6rem;
  padding: 0.75rem 0.9rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.wizard-input:focus {
  outline: none;
  border-color: rgba(233, 184, 114, 0.55);
  background: rgba(255, 255, 255, 0.09);
}
.wizard-input::placeholder { color: var(--ink-faint); }

/* How the sentence was read — the panel's most important line. */
.wizard-reading {
  min-height: 1.4rem;
  margin-top: 0.7rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ember);
  transition: color 0.2s var(--ease);
}
.wizard-reading.is-unsure { color: var(--ink-soft); }

.wizard-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.wizard-chip {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--hairline-soft);
}
.wizard-chip.is-detected {
  color: #241703;
  font-weight: 600;
  background: linear-gradient(150deg, var(--ember) 0%, var(--ember-deep) 100%);
  border-color: rgba(255, 226, 178, 0.5);
}

.wizard-error {
  margin-top: 0.6rem;
  font-size: 0.83rem;
  color: #f0a08a;
}
.wizard-error[hidden] { display: none; }

.wizard-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.3rem;
  flex-wrap: wrap;
}

/*
 * The second road out of this panel — the same loop as the in-scene pill, so the same sparkle.
 * Laid out as a flex row with a gap, like `.ai-open`, because a `.btn` on its own is an inline box
 * and a glyph dropped into one sits on the text baseline with no space of its own.
 */
.wizard-ai {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.wizard-foot {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline-soft);
  font-size: 0.74rem;
  color: var(--ink-faint);
  line-height: 1.5;
}

@media (max-width: 720px) {
  .wizard-card { padding: 1.5rem 1.25rem 1.2rem; border-radius: 16px; }
  .wizard-title { font-size: 1.3rem; }
  .wizard-actions .btn { flex: 1 1 auto; }
}
