:root {
  --bg: #0f172a;
  --bg2: #111827;
  --card: rgba(255, 255, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.14);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --blue: #2563eb;
  --blue-strong: #1d4ed8;
  --green: #16a34a;
  --green-strong: #15803d;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.wrap {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-decoration: none;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn,
.choice,
.cat {
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease,
    box-shadow 0.15s ease, color 0.15s ease;
}

.btn {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 700;
}

.btn.primary {
  background: linear-gradient(135deg, var(--green), var(--green-strong));
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.28);
}

.btn[disabled] {
  cursor: wait;
  opacity: 0.84;
}

.hero {
  text-align: center;
  padding: 18px 8px 6px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.04;
  text-wrap: balance;
}

.hero p {
  margin: 0 auto;
  max-width: 42rem;
  color: var(--muted);
  line-height: 1.65;
  font-size: 1rem;
}

.category-strip,
.card,
.ad {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.category-strip {
  margin-top: 18px;
  padding: 12px;
}

.category-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.categories {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.cat {
  display: block;
  min-height: 84px;
  padding: 12px 10px;
  border-radius: 18px;
  background: var(--card-strong);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  text-decoration: none;
}

.cat small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cat.active,
.cat[aria-current="page"] {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(22, 163, 74, 0.24));
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
}

.cat.active small,
.cat[aria-current="page"] small {
  color: rgba(248, 250, 252, 0.86);
}

.card {
  margin-top: 18px;
  padding: 20px;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.card.is-switching {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.question {
  margin: 0 0 16px;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.1;
  font-weight: 900;
  text-align: center;
  text-wrap: balance;
}

.choices {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.choice {
  min-height: 114px;
  text-align: left;
  border-radius: 20px;
  padding: 16px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.choice.a {
  background: linear-gradient(135deg, #3b82f6, var(--blue-strong));
}

.choice.b {
  background: linear-gradient(135deg, #22c55e, var(--green-strong));
}

.choice small {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

.choice span {
  display: block;
  font-size: 1.08rem;
  line-height: 1.35;
  font-weight: 800;
}

.choice:disabled {
  cursor: default;
}

.choice.selected {
  border-color: rgba(255, 255, 255, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 0 2px rgba(248, 250, 252, 0.18);
}

.results {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  animation: panel-in 0.18s ease;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(72px, 92px) 1fr 56px;
  gap: 10px;
  align-items: center;
  font-weight: 800;
  padding: 4px 0;
}

.bar-row.selected {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
}

.bar {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}

.fill {
  height: 100%;
  transition: width 0.24s ease;
}

.fill-a {
  background: linear-gradient(90deg, #60a5fa, var(--blue));
}

.fill-b {
  background: linear-gradient(90deg, #4ade80, var(--green));
}

.actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.final-state {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 4px 0 6px;
  text-align: center;
  animation: panel-in 0.18s ease;
}

.final-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.final-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.15;
  font-weight: 900;
}

.final-copy {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--muted);
  line-height: 1.6;
}

.ad {
  margin-top: 16px;
  padding: 14px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.ad strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}

.btn:hover,
.choice:hover,
.cat:hover {
  transform: translateY(-1px);
}

.card.is-rtl .question {
  text-align: right;
  direction: rtl;
}

.card.is-rtl .choice {
  text-align: right;
}

.card.is-rtl .choice small,
.card.is-rtl .choice span,
.card.is-rtl #result-label-a,
.card.is-rtl #result-label-b {
  direction: rtl;
  text-align: right;
}

.btn:focus-visible,
.choice:focus-visible,
.cat:focus-visible,
.brand:focus-visible {
  outline: 2px solid rgba(248, 250, 252, 0.9);
  outline-offset: 2px;
}

.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;
}

[hidden] {
  display: none !important;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .categories {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .categories {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar {
    padding: 10px 12px;
  }

  .top-actions .btn:last-child {
    display: none;
  }
}
