:root {
  color-scheme: dark;
  --bg: #050d16;
  --bg-2: #0c2030;
  --bg-3: #172d3c;
  --card: rgba(255, 252, 241, 0.98);
  --card-soft: rgba(255, 252, 241, 0.1);
  --ink: #0f1c27;
  --ink-2: #243645;
  --muted: #667582;
  --cream: #fff6dd;
  --cream-2: #f6ead1;
  --gold: #d9ad53;
  --gold-2: #f4d995;
  --amber-soft: #fff3cf;
  --green: #237066;
  --green-2: #8ac7b7;
  --blue: #123247;
  --line: rgba(15, 28, 39, 0.13);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.36);
  --soft-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  --radius: 30px;
  --radius-sm: 18px;
  --max-width: 1120px;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(217, 173, 83, 0.18), transparent 25rem),
    radial-gradient(circle at 86% 24%, rgba(35, 112, 102, 0.26), transparent 32rem),
    radial-gradient(circle at 40% 120%, rgba(79, 130, 155, 0.22), transparent 34rem),
    linear-gradient(135deg, var(--bg), var(--bg-2) 48%, #071621);
  color: var(--cream);
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.055), transparent 18%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 18rem);
  opacity: 0.8;
}

button,
a { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.bg-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.13;
  background-image:
    linear-gradient(30deg, rgba(255, 255, 255, 0.11) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.11) 87.5%, rgba(255, 255, 255, 0.11)),
    linear-gradient(150deg, rgba(255, 255, 255, 0.11) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.11) 87.5%, rgba(255, 255, 255, 0.11));
  background-size: 82px 142px;
  mask-image: linear-gradient(to bottom, #000, transparent 95%);
}

.app-shell {
  width: min(var(--max-width), calc(100% - 32px));
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(30px, env(safe-area-inset-top)) 0 max(30px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.screen {
  width: 100%;
  animation: fadeUp 420ms ease both;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.82fr);
  gap: 24px;
  align-items: stretch;
}

.hero-card,
.conversation-card,
.side-card,
.about-card {
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  min-height: min(620px, calc(100vh - 72px));
  padding: clamp(28px, 5vw, 56px);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(255, 252, 241, 0.14), rgba(255, 252, 241, 0.045)),
    linear-gradient(145deg, rgba(17, 38, 54, 0.96), rgba(16, 32, 45, 0.78));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.hero-card::before,
.conversation-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 82% 18%, rgba(244, 217, 149, 0.11), transparent 17rem);
}

.hero-card::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(217, 173, 83, 0.24);
  border-radius: 50%;
  right: -90px;
  top: -82px;
}

.hero-card > *,
.conversation-card > * { position: relative; z-index: 1; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-2);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.kicker::before {
  content: "";
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.hero h1 {
  margin: 28px 0 18px;
  font-size: clamp(3rem, 8vw, 6.1rem);
  line-height: 0.9;
  letter-spacing: -0.075em;
  max-width: 720px;
  color: var(--cream);
  text-wrap: balance;
}

.hero p {
  max-width: 650px;
  color: rgba(255, 246, 221, 0.82);
  font-size: clamp(1rem, 2vw, 1.24rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.landing-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--cream);
  flex: 0 0 auto;
  max-width: 100%;
}

.language-option {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 850;
  font-size: 0.84rem;
  white-space: nowrap;
}

.language-option.active {
  background: var(--gold-2);
  color: #201608;
}

.mystery-note {
  margin-bottom: 0;
  color: rgba(255, 246, 221, 0.72) !important;
}

.side-card {
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 34px);
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 173, 83, 0.16), transparent 15rem),
    rgba(255, 252, 241, 0.98);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.side-card p {
  color: #3f5060;
  font-size: 1.02rem;
  line-height: 1.7;
}

.side-card h2 {
  margin: 10px 0 10px;
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  letter-spacing: -0.045em;
}

.mystery-symbol {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: #edf5ef;
  color: var(--green);
  font-weight: 900;
}

.mystery-prompts {
  display: grid;
  gap: 11px;
}

.mystery-prompts span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #21313d;
  font-weight: 850;
  line-height: 1.35;
}

.mystery-prompts span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(217, 173, 83, 0.14);
  flex: 0 0 auto;
}

.quiet-rule {
  padding: 14px 16px;
  border-radius: 18px;
  background: #f2ead6;
  border: 1px solid rgba(15, 28, 39, 0.08);
  color: #40515e;
  font-weight: 750;
  line-height: 1.5;
}

.path-list {
  display: grid;
  gap: 12px;
  margin: 8px 0;
}

.path-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #f4edd9;
  color: var(--ink);
}

.path-index {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-weight: 850;
}

