/* duduangfree.buzz — compatibility.css (สแกนความเข้ากัน) */

/* ---------- Form ---------- */
body[data-page="compatibility"] .page-hero.container { padding-left: var(--gutter); padding-right: var(--gutter); }
.compat-form-wrap { padding-top: 12px; }
.compat-people { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
.person-card { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; border: 0; padding: 22px; }
.person-card[data-person="b"] { --hud-c: var(--gold); }
.person-card[data-person="b"] .hud-label { color: var(--gold); }
.person-head { display: flex; align-items: center; gap: 10px; }
.person-head h3 { margin: 0; }
.person-badge { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-latin); font-weight: 700; font-size: .9rem;
  color: #fff; background: linear-gradient(135deg, var(--red), var(--red-3)); flex: none; clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%); }
.person-card[data-person="b"] .person-badge { color: #2a1d05; background: linear-gradient(135deg, var(--gold-2), var(--gold-3)); }
.field-label { font-family: var(--font-head); font-size: .9rem; color: var(--text-2); margin-bottom: -8px; }
.dmy { display: grid; grid-template-columns: .8fr 1.4fr 1fr; gap: 8px; }
.dmy select { padding-left: 10px; padding-right: 28px; background-position: calc(100% - 16px) 50%, calc(100% - 10px) 50%; min-width: 0; }
.people-join { display: grid; place-items: center; }
.people-join span { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-latin); font-weight: 900; font-size: .95rem; color: var(--gold);
  background: radial-gradient(circle, rgba(168,85,247,.25), rgba(7,3,15,.9)); border: 1px solid var(--red); box-shadow: 0 0 18px var(--red-glow), inset 0 0 12px rgba(168,85,247,.3); animation: c-vs 1.8s ease-in-out infinite; }
@keyframes c-vs { 0%, 100% { box-shadow: 0 0 14px var(--red-glow), inset 0 0 10px rgba(168,85,247,.25); } 50% { box-shadow: 0 0 28px var(--red), inset 0 0 16px rgba(168,85,247,.45); } }
.compat-actions { justify-content: center; margin-top: 22px; }
.form-error { color: var(--danger); text-align: center; margin: 14px 0 0; font-family: var(--font-head); font-size: .95rem; }
@media (max-width: 760px) {
  .compat-people { grid-template-columns: 1fr; gap: 10px; }
  .people-join span { width: 40px; height: 40px; font-size: .85rem; }
  .compat-actions .btn { flex: 1 1 100%; }
}

/* ---------- Result wrapper ---------- */
.c-result { display: grid; gap: 18px; max-width: 920px; margin: 0 auto; }
.c-result > * { margin: 0; min-width: 0; }
.c-result > .hud-card { animation: c-in .5s var(--ease-out) both; }
.c-result > .hud-card:nth-child(2) { animation-delay: .15s; } .c-result > .hud-card:nth-child(n+3) { animation-delay: .25s; }
@keyframes c-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.c-person { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.c-avatar { width: 84px; height: 84px; clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%); padding: 2px; display: grid; place-items: center; margin-bottom: 6px;
  background: linear-gradient(135deg, var(--red-2), var(--red-3)); }
.c-person-b .c-avatar { background: linear-gradient(135deg, var(--gold-2), var(--gold-3)); }
.c-avatar span { width: 100%; height: 100%; clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%); display: grid; place-items: center; background: var(--bg-3);
  font-family: var(--font-head); font-size: 2rem; color: var(--red-2); line-height: 1; }
.c-person-b .c-avatar span { color: var(--gold-2); }
.c-name { font-family: var(--font-head); font-size: 1.1rem; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-sign { font-size: .9rem; color: var(--text-2); }
.c-glyph { font-family: 'Noto Sans Symbols', 'Segoe UI Symbol', serif; color: var(--gold-2); }
.c-birth { font-size: .8rem; }

/* ---------- Scan ---------- */
.c-scan { padding: 26px 20px 20px; overflow: hidden; }
.c-scan-pair { display: grid; grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr); align-items: center; gap: 8px; max-width: 620px; margin: 6px auto 18px; }
.c-scan-p { position: relative; }
.c-scan-p::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--red), transparent); box-shadow: 0 0 14px var(--red);
  animation: c-sweep 1.4s ease-in-out infinite alternate; }
