/* Xin Xăm Quan Âm — 100 quẻ. Tông peach/cream pastel Mèo Béo, mobile-first. */
.xx-wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; color: var(--text-main, #5c4b47); }

/* ── Hero ── */
.xx-hero { text-align: center; margin-bottom: 18px; }
.xx-eyebrow {
  display: inline-block; font-weight: 700; font-size: 0.82rem; color: var(--accent, #d67d63);
  background: var(--peach-light, #fff5f2); border: 1px solid var(--border-soft, #ffe6e0);
  padding: 5px 14px; border-radius: 999px; margin: 0 0 10px;
}
.xx-title { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 2rem; color: var(--accent-soft, #e59882); margin: 0 0 8px; }
.xx-sub { color: var(--text-muted, #8a7772); line-height: 1.65; margin: 0 auto; max-width: 50ch; font-size: 0.95rem; }
.xx-sub strong { color: var(--accent, #d67d63); }

/* ── Sân khấu ống xăm ── */
.xx-stage {
  position: relative; text-align: center;
  background: radial-gradient(120% 90% at 50% 8%, #fff8ee 0%, #fff3f0 60%, #ffeef0 100%);
  border: 1px solid var(--border-soft, #ffe6e0); border-radius: 28px;
  box-shadow: var(--shadow-card, 0 8px 24px -10px rgba(250, 208, 196, 0.6));
  padding: 14px 18px 22px; margin-bottom: 20px; scroll-margin-top: 90px;
}
.xx-scene { display: grid; place-items: center; }
.xx-tube { width: 300px; max-width: 84%; height: auto; }
.xx-tube-body { transform-box: fill-box; transform-origin: 50% 92%; }

/* thẻ xăm trong ống đung đưa nhẹ */
.xx-tube .ts { transform-box: fill-box; transform-origin: 50% 100%; }
.xx-tube .ts1 { animation: xx-sway 3.4s ease-in-out infinite; }
.xx-tube .ts2 { animation: xx-sway 4.1s ease-in-out infinite 0.5s; }
.xx-tube .ts3 { animation: xx-sway 3.7s ease-in-out infinite 1s; }
.xx-tube .ts4 { animation: xx-sway 4.4s ease-in-out infinite 1.6s; }
@keyframes xx-sway { 0%, 100% { transform: rotate(-2.2deg); } 50% { transform: rotate(2.2deg); } }

/* lắc ống */
.xx-tube.shaking .xx-tube-body { animation: xx-shake 1.25s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
.xx-tube.shaking .ts { animation: xx-rattle 0.26s ease-in-out infinite; }
@keyframes xx-shake {
  0%, 100% { transform: rotate(0deg); }
  12% { transform: rotate(-9deg); } 26% { transform: rotate(8deg); }
  40% { transform: rotate(-7deg); } 54% { transform: rotate(6deg); }
  68% { transform: rotate(-4deg); } 84% { transform: rotate(3deg); }
}
@keyframes xx-rattle { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-2px); } }

/* thẻ xăm trồi lên */
.xx-out { opacity: 0; transform: translateY(74px); }
.xx-tube.drawing .xx-out { animation: xx-rise 0.95s cubic-bezier(0.34, 1.25, 0.5, 1) forwards; }
@keyframes xx-rise {
  0% { opacity: 0; transform: translateY(74px); }
  30% { opacity: 1; transform: translateY(45px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── Ô hỏi + nút ── */
.xx-form { max-width: 400px; margin: 6px auto 0; }
.xx-btn {
  width: 100%; justify-content: center; padding: 15px 26px;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.05rem; cursor: pointer;
  border: none; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  color: #7a4a3a; background: linear-gradient(135deg, #ffd9a0 0%, #ff9e7d 100%);
  box-shadow: 0 8px 20px rgba(255, 158, 125, 0.5); transition: transform 0.25s, box-shadow 0.25s;
}
.xx-btn:hover:not(:disabled) { transform: translateY(-3px) scale(1.01); box-shadow: 0 12px 26px rgba(255, 158, 125, 0.65); }
.xx-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.xx-btn-ico { width: 1.35em; height: 1.35em; }
.xx-hint { font-size: 0.8rem; color: var(--text-muted, #8a7772); margin: 10px 0 0; min-height: 1.2em; line-height: 1.5; }

/* ── Thẻ quẻ ── */
.xx-result { scroll-margin-top: 90px; margin-bottom: 18px; }
.xx-result[hidden] { display: none; }
.xx-card {
  --xl-fg: #2c6b96; --xl-bg: #eaf4fb;
  border: 1px solid var(--border-soft, #ffe6e0); border-radius: 24px; overflow: hidden;
  background: linear-gradient(180deg, var(--xl-bg) 0%, #fffcfb 86px);
  box-shadow: var(--shadow-card, 0 8px 24px -10px rgba(250, 208, 196, 0.6));
  animation: xx-fade 0.5s ease;
}
@keyframes xx-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.xx-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 16px 20px 0; }
.xx-no { font-size: 0.84rem; font-weight: 700; color: var(--text-muted, #8a7772); }
.xx-no b { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.6rem; color: var(--xl-fg); vertical-align: -2px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.xx-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: #fff; border: 1.5px solid var(--xl-fg); color: var(--xl-fg); font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.8rem; }
.xx-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--xl-fg); display: inline-block; }
.xx-name { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.4rem; color: var(--accent, #d67d63); margin: 8px 20px 0; line-height: 1.3; text-align: center; }

.xx-poem { margin: 14px 20px 0; padding: 18px 14px; border-radius: 18px; background: #fff; border: 1px dashed var(--border-soft, #ffe6e0); text-align: center; }
.xx-poem p { margin: 0 0 8px; color: var(--text-main, #5c4b47); font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 1.02rem; line-height: 1.7; }
.xx-poem p:last-child { margin-bottom: 0; }

.xx-h { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.84rem; color: var(--accent, #d67d63); margin: 18px 20px 7px; text-transform: uppercase; letter-spacing: 0.05em; }
.xx-block { margin: 0 20px; }
.xx-block p { margin: 0; color: var(--text-main, #5c4b47); line-height: 1.7; font-size: 0.95rem; }

.xx-aspects { list-style: none; margin: 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; }
.xx-aspects li { padding: 11px 14px; border-radius: 14px; background: var(--peach-light, #fff5f2); border: 1px solid var(--border-soft, #ffe6e0); }
.xx-aspects .lbl { display: block; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.78rem; color: var(--xl-fg); margin-bottom: 2px; }
.xx-aspects .txt { display: block; font-size: 0.87rem; color: var(--text-main, #5c4b47); line-height: 1.55; }

.xx-advice { margin: 0 20px; padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--border-soft, #ffe6e0); border-left: 4px solid var(--primary-peach-hover, #fbc1b0); }
.xx-advice p { margin: 0; color: var(--text-main, #5c4b47); line-height: 1.65; font-size: 0.95rem; font-style: italic; }
.xx-card-foot { margin: 16px 20px 20px; padding-top: 13px; border-top: 2px dashed var(--border-soft, #ffe6e0); color: var(--text-muted, #8a7772); font-size: 0.8rem; line-height: 1.6; text-align: center; }

/* ── Panel ── */
.xx-panel { background: #fff; border: 1px solid var(--border-soft, #ffe6e0); border-radius: 24px; box-shadow: var(--shadow-card, 0 8px 24px -10px rgba(250, 208, 196, 0.6)); padding: 20px 20px 22px; margin-bottom: 18px; }
.xx-panel-title { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.05rem; color: var(--accent, #d67d63); margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px dashed var(--border-soft, #ffe6e0); }
.xx-panel-sub { color: var(--text-muted, #8a7772); margin: 0 0 14px; font-size: 0.92rem; line-height: 1.6; }

/* ── Các bước ── */
.xx-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.xx-step { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 16px; background: var(--peach-light, #fff5f2); border: 1px solid var(--border-soft, #ffe6e0); }
.xx-step-no { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #fad0c4, #fbc1b0); color: #7a4a3a; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.9rem; }
.xx-step b { display: block; font-family: 'Nunito', sans-serif; font-weight: 800; color: var(--accent, #d67d63); margin-bottom: 2px; }
.xx-step p { margin: 0; color: var(--text-main, #5c4b47); font-size: 0.9rem; line-height: 1.6; }

/* ── Cấp quẻ ── */
.xx-levels { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.xx-level { padding: 12px 15px; border-radius: 16px; background: var(--lv-bg); border: 1px solid var(--border-soft, #ffe6e0); border-left: 4px solid var(--lv-fg); }
.xx-level-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.xx-level-head i { width: 10px; height: 10px; border-radius: 50%; background: var(--lv-fg); flex-shrink: 0; }
.xx-level-head b { font-family: 'Nunito', sans-serif; font-weight: 800; color: var(--lv-fg); }
.xx-level-head span { margin-left: auto; font-size: 0.76rem; color: var(--text-muted, #8a7772); font-weight: 600; }
.xx-level p { margin: 0; color: var(--text-main, #5c4b47); font-size: 0.88rem; line-height: 1.6; }

/* ── Nội dung + FAQ ── */
.xx-seo-p { color: var(--text-main, #5c4b47); line-height: 1.75; margin: 0 0 12px; font-size: 0.94rem; }
.xx-seo-p strong { color: var(--accent, #d67d63); }
.xx-faq-title { font-family: 'Nunito', sans-serif; font-weight: 800; color: var(--text-main, #5c4b47); font-size: 1rem; margin: 18px 0 10px; }
.xx-faq { border: 1px solid var(--border-soft, #ffe6e0); border-radius: 14px; padding: 2px 14px; margin-bottom: 8px; background: var(--peach-light, #fff5f2); }
.xx-faq summary { cursor: pointer; padding: 12px 0; font-weight: 700; font-family: 'Nunito', sans-serif; color: var(--text-main, #5c4b47); list-style: none; position: relative; padding-right: 24px; }
.xx-faq summary::-webkit-details-marker { display: none; }
.xx-faq summary::after { content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--accent, #d67d63); font-size: 1.2rem; font-weight: 800; }
.xx-faq[open] summary::after { content: '−'; }
.xx-faq p { margin: 0 0 12px; color: var(--text-muted, #8a7772); line-height: 1.65; font-size: 0.9rem; }

/* ── Khám phá thêm ── */
.xx-promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.xx-promo-card { display: flex; flex-direction: column; gap: 3px; padding: 14px; border-radius: 16px; text-decoration: none; background: var(--peach-light, #fff5f2); border: 1px solid var(--border-soft, #ffe6e0); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.xx-promo-card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px -8px rgba(250, 208, 196, 0.7); border-color: var(--primary-peach-hover, #fbc1b0); }
.xx-promo-ico { width: 32px; height: 32px; display: block; margin-bottom: 3px; }
.xx-promo-name { font-family: 'Nunito', sans-serif; font-weight: 800; color: var(--accent, #d67d63); }
.xx-promo-desc { font-size: 0.8rem; color: var(--text-muted, #8a7772); line-height: 1.45; }

.xx-footnote { text-align: center; color: var(--text-muted, #8a7772); font-size: 0.82rem; line-height: 1.65; margin: 6px auto 0; max-width: 48ch; }

@media (max-width: 520px) {
  .xx-wrap { padding: 20px 12px 56px; }
  .xx-title { font-size: 1.7rem; }
  .xx-tube { max-width: 92%; }
  .xx-stage { padding: 10px 14px 20px; }
  .xx-panel { padding: 16px 15px 18px; }
  .xx-name { font-size: 1.25rem; }
  .xx-card-head { padding-left: 14px; padding-right: 14px; }
  .xx-name, .xx-poem, .xx-h, .xx-block, .xx-aspects, .xx-advice, .xx-card-foot { margin-left: 14px; margin-right: 14px; }
  .xx-poem { padding: 15px 10px; }
  .xx-poem p { font-size: 0.96rem; }
}
@media (prefers-reduced-motion: reduce) {
  .xx-tube .ts, .xx-tube.shaking .xx-tube-body, .xx-tube.shaking .ts { animation: none !important; }
  .xx-tube.drawing .xx-out { animation: none; opacity: 1; transform: translateY(0); }
  .xx-card { animation: none; }
}