.path-item strong {
  display: block;
  margin-bottom: 4px;
}

.path-item span {
  color: var(--muted);
  line-height: 1.45;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 19px;
  min-height: 48px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 850;
  text-decoration: none;
  max-width: 100%;
  text-align: center;
  white-space: normal;
  line-height: 1.2;
  overflow-wrap: anywhere;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, opacity 180ms ease, border-color 180ms ease;
}

.btn:hover { transform: translateY(-2px); }

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

button:disabled:hover { transform: none; }

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

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #201608;
  box-shadow: 0 12px 30px rgba(217, 173, 83, 0.28);
}

.btn-primary:hover { box-shadow: 0 16px 42px rgba(217, 173, 83, 0.34); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.11);
  color: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.btn-dark {
  background: #0f2635;
  color: white;
  box-shadow: 0 14px 30px rgba(15, 38, 53, 0.2);
}

.btn-ghost {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(15, 28, 39, 0.16);
}

.btn-small {
  padding: 9px 13px;
  min-height: 38px;
  font-size: 0.88rem;
}

.conversation-layout {
  display: flex;
  justify-content: center;
  align-items: center;
}

.conversation-card {
  width: min(100%, 960px);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 173, 83, 0.12), transparent 16rem),
    var(--card);
  color: var(--ink);
  padding: clamp(24px, 4vw, 44px);
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  min-width: 0;
}

.brand-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-weight: 950;
  letter-spacing: -0.02em;
  min-width: 0;
}

.mark {
  width: 34px;
  height: 34px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--green), #143f39);
  color: var(--gold-2);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(35, 112, 102, 0.24);
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.nav-actions .language-switcher,
.about-card .language-switcher {
  background: rgba(15, 28, 39, 0.07);
  border-color: rgba(15, 28, 39, 0.14);
  color: var(--ink);
}

.main-menu-button {
  background: #10202d;
  color: #fff7df;
  border-color: rgba(16, 32, 45, 0.35);
  box-shadow: 0 10px 22px rgba(16, 32, 45, 0.13);
}

.progress-wrap { margin-bottom: 26px; }

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 8px;
  font-weight: 760;
}

.progress-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: #e8dfc9;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 10%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transition: width 300ms ease;
}

.node-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #ecf4eb;
  color: var(--green);
  font-weight: 850;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.question-title {
  margin: 18px 0 12px;
  font-size: clamp(1.52rem, 3vw, 2.55rem);
  line-height: 1.16;
  letter-spacing: -0.035em;
  color: #0d1a25;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.node-description {
  margin: 0;
  max-width: 790px;
  color: #40515e;
  font-size: clamp(0.95rem, 1.35vw, 1.04rem);
  line-height: 1.68;
  overflow-wrap: anywhere;
}

.answers {
  display: grid;
  gap: 11px;
  margin-top: 28px;
}

.answer-btn {
  width: 100%;
  border: 1px solid rgba(15, 28, 39, 0.1);
  border-radius: 18px;
  background: linear-gradient(180deg, #fbf4e4, #f3ead5);
  color: var(--ink);
  min-height: 56px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  font-weight: 820;
  font-size: 1rem;
  line-height: 1.35;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.answer-btn:hover {
  transform: translateX(4px);
  background: #fff8e9;
  border-color: rgba(35, 112, 102, 0.45);
  box-shadow: var(--soft-shadow);
}

.answer-btn span:first-child {
  max-width: 92%;
  overflow-wrap: anywhere;
}
.answer-btn span:last-child {
  color: var(--green);
  font-size: 1.08rem;
}

.reference-card {
  margin-top: 22px;
  border-radius: 18px;
  padding: 16px;
  background: #eef5ed;
  border-left: 5px solid var(--green);
  color: var(--ink);
}

.reference-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
}

.reference-card p {
  margin: 0 0 10px;
  line-height: 1.6;
}

.reference-card a,
.reference-card span {
  color: var(--green);
  font-weight: 850;
  text-decoration: none;
}

.result-actions,
.utility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}

.result-actions { margin-top: 26px; }
.utility-actions { margin-top: 18px; }

.about-card {
  border-radius: var(--radius);
  padding: clamp(24px, 5vw, 48px);
  background: rgba(255, 252, 241, 0.96);
  color: var(--ink);
}

.about-card h1 {
  margin-top: 0;
  font-size: clamp(2rem, 5vw, 3.8rem);
  letter-spacing: -0.06em;
}

.about-card p,
.about-card li {
  color: #40515e;
  line-height: 1.75;
}

