/* ========================================
   DESTINY SAJU - FREE CHART
   Phase 1: Structural foundation
   ======================================== */


/* ---------- BASIC RESET ---------- */

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
}

body {
    background: #ffffff;
    color: #241b33;
    font-family: "Poppins", "Noto Sans KR", Arial, sans-serif;
}


/* ---------- MAIN PAGE ---------- */

.main-div {
    width: 100%;
    max-width: 1200px;
    margin-left: auto !important;
    margin-right: auto !important;
}


/* ========================================
   FOUR PILLARS
   시 · 일 · 월 · 년
   ======================================== */

.pillar {
    /*
       Four cells must ALWAYS remain on one row.
       Bootstrap's flex-wrap may remain in the PHP,
       but these cells are allowed to shrink.
    */

    flex: 0 0 calc(25% - 16px);
    width: calc(25% - 16px);
    min-width: 0;
    max-width: none;

    margin: 8px;
    padding: 10px 6px;

    border-radius: 10px;

    text-align: center;
    overflow: hidden;
}


/* Remove default paragraph spacing inside chart cells */

.pillar p {
    margin: 0;
}


/* ========================================
   8 LUCK PILLARS
   8 대운의 흐름
   ======================================== */

.pillar_sm {
    /*
       Eight cells must ALWAYS remain on one row.
    */

    flex: 0 0 calc(12.5% - 8px);
    width: calc(12.5% - 8px);
    min-width: 0;
    max-width: none;

    margin: 4px;
    padding: 7px 2px;

    border-radius: 7px;

    text-align: center;
    overflow: hidden;
}

.pillar_sm p {
    margin: 0;
}


/* ========================================
   MOBILE
   ======================================== */

@media (max-width: 600px) {

    /*
       Bootstrap p-5 gives .main-div enormous
       mobile padding. Override it.
    */

    .main-div {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }


    /* ---------- FOUR PILLARS ---------- */

    .pillar {
        flex-basis: calc(25% - 6px);
        width: calc(25% - 6px);

        margin: 3px;
        padding: 7px 2px;

        border-radius: 7px;
    }


    /*
       freechart.php currently puts 6rem directly
       on the large Chinese characters.

       Inline style normally wins over ordinary CSS,
       therefore !important is intentional here.
    */

    .pillar p[style*="font-size"] {
        font-size: clamp(2.6rem, 14vw, 4rem) !important;
        line-height: 1.15;
    }


    /* Ordinary labels inside the four pillars */

    .pillar p:not([style*="font-size"]) {
        font-size: 0.95rem;
        line-height: 1.3;
    }


    /* ---------- 8 LUCK PILLARS ---------- */

    .pillar_sm {
        flex-basis: calc(12.5% - 2px);
        width: calc(12.5% - 2px);

        margin: 1px;
        padding: 5px 1px;

        border-radius: 5px;
    }

    .pillar_sm p {
        font-size: 0.72rem;
        line-height: 1.2;
    }


    /*
       Large Chinese characters in the small
       eight-column chart.
    */

    .pillar_sm p[style*="font-size"] {
        font-size: clamp(1.35rem, 6vw, 2rem) !important;
    }
}

/* =========================================================
   SAJU NATAL CHART
   Normal Chart + Transformed Chart
   ========================================================= */


/* Horizontal divider above chart */
.natal-divider {
    width: 100%;
    max-width: 900px;
    margin: 28px auto 22px;
    border: 0;
    border-top: 1px solid #ddd6e5;
}


/* ---------------------------------------------------------
   ROW STRUCTURE
   Always 4 columns: 시 | 일 | 월 | 년
   --------------------------------------------------------- */

.natal-row {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;

    display: flex;
    flex-wrap: nowrap !important;
    justify-content: center;
    gap: 8px;
}


/* ---------------------------------------------------------
   BASE PILLAR CELL
   --------------------------------------------------------- */

.natal-row .pillar {
    flex: 1 1 0;
    width: 25%;
    min-width: 0;
    max-width: none;

    margin: 0 0 8px 0;
    padding: 0;

    box-sizing: border-box;
    text-align: center;

    border-radius: 10px;
    overflow: hidden;
}

