:root {
  --bg0: #f6f7fb;
  --bg1: #eef1fb;
  --card: rgba(255, 255, 255, 0.78);
  --card2: rgba(255, 255, 255, 0.68);
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: rgba(15, 23, 42, 0.88);
  --muted: rgba(15, 23, 42, 0.62);
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 10px 26px rgba(15, 23, 42, 0.10);
  --ring: 0 0 0 4px rgba(59, 130, 246, 0.18);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-monospace, "Monaco", "Menlo", "Cascadia Mono", "Consolas",
    "Liberation Mono", "Courier New", monospace;
  text-transform: lowercase;
  font-weight: 420;
  color: var(--text);
  background: radial-gradient(1100px circle at 18% 10%, rgba(59, 130, 246, 0.18), transparent 55%),
    radial-gradient(1000px circle at 92% 22%, rgba(16, 185, 129, 0.16), transparent 55%),
    linear-gradient(160deg, var(--bg0), var(--bg1) 70%);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px circle at 20% 15%, rgba(59, 130, 246, 0.10), transparent 55%),
    radial-gradient(900px circle at 85% 35%, rgba(16, 185, 129, 0.08), transparent 60%);
  opacity: 1;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image:
    repeating-linear-gradient(0deg, rgba(15, 23, 42, 0.22) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.16) 0 1px, transparent 1px 6px);
}

.app {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 18px;
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.screen {
  width: 100%;
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: 12px;
}

.screen[hidden] {
  display: none;
}

.header {
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.title {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  font-weight: 520;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 56ch;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 20px;
  backdrop-filter: blur(14px);
}

.form {
  display: grid;
  gap: 14px;
}

.fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.legend {
  font-weight: 520;
  margin-bottom: 12px;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.52);
  cursor: pointer;
  user-select: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease,
    box-shadow 160ms ease;
}

.choice:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.065);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.choice input {
  width: 18px;
  height: 18px;
}

.choice:has(input:focus-visible) {
  outline: none;
  box-shadow: var(--ring);
}

.btn {
  appearance: none;
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-weight: 520;
  letter-spacing: 0.01em;
  color: rgba(15, 23, 42, 0.84);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.82),
    rgba(255, 255, 255, 0.62)
  );
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease,
    box-shadow 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92),
    rgba(255, 255, 255, 0.72)
  );
  border-color: rgba(59, 130, 246, 0.30);
  box-shadow: var(--shadow-soft);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.status {
  min-height: 1.2em;
  margin: 0;
  color: var(--muted);
}

.result {
  margin-top: 12px;
}

.resultCard {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 20px;
  backdrop-filter: blur(12px);
}

.btnSecondary {
  justify-self: stretch;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.74),
    rgba(255, 255, 255, 0.52)
  );
  border-color: rgba(15, 23, 42, 0.12);
}

.btnSecondary:hover {
  border-color: rgba(15, 23, 42, 0.18);
}

.resultTop {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.resultTitle {
  margin: 0;
  font-size: 18px;
  font-weight: 520;
}

.link {
  color: rgba(15, 23, 42, 0.74);
  text-decoration: none;
  border-bottom: 1px solid rgba(15, 23, 42, 0.22);
}

.link:hover {
  border-bottom-color: rgba(15, 23, 42, 0.42);
}

.figure {
  margin: 0;
  display: grid;
  gap: 10px;
}

.catImg {
  width: 100%;
  max-height: min(48vh, 420px);
  object-fit: contain;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.04);
}

.caption {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 560px) {
  .choices {
    grid-template-columns: 1fr;
  }
}

/* Mood themes (set by JS) */
body[data-mood="happy"] {
  background: radial-gradient(1100px circle at 15% 12%, rgba(59, 130, 246, 0.20), transparent 55%),
    radial-gradient(1000px circle at 90% 18%, rgba(16, 185, 129, 0.18), transparent 55%),
    linear-gradient(160deg, #f7fbff, #eef1fb 70%);
}

body[data-mood="sad"] {
  background: radial-gradient(1100px circle at 15% 16%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(1000px circle at 90% 12%, rgba(14, 165, 233, 0.16), transparent 55%),
    linear-gradient(160deg, #f7f8ff, #eef1fb 70%);
}

body[data-mood="confused"] {
  background: radial-gradient(1100px circle at 18% 12%, rgba(245, 158, 11, 0.18), transparent 55%),
    radial-gradient(1000px circle at 90% 20%, rgba(236, 72, 153, 0.12), transparent 55%),
    linear-gradient(160deg, #fff9f1, #eef1fb 72%);
}

body[data-mood="lonely"] {
  background: radial-gradient(1100px circle at 18% 12%, rgba(20, 184, 166, 0.16), transparent 55%),
    radial-gradient(1000px circle at 90% 20%, rgba(59, 130, 246, 0.14), transparent 55%),
    linear-gradient(160deg, #f3fffd, #eef1fb 72%);
}

@supports not (backdrop-filter: blur(12px)) {
  .card,
  .resultCard {
    background: rgba(255, 255, 255, 0.06);
  }
}
