@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans-latin.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: Bricolage;
  src: url("/assets/fonts/Bricolage-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: Bricolage;
  src: url("/assets/fonts/Bricolage-vi.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  color-scheme: light;
  --paper: #f7edd6;
  --surface: #fffaf0;
  --surface-warm: #f3e4c6;
  --ink: #23181e;
  --muted: #57453a;
  --red: #c82e1d;
  --coral: #f77b60;
  --line: #a4896e;
  --lavender: #dcbce8;
  --yellow: #fae495;
  --shadow-lg: 6px 6px 0 var(--ink);
  --shadow-md: 4px 4px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --display: Bricolage, "DM Sans", system-ui, sans-serif;
  font: 16px/1.5 "DM Sans", system-ui, sans-serif;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(35, 24, 30, 0.07) 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); }
html[lang="vi"] { font-family: var(--display); }
[hidden] { display: none !important; }
::selection { color: var(--ink); background: var(--lavender); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
a { color: inherit; }
button, select, textarea, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
h1, h2, p { margin: 0; }
h1, h2 { font: 800 2.4rem/1.02 var(--display); letter-spacing: -.03em; }
p { text-wrap: pretty; }
img { display: block; max-width: 100%; }
.frame { width: min(1240px, calc(100% - 64px)); margin-inline: auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* ==================== SITE HEADER ==================== */
.site-header {
  background: rgba(247, 237, 214, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 2.5px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top);
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: clamp(14px, 2.6vw, 36px);
  min-height: 66px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  text-decoration: none;
  white-space: nowrap;
  text-transform: uppercase;
  font: 800 clamp(1.25rem, 2.3vw, 1.85rem)/1 var(--display);
  letter-spacing: -.03em;
}
.wordmark img {
  width: clamp(32px, 3.2vw, 40px);
  height: clamp(32px, 3.2vw, 40px);
  object-fit: contain;
  filter: drop-shadow(1px 2px 0 rgba(35, 24, 30, 0.2));
}
.site-nav, .languages { display: flex; align-items: center; }
.site-nav { gap: clamp(16px, 2.4vw, 32px); font-weight: 740; font-size: .95rem; }
.site-nav a, .languages a { text-decoration: none; }
.site-nav a { display: inline-flex; min-height: 42px; align-items: center; }
.site-nav a:hover { color: var(--red); text-decoration: underline; text-underline-offset: 4px; }
.languages {
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: .82rem;
  font-weight: 800;
}
.languages a { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.languages a[aria-current] { color: var(--surface); background: var(--ink); }

/* ==================== QUIZ STAGE (DIRECTION A: RISOGRAPH TAROT PRESS) ==================== */
.hero {
  padding: 26px 0 18px;
}
.hero-content {
  max-width: 880px;
  margin-inline: auto;
}
.hero-masthead {
  text-align: center;
  margin-bottom: 18px;
}
.masthead-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
}
.hero h1 {
  font-size: clamp(2.35rem, 5vw, 3.9rem);
  line-height: .96;
  letter-spacing: -.038em;
}
.hero h1 span { color: var(--red); }
html[lang="vi"] .hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); line-height: 1.04; }

.fact-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 7px;
  padding: 6px 14px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font: 800 .82rem/1.1 var(--display);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.fact-row span { white-space: nowrap; }
.fact-row span + span::before { content: "·"; margin-right: 7px; }

.intro {
  max-width: 60ch;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: clamp(.95rem, 1.25vw, 1.08rem);
  line-height: 1.45;
  transition: opacity 180ms ease;
}
body.quiz-in-progress .intro {
  display: none;
}

.inviter {
  max-width: 680px;
  margin: 0 auto 14px;
  padding: 10px 16px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  font-weight: 760;
}

/* Outer Risograph Stage Frame */
.tarot-stage-card {
  padding: clamp(16px, 2.8vw, 28px);
  background: var(--surface-warm);
  border: 2.5px solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.quiz-progress {
  max-width: 680px;
  margin: 0 auto 16px;
}
.quiz-progress > span {
  display: block;
  text-align: center;
  font: 800 .84rem/1.2 var(--display);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 7px;
}
.quiz-progress { scroll-margin-top: calc(86px + env(safe-area-inset-top)); }
progress {
  display: block;
  appearance: none;
  width: 100%;
  height: 16px;
  padding: 2px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: inset 0 1px 2px rgba(35, 24, 30, 0.12);
}
progress::-webkit-progress-bar { background: transparent; border-radius: 999px; }
progress::-webkit-progress-value { background: var(--ink); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--ink); border-radius: 999px; }