.about-card ul { padding-left: 1.2rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 999px;
  color: #24190a;
  background: var(--gold-2);
  font-weight: 900;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
  z-index: 10;
  animation: toastIn 240ms ease both;
}

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

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 900px) {
  .app-shell {
    width: min(calc(100% - 20px), var(--max-width));
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    align-items: flex-start;
  }

  .hero { grid-template-columns: 1fr; }

  .hero-card { min-height: auto; }

  .conversation-card { min-height: auto; }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  body { min-width: 0; }

  .app-shell {
    width: min(calc(100% - 16px), var(--max-width));
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .hero-card,
  .conversation-card,
  .side-card,
  .about-card { border-radius: 18px; }

  .hero-card,
  .conversation-card,
  .side-card { padding: 18px; }

  .hero {
    gap: 14px;
  }

  .hero-card {
    gap: 28px;
  }

  .hero h1 {
    margin: 22px 0 14px;
    font-size: clamp(2.35rem, 15vw, 3.55rem);
    line-height: 0.95;
    letter-spacing: -0.045em;
  }

  .hero p,
  .side-card p {
    font-size: 0.98rem;
    line-height: 1.6;
  }

  .hero-actions,
  .result-actions,
  .utility-actions { flex-direction: column; }

  .btn,
  .answer-btn { width: 100%; }

  .landing-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .landing-topline .language-switcher,
  .hero-actions .btn,
  .result-actions .btn,
  .utility-actions .btn { width: 100%; }

  .landing-topline .language-option { flex: 1 1 0; }

  .language-option {
    justify-content: center;
    min-height: 40px;
    font-size: 0.9rem;
  }

  .topbar {
    gap: 14px;
    margin-bottom: 18px;
  }

  .brand-mini {
    font-size: 0.95rem;
  }

  .nav-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .nav-actions .language-switcher {
    grid-column: 1 / -1;
    width: 100%;
  }

  .nav-actions .language-option {
    flex: 1 1 0;
  }

  .nav-actions .main-menu-button {
    grid-column: 1 / -1;
  }

  .btn-small {
    min-height: 42px;
    padding: 9px 11px;
    font-size: 0.84rem;
  }

  .progress-wrap {
    margin-bottom: 20px;
  }

  .progress-meta {
    font-size: 0.8rem;
  }

  .node-label {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
  }

  .question-title {
    margin-top: 14px;
    font-size: clamp(1.5rem, 6.7vw, 1.875rem);
    line-height: 1.2;
    letter-spacing: -0.015em;
  }

  .node-description {
    font-size: 0.96rem;
    line-height: 1.62;
  }

  .answers {
    gap: 12px;
    margin-top: 22px;
  }

  .answer-btn {
    min-height: 56px;
    padding: 13px 14px;
    border-radius: 16px;
    font-size: 0.98rem;
    line-height: 1.38;
    gap: 12px;
  }

  .answer-btn:hover {
    transform: none;
  }

  .reference-card {
    padding: 14px;
    font-size: 0.95rem;
  }

  .about-card {
    padding: 18px;
  }

  .about-card h1 {
    font-size: clamp(1.8rem, 10vw, 2.5rem);
    letter-spacing: -0.035em;
  }

  .toast {
    width: min(calc(100% - 24px), 420px);
    text-align: center;
    border-radius: 18px;
    bottom: max(14px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 370px) {
  .app-shell {
    width: min(calc(100% - 12px), var(--max-width));
  }

  .hero-card,
  .conversation-card,
  .side-card,
  .about-card {
    padding: 16px;
  }

  .question-title {
    font-size: clamp(1.42rem, 6.3vw, 1.72rem);
  }

  .node-description,
  .answer-btn {
    font-size: 0.94rem;
  }

  .btn-small {
    font-size: 0.8rem;
    padding-inline: 9px;
  }
}

@media (max-height: 780px) and (min-width: 901px) {
  .app-shell { padding: 20px 0; }
  .hero-card { min-height: calc(100vh - 56px); }
  .hero h1 { font-size: clamp(3rem, 7vw, 5.4rem); }
  .hero p { line-height: 1.58; }
}

html[lang="bn"] body {
  font-family: "Noto Sans Bengali", "Hind Siliguri", "SolaimanLipi", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[lang="bn"] .question-title {
  letter-spacing: -0.01em;
  line-height: 1.28;
}

html[lang="bn"] .node-description,
html[lang="bn"] .answer-btn,
html[lang="bn"] .reference-card {
  line-height: 1.72;
}

.conversation-card {
  border-color: rgba(217, 173, 83, 0.16);
}

.answer-btn:focus-visible,
.btn:focus-visible,
.language-option:focus-visible {
  outline: 3px solid rgba(217, 173, 83, 0.72);
  outline-offset: 3px;
}

@media (min-width: 901px) {
  .conversation-card {
    padding-top: 38px;
  }

  .question-title {
    max-width: 860px;
  }
}
