/* ── Theme tokens ─────────────────────────────────────────────── */
:root {
  --blue-deep: #0b2545;
  --blue: #13315c;
  --blue-soft: #1d4e89;
  --cream: #fdf6e3;
  --cream-edge: #f3e8c8;
  --ink: #20303f;
  --ink-soft: #5b6b78;
  --gold: #d4a017;
  --gold-soft: #e7c869;

  --yes: #2e7d32;
  --yes-bg: #e7f4e8;
  --no: #c62828;
  --no-bg: #fbe9e9;
  --meh: #c77800;
  --meh-bg: #fbf0dc;

  --radius: 20px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

/* ── Base ─────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 4vw, 32px);
  padding-top: max(clamp(12px, 4vw, 32px), env(safe-area-inset-top));
  padding-bottom: max(clamp(12px, 4vw, 32px), env(safe-area-inset-bottom));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(
      1200px 600px at 50% -10%,
      var(--blue-soft),
      transparent 60%
    ),
    linear-gradient(160deg, var(--blue-deep), var(--blue));
  background-attachment: fixed;
}

/* ── Card ─────────────────────────────────────────────────────── */
.card {
  width: 100%;
  max-width: 560px;
  background: var(--cream);
  border: 1px solid var(--cream-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 5vw, 40px);
  overflow: hidden;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: clamp(18px, 4vw, 28px);
}

.hero__star {
  font-size: clamp(34px, 9vw, 46px);
  line-height: 1;
}

.hero__title {
  margin: 6px 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 9vw, 46px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--blue-deep);
}

.hero__subtitle {
  margin: 0;
  font-size: clamp(14px, 3.6vw, 16px);
  color: var(--ink-soft);
}

/* ── Ask form ─────────────────────────────────────────────────── */
.ask {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ask__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
}

.ask__input {
  width: 100%;
  resize: none;
  font: inherit;
  font-size: 16px; /* keeps iOS from zooming on focus */
  line-height: 1.4;
  color: var(--ink);
  background: #fffdf7;
  border: 2px solid var(--cream-edge);
  border-radius: 14px;
  padding: 14px 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ask__input::placeholder {
  color: #a89f86;
}

.ask__input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 160, 23, 0.18);
}

.ask__button {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  padding: 15px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--blue-soft), var(--blue));
  box-shadow: 0 8px 18px rgba(11, 37, 69, 0.3);
  transition: transform 0.08s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  min-height: 52px; /* comfy tap target */
}

.ask__button:hover {
  box-shadow: 0 10px 22px rgba(11, 37, 69, 0.38);
}

.ask__button:active {
  transform: translateY(1px) scale(0.995);
}

.ask__button:disabled {
  cursor: progress;
  opacity: 0.75;
}

/* ── Example chips ────────────────────────────────────────────── */
.examples {
  margin-top: 16px;
  text-align: center;
}

.examples__hint {
  display: block;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.examples__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chip {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  color: var(--blue);
  background: #fffdf7;
  border: 1.5px solid var(--cream-edge);
  border-radius: 999px;
  padding: 8px 13px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.08s ease;
}

.chip:hover {
  border-color: var(--gold-soft);
  background: #fffaf0;
}

.chip:active {
  transform: translateY(1px);
}

/* ── Result ───────────────────────────────────────────────────── */
.result {
  margin-top: clamp(18px, 5vw, 26px);
  padding: clamp(18px, 5vw, 24px);
  border-radius: 16px;
  background: #fffdf7;
  border: 1px solid var(--cream-edge);
  text-align: center;
  animation: pop 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.result__question {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ink-soft);
  font-style: italic;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.result__verdict {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 14vw, 64px);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 12px;
}

.result__verdict--yes {
  color: var(--yes);
}
.result__verdict--no {
  color: var(--no);
}
.result__verdict--meh {
  color: var(--meh);
}

.result__explanation {
  margin: 0;
  font-size: clamp(15px, 4vw, 17px);
  line-height: 1.55;
  color: var(--ink);
}

.result--error .result__verdict {
  font-size: clamp(30px, 9vw, 40px);
  color: var(--no);
}

/* badge tint behind the verdict word */
.result__verdict-badge {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
}
.result__verdict-badge.yes {
  background: var(--yes-bg);
}
.result__verdict-badge.no {
  background: var(--no-bg);
}
.result__verdict-badge.meh {
  background: var(--meh-bg);
}

/* ── Loading dots ─────────────────────────────────────────────── */
.loader {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 12px;
}
.loader span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  animation: bounce 1s infinite ease-in-out both;
}
.loader span:nth-child(2) {
  animation-delay: 0.15s;
}
.loader span:nth-child(3) {
  animation-delay: 0.3s;
}

.loading-text {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
  font-style: italic;
}

/* ── Footer ───────────────────────────────────────────────────── */
.footnote {
  margin-top: clamp(20px, 5vw, 28px);
  text-align: center;
  border-top: 1px dashed var(--cream-edge);
  padding-top: 14px;
}

.footnote p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.footnote__powered {
  margin-top: 6px !important;
  font-size: 11.5px !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* ── Animations ───────────────────────────────────────────────── */
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .result,
  .loader span {
    animation: none;
  }
}
