:root {
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #64748b;
  --paper: #ffffff;
  --bg: #f3f7fd;
  --line: #dbe4f0;
  --blue: #1d4ed8;
  --blue-mid: #2563eb;
  --blue-light: #3b82f6;
  --blue-tint: #e8f0fe;
  --sky: #e0f2fe;
  --green: #047857;
  --green-tint: #dcfce7;
  --red: #b91c1c;
  --red-tint: #fee2e2;
  --amber-tint: #fef3c7;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 6px 20px -8px rgba(15, 23, 42, 0.15), 0 1px 3px rgba(15, 23, 42, 0.06);
  --font-display: "Plus Jakarta Sans", "Noto Sans Devanagari", -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", "Noto Sans Devanagari", "Mangal", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.3; margin: 0; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--blue-light); outline-offset: 2px; }
.dq-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.dq-wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* Header */
.dq-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.dq-header-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.dq-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.dq-logo img { border-radius: 8px; }
.dq-logo b { color: var(--blue-mid); font-weight: 800; }
.dq-lang { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.dq-lang button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; font-size: 0.85rem; color: var(--ink-soft); cursor: pointer; min-height: 32px; }
.dq-lang button[aria-pressed="true"] { background: var(--paper); color: var(--blue); font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,0.12); }

.dq-main { flex: 1; padding-top: 20px; padding-bottom: 40px; }
.dq-screen { display: flex; flex-direction: column; gap: 16px; }

