/* 메인(허브) "살아있는 만세력" P0 — 각인 엔진, 신뢰 낙관, 고정 CTA, 리빌.
   색은 UMAUMA 5색 + 흰색만, 반투명은 rgb() 표기만 쓴다. 글자는 15px 아래 금지. */

/* ── 각인 엔진 (다크 히어로 위) ───────────────────────── */

.hero-engine {
    margin: 4px 0 28px;
}

.hero-pillars {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    max-width: 430px;
    margin: 0 auto 20px;
}

.hero-col {
    display: grid;
    gap: 8px;
}

.hero-col-head {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    font-size: 15px;
    font-weight: 700;
    color: rgb(242 238 216 / 75%);
}

.hero-col-head b {
    font-size: 18px;
    font-weight: 800;
    color: #F2EED8;
}

.hero-tile {
    position: relative;
    min-height: 78px;
    padding: 9px 4px 10px;
    border: 2px dashed rgb(242 238 216 / 30%);
    border-radius: 14px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 2px;
    background: rgb(255 255 255 / 5%);
}

.hero-tile.is-filled {
    border: 2px solid #FFFFFF;
    background: #FFFFFF;
    box-shadow: 0 10px 26px rgb(1 12 28 / 45%);
}

.hero-glyph {
    font-family: "Nanum Myeongjo", "Noto Serif KR", "AppleMyungjo", serif;
    font-size: clamp(29px, 7.6vw, 38px);
    font-weight: 800;
    line-height: 1.05;
    color: #011C40;
}

