/* ============================================================================
 *  Quiz nhanh — style cho bảng/biểu đồ kết quả (lá số, chỉ số, quẻ, bản đồ sao,
 *  lá bài). Trích & scope từ CSS của các trang bói riêng lẻ, gói dưới
 *  `.quiz-chart` để KHÔNG đụng tới style trang chủ.
 * ========================================================================== */

.quiz-chart { margin: 4px 0 22px; }

/* -------------------- Tử Vi: lá số 12 cung (lưới 4x4) -------------------- */
.quiz-chart-tuvi {
    --tuvi-primary: #d67d63;
    --tuvi-border: #ffe6e0;
    --tuvi-card-bg: #ffffff;
    --tuvi-text-1: #5c4b47;
    --tuvi-text-2: #8a7772;
    --tuvi-shadow: 0 10px 30px rgba(250, 208, 196, 0.3);
    --tuvi-kim: #a5a5a5;
    --tuvi-moc: #27ae60;
    --tuvi-thuy: #3498db;
    --tuvi-hoa: #e74c3c;
    --tuvi-tho: #f39c12;
}
.quiz-chart-tuvi .la-so-container {
    display: grid;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background-color: #fff5f2;
    border: 1px solid var(--tuvi-border);
    grid-template-columns: 1fr;
}
.quiz-chart-tuvi .thien-ban {
    grid-column: 1 / -1;
    padding: 20px;
    border-radius: 12px;
    background-color: #fffaf9;
    border: 1px solid var(--tuvi-border);
}
@media (min-width: 1024px) {
    .quiz-chart-tuvi .la-so-container {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: auto 1fr 1fr auto;
        grid-template-areas:
          "cung4  cung5  cung6  cung7"
          "cung3  center center cung8"
          "cung2  center center cung9"
          "cung1  cung12 cung11 cung10";
    }
    .quiz-chart-tuvi .thien-ban {
        grid-area: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        min-height: 400px;
    }
    .quiz-chart-tuvi .cung:nth-of-type(1)  { grid-area: cung1; }
    .quiz-chart-tuvi .cung:nth-of-type(2)  { grid-area: cung2; }
    .quiz-chart-tuvi .cung:nth-of-type(3)  { grid-area: cung3; }
    .quiz-chart-tuvi .cung:nth-of-type(4)  { grid-area: cung4; }
    .quiz-chart-tuvi .cung:nth-of-type(5)  { grid-area: cung5; }
    .quiz-chart-tuvi .cung:nth-of-type(6)  { grid-area: cung6; }
    .quiz-chart-tuvi .cung:nth-of-type(7)  { grid-area: cung7; }
    .quiz-chart-tuvi .cung:nth-of-type(8)  { grid-area: cung8; }
    .quiz-chart-tuvi .cung:nth-of-type(9)  { grid-area: cung9; }
    .quiz-chart-tuvi .cung:nth-of-type(10) { grid-area: cung10; }
    .quiz-chart-tuvi .cung:nth-of-type(11) { grid-area: cung11; }
    .quiz-chart-tuvi .cung:nth-of-type(12) { grid-area: cung12; }
}
.quiz-chart-tuvi .thien-ban-header {
    display: flex; flex-direction: column; align-items: center; gap: 5px; margin-bottom: 15px;
}
.quiz-chart-tuvi .thien-ban-header h2 { color: var(--tuvi-primary); margin: 0; font-size: 1.4em; }
.quiz-chart-tuvi .person-info .name { font-size: 1.2em; font-weight: 600; }
.quiz-chart-tuvi .thien-ban-details p { margin: 8px 0; color: var(--tuvi-text-2); font-size: 0.95em; }
.quiz-chart-tuvi .thien-ban-details strong { color: var(--tuvi-text-1); font-weight: 500; }
.quiz-chart-tuvi .thien-ban-details .highlight { color: var(--tuvi-primary); font-weight: 600; }
.quiz-chart-tuvi .cung {
    border: 1px solid var(--tuvi-border);
    background-color: var(--tuvi-card-bg);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    font-size: 13px;
    border-radius: 8px;
    transition: all 0.3s ease;
    overflow: hidden;
}
.quiz-chart-tuvi .cung:hover { transform: translateY(-5px) scale(1.02); box-shadow: var(--tuvi-shadow); z-index: 10; }
.quiz-chart-tuvi .cung-header {
    display: flex; justify-content: space-between; padding: 6px 8px;
    background-color: #fff5f2; font-weight: 600; color: var(--tuvi-text-1);
}
.quiz-chart-tuvi .cung-chu { color: var(--tuvi-primary); }
.quiz-chart-tuvi .than-tag { color: var(--tuvi-hoa); font-size: 0.9em; }
.quiz-chart-tuvi .cung-ten-chi { color: #8a7772; }
.quiz-chart-tuvi .cung-dai-han { font-weight: 500; color: #8a7772; }
.quiz-chart-tuvi .cung-content { flex-grow: 1; padding: 8px; text-align: left; overflow-y: auto; }
.quiz-chart-tuvi .chinh-tinh { font-weight: 700; margin-bottom: 8px; text-transform: uppercase; font-size: 14px; }
.quiz-chart-tuvi .chinh-tinh span, .quiz-chart-tuvi .phu-tinh span {
    display: inline-block; margin-right: 5px; margin-bottom: 3px; line-height: 1.4;
}
.quiz-chart-tuvi .chinh-tinh span span, .quiz-chart-tuvi .phu-tinh span span {
    font-size: 0.8em; color: #a89890; font-weight: 400; margin-left: 2px;
}
.quiz-chart-tuvi .sat-tinh { color: var(--tuvi-hoa); }
.quiz-chart-tuvi .cat-tinh { color: var(--tuvi-thuy); }
.quiz-chart-tuvi .cung-footer {
    display: flex; justify-content: space-between; padding: 6px 8px; font-size: 11px;
    color: var(--tuvi-text-2); border-top: 1px dashed var(--tuvi-border); margin-top: auto;
}
.quiz-chart-tuvi .tuan-triet {
    font-weight: bold; color: var(--tuvi-hoa); background: #ffe8e5; padding: 1px 4px; border-radius: 4px;
}
.quiz-chart-tuvi .hanhKim  { color: var(--tuvi-kim); }
.quiz-chart-tuvi .hanhMoc  { color: var(--tuvi-moc); }
.quiz-chart-tuvi .hanhThuy { color: var(--tuvi-thuy); }
.quiz-chart-tuvi .hanhHoa  { color: var(--tuvi-hoa); }
.quiz-chart-tuvi .hanhTho  { color: var(--tuvi-tho); }

/* -------------------- Thần Số Học: thẻ con số đường đời -------------------- */
.quiz-chart-num { text-align: center; display: flex; justify-content: center; }
.quiz-chart-num .number-card {
    background: linear-gradient(135deg, #ffffff 0%, #fff0ec 100%);
    border: 2px dashed #fbc1b0; border-radius: 25px; padding: 30px 22px; max-width: 380px;
    box-shadow: 0 10px 25px rgba(250, 208, 196, 0.4); position: relative; overflow: hidden;
}
.quiz-chart-num .number-card::after {
    content: '✨'; position: absolute; top: 15px; right: 15px; font-size: 1.5rem; opacity: 0.6;
}
.quiz-chart-num .life-path-title {
    font-size: 1rem; color: #8a7772; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 5px; font-weight: 700;
}
.quiz-chart-num .life-path-number {
    font-size: 5.5rem; font-weight: 900; color: #e59882; line-height: 1; margin: 12px 0;
    text-shadow: 3px 3px 0px #fff, 6px 6px 15px rgba(250, 208, 196, 0.8);
}
.quiz-chart-num .life-path-meaning { font-size: 1.05rem; color: #d67d63; font-weight: 600; margin-top: 12px; }

/* -------------------- Kinh Dịch: quẻ chính / quẻ biến -------------------- */
.quiz-chart-kinhdich { --yang: #d67d63; --yin: #b09a93; }
.quiz-chart-kinhdich .hex-grid {
    display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: center;
}
.quiz-chart-kinhdich .hex-card {
    background: linear-gradient(135deg, #fffefd 0%, #fff0ec 100%);
    border: 1.5px dashed #fbc1b0; border-radius: 16px; padding: 14px 16px;
    min-width: 160px; max-width: 200px; text-align: center; box-shadow: 0 4px 10px rgba(250, 208, 196, 0.3);
}
.quiz-chart-kinhdich .hex-tag {
    font-size: 0.72rem; color: #8a7772; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700;
}
.quiz-chart-kinhdich .hex-han { font-size: 2rem; color: #d67d63; line-height: 1; margin: 6px 0; font-weight: 800; }
.quiz-chart-kinhdich .hex-name { font-size: 1rem; font-weight: 700; color: #5c4b47; }
.quiz-chart-kinhdich .hex-sub { font-size: 0.8rem; color: #8a7772; margin-top: 3px; }
.quiz-chart-kinhdich .hex-trigrams { margin-top: 4px; font-size: 1.1rem; color: #c9a84c; letter-spacing: 4px; }
.quiz-chart-kinhdich .hex-stack {
    margin: 10px auto 6px; display: flex; flex-direction: column-reverse; gap: 4px; width: 100px;
}
.quiz-chart-kinhdich .hex-line { height: 9px; border-radius: 3px; position: relative; background: var(--yang); }
.quiz-chart-kinhdich .hex-line.yin { background: transparent; display: flex; justify-content: space-between; }
.quiz-chart-kinhdich .hex-line.yin::before, .quiz-chart-kinhdich .hex-line.yin::after {
    content: ''; height: 9px; width: 44%; background: var(--yin); border-radius: 3px;
}
.quiz-chart-kinhdich .hex-line.changing::after,
.quiz-chart-kinhdich .hex-line:not(.yin).changing::after {
    content: '◉'; position: absolute; top: -6px; right: -14px; color: #e59882; font-size: 0.8rem;
    height: auto; width: auto; background: transparent;
}
.quiz-chart-kinhdich .hex-line.yin.changing::after {
    position: absolute; right: -16px; top: -6px; content: '◉'; color: #e59882;
    height: auto; width: auto; background: transparent;
}
.quiz-chart-kinhdich .hex-arrow { font-size: 1.6rem; color: #d67d63; padding: 0 4px; }
.quiz-chart-kinhdich .hex-judgment {
    font-size: 0.9rem; color: #8a7772; margin: 14px 4px 0; line-height: 1.6; font-style: italic; text-align: center;
}
@media (max-width: 560px) {
    .quiz-chart-kinhdich .hex-card { min-width: 130px; padding: 10px 12px; }
    .quiz-chart-kinhdich .hex-han { font-size: 1.7rem; }
    .quiz-chart-kinhdich .hex-arrow { transform: rotate(90deg); }
}

/* -------------------- Chiêm Tinh: cung Mặt Trời + biểu đồ + bảng -------------------- */
.quiz-chart-astro .zodiac-display {
    text-align: center; font-size: 1.6rem; color: #d67d63; margin-bottom: 16px; font-weight: bold;
    border-bottom: 2px dashed #ffe6e0; padding-bottom: 16px;
}
.quiz-chart-astro .astro-wheel { margin-bottom: 24px; }
.quiz-chart-astro .astro-table-wrapper {
    overflow-x: auto; background: #fff; border-radius: 15px; border: 1px solid #ffe6e0;
    padding: 10px; box-shadow: 0 4px 15px rgba(250,208,196,0.2);
}
.quiz-chart-astro .astro-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.quiz-chart-astro .astro-table th, .quiz-chart-astro .astro-table td {
    padding: 12px 14px; text-align: left; border-bottom: 1px dashed #ffe6e0;
}
.quiz-chart-astro .astro-table th { background: #fffaf9; color: #e59882; font-weight: bold; font-size: 1rem; }
.quiz-chart-astro .astro-table td { color: #5c4b47; font-weight: 500; }
.quiz-chart-astro .astro-table tr:last-child td { border-bottom: none; }
.quiz-chart-astro .astro-table tr:hover { background: #fff5f2; }

/* -------------------- Tarot / Bài Tây: các lá đã rút -------------------- */
.quiz-chart-cards {
    display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
}
.quiz-chart-cards .qc-card { width: 120px; text-align: center; }
.quiz-chart-cards .qc-card-pos {
    font-size: 0.72rem; color: #8a7772; text-transform: uppercase; letter-spacing: 1px;
    font-weight: 700; margin-bottom: 6px;
}
.quiz-chart-cards .qc-card img {
    width: 100%; border-radius: 10px; box-shadow: 0 6px 16px rgba(250, 208, 196, 0.5);
    border: 1px solid #ffe6e0; background: #fff;
}
.quiz-chart-cards .qc-card img.reversed { transform: rotate(180deg); }
.quiz-chart-cards .qc-card-name { font-size: 0.85rem; color: #5c4b47; font-weight: 600; margin-top: 8px; }
.quiz-chart-cards .qc-card-ori { font-size: 0.72rem; color: #d67d63; }

/* -------------------- Ô nơi sinh (Chiêm tinh) + gợi ý Mapbox -------------------- */
.quiz-geo { position: relative; }
.quiz-geo-list {
    list-style: none; margin: 4px 0 0; padding: 0; position: absolute; z-index: 30;
    left: 0; right: 0; top: 100%; display: none; max-height: 220px; overflow-y: auto;
    background: #fff; border: 1px solid #ffe6e0; border-radius: 12px;
    box-shadow: 0 10px 24px rgba(250, 208, 196, 0.45);
}
.quiz-geo-list li {
    padding: 10px 14px; cursor: pointer; font-size: 0.9rem; color: #5c4b47;
    border-bottom: 1px dashed #ffe6e0;
}
.quiz-geo-list li:last-child { border-bottom: none; }
.quiz-geo-list li:hover { background: #fff5f2; color: #d67d63; }