@keyframes c-sweep { from { transform: translateY(0); } to { transform: translateY(150px); } }
.c-scan-mid { position: relative; height: 80px; display: grid; place-items: center; }
.c-scan-beam { position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: linear-gradient(90deg, var(--red), var(--gold), var(--red)); background-size: 200% 100%; animation: c-flow 1s linear infinite; box-shadow: 0 0 10px var(--red); }
@keyframes c-flow { to { background-position: -200% 0; } }
.c-scan-heart { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--bg-3); border: 1px solid var(--red); color: var(--red); font-size: 1.3rem; text-shadow: 0 0 10px var(--red); animation: c-beat 0.8s ease-in-out infinite; }
@keyframes c-beat { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.22); } 40% { transform: scale(1); } 55% { transform: scale(1.12); } }
.c-prog { height: 10px; border-radius: 6px; background: rgba(255,255,255,.07); overflow: hidden; border: 1px solid var(--border); max-width: 620px; margin: 0 auto; }
.c-prog > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--gold)); box-shadow: 0 0 12px var(--red); transition: width .5s var(--ease-out); }
.c-prog-txt { display: flex; justify-content: space-between; align-items: center; max-width: 620px; margin: 8px auto 0; color: var(--gold-2); font-size: .9rem; }
.c-log { list-style: none; margin: 12px auto 0; padding: 12px 14px; max-width: 620px; min-height: 120px; background: rgba(0,0,0,.35); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .92rem; color: var(--text-3); display: grid; gap: 4px; align-content: start; }
.c-log li { animation: c-in .25s ease both; }
.c-log li.ok { color: var(--gold-2); }
@media (max-width: 420px) { .c-scan-pair { grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr); } .c-scan-heart { width: 34px; height: 34px; font-size: 1rem; } }
@media (prefers-reduced-motion: reduce) { .c-scan-p::after, .c-scan-beam, .c-scan-heart, .people-join span { animation: none !important; } }

/* ---------- Hero result ---------- */
.c-hero { text-align: center; overflow: hidden; padding: 30px 22px; }
.c-hero > * { position: relative; z-index: 1; }
.c-hero .hud-label { text-align: left; }
.c-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(50px, .8fr) minmax(0, 1fr); align-items: start; gap: 8px; max-width: 620px; margin: 0 auto; }
.c-link { position: relative; height: 84px; display: grid; place-items: center; }
.c-ekg { position: absolute; left: 0; right: 0; top: 50%; width: 100%; height: 40px; transform: translateY(-50%); overflow: visible; }
.c-ekg path { fill: none; stroke: var(--red); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke;
  stroke-dasharray: 60 340; stroke-dashoffset: 400; filter: drop-shadow(0 0 4px var(--red)); animation: c-ekg 2.4s linear infinite; }
.c-link::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: linear-gradient(90deg, var(--red), var(--gold)); opacity: .45; }
@keyframes c-ekg { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .c-ekg path { animation: none !important; stroke-dasharray: none; opacity: .55; } }

/* เกจหัวใจแดงทอง */
.c-heartgauge { position: relative; width: 190px; margin: 14px auto 6px; }
.c-heartgauge svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 0 18px var(--red-glow)); animation: c-hbeat 1.6s ease-in-out infinite; transform-origin: 50% 55%; }
@keyframes c-hbeat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.05); } 24% { transform: scale(1); } 36% { transform: scale(1.03); } }
.c-h-bg { fill: rgba(168,85,247,.08); }
.c-h-fill { transition: transform 1.5s var(--ease-out); }
.c-h-line { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linejoin: round; filter: drop-shadow(0 0 4px var(--gold-glow)); }
.c-h-num { position: absolute; inset: 0 0 12% 0; display: flex; align-items: center; justify-content: center; gap: 2px; padding-bottom: 6%; }
.c-h-num b { font-size: 2.6rem; font-weight: 900; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.8), 0 0 14px rgba(0,0,0,.6); }
.c-h-num small { font-size: 1rem; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.8); align-self: flex-end; margin-bottom: 1.2rem; }
@media (prefers-reduced-motion: reduce) { .c-heartgauge svg { animation: none; } .c-h-fill { transition: none; } }

/* ป้ายระดับคู่ */
.c-rank { display: inline-flex; align-items: center; gap: 14px; margin: 12px auto 4px; padding: 10px 20px 10px 12px; border: 1px solid var(--gold); border-radius: var(--radius-sm); text-align: left;
  background: linear-gradient(135deg, rgba(247,197,72,.14), rgba(168,85,247,.12)); box-shadow: 0 0 24px -6px var(--gold-glow); max-width: 100%; }
