/* Shared styles for the quiz hub and every quiz page (/quizzes/ and /<lang>/quizzes/).
   Per-quiz colors come from the theme in the quiz data file, set as CSS variables on <body>. */
:root {
  --qz-ink: #231815;
  --qz-text: #40332e;
  --qz-muted: #7a6b65;
  --qz-line: #eadfd8;
  --qz-bg: #fffaf6;
  --qz-card: #ffffff;
  --qz-accent: #e4572e;
  --qz-accent-dark: #b93a17;
  --qz-soft: #fff1ea;
  --qz-radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--qz-bg);
  color: var(--qz-text);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

main { width: 100%; flex: 1 0 auto; }

.qz-wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.qz-narrow { max-width: 760px; }

h1, h2, h3 {
  font-family: 'Fredoka', 'Nunito', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--qz-ink);
  line-height: 1.2;
  margin: 0;
}

a { color: var(--qz-accent-dark); }

/* ---------- Hero ---------- */
.qz-hero { padding: 30px 0 18px; text-align: center; }

.qz-crumbs { font-size: 0.88rem; color: var(--qz-muted); margin: 0 0 14px; }
.qz-crumbs a { color: var(--qz-muted); text-decoration: none; }
.qz-crumbs a:hover { text-decoration: underline; }

.qz-hero h1 { font-size: clamp(2rem, 6vw, 3.1rem); font-weight: 700; }
.qz-hero-lead { max-width: 640px; margin: 14px auto 0; font-size: 1.1rem; }

.qz-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.qz-chips li { background: var(--qz-soft); color: var(--qz-accent-dark); font-weight: 700; font-size: 0.88rem; padding: 5px 14px; border-radius: 999px; }

/* ---------- Quiz stage ---------- */
.qz-stage { padding: 10px 0 34px; }

.qz-app {
  background: var(--qz-card);
  border: 1px solid var(--qz-line);
  border-radius: 24px;
  box-shadow: 0 14px 40px rgba(60, 30, 15, 0.08);
  padding: 30px 26px;
  max-width: 680px;
  margin: 0 auto;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.qz-screen { display: flex; flex-direction: column; align-items: stretch; animation: qz-in 0.28s ease; }
@keyframes qz-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .qz-screen { animation: none; } }

.qz-screen--intro { align-items: center; text-align: center; gap: 14px; }
.qz-intro-emoji { font-size: 4rem; line-height: 1; }
.qz-intro-note { margin: 0; color: var(--qz-muted); font-size: 0.95rem; }

.qz-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 800; text-decoration: none; cursor: pointer;
  border-radius: 999px; border: 2px solid transparent; padding: 11px 24px;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.qz-btn:hover { transform: translateY(-1px); }
.qz-btn:focus-visible, .qz-option:focus-visible, .qz-link-btn:focus-visible { outline: 3px solid var(--qz-accent); outline-offset: 2px; }
.qz-btn--primary { background: var(--qz-accent); color: #fff; font-size: 1.08rem; padding: 13px 34px; }
.qz-btn--primary:hover { background: var(--qz-accent-dark); color: #fff; }

.qz-link-btn {
  align-self: center; margin-top: 18px; background: none; border: 0; padding: 4px 8px;
  font: inherit; font-size: 0.95rem; color: var(--qz-muted); cursor: pointer; text-decoration: underline;
}

/* Question */
.qz-progress { margin-bottom: 20px; }
.qz-progress-label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--qz-muted); margin-bottom: 6px; }
.qz-progress-track { height: 8px; background: var(--qz-soft); border-radius: 999px; overflow: hidden; }
.qz-progress-fill { height: 100%; background: var(--qz-accent); border-radius: 999px; transition: width 0.3s ease; }

.qz-question { font-size: clamp(1.3rem, 4.4vw, 1.7rem); margin-bottom: 20px; outline: none; }