.natal-row .pillar p {
    margin: 0;
}


/* ---------------------------------------------------------
   시 · 일 · 월 · 년
   --------------------------------------------------------- */

.natal-title {
    padding: 9px 4px !important;

    background: transparent;

    color: #2d2139;
    font-size: 1.1rem;
    font-weight: 600;

    border: 1px solid #e2dce8;
}


/* ---------------------------------------------------------
   십성
   --------------------------------------------------------- */

.natal-tengod {
    padding: 10px 4px !important;

    background: #eeeaf3;

    color: #382b46;
    font-size: 1rem;
    font-weight: 600;

    border: 1px solid #ddd6e5;
}


/* ---------------------------------------------------------
   천간 / 지지
   Dynamic element background remains in PHP
   --------------------------------------------------------- */

.natal-character {
    min-height: 135px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(0, 0, 0, 0.08);
}

.natal-character p {
    font-weight: 500;
    line-height: 1;
}


/* ---------------------------------------------------------
   12운성 + 지장간
   --------------------------------------------------------- */

.natal-stage {
    padding: 13px 5px !important;

    background: #f3f0f6;

    color: #382d44;
    font-size: 0.95rem;
    line-height: 1.55;

    border: 1px solid #e1dbe7;
}


/* ---------------------------------------------------------
   신살
   --------------------------------------------------------- */

.natal-sinsal {
    padding: 14px 6px !important;

    background: #f3f0f6;

    color: #382d44;
    line-height: 1.5;

    border: 1px solid #e1dbe7;
}

.natal-sinsal-list {
    margin: 0 !important;

    font-size: 0.9rem;

    word-break: keep-all;
    overflow-wrap: break-word;
}

.natal-gongmang {
    margin: 7px 0 0 !important;

    color: #a44750;

    font-size: 0.85rem;
    font-weight: 600;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 768px) {

    .natal-row {
        gap: 5px;
    }

    .natal-row .pillar {
        margin-bottom: 5px;
        border-radius: 8px;
    }

    .natal-character {
        min-height: 105px;
    }



    .natal-stage {
        font-size: 0.82rem;
    }

    .natal-sinsal-list {
        font-size: 0.78rem;
    }

    .natal-gongmang {
        font-size: 0.75rem;
    }
}


/* =========================================================
   MOBILE
   Still ALWAYS 4 columns
   ========================================================= */

@media (max-width: 600px) {

    .natal-divider {
        margin: 20px auto 16px;
    }

    .natal-row {
        width: 100%;
        gap: 3px;
        padding: 0 3px;

        box-sizing: border-box;

        flex-wrap: nowrap !important;
    }

    .natal-row .pillar {
        flex: 1 1 0;
        width: 25%;
        min-width: 0;

        margin-bottom: 3px;

        border-radius: 6px;
    }


    /* 시 일 월 년 */

    .natal-title {
        padding: 7px 1px !important;

        font-size: 0.9rem;
    }


    /* 십성 */

    .natal-tengod {
        padding: 7px 1px !important;

        font-size: 0.76rem;
    }


    /* 천간 / 지지 */

    .natal-character {
        min-height: 82px;
    }




    /* 12운성 + 지장간 */

    .natal-stage {
        padding: 8px 2px !important;

        font-size: 0.68rem;
        line-height: 1.4;

        word-break: keep-all;
        overflow-wrap: break-word;
    }


    /* 신살 */

    .natal-sinsal {
        padding: 8px 2px !important;

        line-height: 1.4;
    }

    .natal-sinsal-list {
        font-size: 0.64rem;

        word-break: keep-all;
        overflow-wrap: break-word;
    }

    .natal-gongmang {
        margin-top: 4px !important;

        font-size: 0.64rem;
    }
}


/* =========================================================
   VERY SMALL PHONES
   Keep 4 columns — shrink typography instead of stacking
   ========================================================= */

@media (max-width: 380px) {

    .natal-row {
        gap: 2px;
        padding: 0 2px;
    }

    .natal-title {
        font-size: 0.82rem;
    }

    .natal-tengod {
        font-size: 0.7rem;
    }

    .natal-character {
        min-height: 75px;
    }



    .natal-stage {
        font-size: 0.62rem;
        padding: 7px 1px !important;
    }

    .natal-sinsal {
        padding: 7px 1px !important;
    }

    .natal-sinsal-list,
    .natal-gongmang {
        font-size: 0.59rem;
    }
}