/* Inner Double-Line Tarot Question Box */
.tarot-question-box {
  position: relative;
  max-width: 720px;
  margin-inline: auto;
  padding: clamp(22px, 3.6vw, 38px) clamp(18px, 3.4vw, 38px) clamp(18px, 2.6vw, 26px);
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  box-shadow: 5px 5px 0 var(--ink);
}
.tarot-question-box::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  pointer-events: none;
  opacity: 0.75;
}

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.question-copy, .question-reserve { display: grid; }
.question-copy {
  margin-bottom: 22px;
  text-align: center;
  align-items: center;
}
.question-reserve { visibility: hidden; pointer-events: none; }
.question-copy > *, .question-reserve > * { grid-area: 1 / 1; }
.question-line {
  font: 800 clamp(1.38rem, 2.35vw, 2.05rem)/1.18 var(--display);
  letter-spacing: -.025em;
  text-wrap: balance;
  padding-inline: 6px;
}
#question-title:focus { outline: 0; }

.scale-poles {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px 8px;
  font: 800 .74rem/1.1 var(--display);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}

.options {
  --choice-size: clamp(46px, 5.4vw, 62px);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}
.options::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-inline: 10%;
  top: calc(var(--choice-size) / 2);
  border-top: 2px dashed rgba(35, 24, 30, 0.25);
}
.option {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  min-width: 0;
  text-align: center;
  cursor: pointer;
}
.option-number {
  display: grid;
  place-items: center;
  width: var(--choice-size);
  aspect-ratio: 1;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font: 800 clamp(1.15rem, 2.1vw, 1.55rem)/1 var(--display);
  transition: transform 130ms ease-out, background-color 130ms ease, box-shadow 130ms ease;
}
.option-step-1 .option-number { background: #fde6df; }
.option-step-2 .option-number { background: #fef1ec; }
.option-step-3 .option-number { background: var(--surface); transform: scale(0.93); }
.option-step-4 .option-number { background: #eef5d8; }
.option-step-5 .option-number { background: #e1f0b8; }

.option-label {
  font-size: clamp(.72rem, 1vw, .84rem);
  line-height: 1.18;
  font-weight: 720;
  color: var(--ink);
  text-wrap: balance;
}
.option input { position: absolute; inset: 50% auto auto 0; width: 1px; height: 1px; margin: 0; clip-path: inset(50%); }

@media (hover: hover) {
  .option:hover .option-number {
    transform: translateY(-2px) scale(1.04);
    background: var(--yellow);
    box-shadow: 3px 3px 0 var(--ink);
  }
}
.option:active .option-number { transform: translateY(1px) scale(.97); }
.option:has(input:checked) .option-number {
  background: var(--coral);
  color: var(--ink);
  transform: scale(1.08);
  box-shadow: 3px 3px 0 var(--ink);
}
.option:has(input:focus-visible) .option-number {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.quiz-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1.5px solid rgba(35, 24, 30, 0.14);
}
#quiz-back { flex: 0 0 auto; white-space: nowrap; min-height: 38px; padding: 6px 13px; font-size: .86rem; }
#quiz-back:disabled { visibility: hidden; }
#auto-advance { color: var(--muted); font-size: .82rem; font-weight: 680; text-align: right; }
.quiz-status:not(:empty) { margin-top: 10px; text-align: center; font-weight: 750; color: var(--red); }

/* ==================== BUTTONS ==================== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 18px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-weight: 800;
  text-decoration: none;
  line-height: 1.2;
  box-shadow: var(--shadow-sm);
  transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}
.button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 var(--ink);
}
.button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 var(--ink);
}
.primary { color: var(--surface); background: var(--ink); }
.primary:hover:not(:disabled) { background: #3b2832; }
.primary:disabled { color: #fef0d9; background: #79686c; box-shadow: none; }
.secondary { color: var(--ink); background: var(--surface); }
.secondary:hover:not(:disabled) { background: var(--yellow); }
.subtle { color: var(--ink); background: var(--surface-warm); }

/* ==================== 7 TAROT SINS DECK GALLERY ==================== */
.section {
  padding: 22px 0 32px;
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title h2 {
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
}

.sin-gallery {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}
.sin-tile {
  position: relative;
  background: var(--accent);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: transform 150ms ease, box-shadow 150ms ease;
  overflow: hidden;
}
.sin-tile::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1.5px solid rgba(35, 24, 30, 0.65);
  border-radius: 8px;
  pointer-events: none;
  z-index: 1;
}
.sin-tile:hover {
  transform: translateY(-3px);
  box-shadow: 6px 6px 0 var(--ink);
}
.sin-tile[open] {
  grid-column: span 3;
  background: var(--surface);
}
.sin-tile[open] summary {
  background: var(--accent);
  border-bottom: 2px solid var(--ink);
}

summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }

.sin-tile summary {
  position: relative;
  padding: 10px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  text-align: center;
}
.tile-roman {
  font: 800 .7rem/1 var(--display);
  letter-spacing: .08em;
  opacity: 0.8;
}
.tile-art {
  width: 100%;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  overflow: hidden;
}
.tile-art img {
  width: 104px;
  height: 104px;
  max-width: 100%;
  max-height: 104px;
  min-height: 0;
  object-fit: contain;
  margin: auto;
  filter: drop-shadow(0 2px 3px rgba(35, 24, 30, 0.14));
}
.tile-plate {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 5px 6px;
  background: rgba(255, 250, 240, 0.92);
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.tile-name {
  font: 800 clamp(.74rem, 1.05vw, .95rem)/1.05 var(--display);
  text-transform: uppercase;
  letter-spacing: -.01em;
}
.disclosure {
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  flex: 0 0 auto;
  margin-top: -2px;
}
details[open] > summary .disclosure {
  transform: rotate(225deg);
  margin-top: 3px;
}

.tile-detail {
  padding: 14px 16px 16px;
  font-size: .95rem;
  line-height: 1.45;
  background: var(--surface);
}
.tile-detail p + p { margin-top: 8px; }
.tile-virtue {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px !important;
  padding: 4px 10px;
  background: var(--ink);
  color: var(--surface);
  border-radius: 999px;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.tile-virtue span::after { content: "·"; margin-left: 6px; opacity: 0.7; }

/* ==================== READING, FAQ & HISTORY ==================== */
.reading {
  display: grid;
  grid-template-columns: .88fr 1.12fr;
  gap: 24px;
  padding-block: 10px 28px;
}
.reading-card, .history {
  padding: clamp(20px, 2.8vw, 30px);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}
.reading h2, .history h2 {
  margin-bottom: 12px;
  font-size: clamp(1.45rem, 2.3vw, 1.95rem);
}
.reading p + p { margin-top: 12px; }
.reading-disclaimer {
  padding: 10px 13px;
  background: var(--surface-warm);
  border-left: 3px solid var(--red);
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 650;
}

.faq-list { border-top: 1.5px solid rgba(35, 24, 30, 0.2); }
.faq-list details { border-bottom: 1.5px solid rgba(35, 24, 30, 0.2); }
.faq-list summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 11px 4px;
  font-weight: 760;
}
.faq-list summary:hover { color: var(--red); }
.faq-list details p { padding: 0 14px 14px 4px; color: var(--muted); }

.history { margin-bottom: 32px; }
.history p { margin-top: 11px; color: var(--muted); max-width: 78ch; }
.history-sources { font-size: .88rem; font-weight: 680; color: var(--ink) !important; }
.history-sources a { text-decoration: underline; text-underline-offset: 3px; color: var(--red); }
.virtue-pairings {
  width: 100%;
  max-width: 40rem;
  margin-top: 14px;
  border-collapse: collapse;
  text-align: left;
}
.virtue-pairings th, .virtue-pairings td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.virtue-pairings thead { background: var(--surface-warm); }

/* ==================== RESULT OVERVIEW ==================== */
.result-main {
  max-width: 980px;
  padding-top: 24px;
}
.profile-text {
  display: grid;
  grid-template: "art intro" "actions scores" "save scores" / minmax(0, .7fr) minmax(0, 1fr);
  align-items: center;
  column-gap: 28px;
  row-gap: 0;
  padding: clamp(16px, 3vw, 28px);
  background: var(--accent);
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}
.profile-text:has(> .challenge:not([hidden])) {
  grid-template: "art intro" "art challenge" "scores scores" / minmax(0, .7fr) minmax(0, 1fr);
}
.profile-text:has(> .challenge:not([hidden])) .profile-intro { align-self: end; }
.profile-text:has(> .challenge:not([hidden])) .score-panel { margin-top: 14px; }
.profile-intro { grid-area: intro; min-width: 0; }
.profile-kicker {
  margin-bottom: 6px;
  font: 800 .76rem/1.2 var(--display);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.profile-text h1 {
  font-size: clamp(1.65rem, 4vw, 3.15rem);
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
html[lang="en"] .profile-text:has(.quick-share:not([hidden])):has(.profile-poster:not([hidden])) h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.profile-tagline {
  max-width: 39ch;
  font: 740 clamp(1.2rem, 2.4vw, 1.65rem)/1.22 var(--display);
  text-wrap: pretty;
}
.profile-art {
  grid-area: art;
  display: grid;
  place-items: center;
  width: min(100%, 200px);
  margin-inline: auto;
}
.profile-art img { height: auto; object-fit: contain; }
.profile-art--poster { width: min(100%, 258px); aspect-ratio: 9 / 16; }
.profile-art--poster .profile-poster {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 9px;
  outline: 2px solid var(--ink);
  background: var(--ink);
}
.profile-art--poster img:not(.profile-poster) { width: 74%; }
.quick-share { grid-area: actions; align-self: start; min-width: 0; margin-top: 12px; }
.challenge { grid-area: challenge; align-self: start; min-width: 0; margin-top: 12px; }
.quick-share .button, .challenge .button {
  width: 100%;
  min-height: 48px;
  padding-inline: 8px;
  text-align: center;
}
.share-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 10px;
}
.copy-result-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 4px 3px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: .86rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#quick-status:not(:empty) { text-align: center; font-size: .9rem; font-weight: 700; margin-top: 6px; }

.comparison-card {
  padding: 16px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.comparison-card h2 { margin-bottom: 10px; font-size: 1.25rem; }
.comparison-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.comparison-side {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  padding: 10px;
  background: var(--comparison-color);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.comparison-side img { object-fit: contain; height: 52px; }
.comparison-side span { font-size: .78rem; font-weight: 720; text-transform: uppercase; }
#compare-note { margin-top: 10px; font-size: .92rem; font-weight: 720; }

.score-panel { grid-area: scores; min-width: 0; }
.score-panel h2 {
  margin-bottom: 7px;
  font-size: 1.09rem;
  line-height: 1.2;
  letter-spacing: 0;
}
.profile-reading {
  margin-top: 14px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.profile-reading > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 14px;
  font: 800 1rem/1.2 var(--display);
  list-style: none;
  cursor: pointer;
}
.profile-reading > summary::-webkit-details-marker { display: none; }
.profile-reading[open] > summary { border-bottom: 1px solid var(--line); }
.profile-reading-content { display: grid; align-items: start; gap: 16px; padding: 14px; }
.profile-detail { max-width: 64ch; font-size: 1rem; line-height: 1.55; }
.virtue-chip { margin-top: 10px; font-size: .9rem; }
.virtue-chip span::after { content: " · "; }
.result-links { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin: 4px 0 12px; }
.result-links:not(:has(> :not([hidden]))) { display: none; }
.result-links .retake { margin-top: 0; }
.result-main > .comparison-card { margin-bottom: 16px; }

/* 7-Axis Heptagon Radar Chart */
.score-radar {
  width: min(100%, 300px);
  margin: 4px auto 14px;
}
.score-radar svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.radar-ring {
  fill: var(--surface-warm);
  fill-opacity: 0.35;
  stroke: var(--ink);
  stroke-width: 1.4;
}
.radar-spoke {
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-opacity: 0.45;
}
.radar-area {
  fill-opacity: 0.72;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linejoin: round;
}
.radar-dot {
  stroke: var(--ink);
  stroke-width: 1.8;
}
.radar-label {
  font: 800 10.5px/1 var(--display);
  fill: var(--ink);
  text-transform: uppercase;
  letter-spacing: .02em;
}

.score-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
}
.score-panel li {
  display: grid;
  grid-template-columns: minmax(85px, 1fr) minmax(0, 1.6fr) 3em;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 9px;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: 7px;
}
.score-name { font: 750 .88rem/1.18 var(--display); overflow-wrap: anywhere; }
.score-points {
  text-align: right;
  font: 800 .86rem/1 var(--display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.score-panel meter {
  width: 100%;
  height: 8px;
  appearance: none;
  border-radius: 999px;
  overflow: hidden;
}
.score-panel meter::-webkit-meter-bar {
  background: var(--surface-warm);
  border: 1px solid var(--ink);
  border-radius: 999px;
}
.score-panel meter::-webkit-meter-optimum-value { background: var(--meter-color); border-radius: 999px; }
.score-panel meter::-moz-meter-bar { background: var(--meter-color); border-radius: 999px; }

/* ==================== RESULT IMAGE AND SHARE CONTROLS ==================== */
.card-save { grid-area: save; min-width: 0; }
.card-save:has(#share-image:not([hidden])) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.card-save .button { width: 100%; min-height: 44px; padding-inline: 8px; text-align: center; }
.profile-art:has(#card-preview:not([hidden])) > :not(#card-preview) { display: none; }
#card-status:empty { display: none; }
#card-status { grid-column: 1 / -1; color: var(--muted); font-size: .86rem; font-weight: 700; }
#card-style {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, .84fr);
  gap: 4px;
  width: min(100%, 245px);
  min-inline-size: 0;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}
#card-style label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 3px 2px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
  font-size: clamp(.72rem, 2.5vw, .9rem);
  font-weight: 740;
  line-height: 1.1;
  overflow-wrap: anywhere;
  cursor: pointer;
}
#card-style label:has(input:checked) { background: var(--ink); color: var(--surface); }
#card-style label:has(input:focus-visible) { outline: 3px solid var(--red); outline-offset: 2px; }
#card-style input { position: absolute; width: 1px; height: 1px; margin: 0; clip-path: inset(50%); }
#card-preview {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface-warm);
  border-radius: 10px;
}
.include-scores {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 44px;
  font-size: .86rem;
  font-weight: 740;
  cursor: pointer;
}
.include-scores input { accent-color: var(--red); width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
#manual-copy {
  width: 100%;
  min-height: 70px;
  margin: 8px 0;
  padding: 8px;
  background: white;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 8px;
}
.retake {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 6px;
  color: var(--red);
  font-weight: 800;
  text-underline-offset: 3px;
}

/* ==================== FOOTER & CONSENT ==================== */
.site-footer {
  border-top: 2.5px solid var(--ink);
  background: var(--surface-warm);
  padding-bottom: env(safe-area-inset-bottom);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 0;
  font-size: .82rem;
  color: var(--muted);
}
.event-privacy-toggle {
  border: 0;
  background: none;
  padding: 0;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  text-decoration: underline;
  cursor: pointer;
}
.footer-inner .wordmark { font-size: 1.2rem; color: var(--ink); }
.footer-inner .wordmark img { width: 28px; height: 28px; }

.not-found { padding: 72px 0; text-align: center; }
.not-found p { margin: 15px auto; max-width: 48ch; }

.analytics-consent {
  position: fixed;
  z-index: 100;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 1rem;
  right: 1rem;
  max-width: 38rem;
  margin: auto;
  padding: 1rem;
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}
.analytics-consent p { flex: 1 1 100%; margin: 0; }
.analytics-consent button {
  min-height: 44px;
  padding: .55rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background: var(--yellow);
  font: inherit;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */
@media (max-width: 980px) {
  .frame { width: calc(100% - 36px); }
}

@media (min-width: 761px) {
  .profile-reading-content:has(.score-radar:not([hidden])) { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
}

@media (max-width: 760px) {
  .sin-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sin-tile[open] { grid-column: span 2; }
  .result-main { max-width: 480px; padding-top: 12px; }
  .profile-text {
    grid-template: "art intro" "actions actions" "save save" "scores scores" / minmax(0, 46%) minmax(0, 1fr);
    column-gap: 12px;
    padding: 12px;
    border-radius: 14px;
    box-shadow: var(--shadow-md);
  }
  .profile-text:has(> .challenge:not([hidden])) {
    grid-template: "art intro" "challenge challenge" "scores scores" / minmax(0, 46%) minmax(0, 1fr);
  }
  .profile-text:has(> .challenge:not([hidden])) .profile-intro { align-self: center; }
  .profile-kicker { font-size: .69rem; }
  .profile-tagline { font-size: clamp(1.02rem, 4.5vw, 1.4rem); }
  .profile-art--poster { width: min(100%, 172px); }
  .card-save .button { min-height: 44px; }
  .profile-text:has(.card-save:not([hidden])) .score-panel { margin-top: 14px; }
  .score-panel ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-panel li {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
    padding: 4px 7px;
    box-shadow: inset 3px 0 var(--meter-color);
  }
  .score-panel meter { display: none; }
  .score-radar { max-width: 245px; }
}

@media (max-width: 680px) {
  .frame { width: calc(100% - 28px); }
  .header-inner { min-height: 56px; grid-template-columns: 1fr auto; }
  .site-nav { display: none; }
  .hero { padding: 16px 0 10px; }
  .hero-masthead { text-align: left; margin-bottom: 14px; }
  .masthead-top { display: grid; justify-content: start; gap: 6px; }
  .hero h1, html[lang="vi"] .hero h1 { font-size: clamp(1.75rem, 8vw, 2.7rem); line-height: 1.07; }
  .fact-row {
    justify-content: flex-start;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--muted);
    text-transform: none;
    font-size: .86rem;
    letter-spacing: 0;
  }
  .intro, body.quiz-in-progress .intro { display: block; margin: 6px 0 0; font-size: .96rem; }
  .hero-content:has(.inviter:not([hidden])) .intro { display: none; }
  .inviter { margin-bottom: 10px; font-size: .95rem; padding: 8px 10px; text-align: left; }
  .tarot-stage-card { padding: 13px 12px 6px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-md); }
  .quiz-progress { margin-bottom: 11px; scroll-margin-top: calc(64px + env(safe-area-inset-top)); }
  .quiz-progress > span { text-align: left; margin-bottom: 5px; }
  progress { height: 8px; padding: 0; border-width: 1px; }
  progress::-webkit-progress-value { background: var(--red); }
  progress::-moz-progress-bar { background: var(--red); }
  .tarot-question-box { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .tarot-question-box::before, .options::before { content: none; }
  .question-copy { text-align: left; margin-bottom: 12px; }
  .question-line { font-size: clamp(1.15rem, 4.9vw, 1.55rem); padding: 0; text-wrap: pretty; }
  .options { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .option {
    grid-template-columns: 28px minmax(0, 1fr);
    align-content: center;
    align-items: center;
    justify-items: start;
    gap: 10px;
    min-height: 46px;
    padding: 5px 10px;
    border: 1.5px solid var(--ink);
    border-radius: 9px;
    text-align: left;
    background: var(--surface);
    touch-action: manipulation;
  }
  .option .option-number {
    width: 28px;
    border-width: 1px;
    box-shadow: none;
    transform: none;
    font-size: .95rem;
  }
  .option-label { font-size: 1rem; text-wrap: pretty; }
  .option:active, .option:has(input:checked) { background: var(--yellow); }
  .option:has(input:checked) .option-number { background: var(--ink); color: var(--surface); }
  .option:has(input:focus-visible) { outline: 3px solid var(--red); outline-offset: 2px; }
  .option:has(input:focus-visible) .option-number { outline: 0; }
  .quiz-actions { margin-top: 7px; padding-top: 0; border-top: 0; }
  #quiz-back { min-height: 44px; box-shadow: none; }
  #auto-advance { font-size: .82rem; }
  .sin-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sin-tile[open] { grid-column: 1 / -1; }
  .reading { grid-template-columns: 1fr; gap: 16px; }
  .footer-inner { display: grid; gap: 10px; }
  .footer-inner > span { display: none; }
}

@media (max-width: 360px) {
  .hero { padding-top: 10px; }
  .hero-masthead { margin-bottom: 10px; }
  .fact-row { font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .option-number, .button, .sin-tile { transition: none; }
}

.profile-link, .related-quizzes a, .reader-guide a { color: var(--red); font-weight: 700; text-underline-offset: .18em; }
.related-quizzes { display: flex; flex-wrap: wrap; gap: .8rem 2rem; margin: 1.5rem 0 2.25rem; }
.reader-guide {
  width: min(48rem, calc(100% - 2rem));
  margin: 2rem auto 3rem;
  padding: clamp(1rem, 4vw, 3rem);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
}
.reader-guide h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
.reader-guide h2 { margin-top: 2rem; font-size: 1.55rem; }
.reader-guide p, .reader-guide li { margin-block: .8rem; }
.reader-guide table { display: block; overflow-x: auto; }
.reader-guide table, .comparison-scores { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.reader-guide :is(th, td), .comparison-scores :is(th, td) { padding: .4rem .55rem; border-bottom: 1px solid var(--line); text-align: start; }
.comparison-scores { width: 100%; margin-top: 1rem; }
.comparison-scores caption { text-align: start; font-weight: 800; padding-bottom: .4rem; }
