/* ============================================================
   QUIZ VIỆT — Stylesheet dùng chung (trang chủ + engine quiz)
   ============================================================ */
:root {
  --ink: #251b32;
  --muted: #6b6378;
  --soft: #f7f4ef;
  --line: rgba(37, 27, 50, 0.1);
  --coral: #ef5b4f;
  --coral-dark: #cf443a;
  --sun: #f5bd32;
  --teal: #1fb5a9;
  --blue: #2f6fd6;
  --violet: #7457d8;
  --pink: #e96d9d;
  --card: #fffefa;
  --shadow: rgba(37, 27, 50, 0.12);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  width: 100%;
  max-width: 100%;
}
body {
  font-family: "Be Vietnam Pro", sans-serif;
  color: var(--ink);
  background: var(--soft);
  background-image:
    linear-gradient(rgba(37, 27, 50, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 27, 50, 0.03) 1px, transparent 1px),
    linear-gradient(180deg, #fffaf3 0%, #f3fbfa 100%);
  background-size: 28px 28px, 28px 28px, 100% 100%;
  min-height: 100vh;
  padding: 24px 16px 48px;
  overflow-x: hidden;
}
.wrap {
  width: 100%;
  max-width: min(760px, 100%);
  margin: 0 auto;
}
.wrap:has(#app) {
  max-width: min(560px, 100%);
}
h1,
h2 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  overflow-wrap: break-word;
  text-wrap: balance;
}
.btn {
  font-family: "Be Vietnam Pro", sans-serif;
  border: none;
  cursor: pointer;
  font-weight: 700;
  border-radius: 10px;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}
.btn:active {
  transform: scale(0.97);
}
.btn:focus-visible,
.tile.live:focus-visible,
.opt:focus-visible,
.back:focus-visible,
.retry:focus-visible,
.go:focus-visible {
  outline: 3px solid rgba(31, 181, 169, 0.34);
  outline-offset: 3px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: #fffaf3;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  padding: 7px 14px;
  border-radius: 999px;
  text-transform: uppercase;
}

/* ---------- icon gradients (dùng chung) ---------- */
.ic-a {
  background: linear-gradient(135deg, var(--blue), var(--teal));
}
.ic-b {
  background: linear-gradient(135deg, var(--coral), var(--sun));
}
.ic-c {
  background: linear-gradient(135deg, var(--violet), var(--pink));
}
.ic-d {
  background: linear-gradient(135deg, var(--teal), var(--sun));
}

/* ============================================================
   TRANG CHỦ (HUB)
   ============================================================ */
.hero {
  text-align: center;
  padding: 12px 4px 30px;
}
.hero .emoji {
  font-size: 48px;
  display: block;
  margin: 14px 0 12px;
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(-8px) rotate(3deg);
  }
}
.hero h1 {
  font-size: 44px;
  margin-bottom: 14px;
}
.hero h1 .hl {
  color: var(--coral);
}
.hero p {
  font-size: 15.5px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 430px;
  margin: 0 auto;
}
.sec-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 34px 0 14px;
}
.sec-title h2 {
  font-size: 20px;
}
.sec-title .line {
  flex: 1;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
}
.grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tile {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border-radius: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px -22px var(--shadow);
  text-decoration: none;
  color: var(--ink);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
}
.tile.live::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--coral), var(--teal));
}
.tile.live:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px -24px var(--shadow);
  border-color: var(--coral);
}
.tile .ic {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.tile .body {
  flex: 1;
  min-width: 0;
}
.tile .body h3 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  font-size: 17.5px;
  line-height: 1.15;
  margin-bottom: 4px;
}
.tile .body p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.tile .meta {
  font-size: 11.5px;
  color: #8c8499;
  margin-top: 6px;
  font-weight: 600;
}
.tile .arrow {
  font-size: 20px;
  color: var(--coral);
  flex-shrink: 0;
  font-weight: 700;
}
.tile.soon {
  opacity: 0.72;
  background: rgba(255, 254, 250, 0.74);
}
.tile.soon .ic {
  filter: grayscale(0.3);
}
.tag-soon {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(37, 27, 50, 0.08);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-bottom-left-radius: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}
.foot {
  text-align: center;
  margin-top: 30px;
  font-size: 12.5px;
  color: #8c8499;
  line-height: 1.6;
}
.foot a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.foot a:hover {
  color: var(--coral);
}
.foot-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* ============================================================
   TRANG NOI DUNG
   ============================================================ */