/* =========================================================
   8 대운 SUMMARY
   Always 8 columns
   ========================================================= */

.luck-summary {
    width: 100%;
    max-width: 1100px;
    margin-left: auto !important;
    margin-right: auto !important;
}


/* Every row remains exactly 8 columns */

.luck-summary-row {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;

    display: flex;
    flex-wrap: nowrap !important;
    justify-content: center;

    gap: 5px;
}


/* Override legacy .pillar_sm layout */

.luck-summary-row .pillar_sm {
    flex: 1 1 0;
    width: 12.5%;
    min-width: 0;
    max-width: none;

    margin: 0 0 5px 0;
    padding: 8px 3px;

    box-sizing: border-box;

    text-align: center;

    border-radius: 7px;
    overflow: hidden;
}


/* Remove inherited paragraph margins */

.luck-summary-row .pillar_sm p {
    margin: 0;
}


/* ---------------------------------------------------------
   Row 1 — 천간 십성
   Inline font size overridden intentionally
   --------------------------------------------------------- */

.luck-summary-tengod .pillar_sm {
    background: #eeeaf3;
    color: #382b46;
}

.luck-summary-tengod .pillar_sm p {
    font-size: 0.9rem !important;
    font-weight: 600;

    white-space: nowrap;
}


/* ---------------------------------------------------------
   Row 2 — 천간
   --------------------------------------------------------- */