.hero-tile.is-목 .hero-glyph { color: #1D64F2; }
.hero-tile.is-화 .hero-glyph { color: #F24822; }
.hero-tile.is-토 .hero-glyph { color: #F24822; }
.hero-tile.is-금 .hero-glyph { color: #011C40; }
.hero-tile.is-수 .hero-glyph { color: #011C40; }

.hero-reading {
    font-size: 15px;
    font-weight: 700;
    color: #1243A6;
}

/* 일간(나를 뜻하는 글자) 표시 */
.hero-tile.is-me {
    outline: 3px solid #F24822;
    outline-offset: 2px;
}

/* 시간을 아직 모르는 시주 칸 */
.hero-tile.is-empty .hero-glyph { color: rgb(242 238 216 / 65%); }
.hero-tile.is-empty .hero-reading { color: rgb(242 238 216 / 65%); }

/* 도장이 착지할 때 퍼지는 먹 링 */
.hero-ring {
    position: absolute;
    inset: -7px;
    border: 2px solid #F2EED8;
    border-radius: 18px;
    opacity: 0;
    pointer-events: none;
}

.hero-tile.is-stamped .hero-ring {
    animation: hero-ring 0.55s ease-out;
}

@keyframes hero-ring {
    0% { opacity: 0.55; transform: scale(0.86); }
    100% { opacity: 0; transform: scale(1.22); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-tile.is-stamped .hero-ring { animation: none; }
}

/* ── 히어로 생년월일 입력 ───────────────────────── */

.hero-birth {
    max-width: 430px;
    margin: 0 auto;
}

.hero-birth .field-label {
    display: block;
    margin-bottom: 8px;
    color: #F2EED8;
    text-align: center;
}

.hero-birth-selects {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 8px;
}

.hero-status {
    margin: 12px auto 0;
    max-width: 430px;
    font-size: 16px;
    line-height: 1.5;
    color: #F2EED8;
    text-align: center;
}

.ph-hero .ph-hero-timer {
    margin-top: 26px;
}

/* ── 3장 · 갈림길의 밤 ───────────────────────── */

.night {
    position: relative;
    padding: 96px 0 120px;
    background: #011C40;
    overflow: clip;
}

.night-sky {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.night-sky canvas {
    position: sticky;
    top: 0;
    display: block;
    width: 100%;
    height: 100vh;
}

.night-body {
    position: relative;
}

.night-intro {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #F2EED8;
    text-align: center;
}

.night-title {
    margin: 0 0 72px;
    font-size: clamp(31px, 7vw, 44px);
    font-weight: 900;
    line-height: 1.4;
    letter-spacing: -0.02em;
    color: #FFFFFF;
    text-align: center;
    word-break: keep-all;
}

.night-scenes {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 76px;
}

.night-trail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.night-trail path {
    stroke: #F2EED8;
    stroke-width: 2.5px;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgb(242 238 216 / 65%));
    opacity: 0.85;
}

.night-scene {
    position: relative;
    margin: 0;
    width: min(86%, 420px);
    display: flex;
    flex-direction: column;
}

.night-scene.is-left { align-self: flex-start; }
.night-scene.is-right { align-self: flex-end; }

.night-cut {
    overflow: hidden;
    border: 3px solid #FFFFFF;
    border-radius: 18px;
    background: #011C40;
    box-shadow: 6px 6px 0 #F24822;
}

.night-cut img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.night-bubble {
    position: relative;
    z-index: 1;
    align-self: center;
    width: calc(100% - 22px);
    margin: -26px 0 0;
    padding: 18px 20px;
    border: 2px solid #011C40;
    border-radius: 22px;
    background: rgb(255 255 255 / 97%);
    color: #011C40;
    font-size: clamp(19px, 4.6vw, 24px);
    font-weight: 800;
    line-height: 1.5;
    letter-spacing: -0.02em;
    text-align: center;
    word-break: keep-all;
    box-shadow: 0 8px 0 rgb(1 12 28 / 35%);
}

/* ── 4장 · 족자 진열대 ───────────────────────── */

body.home-manse [data-shelf] {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(82vw, 480px);
    gap: 18px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    padding: 8px 4px 18px;
    scrollbar-width: thin;
}

body.home-manse [data-shelf] .ph-card {
    scroll-snap-align: center;
}

/* 족자 봉 — 카드 맨 위의 남색 봉과 파란 손잡이 */
body.home-manse [data-shelf] .ph-card::before {
    content: "";
    display: block;
    height: 13px;
    background:
        radial-gradient(circle at 11px 6.5px, #1243A6 4.5px, transparent 5.5px),
        radial-gradient(circle at calc(100% - 11px) 6.5px, #1243A6 4.5px, transparent 5.5px),
        #011C40;
}

/* ── 신뢰 낙관 섹션 ───────────────────────── */

.home-trust .ph-container {
    position: relative;
}

.home-trust-line {
    margin: 0;
    font-size: clamp(25px, 5.8vw, 35px);
    line-height: 1.55;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #011C40;
    word-break: keep-all;
}

.home-trust-seal {
    display: block;
    width: 58px;
    height: 58px;
    margin-top: 24px;
    border: 3px solid #F24822;
    border-radius: 13px;
    transform: rotate(-3deg);
    box-shadow: 0 10px 24px rgb(242 72 34 / 30%);
}

/* ── 하단 고정 CTA (계약: /saju/ 주 CTA는 이 하나) ───────────────────────── */

.home-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgb(255 255 255 / 93%);
    backdrop-filter: blur(10px);
    border-top: 1.5px solid rgb(1 28 64 / 14%);
}

.home-cta-inner {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.home-cta-timer {
    display: flex;
    flex-direction: column;
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #011C40;
    white-space: nowrap;
}

.home-cta-timer b {
    font-size: 21px;
    color: #F24822;
    font-variant-numeric: tabular-nums;
}

.home-cta-button {
    flex: 1;
    min-height: 58px;
    font-size: 19px;
}

body.has-home-cta {
    padding-bottom: 112px;
}

@media (max-width: 560px) {
    .home-cta-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 7px;
    }

    .home-cta-timer {
        flex-direction: row;
        justify-content: center;
        align-items: baseline;
        gap: 8px;
    }

    body.has-home-cta {
        padding-bottom: 148px;
    }
}
