/* =========================================================
   봄툰 BL 사주 — style.css
   ※ 모든 px 값은 시안(폭 420px 기준)에서 잰 값입니다.
     실제 화면 폭에 맞춰 #app 전체가 비율로 줄었다 늘었다(zoom) 하므로
     폰트 크기·여백은 시안 그대로 px 로 적어 두었어요.
   ========================================================= */

/* ---------- 폰트 (site/fonts 안의 파일을 직접 사용 · 에이투지체는 Regular/Bold, 가평한석봉체는 Bold만) ---------- */
@font-face { font-family: 'A2z'; src: url('../fonts/A2z-Light.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'A2z'; src: url('../fonts/A2z-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'A2z'; src: url('../fonts/A2z-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'A2z'; src: url('../fonts/A2z-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'GapyeongHanseokbongBigBrush'; src: url('../fonts/GapyeongHanseokbong-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

/* ---------- 변수 ---------- */
:root {
    --ink: #151515;            /* 검정 글자 */
    --pink: #ff3880;           /* 핫핑 버튼/포인트 */
    --gray-label: #757575;
    --gray-line: #e1e1e1;
    --gray-ph: #c6c6c6;
    --gray-sub: #575757;
    --gray-bg: #f5f5f5;
    --grad-pink:   linear-gradient(180deg, #FF2F9B 0%, #FF126E 100%);
    --grad-purple: linear-gradient(180deg, #B656F6 0%, #A42CF1 100%);
    --grad-cyan:   linear-gradient(180deg, #14B2D0 0%, #008DA8 100%);
    --font-body: 'A2z', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    --font-brush: 'GapyeongHanseokbongBigBrush', 'A2z', sans-serif;
    --z: 1;                    /* JS 가 화면 폭에 맞춰 갱신 (viewport / 420) */
    --h: 915px;                /* JS 가 화면 높이에 맞춰 갱신 */
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
    background: #ececf0;
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 400;
    word-break: keep-all;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    font-synthesis: none;
}
body.fonts-wait { opacity: 0; }
body { transition: opacity .2s; }
button, input, a { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { text-decoration: none; }
ul, ol { list-style: none; }
input { border: 0; outline: 0; background: none; border-radius: 0; }
.pink { color: var(--pink); }

/* 글자 그라데이션 */
.grad-pink, .grad-purple, .grad-cyan {
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.grad-pink   { background-image: var(--grad-pink); }
.grad-purple { background-image: var(--grad-purple); }
.grad-cyan   { background-image: var(--grad-cyan); }

/* ---------- 앱 프레임 (시안 폭 420) ---------- */
#app {
    width: 420px;
    margin: 0 auto;
    zoom: var(--z);
    background: #fefefe;
    position: relative;
    overflow-x: clip;          /* sticky 네비가 먹도록 hidden 대신 clip */
    min-height: var(--h);
    display: flex; flex-direction: column;
}
#main { flex: 1; display: flex; flex-direction: column; }
.screen { flex-shrink: 0; }
.screen.active { flex: 1 0 auto; }
.screen { display: none; width: 420px; position: relative; }
.screen.active { display: block; }

/* ---------- 공통 버튼 ---------- */
.main-btn {
    display: flex; align-items: center; justify-content: center;
    width: 364.5px; height: 48px; margin: 0 auto;
    border-radius: 24px;
    background: var(--pink); color: #fff;
    font-size: 20.2px; font-weight: 700;
    border: 2px solid var(--pink);
}
.main-btn.outline { background: #fff; color: var(--pink); }
.main-btn.black   { background: var(--ink); border-color: var(--ink); color: #fff; }
.main-btn:disabled { background: #c6c6c6; border-color: #c6c6c6; color: #888; cursor: default; }

/* =========================================================
   ① 인트로
   ========================================================= */
#intro {
    height: max(900px, calc(var(--h) - 108.8px));
    background: #fbd1e7 url('../assets/intro.jpg') center top / 420px auto no-repeat;
}
.intro-top {
    position: absolute; left: 0; right: 0; top: 45px;
    text-align: center;
    font-size: 16.33px; line-height: 24px; font-weight: 700;
}
.intro-btn {
    position: absolute; left: 26px; top: 747px; width: 368px; line-height: 0;
}
.intro-btn img { width: 100%; display: block; }
.intro-btn:active { transform: scale(.98); }
.intro-count {
    position: absolute; left: 0; right: 0; top: 849px;
    text-align: center; font-size: 14px; line-height: 24px; color: var(--ink);
}

/* =========================================================
   ② 입력
   ========================================================= */
#input, #loading { background: #fdfdfd; }
.back { position: absolute; left: 8px; top: 12px; width: 32px; height: 32px; display: none; align-items: center; justify-content: center; }
.in-logo { width: 150.8px; display: block; margin-top: 29px; flex: none; }
.in-head {
    margin-top: 26.9px; flex: none;
    text-align: center; color: #333;
    font-size: 21.4px; line-height: 28.7px; font-weight: 400;
}
#form { width: 364.5px; flex: 1; display: flex; flex-direction: column; }
.sp { min-height: 0; }
.sp.s1 { flex: 48 1 0; }
.sp.s2 { flex: 17 1 0; }
.field { margin-bottom: 31px; flex: none; }
.field:last-of-type { margin-bottom: 0; }
.field label:not(.chk) { display: block; height: 24px; line-height: 24px; font-size: 16.33px; color: var(--gray-label); }
.line { height: 38px; border-bottom: 1px solid var(--gray-line); }
.line input { width: 100%; height: 37px; font-size: 21px; color: var(--ink); }
.line input.c { text-align: center; }
.line input::placeholder { color: var(--gray-ph); opacity: 1; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 10.7px; }
.row-time { display: flex; align-items: flex-start; }
.row-time .line { width: 150px; }
.row-time .line:last-of-type { width: 150px; }
.row-time .unit { height: 37px; line-height: 37px; font-size: 21px; color: var(--ink); }
.row-time .unit:nth-of-type(1) { margin-left: 13px; width: 29px; }  /* 시 */
.row-time .unit:nth-of-type(2) { margin-left: auto; width: 22px; text-align: right; }   /* 분 */
.row-time .line + .unit + .line { margin-left: 0; }
.row-time .line.dis { border-bottom-color: #efefef; }
.chk { display: flex; align-items: center; height: 24px; margin-top: 15.5px; cursor: pointer; }
.chk input { position: absolute; opacity: 0; pointer-events: none; }
.chk .box {
    width: 19px; height: 19px; border: 1px solid #c6c6c6; border-radius: 2px;
    display: flex; align-items: center; justify-content: center; background: #fff;
}
.chk .box svg { opacity: 0; }
.chk input:checked + .box { background: var(--pink); border-color: var(--pink); }
.chk input:checked + .box svg { opacity: 1; }
.chk-text { margin-left: 12px; font-size: 17.9px; line-height: 24px; color: #333; }
.main-btn#btnSubmit { flex: none; margin: 0 0 31.4px; }

/* =========================================================
   ③ 로딩
   ========================================================= */
.ld-char { width: 311px; display: block; will-change: transform; }
.ld-char.bounce { animation: ldBounce 2.4s ease-in-out 1 both; }
@keyframes ldBounce {         /* 8px 씩 위 → 아래 → 위 → 아래 (2회) · 구간마다 ease-in-out 으로 부드럽게 */
    0%   { transform: translateY(0);    animation-timing-function: ease-in-out; }
    25%  { transform: translateY(-8px); }
    50%  { transform: translateY(0); }
    75%  { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}
.ld-text {
    margin-top: 43.1px; width: 100%;
    text-align: center; color: #333;
    font-size: 21px; line-height: 30.5px; font-weight: 400;
}
.ld-bar {
    position: relative; margin-top: 22.5px; width: 364.5px; height: 26px;
    border-radius: 13px; background: #f9f5f9;
}
.ld-fill {
    position: absolute; left: 0; top: 0; height: 100%; width: 26px;
    border-radius: 13px; background: var(--pink);
    transition: width .35s ease;
}
.ld-bar i { position: absolute; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }

/* =========================================================
   ④ 결과
   ========================================================= */
#result { background: #fefefe; }
.r-wrap { padding: 0 28px; }
.r-wrap > * { margin-left: auto; margin-right: auto; }

/* 결과 요약 카드 (배경 = 결과.png) */
.card1 {
    position: relative;
    margin-top: 46.8px;
    width: 364.5px; height: 585px;
    background: url('../assets/result-card.png') 0 0 / 100% 100% no-repeat;
    text-align: center; border-radius: 20px; overflow: hidden;
}
.c1-sub {
    position: absolute; left: 0; right: 0; top: 114px;
    font-family: var(--font-brush); font-weight: 700;
    font-size: 15.56px; line-height: 24px;
}
.c1-title {
    position: absolute; left: 0; right: 0; top: 132.5px;
    font-family: var(--font-brush); font-weight: 700;
    font-size: 30.7px; line-height: 44px; white-space: nowrap;
}
.c1-top { position: absolute; left: 50%; top: 35.5px; width: 66px; margin-left: -33px; }
.polaroid {
    position: absolute; width: 111px; height: 148px; background-color: #fff;
    box-shadow: 0 2px 10px rgba(190, 80, 130, .10);
    background-size: cover; background-position: center;
}
.p-left  { left: 67px;  top: 195px; transform: rotate(-5deg); }
.p-right { left: 188px; top: 205px; transform: rotate(4.5deg); }
.c1-body {
    position: absolute; left: 22px; right: 22px; top: 372px;
    font-size: 16.33px; line-height: 24.5px; white-space: pre-line;
}
.c1-logo { position: absolute; left: 50%; top: 617.5px; width: 81px; margin-left: -40.5px; }
.r-save { margin-top: 19px; }

/* 취향 / 공수 / 덕메 카드 */
.card {
    position: relative; isolation: isolate;
    width: 364.5px; margin-top: 28px; padding: 24px 14px 20.7px;
    border-radius: 20px; text-align: center;
}
.card.purple { background: #f8efff; }
.card.cyan   { background: #ecfbfe; }
.tex::before {            /* 컬러번 3% 텍스처를 미리 합성한 이미지를 카드 폭(936px 시안 기준)에 맞춰 깔아요 */
    content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
    background-repeat: repeat; background-size: 364.5px auto; pointer-events: none;
}
.card.purple::before { background-image: url('../assets/texture-purple.png'); }
.card.cyan::before   { background-image: url('../assets/texture-cyan.png'); }
.c-label { height: 24px; line-height: 24px; font-size: 16.33px; font-weight: 600; }
.purple .c-label { color: #c67bf7; }
.cyan   .c-label { color: #3dbfd8; }
.c-title {
    margin-top: 5px; height: 48px; line-height: 48px;
    font-family: var(--font-brush); font-weight: 700; font-size: 40.8px; white-space: nowrap;
}
.c-body { margin-top: 20.5px; padding: 0 9px; font-size: 16.33px; line-height: 27.77px; }
.c-body p + p { margin-top: 20.7px; }
/* 취향 카드: 꽃 아이콘 + 왼쪽 정렬 */
#tasteBody { margin-left: -14px; margin-right: -14px; padding: 0 23px 0 24px; text-align: left; }
#tasteBody .bl { position: relative; padding-left: 18px; word-break: keep-all; overflow-wrap: anywhere; }
#tasteBody .bl + .bl { margin-top: 20.5px; }
#tasteBody .bl::before {
    content: ''; position: absolute; left: 1.3px; top: 7.7px; width: 12.44px; height: 12.44px;
    background: url('../assets/bullet.png') center / contain no-repeat;
}
/* 덕메 카드: 공×수 칩 */
.c-chip {
    margin: 6px auto 0; height: 26px; line-height: 26px; background: none;
    color: #1aa7c4; font-size: 15.5px; font-weight: 300; letter-spacing: .05em; white-space: pre;
}
.cyan { padding-top: 17px; padding-bottom: 24px; }
.cyan .c-title { height: 48px; margin-top: 9px; }
.cyan .c-body { margin-top: 20px; padding: 0; }

/* 운명의 BL 추천 헤더 */
.pill-wrap { position: relative; text-align: center; height: 31px; }
.pill {
    position: relative; display: inline-block; min-width: 163px; padding: 0 16px; box-sizing: border-box; white-space: nowrap; height: 31px; line-height: 31px;
    border-radius: 16px; background: #fff4ff; color: var(--pink); font-size: 16.33px;
}
.pill::after {
    content: ''; position: absolute; left: 50%; bottom: -8px; margin-left: -6px;
    border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid #fff4ff;
}
.rec-pill { margin-top: 46.5px; }
.rec-title {
    margin-top: 15.7px; height: 48px; line-height: 48px; text-align: center;
    font-family: var(--font-brush); font-weight: 700; font-size: 40.8px;
}
.r-wrap + .banner { margin-top: 0; }
#result > .r-wrap:first-child { padding-bottom: 15.5px; }

/* 롤링 배너 (전체 폭 420 x 421) */
.banner { position: relative; width: 420px; height: 421px; overflow: hidden; background: var(--gray-bg); }
.banner-track { display: flex; width: 1680px; height: 100%; transition: transform .6s ease; }
.banner-track.no-anim { transition: none; }
.slide { flex: 0 0 420px; height: 100%; background: center / cover no-repeat var(--gray-bg); }
.dots { position: absolute; left: 0; right: 0; bottom: 14.5px; display: flex; justify-content: center; gap: 8.5px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.55); }
.dots i.on { background: #fff; }

/* 추천 작품 정보 */
.work-pair { margin-top: 25.3px; height: 24px; line-height: 24px; text-align: center; font-size: 16.33px; color: var(--pink); }
.work-title {
    margin-top: 9px; text-align: center;
    font-size: 28px; line-height: 36.9px; font-weight: 700; color: var(--ink);
}
.link-btn { margin-top: 26.6px; }
.link-btn + .link-btn { margin-top: 9.5px; }

/* SNS 공유 이벤트 (연분홍 구역) */
.sns {
    margin-top: 49.4px; padding: 47.4px 28px 48px; text-align: center;
    background: linear-gradient(180deg, #fdecf2 0%, #fef7fa 100%);
}
.sns-pill { position: relative; height: 34.6px; }
.sns-pill span {
    position: relative; display: inline-block; width: 164px; height: 34.6px; line-height: 34.6px;
    border-radius: 17.3px; background: #fff; color: #ff3880; font-size: 16.33px;
}
.sns-pill span::after {
    content: ''; position: absolute; left: 50%; bottom: -8.5px; margin-left: -6px;
    border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid #fff;
}
.sns-title { margin-top: 20.5px; color: var(--ink); font-size: 29.5px; line-height: 46.9px; white-space: nowrap; font-weight: 700; }
.sns-title mark { background: #ff3880; color: #fff; padding: 2px 5px; }
.sns-img { margin: 18px auto 0; width: 364.5px; height: 364.9px; background: #f5f5f5; }
.prize { margin-top: 20.3px; padding: 16.33px; border-radius: 16px; background: #fff; }   /* 디자인: 안쪽 여백 42px */
.prize li { display: flex; align-items: center; height: 28px; font-size: 16.33px; margin-top: 7px;   /* 디자인: 글자 42 / 줄 높이 72 / 줄 간격 18 */ white-space: nowrap; text-align: left; }
.prize li:first-child { margin-top: 0; }
.prize em { flex: none; width: 36px; font-style: normal; font-weight: 700; color: #ff3880; }
.prize span { flex: 1; min-width: 0; margin-left: 0; font-weight: 400; color: var(--ink); }
.prize b { flex: none; text-align: right; font-weight: 400; color: var(--ink); }
.ev-card { margin-top: 19.9px; padding: 39px 16.8px 45.3px; border-radius: 16px; background: #fff; text-align: left; }
.ev-head { text-align: center; white-space: nowrap; font-size: 20.9px; line-height: 29.7px; color: var(--ink); }
.ev-head b { font-weight: 700; color: var(--ink); padding: 0 2.5px; margin: 0 -2.5px;
    background: linear-gradient(to top, transparent 0, transparent 1px, #ff9bbf 1px, #ff9bbf 9.3px, transparent 9.3px); }   /* 형광펜 밑줄 */
.ev-sub { margin-top: 37.2px; height: 28px; line-height: 28px; font-size: 16.33px; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.steps { margin-top: 10.6px; }
.steps li { display: flex; font-size: 16px; line-height: 27.7px; margin-top: 6.7px; color: var(--ink); }
.steps li:first-child { margin-top: 0; }
.steps span { white-space: nowrap; }
.steps i { width: 35.2px; flex: none; font-style: normal; font-weight: 700; color: #ff3880; }
.steps strong { font-weight: 700; color: var(--ink); }
.ev-info { margin-top: 37.9px; }
.ev-info > div { display: flex; align-items: center; height: 28px; margin-top: 13px; }
.ev-info > div:first-child { margin-top: 0; }
.ev-info dt { flex: none; width: 84px; margin-right: 11px; height: 28px; line-height: 28px; border-radius: 14px; background: #ff3880; color: #fff; font-size: 14.4px; text-align: center; }
.ev-info dd { font-size: 15.2px; color: var(--ink); white-space: nowrap; }
.ev-info small { margin-left: 4px; font-size: 12.5px; color: var(--ink); }
.sns-x {
    display: block; width: 331px; height: 48px; margin: 22.1px auto 0; border-radius: 24px;
    background: #ff3880; color: #fff; font-size: 20.2px; font-weight: 700;
}
.sns-note { margin-top: 12.5px; font-size: 13px; line-height: 20px; color: var(--ink); }
.sns-note b { font-weight: 700; }

.r-bottom { padding-top: 47px; padding-bottom: 112px; }
.r-bottom .main-btn + .main-btn { margin-top: 9.5px; }

/* 토스트 */
#toast {
    position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px);
    background: rgba(21,21,21,.88); color: #fff; font-size: 14px; line-height: 20px;
    padding: 10px 18px; border-radius: 20px; opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s; z-index: 99; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   네비 / 푸터 / 한 화면 맞춤(입력·로딩은 스크롤 없이)
   ========================================================= */
#nav {
    position: sticky; top: 0; z-index: 30; flex: none;
    height: 42px; background: #fff; border-bottom: 1px solid #ededed;  /* 디자인 108px + 라인 */
    display: flex; align-items: center; justify-content: center;
}
.nav-logo { width: 100.5px; height: auto; display: block; }  /* 로고 크기는 디자인 확인 후 조정 */  /* 로고 파일 받으면 교체 */
#foot {
    flex: none; height: 54.4px; padding: 0 11.7px;
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; color: #8c8c8c; font-size: 10.3px; line-height: 1; white-space: nowrap;
}
#foot .f-l { display: flex; align-items: center; gap: 10px; }
#foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#foot .f-r { color: #151515; }
#app[data-screen="intro"] #nav { height: 54.4px; border-bottom: 0; }
#app[data-screen="intro"] .nav-logo { width: 125px; }
#foot { display: none; }
#app[data-screen="intro"] #foot { display: flex; }   /* 푸터는 인트로에서만 */

/* 입력·로딩: 높이 = 화면 − 네비 − 푸터. 모자라면 JS 가 --s 로 전체를 비율 축소 */
.screen.fit { overflow: hidden; }
.fit-in {
    box-sizing: border-box; width: 420px; margin: 0 auto; position: relative;
    zoom: var(--s, 1);
    display: flex; flex-direction: column; align-items: center;
}
.fit-in.center { justify-content: center; padding-bottom: 40px; }