.luck-summary-gan .pillar_sm {
    min-height: 62px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.luck-summary-gan .pillar_sm p {
    font-size: 2rem !important;
    line-height: 1;
}


/* ---------------------------------------------------------
   Row 3 — 지지
   --------------------------------------------------------- */

.luck-summary-zhi .pillar_sm {
    min-height: 62px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.luck-summary-zhi .pillar_sm p {
    font-size: 2rem !important;
    line-height: 1;
}


/* ---------------------------------------------------------
   Row 4 — 지지 십성
   --------------------------------------------------------- */

.luck-summary-earth-tengod .pillar_sm {
    background: #eeeaf3;
    color: #382b46;
}

.luck-summary-earth-tengod .pillar_sm p {
    font-size: 0.9rem !important;
    font-weight: 600;

    white-space: nowrap;
}


/* ---------------------------------------------------------
   Row 5 — 시작 연도 / 공망
   --------------------------------------------------------- */

.luck-summary-year .pillar_sm {
    background: #f3f0f6 !important;
    color: #382d44 !important;
}

.luck-summary-year .pillar_sm p {
    font-size: 0.85rem !important;
    line-height: 1.35;

    white-space: nowrap;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 768px) {

    .luck-summary-row {
        gap: 3px;
    }

    .luck-summary-row .pillar_sm {
        margin-bottom: 3px;
        padding: 7px 2px;

        border-radius: 6px;
    }

    .luck-summary-tengod .pillar_sm p,
    .luck-summary-earth-tengod .pillar_sm p {
        font-size: 0.75rem !important;
    }

    .luck-summary-gan .pillar_sm,
    .luck-summary-zhi .pillar_sm {
        min-height: 55px;
    }

    .luck-summary-gan .pillar_sm p,
    .luck-summary-zhi .pillar_sm p {
        font-size: 1.75rem !important;
    }

    .luck-summary-year .pillar_sm p {
        font-size: 0.72rem !important;
    }
}


/* =========================================================
   MOBILE
   Still ALWAYS 8 columns
   ========================================================= */

@media (max-width: 600px) {

    .luck-summary {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .luck-summary-row {
        width: 100%;

        gap: 2px;

        flex-wrap: nowrap !important;
    }

    .luck-summary-row .pillar_sm {
        flex: 1 1 0;
        width: 12.5%;
        min-width: 0;

        margin-bottom: 2px;
        padding: 5px 1px;

        border-radius: 4px;
    }


    /* 십성 — must remain horizontal */

    .luck-summary-tengod .pillar_sm p,
    .luck-summary-earth-tengod .pillar_sm p {
        font-size: 0.59rem !important;
        line-height: 1.15;

        white-space: nowrap;
        word-break: keep-all;
    }


    /* 천간 / 지지 */

    .luck-summary-gan .pillar_sm,
    .luck-summary-zhi .pillar_sm {
        min-height: 44px;
    }

    .luck-summary-gan .pillar_sm p,
    .luck-summary-zhi .pillar_sm p {
        font-size: 1.45rem !important;
        line-height: 1;
    }


    /* Years */

    .luck-summary-year .pillar_sm {
        padding-left: 0;
        padding-right: 0;
    }

    .luck-summary-year .pillar_sm p {
        font-size: 0.55rem !important;
        line-height: 1.2;

        white-space: nowrap;
    }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 380px) {

    .luck-summary {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    .luck-summary-row {
        gap: 1px;
    }

    .luck-summary-row .pillar_sm {
        margin-bottom: 1px;
        border-radius: 3px;
    }

    .luck-summary-tengod .pillar_sm p,
    .luck-summary-earth-tengod .pillar_sm p {
        font-size: 0.54rem !important;
    }

    .luck-summary-gan .pillar_sm p,
    .luck-summary-zhi .pillar_sm p {
        font-size: 1.3rem !important;
    }

    .luck-summary-year .pillar_sm p {
        font-size: 0.5rem !important;
    }
}

/* =========================================================
   10-YEAR LUCK CYCLES - COLLAPSIBLE CARDS
   ========================================================= */

.luck-detail-section {
    max-width: 1100px;
    margin: 55px auto;
    padding: 40px 30px !important;
    box-sizing: border-box;
}

.luck-detail-section > h1 {
    margin: 0 0 24px;
    font-size: 2rem;
    font-weight: 600;
    color: #211a33;
}

.luck-detail-section > hr {
    border: 0;
    border-top: 1px solid #ddd8e5;
    margin: 0 0 32px;
}


/* ---------- 8 cycle grid ---------- */

.luck-cycle-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}


/* ---------- Individual cycle card ---------- */

.luck-cycle-card {
    min-width: 0;
    background: #ffffff;
    border: 1px solid #ddd8e5;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(38, 27, 58, 0.06);
}


/* Remove browser's default details arrow */

.luck-cycle-card > summary {
    list-style: none;
}

.luck-cycle-card > summary::-webkit-details-marker {
    display: none;
}


/* ---------- Clickable card header ---------- */

.luck-cycle-summary {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 145px;
    padding: 20px 36px 18px 20px;

    cursor: pointer;
    user-select: none;

    background: #f8f6fa;
    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.luck-cycle-summary:hover {
    background: #f2eef6;
}


/* ---------- Main 대운 characters ---------- */

.luck-cycle-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    margin-bottom: 9px;

    font-size: 2.35rem;
    font-weight: 600;
    line-height: 1;
    color: #211a33;
}


/* ---------- Year range ---------- */

.luck-cycle-years {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #6d6676;
}


/* ---------- Custom arrow ---------- */

.luck-cycle-arrow {
    position: absolute;
    right: 17px;
    top: 50%;

    font-size: 1.3rem;
    line-height: 1;
    color: #a58a55;

    transform: translateY(-50%);
    transition: transform 0.2s ease;
}

.luck-cycle-card[open] .luck-cycle-arrow {
    transform: translateY(-50%) rotate(180deg);
}


/* ---------- Open card ---------- */

.luck-cycle-card[open] {
    border-color: #c9b98f;
    box-shadow: 0 5px 18px rgba(38, 27, 58, 0.09);
}

.luck-cycle-card[open] .luck-cycle-summary {
    background: #f3eff7;
    border-bottom: 1px solid #e1dbe7;
}


/* ---------- 10 individual years ---------- */

.luck-cycle-detail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    padding: 15px;
    gap: 7px 10px;

    background: #ffffff;
}

.luck-year-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-width: 0;
    padding: 8px 9px;

    border-radius: 7px;
    background: #faf9fb;

    font-size: 0.9rem;
    line-height: 1.2;
    color: #302a39;
}

.luck-year-number {
    font-weight: 500;
}

.luck-year-ganzhi {
    margin-left: 8px;
    font-weight: 600;
    color: #332744;
}


/* Current calendar year */

.luck-year-row.current-luck-year {
    background: #f4ecd8;
    outline: 1px solid #d2bd86;
}

.luck-year-row.current-luck-year .luck-year-number,
.luck-year-row.current-luck-year .luck-year-ganzhi {
    font-weight: 700;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .luck-detail-section {
        width: 100%;
        margin: 35px auto;
        padding: 28px 18px !important;
    }

    .luck-detail-section > h1 {
        margin-bottom: 20px;
        font-size: 1.65rem;
    }

    .luck-detail-section > hr {
        margin-bottom: 22px;
    }


    /* One 10-year cycle per row */

    .luck-cycle-grid {
        grid-template-columns: 1fr;
        gap: 11px;
    }


    /* Much shorter card header */

    .luck-cycle-summary {
        flex-direction: row;
        justify-content: flex-start;
        min-height: 0;

        padding: 16px 45px 16px 17px;
    }


    .luck-cycle-name {
        flex: 0 0 auto;

        margin: 0 18px 0 0;

        font-size: 1.65rem;
        line-height: 1;
    }


    .luck-cycle-years {
        margin: 0;

        font-size: 0.95rem;
        white-space: nowrap;
    }


    .luck-cycle-arrow {
        right: 17px;
        font-size: 1.2rem;
    }


    /* Expanded years stay compact */

    .luck-cycle-detail {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        padding: 12px;
        gap: 6px;
    }


    .luck-year-row {
        padding: 8px 7px;
        font-size: 0.84rem;
    }

    .luck-year-ganzhi {
        margin-left: 5px;
    }
}

.element-water {
    background: var(--water);
    color: #f7f5fa;
}

/* =========================================================
   DESTINY SAJU - INTERPRETATION CARDS
   ========================================================= */

.saju-reading-card {
    max-width: 1180px;
    margin: 52px auto;
    padding: 38px 42px 42px;
    background: #ffffff;
    border: 1px solid #e6e0ea;
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(42, 29, 58, 0.06);
}

.saju-reading-title {
    margin: 0 0 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5dfea;
    text-align: center;
    color: #281d38;
    font-size: 2rem;
    font-weight: 600;
}

.saju-reading-content {
    display: flex;
    align-items: flex-start;
    gap: 34px;
}

.saju-reading-visual {
    flex: 0 0 280px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.saju-reading-text {
    flex: 1;
    min-width: 0;
    color: #332a3d;
    font-size: 1rem;
    line-height: 1.85;
}

.saju-reading-text p {
    margin-top: 0;
    margin-bottom: 18px;
}


/* ---------- Yin / Yang ---------- */

.yinyang-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 230px;
}

.yinyang-visual img {
    display: block;
    max-width: 145px;
    height: auto !important;
}


/* ---------- Day Pillar ---------- */

.daypillar-image {
    display: block;
    width: 280px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 18px;
}

.daypillar-celebs {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #eee9f0;
    line-height: 1.9;
}

.daypillar-celebs strong {
    color: #281d38;
}


/* ---------- Five Elements ---------- */

.element-balance-visual {
    flex: 0 0 280px;
    height: 260px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 5px;
}

.element-balance-visual img {
    width: 42px;
    max-height: 260px;
    object-fit: fill;
}


/* ---------- Mobile ---------- */

@media (max-width: 768px) {

    .saju-reading-card {
        margin: 28px 14px;
        padding: 26px 20px 30px;
        border-radius: 18px;
    }

    .saju-reading-title {
        margin-bottom: 24px;
        padding-bottom: 16px;
        font-size: 1.55rem;
    }

    .saju-reading-content {
        display: block;
    }

    .saju-reading-visual {
        width: 100%;
        max-width: 260px;
        margin: 0 auto 24px;
    }

    .saju-reading-text {
        font-size: 0.96rem;
        line-height: 1.8;
    }

    .yinyang-visual {
        min-height: auto;
    }

    .daypillar-image {
        width: 240px;
    }

    .element-balance-visual {
        height: 210px;
        margin-bottom: 26px;
    }

    .element-balance-visual img {
        width: 34px;
        max-height: 210px;
    }
}

/* ==================================================
   BLUE MONSTER - FINAL
   Main Saju - Heavenly Stems / Earthly Branches
   ================================================== */

.natal-character p {
    line-height: 1;
    margin: 0;
}

/* Desktop */
@media (min-width: 769px) {
    .natal-character p {
        font-size: 76px !important;
        font-weight: 400 !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .natal-character p {
        font-size: 54px !important;
        font-weight: 400 !important;
    }
}

/* ==================================================
   BLUE MONSTER POLISH #2
   Section Headings / Vertical Spacing
   ================================================== */

.page-title {
    margin-bottom: 28px;
}

.chart-section {
    padding: 24px 20px;
    margin: 48px auto;
}

.section-title {
    font-size: 30px;
    font-weight: 600;
    color: #282039;
    margin: 0 0 20px;
}

.section-subtitle {
    font-size: 24px;
    font-weight: 600;
    color: #282039;
    margin: 24px 0 22px;
}

.chart-section hr {
    margin: 16px 0 24px;
}

/* Mobile */
@media (max-width: 768px) {

    .chart-section {
        padding: 20px 12px;
        margin: 32px auto;
    }

    .section-title {
        font-size: 27px;
        margin-bottom: 16px;
    }

    .section-subtitle {
        font-size: 22px;
        margin: 22px 0 20px;
    }

    .chart-section hr {
        margin: 14px 0 20px;
    }
}

/* ==================================================
   BLUE MONSTER POLISH #3
   Special Saju Expandable Card
   ================================================== */

.special-saju-card {
    width: calc(100% - 40px);
    max-width: 1120px;
    margin: 36px auto;
    background: #faf9fc;
    border: 1px solid #ded9e7;
    border-radius: 22px;
    overflow: hidden;
}

/* Remove browser's default details marker */
.special-saju-card summary {
    list-style: none;
}

.special-saju-card summary::-webkit-details-marker {
    display: none;
}

/* Clickable collapsed area */
.special-saju-summary {
    cursor: pointer;
    padding: 28px 24px;
    text-align: center;
    user-select: none;
}

.special-saju-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.special-saju-title {
    font-size: 18px;
    font-weight: 600;
    color: #514663;
    margin-bottom: 10px;
}

.special-saju-type {
    font-size: 26px;
    font-weight: 700;
    color: #282039;
    margin-bottom: 8px;
}

.special-saju-message {
    font-size: 16px;
    color: #5f5869;
    margin-bottom: 16px;
}

.special-saju-more {
    font-size: 15px;
    font-weight: 600;
    color: #625674;
}

/* Expanded content */
.special-saju-content {
    padding: 0 24px 30px;
}

.special-saju-content > p:first-child {
    text-align: center;
    font-size: 16px;
    line-height: 1.7;
    color: #40384b;
    margin: 0 auto 24px;
}

.special-saju-content hr {
    border: 0;
    border-top: 1px solid #ded9e7;
    margin: 24px 0 30px;
}

.special-changed-title {
    text-align: center;
    font-size: 26px;
    font-weight: 600;
    color: #282039;
    margin: 0 0 28px;
}

/* Note underneath transformed chart */
.special-saju-note {
    text-align: center;
    font-size: 15px;
    line-height: 1.7;
    color: #625a6d;
    margin: 26px auto 0;
}

/* Small visual response on desktop */
@media (hover: hover) {
    .special-saju-summary:hover {
        background: #f6f3f9;
    }
}


/* =========================
   Mobile
   ========================= */

@media (max-width: 768px) {

    .special-saju-card {
        width: calc(100% - 28px);
        margin: 28px auto;
        border-radius: 20px;
    }

    .special-saju-summary {
        padding: 24px 18px;
    }

    .special-saju-title {
        font-size: 17px;
        margin-bottom: 9px;
    }

    .special-saju-type {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .special-saju-message {
        font-size: 15px;
        margin-bottom: 14px;
    }

    .special-saju-more {
        font-size: 14px;
    }

    .special-saju-content {
        padding: 0 12px 24px;
    }

    .special-saju-content > p:first-child {
        font-size: 15px;
        line-height: 1.65;
        margin-bottom: 20px;
    }

    .special-saju-content hr {
        margin: 20px 0 24px;
    }

    .special-changed-title {
        font-size: 23px;
        margin-bottom: 22px;
    }

    .special-saju-note {
        font-size: 14px;
        line-height: 1.65;
        margin-top: 22px;
        padding: 0 8px;
    }
}

/* ==================================================
   BLUE MONSTER POLISH #4
   Special Saju Dark Header / Footer
   ================================================== */

.special-saju-card {
    background: #faf9fc;
    border: 1px solid #d8d1e2;
    overflow: hidden;
}

/* Summary itself gets NO padding now */
.special-saju-summary {
    padding: 0;
}

/* Dark special header */
.special-saju-title {
    width: 100%;
    background: #3b304d;
    color: #ffffff;
    text-align: center;
    font-size: 19px;
    font-weight: 700;
    padding: 16px 20px;
    margin: 0;
    letter-spacing: 0.02em;
}

/* Light body underneath header */
.special-saju-preview {
    padding: 24px 20px 22px;
}

.special-saju-type {
    margin-bottom: 10px;
}

.special-saju-message {
    margin-bottom: 16px;
}

.special-saju-more {
    color: #514663;
}

/* Open / close text */
.special-more-close {
    display: none;
}

.special-saju-card[open] .special-more-open {
    display: none;
}

.special-saju-card[open] .special-more-close {
    display: inline;
}


/* Expanded content */
.special-saju-content {
    padding: 0 24px;
}


/* Dark footer */
.special-saju-note {
    background: #3b304d;
    color: #ffffff;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.7;

    /*
       Extend through the content's side padding
       so the footer touches the card edges.
    */
    margin: 30px -24px 0;
    padding: 18px 24px;
}


/* Mobile */
@media (max-width: 768px) {

    .special-saju-title {
        font-size: 18px;
        padding: 15px 16px;
    }

    .special-saju-preview {
        padding: 22px 16px 20px;
    }

    .special-saju-content {
        padding: 0 12px;
    }

    .special-saju-note {
        font-size: 14px;
        line-height: 1.65;
        margin: 26px -12px 0;
        padding: 16px 18px;
    }
}

/* Special Saju header arrow */

.special-saju-title {
    position: relative;
}

/* Solid downward triangle */
.special-saju-arrow {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);

    width: 0;
    height: 0;

    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 9px solid #ffffff;
}

/* When open: solid upward triangle */
.special-saju-card[open] .special-saju-arrow {
    border-top: 0;
    border-bottom: 9px solid #ffffff;
}


/* Mobile */
@media (max-width: 768px) {
    .special-saju-arrow {
        right: 18px;

        border-left-width: 6px;
        border-right-width: 6px;
        border-top-width: 8px;
    }

    .special-saju-card[open] .special-saju-arrow {
        border-top: 0;
        border-bottom-width: 8px;
    }
}

/* ==================================================
   BLUE MONSTER - MOBILE SPACING SURGERY
   Desktop untouched
   ================================================== */

@media (max-width: 768px) {

    /* 1. Top of page:
       reduce Bootstrap p-5 / my-5 vertical space */
    body > .main-div {
        padding-top: 24px !important;
        padding-bottom: 24px !important;
        margin-top: 20px !important;
        margin-bottom: 20px !important;
    }


    /* 2. Space between natal chart
       and Special Saju card */
    .special-saju-card {
        margin-top: 18px;
        margin-bottom: 28px;
    }


    /* 3. Expanded Special Saju:
       remove the empty paragraph's vertical space */
    .special-saju-content > p:first-child:empty {
        display: none;
        margin: 0;
        padding: 0;
    }

}

/* ==================================================
   PROFILE INFO
   Name · Birth Date/Time · Gender
   ================================================== */

.profile-info {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 10px;

    margin: 0 auto 18px;

    color: #4f4659;
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
}

.profile-name {
    color: #282039;
    font-weight: 600;
}

.profile-divider {
    color: #a49baa;
}


/* Mobile */
@media (max-width: 768px) {

    .profile-info {
        display: grid;
        grid-template-columns: auto auto auto;
        justify-content: center;
        column-gap: 7px;
        row-gap: 1px;

        margin-bottom: 16px;

        font-size: 14px;
    }

    .profile-name {
        grid-column: 1 / -1;
        font-size: 16px;
        margin-bottom: 1px;
    }

    /* Hide the divider after the name on mobile */
    .profile-name + .profile-divider {
        display: none;
    }
}

/* ==================================================
   DESTINY SAJU - FIVE ELEMENT BALANCE
   Official locked palette
   ================================================== */

.element-balance-visual .element-bar {
    width: 40px;
    display: inline-block;
    vertical-align: bottom;
}

.element-bar-wood {
    background-color: #719584;
}

.element-bar-fire {
    background-color: #C66C72;
}

.element-bar-earth {
    background-color: #C49B5C;
}

.element-bar-metal {
    background-color: #A1A7B1;
}

.element-bar-water {
    background-color: #536987;
}

/* ==================================================
   ELEMENT BALANCE - LABELS
   ================================================== */

.element-bar {
    position: relative;
}

.element-bar-label {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);

    color: #241B33;
    font-size: 22px;
    font-weight: 600;
    line-height: 1;

    pointer-events: none;
}

@media (max-width: 768px) {
    .element-bar-label {
        bottom: 8px;
        font-size: 18px;
    }
}

/* ==================================================
   CURRENT 10-YEAR LUCK CYCLE
   ================================================== */

.luck-cycle-card.current-luck-cycle {
    border-color: #d2bd86;
}

.luck-cycle-card.current-luck-cycle .luck-cycle-summary {
    background: #f4ecd8;
}

/* =========================================================
   Same Day Pillar Celebrities
   ========================================================= */

.daypillar-celebs {
    margin-top: 20px;
    padding-top: 18px;

    border-top: 1px solid #eeeaf2;

    /* remove the inner box */
    background: transparent;
    border-radius: 0;
}

.daypillar-celebs strong {
    display: block;
    margin-bottom: 2px;

    color: #2d243d;
    font-size: 0.95em;
    font-weight: 700;
}

.daypillar-celebs a {
    display: inline-block;

    margin: 3px 2px;
    padding: 3px 8px;

    background: #766581;
    color: #ffffff;

    border: none;
    border-radius: 12px;

    font-size: 0.78em;
    font-weight: 500;
    line-height: 1.35;

    text-decoration: none;

    transition: background 0.2s ease;
}

.daypillar-celebs a:visited {
    color: #ffffff;
}

.daypillar-celebs a:hover {
    background: #a48a63;
    color: #ffffff;
}

/* Celebrity profile heading */
.celebrity-profile {
    text-align: center;
}

.celebrity-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-bottom: 5px;
}