/* Cards and buttons */
.dq-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 20px; }
.dq-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dq-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.dq-btn-lg { min-height: 54px; font-size: 1.05rem; }
.dq-btn-block { width: 100%; }
.dq-btn-primary { background: var(--blue); color: #fff; }
.dq-btn-primary:hover:not(:disabled) { background: #1e40af; }
.dq-btn-secondary { background: var(--blue-tint); color: var(--blue); }
.dq-btn-ghost { background: var(--paper); color: var(--ink-soft); border-color: var(--line); }
.dq-btn-play { background: var(--ink); color: #fff; min-height: 44px; font-size: 0.92rem; padding: 10px 16px; }
.dq-link { background: none; border: 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; padding: 10px 6px; min-height: 44px; font-size: 0.95rem; }

.dq-eyebrow { margin: 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; color: var(--blue); }
.dq-note { margin: 0; font-size: 0.88rem; color: var(--ink-faint); text-align: center; }
.dq-fine { margin: 8px 0 0; font-size: 0.8rem; color: var(--ink-faint); }
.dq-error { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--red-tint); color: var(--red); font-size: 0.92rem; }

/* Landing */
.dq-banner {
  background: linear-gradient(150deg, #1e3a8a 0%, #1d4ed8 55%, #38bdf8 130%);
  color: #fff; border-radius: 20px; padding: 26px 20px 20px; box-shadow: 0 16px 36px -18px rgba(29, 78, 216, 0.7);
  display: flex; flex-direction: column; gap: 14px;
}
.dq-banner .dq-eyebrow { color: #bfdbfe; }
.dq-banner h1 { font-size: clamp(1.55rem, 6vw, 2.1rem); font-weight: 800; color: #fff; }
.dq-desc { margin: 0; color: #dbeafe; font-size: 1rem; }
.dq-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dq-chips li { background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.25); padding: 5px 12px; border-radius: 999px; font-size: 0.86rem; }
.dq-chips .chip-free { background: #dcfce7; color: #065f46; border-color: #dcfce7; font-weight: 600; }
.dq-banner .dq-btn-primary { background: #fff; color: var(--blue); }
.dq-banner .dq-btn-primary:hover:not(:disabled) { background: #eff6ff; }
.dq-banner .dq-note { color: #dbeafe; }

/* Optional app link under the quiz card */
.dq-landing-app {
  display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.dq-landing-app-logo { border-radius: 12px; box-shadow: 0 3px 10px -4px rgba(15,23,42,0.3); }
.dq-landing-app-text h2 { font-size: 1rem; margin: 0 0 2px; }
.dq-landing-app-text p { margin: 0; font-size: 0.86rem; color: var(--ink-soft); line-height: 1.45; }
.dq-play-badge {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 8px 18px; border-radius: 12px; background: #0f172a; color: #fff;
  text-decoration: none; border: 1px solid #0f172a;
}
.dq-play-badge:hover { background: #1e293b; }
.dq-play-badge span { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.dq-play-badge small { font-size: 0.68rem; letter-spacing: 0.04em; color: #cbd5e1; }
.dq-play-badge b { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; }
@media (min-width: 480px) {
  .dq-landing-app { grid-template-columns: auto 1fr auto; }
  .dq-play-badge { grid-column: auto; }
}

.dq-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dq-steps div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 10px; font-size: 0.84rem; color: var(--ink-soft); display: flex; flex-direction: column; gap: 6px; }
.dq-steps b { width: 24px; height: 24px; border-radius: 50%; background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; font-size: 0.8rem; }

/* Skeleton */
.dq-skeleton { display: flex; flex-direction: column; gap: 14px; }
.sk { background: linear-gradient(90deg, #e8eef6 0%, #f3f7fc 50%, #e8eef6 100%); background-size: 200% 100%; border-radius: 8px; animation: sk 1.4s linear infinite; }
.sk-pill { width: 40%; height: 18px; }
.sk-title { width: 85%; height: 30px; }
.sk-line { width: 100%; height: 14px; }
.sk-line.short { width: 60%; }
.sk-btn { width: 100%; height: 52px; border-radius: var(--radius-sm); }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* Progress */
.dq-progress { display: flex; flex-direction: column; gap: 8px; }
.dq-progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 0.92rem; font-weight: 600; }
.dq-progress-hint { font-weight: 500; font-size: 0.8rem; color: var(--ink-faint); text-align: right; }
.dq-bar { height: 8px; border-radius: 999px; background: #dbe4f0; overflow: hidden; }
.dq-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--blue-light)); border-radius: inherit; transition: width 0.2s ease; }
.dq-dots { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dq-dots button {
  width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper);
  font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; padding: 0;
}
.dq-dots .is-answered { background: var(--blue-tint); border-color: #bcd3fb; color: var(--blue); }
.dq-dots .is-current { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 2px var(--blue-tint); }
.dq-dots .is-locked { background: #f1f5f9; color: #94a3b8; border-style: dashed; }

/* Question */
.dq-question h2 { font-family: var(--font-body); font-size: 1.12rem; font-weight: 600; line-height: 1.6; outline: none; }
.dq-question img { display: block; max-width: 100%; max-height: 260px; margin: 14px auto 0; border-radius: 10px; }
.dq-options { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.dq-option {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; min-height: 54px; cursor: pointer; color: var(--ink); font-size: 1rem; line-height: 1.5;
}
.dq-option:hover { border-color: #a9c2ee; }
.dq-option .key {
  flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--bg); color: var(--ink-soft);
  display: grid; place-items: center; font-weight: 700; font-size: 0.85rem;
}
.dq-option[aria-checked="true"] { border-color: var(--blue); background: var(--blue-tint); }
.dq-option[aria-checked="true"] .key { background: var(--blue); color: #fff; }

.dq-nav {
  position: sticky; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr 2fr; gap: 8px;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 75%, rgba(243,247,253,0));
}
.dq-nav .dq-btn { padding: 12px 10px; }

.dq-confirm { background: var(--amber-tint); border: 1px solid #fcd34d; border-radius: var(--radius-sm); padding: 14px; }
.dq-confirm p { margin: 0 0 12px; font-weight: 500; }
.dq-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Messages */
.dq-message { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dq-msg-icon { font-size: 2.2rem; line-height: 1; }
.dq-message h2 { font-size: 1.3rem; outline: none; }
.dq-message p { margin: 0; color: var(--ink-soft); }
.dq-mini-promo { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 16px; border: 1px dashed #bcd0ec; border-radius: var(--radius); }
.dq-mini-promo p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.dq-center { text-align: center; }

/* Result */
.dq-result { text-align: center; display: flex; flex-direction: column; gap: 12px; }
.dq-score { font-family: var(--font-display); font-weight: 800; color: var(--blue); line-height: 1; }
.dq-score span { font-size: 3.4rem; }
.dq-score small { font-size: 1.5rem; color: var(--ink-faint); margin-left: 4px; }
.dq-result-msg { margin: 0; font-weight: 600; }
.dq-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0; }
.dq-stats div { border-radius: var(--radius-sm); padding: 10px 4px; }
.dq-stats dt { font-size: 0.76rem; color: var(--ink-soft); }
.dq-stats dd { margin: 2px 0 0; font-weight: 800; font-size: 1.2rem; font-family: var(--font-display); }
.st-correct { background: var(--green-tint); } .st-correct dd { color: var(--green); }
.st-wrong { background: var(--red-tint); } .st-wrong dd { color: var(--red); }
.st-skip { background: #f1f5f9; }
.st-acc { background: var(--blue-tint); } .st-acc dd { color: var(--blue); }
.dq-result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }

.dq-review-title { font-size: 1.1rem; margin-top: 8px; scroll-margin-top: 12px; }
.dq-review { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dq-review li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.dq-review .rv-q { margin: 0 0 10px; font-weight: 600; }
.dq-review .rv-row { margin: 4px 0 0; font-size: 0.92rem; padding: 8px 10px; border-radius: 8px; }
.rv-ok { background: var(--green-tint); color: #065f46; }
.rv-bad { background: var(--red-tint); color: #7f1d1d; }
.rv-skip { background: #f1f5f9; color: var(--ink-soft); }
.rv-exp { margin: 8px 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.rv-tag { font-size: 0.75rem; font-weight: 700; float: right; }

/* Android app recommendation (after the result) */
.dq-app {
  margin-top: 8px; border-radius: 20px; padding: 22px 18px 20px;
  background: linear-gradient(165deg, #eff6ff 0%, #ffffff 45%);
  border: 1px solid #cfe0fb; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px;
}
.dq-app-head { display: flex; gap: 14px; align-items: center; }
.dq-app-head img { border-radius: 14px; box-shadow: 0 4px 12px -4px rgba(15,23,42,0.25); flex: none; }
.dq-app-kicker { margin: 0 0 2px; font-size: 0.78rem; font-weight: 700; color: var(--blue); letter-spacing: 0.02em; }
.dq-app-head h2 { font-size: 1.2rem; }
.dq-app-lead { margin: 0; color: var(--ink-soft); }
.dq-app-lead b { color: var(--ink); }
.dq-app-features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dq-app-features li { display: flex; gap: 10px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.dq-app-features span { font-size: 1.3rem; line-height: 1.2; }
.dq-app-features b { display: block; font-size: 0.9rem; font-family: var(--font-display); }
.dq-app-features small { display: block; font-size: 0.8rem; color: var(--ink-soft); line-height: 1.45; margin-top: 2px; }
.dq-shots { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 10px; margin: 0 -2px; }
.dq-shots figure { flex: 0 0 42%; max-width: 180px; margin: 0; scroll-snap-align: start; }
.dq-shots img { display: block; width: 100%; height: auto; aspect-ratio: 480 / 1020; object-fit: cover; object-position: top; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.dq-shots figcaption { font-size: 0.78rem; color: var(--ink-faint); text-align: center; margin-top: 6px; }
.dq-trust { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 0.84rem; color: var(--ink-soft); }
.dq-trust li::before { content: "✓"; color: var(--green); font-weight: 700; margin-right: 6px; }
.dq-app .dq-btn-play { min-height: 54px; font-size: 1.02rem; }

/* Footer */
.dq-footer { border-top: 1px solid var(--line); background: var(--paper); padding: 18px 0 24px; font-size: 0.8rem; color: var(--ink-faint); }
.dq-footer p { margin: 0 0 10px; }
.dq-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.dq-footer a { color: var(--ink-soft); }

@media (min-width: 560px) {
  .dq-card { padding: 28px; }
  .dq-banner { padding: 32px 28px 24px; }
}
@media (max-width: 380px) {
  .dq-app-features { grid-template-columns: 1fr; }
  .dq-stats { grid-template-columns: repeat(2, 1fr); }
  .dq-logo span { display: none; }
}

/* Name prompt over a blurred page */
body.dq-modal-open { overflow: hidden; }
.dq-modal {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(15, 23, 42, 0.35);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
}
.dq-modal-card {
  position: relative; width: 100%; max-width: 420px; background: var(--paper);
  border-radius: 22px; padding: 26px 22px 20px; box-shadow: 0 30px 70px -20px rgba(15, 23, 42, 0.55);
  display: flex; flex-direction: column; gap: 10px; text-align: center;
}
.dq-modal-lang { position: absolute; top: 12px; right: 12px; transform: scale(0.9); transform-origin: top right; }
.dq-modal-icon { font-size: 2.4rem; line-height: 1; margin-top: 18px; }
.dq-modal-card h2 { font-size: 1.28rem; }
.dq-modal-card > p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
#name-input {
  margin-top: 6px; width: 100%; min-height: 54px; padding: 12px 16px; font: inherit; font-size: 1.08rem;
  color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  text-align: center;
}
#name-input:focus { outline: none; border-color: var(--blue); background: var(--paper); box-shadow: 0 0 0 4px var(--blue-tint); }
#name-input[aria-invalid="true"] { border-color: var(--red); }
.dq-modal-meta { display: flex; justify-content: space-between; gap: 8px; min-height: 1.3em; font-size: 0.82rem; }
.dq-modal-error { color: var(--red); text-align: left; }
.dq-modal-count { color: var(--ink-faint); margin-left: auto; }
.dq-modal-card .dq-fine a { color: var(--ink-soft); }

.dq-hello { margin: -2px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-weight: 600; color: #fff; font-size: 1rem; }
.dq-hello-change { background: none; border: 0; color: #bfdbfe; text-decoration: underline; font: inherit;
  font-size: 0.85rem; font-weight: 500; cursor: pointer; padding: 8px 0; min-height: 36px; }