.page-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 44px -28px var(--shadow);
  padding: 30px 26px;
  position: relative;
  overflow: hidden;
}
.page-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--coral), var(--sun), var(--teal));
}
.page-card .back-home {
  display: inline-block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 22px;
  text-decoration: none;
}
.page-card .back-home:hover {
  color: var(--coral);
}
.page-card h1 {
  font-size: 38px;
  margin-bottom: 14px;
}
.page-card h2 {
  font-size: 22px;
  margin: 28px 0 10px;
}
.page-card p,
.page-card li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}
.page-card ul {
  padding-left: 20px;
  margin: 10px 0 0;
}
.page-card a {
  color: var(--coral-dark);
  font-weight: 700;
}
.page-note {
  background: rgba(37, 27, 50, 0.04);
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  margin-top: 20px;
  padding: 14px 16px;
}

/* ============================================================
   ENGINE QUIZ (intro / câu hỏi / kết quả)
   ============================================================ */
.screen {
  display: none;
  animation: fade 0.45s ease both;
}
.screen.active {
  display: block;
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* INTRO */
.intro-card {
  background: var(--card);
  border-radius: 8px;
  padding: 34px 26px 30px;
  box-shadow: 0 20px 44px -28px var(--shadow);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.intro-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--coral), var(--sun), var(--teal));
}
.emoji-hero {
  font-size: 56px;
  line-height: 1;
  margin: 18px 0 14px;
  display: block;
}
.intro-card h1 {
  font-size: 38px;
  margin-bottom: 12px;
}
.intro-card h1 .hl {
  color: var(--coral);
}
.sub {
  font-size: 15.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 22px;
}
.meta-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.chip {
  background: rgba(38, 198, 184, 0.16);
  color: #0f8076;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 8px;
}
.chip.b {
  background: rgba(255, 93, 93, 0.14);
  color: var(--coral-dark);
}
.chip.c {
  background: rgba(139, 92, 246, 0.14);
  color: #6d28d9;
}
.credit {
  font-size: 12.5px;
  color: #7d768b;
  line-height: 1.5;
  margin-bottom: 22px;
  padding: 11px 14px;
  background: rgba(37, 27, 50, 0.04);
  border-radius: 8px;
  border-left: 3px solid var(--teal);
}
.cta {
  width: 100%;
  background: var(--coral);
  color: #fff;
  font-size: 18px;
  padding: 18px;
  box-shadow: 0 12px 22px -12px var(--coral);
}
.foot-note {
  text-align: center;
  font-size: 12.5px;
  color: #7d768b;
  margin-top: 16px;
}