.celebrity-star {
    font-size: 0.85em;
    color: #c89b3c;
}

.celebrity-profile .profile-name {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
}

.celebrity-profile .profile-name a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(200, 155, 60, 0.45);
    transition: border-color 0.2s ease, opacity 0.2s ease;
}

.celebrity-profile .profile-name a:hover {
    border-bottom-color: #c89b3c;
    opacity: 0.8;
}

.celebrity-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 0.95rem;
}



/* ==================================================
   FIVE ELEMENT BALANCE - PERCENTAGE GRAPH
   ================================================== */
.pretty-element-balance-visual {
    height: auto;
    min-height: 0;
    align-items: center;
}
.pretty-element-chart {
    width: 100%;
    height: 190px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 7px;
    padding: 28px 0 26px;
}
.pretty-element-item {
    position: relative;
    width: 42px;
    height: 136px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.pretty-element-bar {
    width: 42px;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
}
.pretty-element-percent {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--bar-height) + 7px);
    color: #756c7d;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.pretty-element-label {
    position: absolute;
    left: 50%;
    bottom: -24px;
    transform: translateX(-50%);
    color: #241B33;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
}
@media (max-width: 768px) {
    .pretty-element-chart { height: 178px; gap: 6px; padding-top: 24px; }
    .pretty-element-item { width: 38px; height: 126px; }
    .pretty-element-bar { width: 38px; }
    .pretty-element-percent { font-size: 0.66rem; }
    .pretty-element-label { font-size: 1.05rem; }
}