.c-rank-tag { min-width: 58px; height: 58px; padding: 0 8px; display: grid; place-items: center; font-weight: 900; font-size: 1.7rem; color: #2a1d05; background: var(--holo); border-radius: 12px; box-shadow: 0 0 16px var(--gold-glow); flex: none; }
.c-rank[data-rank="C"] .c-rank-tag, .c-rank[data-rank="D"] .c-rank-tag { background: linear-gradient(135deg, var(--ember), var(--red)); color: #fff; box-shadow: 0 0 16px var(--red-glow); }
.c-rank-title { font-family: var(--font-head); font-size: 1.3rem; font-weight: 500; color: var(--gold-2); line-height: 1.25; }
.c-rank-sub { font-size: .88rem; color: var(--text-2); margin-top: 2px; }
@media (max-width: 420px) { .c-rank { flex-direction: column; text-align: center; padding: 12px; } }
.c-band { font-family: var(--font-head); font-size: 1.1rem; font-weight: 500; margin-top: 8px; }
.c-stars { margin: 2px 0 8px; }
.c-summary { max-width: 560px; margin: 0 auto; color: var(--text-2); font-size: 1.02rem; }

/* ---------- Life summary ---------- */
.c-lifegrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.c-life { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255,255,255,.025); min-width: 0; }
.c-life:nth-child(odd) { border-color: var(--border-2); }
.c-life-ico { font-size: 1.7rem; line-height: 1.1; flex: none; }
.c-life-lbl { font-family: var(--font-head); color: var(--gold-2); font-size: .95rem; margin-bottom: 2px; }
.c-life p { margin: 0; font-size: .95rem; color: var(--text-2); overflow-wrap: anywhere; }
@media (max-width: 640px) { .c-lifegrid { grid-template-columns: 1fr; } }

/* ---------- Dimensions ---------- */
.c-dim-row { grid-template-columns: 130px 1fr 48px; font-family: var(--font-head); margin-bottom: 4px; }
.c-dim-name { white-space: nowrap; }
@media (max-width: 480px) {
  .c-dim-row { grid-template-columns: 1fr 44px; gap: 6px 10px; }
  .c-dim-row .c-dim-name { grid-column: 1 / -1; }
  .c-dim-row .bar { grid-column: 1; }
}
.c-dim + .c-dim { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
.c-dim h4 { font-family: var(--font-head); font-weight: 500; margin: 6px 0 0; color: var(--gold-2); }
.c-dim-detail { font-size: .95rem; color: var(--text-2); padding: 2px 0 8px; }
.c-dim-detail p { margin: 8px 0; }
.c-dim-detail .dim-facts { color: var(--text); line-height: 1.8; }
.c-dim-detail .muted-p { color: var(--text-3); }
.c-dim-detail .chips { gap: 6px; }
.c-emoji { font-size: 1.1em; }
.c-num { font-family: var(--font-latin); color: var(--gold-2); font-size: 1.05em; }
.c-small { font-size: .85rem; }

/* ---------- Sub aspects ---------- */
.c-subs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.c-sub { text-align: center; padding: 16px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 0; }
.c-sub-name { font-family: var(--font-head); font-size: .92rem; margin-top: 8px; color: var(--text); }
.c-sub-band { font-size: .82rem; }
@media (max-width: 760px) { .c-subs { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* ---------- Strengths / cares ---------- */
.c-sc .hud-card { margin: 0; }
.c-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.c-list li { position: relative; padding-left: 26px; color: var(--text-2); font-size: .98rem; }
.c-list li strong { color: var(--text); font-weight: 500; font-family: var(--font-head); }
.c-list li::before { position: absolute; left: 0; top: 0; }
.c-list-good li::before { content: '✓'; color: var(--success); }
.c-list-care li::before { content: '!'; color: var(--warn); font-family: var(--font-head); width: 18px; text-align: center; }

/* ---------- Deep report / tips ---------- */
.c-deep > summary { cursor: pointer; font-family: var(--font-head); color: var(--gold-2); list-style: none; padding: 2px 0; }
.c-deep > summary::-webkit-details-marker { display: none; }
.c-deep > summary::before { content: '▸ '; } .c-deep[open] > summary::before { content: '▾ '; }
.c-deep[open] > summary { margin-bottom: 10px; }
.c-tips-title { font-family: var(--font-head); font-weight: 500; margin: 16px 0 8px; color: var(--gold-2); }
.c-tips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.c-tip { padding: 14px 16px; background: rgba(168,85,247,.07); border: 1px solid rgba(168,85,247,.28); border-radius: var(--radius-sm); }
.c-tip-head { font-family: var(--font-head); color: var(--gold-2); margin-bottom: 4px; }
.c-tip p { margin: 0; color: var(--text-2); font-size: .96rem; }
.c-note { margin: 16px 0 0; }
@media (max-width: 640px) { .c-tips { grid-template-columns: 1fr; } }

/* ---------- Actions ---------- */
.c-actions-card .actions { justify-content: center; }
.c-links { margin-top: 12px; }
.c-links .btn { white-space: normal; text-align: center; line-height: 1.3; }

@media (max-width: 420px) {
  .c-hero { padding: 24px 14px; }
  .c-avatar { width: 64px; height: 64px; }
  .c-avatar span { font-size: 1.5rem; }
  .c-link { height: 64px; }
  .c-name { font-size: .98rem; }
  .c-sign { font-size: .8rem; }
  .c-birth { font-size: .72rem; }
  .c-heartgauge { width: 160px; }
  .actions .btn { flex: 1 1 auto; }
}