/* QUESTION */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.progress {
  flex: 1;
  height: 8px;
  background: rgba(37, 27, 50, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--coral), var(--sun));
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.qcount {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.qcard {
  background: var(--card);
  border-radius: 8px;
  padding: 26px 20px;
  box-shadow: 0 18px 42px -28px var(--shadow);
  border: 1px solid var(--line);
}
.qnum {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--coral);
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.qtext {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  font-size: 23px;
  line-height: 1.18;
  margin-bottom: 20px;
  letter-spacing: 0;
}
.opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.opt {
  text-align: left;
  background: #fff;
  border: 1px solid rgba(37, 27, 50, 0.12);
  padding: 15px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.32;
  transition: all 0.14s ease;
  cursor: pointer;
  width: 100%;
  animation: optin 0.4s ease both;
}
@keyframes optin {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.opt .ico {
  font-size: 21px;
  flex-shrink: 0;
}
.opt:hover {
  border-color: var(--coral);
  transform: translateX(2px);
}
.opt:active {
  transform: scale(0.98);
}
.back {
  display: inline-block;
  margin-top: 14px;
  background: none;
  border: none;
  color: #7d768b;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* RESULT */
.res-card {
  background: var(--card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 48px -28px var(--shadow);
  border: 1px solid var(--line);
}
.res-top {
  padding: 34px 26px 28px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.res-top::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(255, 255, 255, 0.25),
    transparent 60%
  );
}
.res-label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0.9;
  position: relative;
}
.res-emoji {
  font-size: 72px;
  line-height: 1;
  margin: 10px 0 6px;
  position: relative;
  display: block;
  animation: pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes pop {
  from {
    transform: scale(0) rotate(-20deg);
  }
  to {
    transform: scale(1) rotate(0);
  }
}
.res-name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 33px;
  line-height: 1.02;
  position: relative;
  letter-spacing: 0;
}
.res-type {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.92;
  margin-top: 8px;
  position: relative;
}
.res-body {
  padding: 24px 22px 26px;
}
.res-desc {
  font-size: 15.5px;
  line-height: 1.6;
  color: #46415c;
  margin-bottom: 18px;
}
.res-mix {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  background: rgba(116, 87, 216, 0.08);
  padding: 13px 15px;
  border-radius: 8px;
  margin-bottom: 22px;
}
.res-mix b {
  color: #6d28d9;
}
.res-sec {
  margin-bottom: 18px;
}
.res-sec h3 {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #7d768b;
  margin-bottom: 10px;
}
.res-sec .note {
  font-size: 12.5px;
  color: #7d768b;
  line-height: 1.5;
  margin-top: 10px;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  background: rgba(37, 27, 50, 0.06);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 8px;
}
.tag.k {
  background: var(--ink);
  color: #fffaf3;
}
.retry {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  margin-top: 18px;
  color: #7d768b;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}
.disclaimer {
  font-size: 11.5px;
  color: #a09bb0;
  text-align: center;
  margin-top: 14px;
  line-height: 1.5;
}
.share-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.share-row .btn {
  flex: 1;
  padding: 15px;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.sh-fb {
  background: #1877f2;
  color: #fff;
}
.sh-cp {
  background: rgba(37, 27, 50, 0.08);
  color: var(--ink);
}

/* FUNNEL (dùng chung cho hub + quiz) */
.funnel {
  margin-top: 8px;
  background: linear-gradient(135deg, #1d1530, #3a2a5c);
  border-radius: 8px;
  padding: 22px 20px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.funnel.big {
  margin-top: 30px;
  border-radius: 8px;
  padding: 26px 22px;
}
.funnel.big::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 42%);
}
.funnel h2 {
  font-size: 22px;
  margin-bottom: 8px;
  position: relative;
}
.funnel p {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 15px;
  opacity: 0.92;
  position: relative;
}
.funnel p b {
  color: var(--sun);
}
.funnel .go {
  display: inline-block;
  width: 100%;
  background: var(--sun);
  color: var(--ink);
  font-weight: 800;
  font-size: 16.5px;
  padding: 16px;
  border-radius: 8px;
  text-decoration: none;
  position: relative;
  box-shadow: 0 10px 20px -8px rgba(255, 200, 61, 0.7);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: #fff;
  padding: 13px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 380px) {
  .hero h1 {
    font-size: 34px;
  }
  .intro-card h1 {
    font-size: 32px;
  }
  .qtext {
    font-size: 20px;
  }
  .res-name {
    font-size: 28px;
  }
  .tile .body h3 {
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  body {
    padding: 20px 16px 44px;
  }
  .hero h1 {
    font-size: 32px;
    line-height: 1.05;
  }
  .hero p {
    max-width: 100%;
    font-size: 14.5px;
  }
  .wrap,
  .wrap:has(#app) {
    max-width: 100%;
  }
  .intro-card {
    padding: 30px 20px 26px;
  }
  .intro-card h1 {
    font-size: 32px;
    line-height: 1.08;
  }
  .sub {
    max-width: 100%;
    font-size: 14.5px;
  }
  .share-row {
    display: grid;
    grid-template-columns: 1fr;
  }
  .tile {
    gap: 14px;
    padding: 16px;
  }
  .tile .ic {
    width: 52px;
    height: 52px;
    font-size: 26px;
  }
}

@media (max-width: 380px) {
  .hero h1 {
    font-size: 30px;
  }
  .intro-card h1 {
    font-size: 30px;
  }
}

@media (min-width: 720px) {
  body {
    padding-top: 34px;
  }
  .hero {
    padding-bottom: 34px;
  }
  .hero h1 {
    font-size: 56px;
  }
  .hero p {
    max-width: 560px;
    font-size: 16.5px;
  }
  .grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid .tile.featured {
    grid-column: 1 / -1;
  }
  .tile {
    align-items: flex-start;
  }
  .tile .arrow {
    margin-top: 16px;
  }
  .funnel.big {
    text-align: left;
    padding: 28px;
  }
  .funnel.big .go {
    width: auto;
    min-width: 280px;
    text-align: center;
  }
}