.qz-options { display: grid; gap: 10px; }
.qz-option {
  font: inherit; font-weight: 700; text-align: left; color: var(--qz-ink);
  background: var(--qz-card); border: 2px solid var(--qz-line); border-radius: 14px;
  padding: 14px 18px; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease;
}
.qz-option:hover { border-color: var(--qz-accent); background: var(--qz-soft); }
.qz-option.is-selected { border-color: var(--qz-accent); background: var(--qz-accent); color: #fff; }

/* Result */
.qz-result-card {
  --qz-result: var(--qz-accent);
  text-align: center; border-radius: 20px; padding: 26px 20px 22px;
  background: color-mix(in srgb, var(--qz-result) 9%, #fff);
}
.qz-result-kicker { margin: 0; font-weight: 800; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--qz-muted); }
.qz-result-emoji { font-size: 4.4rem; line-height: 1.15; }
.qz-result-name { font-size: clamp(1.9rem, 7vw, 2.6rem); color: var(--qz-result); outline: none; }
.qz-result-tagline { margin: 4px 0 12px; font-weight: 800; color: var(--qz-ink); }
.qz-result-desc { margin: 0 auto; max-width: 520px; }

.qz-traits { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; padding: 0; margin: 16px 0 0; }
.qz-traits li { background: #fff; border: 1px solid var(--qz-line); border-radius: 999px; padding: 4px 14px; font-size: 0.9rem; font-weight: 700; }

.qz-pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.qz-pair { background: #fff; border: 1px solid var(--qz-line); border-radius: 14px; padding: 10px 8px; }
.qz-pair-label { display: block; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--qz-muted); }
.qz-pair-value { font-weight: 800; color: var(--qz-ink); }

.qz-breakdown { margin-top: 22px; }
.qz-breakdown h3 { font-size: 1rem; margin-bottom: 10px; }
.qz-bar { display: grid; grid-template-columns: minmax(110px, 34%) 1fr 44px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 0.92rem; font-weight: 700; }
.qz-bar-track { display: block; height: 10px; background: var(--qz-soft); border-radius: 999px; overflow: hidden; }
.qz-bar-fill { display: block; height: 100%; border-radius: 999px; }
.qz-bar-value { text-align: right; color: var(--qz-muted); }

.qz-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 26px; }
.qz-actions .qz-btn--primary { width: 100%; max-width: 320px; }
.qz-share { display: flex; justify-content: center; gap: 10px; }
.qz-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: var(--qz-soft); color: var(--qz-ink);
  font-size: 1.05rem; cursor: pointer; text-decoration: none; transition: background 0.15s ease, color 0.15s ease;
}
.qz-icon-btn:hover { background: var(--qz-accent); color: #fff; }
.qz-icon-btn:focus-visible, .qz-text-link:focus-visible { outline: 3px solid var(--qz-accent); outline-offset: 2px; }
.qz-share-status { min-height: 1.2em; font-size: 0.88rem; font-weight: 700; color: var(--qz-muted); }
.qz-share-status:empty { display: none; }
.qz-result-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin-top: 4px; }
.qz-text-link { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 0.95rem; color: var(--qz-muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.qz-text-link:hover { color: var(--qz-ink); }

/* ---------- Content sections ---------- */
.qz-section { padding: 34px 0; }
.qz-section + .qz-section { border-top: 1px solid var(--qz-line); }
.qz-section h2 { font-size: clamp(1.5rem, 4.5vw, 2rem); margin-bottom: 14px; }
.qz-section h3 { font-size: 1.15rem; }
.qz-section-intro { margin: 0 0 20px; color: var(--qz-muted); }

.qz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); column-gap: 48px; border-top: 1px solid var(--qz-line); }

.qz-type {
  --qz-result: var(--qz-accent);
  display: grid; grid-template-columns: 52px 1fr; column-gap: 14px;
  padding: 20px 0; border-bottom: 1px solid var(--qz-line); scroll-margin-top: 90px;
}
.qz-type > * { grid-column: 2; }
.qz-type-emoji { grid-column: 1; grid-row: 1 / span 5; font-size: 2.3rem; line-height: 1.1; }
.qz-type-tagline { margin: 2px 0 8px; font-weight: 800; color: var(--qz-result); font-size: 0.92rem; }
.qz-type p { margin: 0; font-size: 0.96rem; }
.qz-type-traits { margin-top: 10px !important; color: var(--qz-muted); font-size: 0.86rem !important; font-weight: 700; }

.qz-steps { padding-left: 22px; margin: 0; }
.qz-steps li { margin-bottom: 8px; }

.qz-faq details { border-bottom: 1px solid var(--qz-line); }
.qz-faq summary { cursor: pointer; font-weight: 800; color: var(--qz-ink); padding: 14px 0; }
.qz-faq details p { margin: 0; padding: 0 0 16px; }
.qz-faq summary h3 { display: inline; font: inherit; color: inherit; }
.qz-section h2 + h3, .qz-section p + h3 { margin-top: 18px; }

.qz-byline { margin: 22px 0 0; font-size: 0.88rem; color: var(--qz-muted); }

.qz-links { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.qz-links a { display: inline-block; background: var(--qz-card); border: 1px solid var(--qz-line); border-radius: 999px; padding: 8px 18px; font-weight: 700; text-decoration: none; color: var(--qz-ink); }
.qz-links a:hover { border-color: var(--qz-accent); }

/* ---------- Quiz cards (hub + "more quizzes") ---------- */
.qz-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.qz-card {
  display: flex; flex-direction: column; background: var(--qz-card); border: 1px solid var(--qz-line);
  border-radius: var(--qz-radius); overflow: hidden; text-decoration: none; color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.qz-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(60, 30, 15, 0.12); }
.qz-card img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; display: block; background: var(--qz-soft); }
.qz-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.qz-card-body h2, .qz-card-body h3 { font-size: 1.2rem; }
.qz-card-body p { margin: 0; font-size: 0.95rem; }
.qz-card-meta { margin-top: auto; padding-top: 8px; font-size: 0.84rem; font-weight: 700; color: var(--qz-muted); }

@media (max-width: 560px) {
  .qz-app { padding: 22px 16px; border-radius: 20px; }
  .qz-hero { padding-top: 22px; }
}

@media (max-width: 400px) { .qz-grid { grid-template-columns: 1fr; } }
