/* =====================================================================
   FFFF · 디자인 컨셉 (2026-10-20): StylaDay 다이어리 톤 × 코발트·탠저린·체커
   레퍼런스: ① 옷 다이어리 앱(크림 바탕, 흰 카드, 옷걸이 레일, 스티커), ② 코발트 블루 + 탠저린 오렌지 + 체커 패턴 일러스트.
   apple.css(흰색 시스템 톤) 위에 덮어 색·서체·장식을 컨셉으로 되돌리고, 로그인 배경의 사주 카드 모션과 화면별 타이포 모션을 더한다.
   기준 기기 iPhone 17(402×874) + 데스크톱 웹.
   ===================================================================== */
:root {
  --bg: #f5f1ea; --bg2: #ebe5db; --card: #fffdf8; --text: #17161a; --muted: #857d72; --line: #e3dcd1; --ink: #17161a;
  --cobalt: #2b47c9; --cobalt-s: #e4e8f8; --tangerine: #ef8a2c; --tangerine-s: #fdebd8;
  --blue: var(--cobalt); --blue-h: #2340b8; --blue-s: var(--cobalt-s); --link: var(--cobalt);
  --lav: #c9d1f3; --lav-s: #e9ecf9; --pink: #f1c6c0; --pink-s: #fbe9e5; --mint: #cfe3d3; --mint-s: #eaf3ec; --butter: #f7cf93; --butter-s: #fdebd8; --sky: #cdd7f1; --sky-s: #e9edf9; --peach: #f6c9a8; --peach-s: #fdeee3;
  --shadow: 0 10px 30px rgba(40,32,24,.08), 0 2px 6px rgba(40,32,24,.05); --shadow-s: 0 4px 12px rgba(40,32,24,.08);
  --display: 'Syne', 'Pretendard Variable', Pretendard, sans-serif;
  --title: 'Hahmlet', 'Pretendard Variable', 'Apple SD Gothic Neo', serif;
  --checker: repeating-conic-gradient(var(--cobalt) 0 25%, var(--tangerine) 0 50%) 0 0 / 10px 10px;
  --rainbow: linear-gradient(90deg, var(--cobalt) 0%, #5b6fe0 45%, var(--tangerine) 100%);
}
html, body { background: var(--bg); color: var(--text); overflow-x: hidden; }
#view-home, #view-start, #view-pick, body.app .al { background: var(--bg); }
::selection { background: var(--lav); }
a { color: var(--link); }

/* ---------- 헤더·로고: 윤곽선 워드마크 + 돌아가는 체커 점 ---------- */
.top { background: rgba(245,241,234,.86); border-bottom: 1px solid rgba(23,22,26,.06); }
.logo .wm { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: .2em; gap: 4px; }
.logo .wm span { color: transparent; -webkit-text-stroke: 1.3px var(--text); transition: color .3s; }
.logo:hover .wm span { color: var(--text); }
.logo .wm::after { content: ''; width: 10px; height: 10px; border-radius: 2px; background: var(--checker); background-size: 5px 5px; margin-left: 6px; animation: spin-checker 6s linear infinite; }
@keyframes spin-checker { to { transform: rotate(360deg); } }
.logo .wm.wm-intro > span { animation: wmdrop .7s cubic-bezier(.34,1.56,.64,1) both; animation-delay: calc(var(--k) * 70ms + 80ms); }
.logo .slogan { font-family: var(--display); letter-spacing: .06em; font-size: 10px; color: var(--muted); }
nav { background: var(--card); padding: 4px; border-radius: 999px; box-shadow: var(--shadow-s); }
nav a { color: var(--muted); font-weight: 600; border-radius: 999px; padding: 6px 14px; }
nav a.on, nav a.on:hover { color: #fff !important; }
nav .nav-ind { display: block; }
.status .wallet-chip { background: var(--card); box-shadow: var(--shadow-s); padding: 5px 12px; border-radius: 999px; font-weight: 700; }

/* ---------- 제목 서체·카드·버튼 ---------- */
.h1, .h2, .td-title, .pk-q, .ob-q, .al-title, .hm-title, .hm-h2, .mg-headline, .rd-title, .rec-tag, #today-greet { font-family: var(--title); }
.h1 { font-weight: 700; letter-spacing: -.02em; }
.h2 { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.h2::before { content: ''; display: inline-block !important; width: 8px; height: 8px; border-radius: 2px; background: var(--checker); background-size: 4px 4px; }
.panel { background: var(--card); box-shadow: var(--shadow); position: relative; }
.panel::before { content: ''; display: block !important; position: absolute; right: 18px; top: -8px; width: 40px; height: 12px; border-radius: 3px; background: var(--checker); transform: rotate(-3deg); opacity: 1; }
.panel-title { font-weight: 800; }
.btn, .ob-next, .pk-go { background: var(--cobalt); }
.btn:hover, .ob-next:hover { background: var(--blue-h); }
.btn.ghost { background: var(--bg2); color: var(--text); }
.chip.on, .tchip.high, .pillar.me, .pm.me, .rd-dm, .mg-tag, nav a.on { background: var(--text); }
.pk-card.on, .ob-choice button.on { border-color: var(--cobalt); background: var(--cobalt-s); }
.pk-card b, .td-eyebrow #td-label, .ob-back, .ob-skip, .ob-ghost, .al-guest, .pk-me, .td-change { color: var(--cobalt); }
.pk-quick button.on, .ob-cam { background: var(--text); }
input, select, textarea, .ob-input { background: #fff; border-color: var(--line); }
input:focus, .ob-input:focus { border-color: var(--cobalt); box-shadow: 0 0 0 4px rgba(43,71,201,.16); }
.ob-prog i { background: var(--checker); background-size: 8px 8px; }
.ob-switch input:checked + .sw-ui { background: var(--cobalt); }
.toast { background: rgba(23,22,26,.92); }
.ring .val { stroke: var(--cobalt); }
.tag { box-shadow: var(--shadow-s); }
.tag::after { content: ''; display: block !important; position: absolute; right: 12px; top: 12px; width: 18px; height: 6px; border-radius: 2px; background: var(--checker); background-size: 6px 6px; transform: rotate(-8deg); }
.lk { background: var(--bg2); }
.cal .day.today { background: var(--cobalt-s); box-shadow: inset 0 0 0 2px var(--cobalt); }

/* ---------- 화면 머리(3초 안에 읽히게): 작은 라벨 + 큰 제목 + 한 줄 설명 ---------- */
.sc-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--cobalt); margin-bottom: 8px; }
.sc-eyebrow::before { content: ''; width: 14px; height: 6px; border-radius: 2px; background: var(--checker); background-size: 5px 5px; }
.ob-top .ob-step-label { font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--muted); text-align: center; white-space: nowrap; margin-bottom: 4px; }
.td-eyebrow, .pk-hint { font-weight: 500; }

/* ---------- 로그인: 떠다니는 사주 카드(실사 전신 + 티어·점수·태그) ---------- */
.sc-stage { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.sc-card { position: absolute; width: var(--w, 190px); aspect-ratio: 3 / 4.6; border-radius: 18px; background: var(--card); box-shadow: 0 24px 60px rgba(40,32,24,.18), 0 2px 6px rgba(40,32,24,.06); overflow: hidden; transform: rotate(var(--r, 0deg)); animation: sc-float var(--t, 9s) ease-in-out infinite alternate, sc-in 1.2s cubic-bezier(.16,1,.3,1) both; animation-delay: var(--d, 0s), calc(var(--d, 0s) * .4); opacity: var(--o, 1); will-change: transform; }
.sc-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.sc-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(23,22,26,.72) 0%, rgba(23,22,26,.25) 38%, transparent 62%); }
.sc-tier { position: absolute; left: 10px; top: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 17px; color: #fff; background: var(--cobalt); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.sc-tier.s { background: linear-gradient(135deg, #ef8a2c, #ffc26b); color: #17161a; } .sc-tier.a { background: var(--cobalt); } .sc-tier.b { background: #6c6f7a; }
.sc-tier small { position: absolute; right: -4px; bottom: -4px; font-size: 7px; letter-spacing: .08em; background: #fff; color: var(--text); border-radius: 4px; padding: 1px 3px; }
.sc-tape { position: absolute; right: 12px; top: -5px; z-index: 2; width: 44px; height: 13px; border-radius: 3px; background: var(--checker); transform: rotate(6deg); }
.sc-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 12px 12px 12px; color: #fff; }
.sc-date { font-family: var(--display); font-size: 9px; letter-spacing: .12em; opacity: .85; }
.sc-score { display: flex; align-items: baseline; gap: 6px; margin: 2px 0 6px; }
.sc-score b { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.sc-score span { font-size: 10px; opacity: .85; }
.sc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.sc-tags i { font-style: normal; font-size: 9.5px; font-weight: 700; padding: 3px 7px; border-radius: 999px; background: rgba(255,255,255,.16); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.22); }
.sc-tags i.hi { background: var(--tangerine); border-color: var(--tangerine); color: #17161a; }
.sc-pal { display: flex; gap: 4px; margin-top: 7px; } .sc-pal i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.7); }
.sc-with { position: absolute; right: 10px; top: 10px; z-index: 2; font-size: 9px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--text); }
@keyframes sc-float { from { transform: rotate(var(--r, 0deg)) translateY(0); } to { transform: rotate(calc(var(--r, 0deg) + 1.5deg)) translateY(-14px); } }
@keyframes sc-in { from { opacity: 0; transform: rotate(var(--r, 0deg)) translateY(40px) scale(.94); } }

.hm-title { background: var(--rainbow); -webkit-background-clip: text; background-clip: text; }
.hm-title.kin .wi { background: var(--rainbow); -webkit-background-clip: text; background-clip: text; }
.hm-sub { font-family: var(--font); font-weight: 600; }
.hm-sub em { font-style: normal; color: var(--cobalt); }
.hm-points { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: -14px 0 28px; }
.hm-points span { font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow-s); }
.hm-points span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--checker); background-size: 4px 4px; margin-right: 7px; vertical-align: -1px; }
.hm-points span.o::before { background: var(--tangerine); } .hm-points span.b::before { background: var(--cobalt); }
.g-btn { background: var(--text); } .g-btn:hover { background: var(--cobalt); }
.hm-final { background: var(--text); }
.hm-card-wrap, .s-notes { font-family: var(--font); }

/* 앱 로그인: 첫 슬라이드 뒤로 카드 세 장이 부채꼴로 떠 있고 제목이 그 위에 */
body.app .al { background: var(--bg); }
body.app .al-title { font-size: clamp(36px, 10.5vw, 46px); margin-bottom: 10px; }
body.app .al-sub { font-size: 14.5px; max-width: 340px; }
body.app .al .hm-points { margin: 10px 0 0; gap: 6px; } body.app .al .hm-points span { font-size: 11.5px; padding: 5px 9px; }
.al-card { box-shadow: var(--shadow); font-family: var(--font); }

/* ---------- 설정 도우미·날 고르기: 제목 키네틱 + 요소 순차 등장 ---------- */
.ob-step.on .ob-hint, .ob-step.on .ob-input, .ob-step.on .ob-choice, .ob-step.on .ob-photo, .ob-step.on .ob-pair, .ob-step.on .ob-group, .ob-step.on .ob-switch, .ob-step.on .ob-seg { animation: rise .7s cubic-bezier(.16,1,.3,1) both; }
.ob-step.on .ob-hint { animation-delay: 90ms; } .ob-step.on .ob-input, .ob-step.on .ob-choice, .ob-step.on .ob-photo, .ob-step.on .ob-pair, .ob-step.on .ob-group, .ob-step.on .ob-seg { animation-delay: 180ms; } .ob-step.on .ob-switch { animation-delay: 260ms; }
.ob-frame { box-shadow: inset 0 0 0 2px var(--line); }
.ob-photo:not(.has) .ob-frame::after { content: ''; position: absolute; inset: 10px; border: 2px dashed var(--cobalt); border-radius: 22px; opacity: .55; animation: ob-pulse 2.4s ease-in-out infinite; }
@keyframes ob-pulse { 0%, 100% { transform: scale(1); opacity: .35; } 50% { transform: scale(1.03); opacity: .8; } }
.ob-seg { display: flex; gap: 8px; flex-wrap: wrap; }
.ob-seg button { flex: 1 1 60px; height: 52px; border-radius: 14px; border: 2px solid transparent; background: var(--bg); font: inherit; font-size: 18px; font-weight: 700; color: var(--text); cursor: pointer; transition: border-color .2s, background .2s; }
.ob-seg button.on { border-color: var(--cobalt); background: var(--cobalt-s); color: var(--cobalt); }
.ob-mbti { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.ob-mbti .pair { display: grid; grid-template-rows: 1fr 1fr; gap: 6px; }
.ob-mbti .pair button { height: 52px; border-radius: 12px; border: 2px solid transparent; background: var(--bg); font: inherit; font-family: var(--display); font-size: 18px; font-weight: 800; cursor: pointer; color: var(--muted); }
.ob-mbti .pair button.on { border-color: var(--tangerine); background: var(--tangerine-s); color: var(--text); }
.ob-mbti-out { margin-top: 12px; font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: .12em; color: var(--cobalt); min-height: 1.3em; }
.ob-sub { font-size: 13px; font-weight: 700; color: var(--muted); margin: 18px 0 8px; }
.pk-choice .pk-card { animation: rise .7s cubic-bezier(.16,1,.3,1) both; box-shadow: var(--shadow-s); }
.pk-choice .pk-card:nth-child(2) { animation-delay: 120ms; }
.pk-card::after { content: ''; position: absolute; right: 14px; top: -6px; width: 34px; height: 11px; border-radius: 3px; background: var(--checker); transform: rotate(5deg); }
.pk-card { position: relative; }
.pk-date, .pk-photo { animation: rise .6s cubic-bezier(.16,1,.3,1) both; animation-delay: 220ms; }
.pk-st.ok { background: var(--mint-s); color: #2f8a5a; } .pk-st.run { background: var(--cobalt-s); color: var(--cobalt); }

/* ---------- 그날의 사주·기록·보관함·내 정보: 소제목 와이프와 카드 순차 등장은 style.css 모션을 그대로 쓴다 ---------- */
.td-head { align-items: flex-end; }
.td-title { font-family: var(--title); }
.hero-card .h1 b { background: linear-gradient(transparent 62%, var(--butter) 62%); padding: 0 2px; color: inherit; }
.ring circle { stroke: var(--bg2); }
.hero-right .weather { background: var(--bg2); }
.tk { color: #d8d1c6; } .tk.fill { color: var(--c, var(--cobalt)); } .tk.hj { color: var(--text); }
.tk-sep { width: 12px; height: 12px; border-radius: 3px; background: var(--checker); transform: rotate(45deg); }
.mg-map, .mg-rxrow, .mg-rel li, .rd-item { background: var(--bg); }
.today-head .muted, .hm-note { color: var(--muted); }
.cat { box-shadow: var(--shadow-s); }
#card { background: var(--bg2); }

@media (prefers-reduced-motion: reduce) {
  .sc-card, .logo .wm::after, .ob-photo:not(.has) .ob-frame::after, .ob-step.on *, .pk-choice .pk-card, .pk-date, .pk-photo { animation: none !important; }
}

/* 확인 목록이 길어도 아래 버튼에 가려지지 않게: 단계 영역 안에서 스크롤하고 목록 끝에 여백 */
.ob-step[data-step=review] { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 24px; }
.ob-step[data-step=review] .ob-group { margin-bottom: 16px; }

/* ---------- 그날의 사주: 접힘 섹션 ---------- */
.td-fold { margin: 6px 0 18px; }
.td-fold > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); padding: 8px 14px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow-s); }
.td-fold > summary::-webkit-details-marker { display: none; }
.td-fold > summary::after { content: '▾'; font-size: 12px; } .td-fold[open] > summary::after { content: '▴'; }
.td-fold[open] > summary { margin-bottom: 12px; color: var(--text); }
.td-fold .panel { margin-top: 0; }
.tag { position: relative; } .tag-go { position: absolute; right: 14px; bottom: 12px; font-size: 11px; font-weight: 800; color: var(--cobalt); }
.mg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }

/* ---------- 플랜 ---------- */
.plan-tabs { margin: 14px 0 16px; display: flex; } .plan-tabs button { flex: 1; }
.outfit-rows { display: grid; gap: 10px; margin: 10px 0 12px; }
.or { background: var(--bg); border-radius: 16px; padding: 12px 14px; }
.or.none { background: var(--tangerine-s); }
.or-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.or-slot { font-weight: 800; font-size: 14px; }
.or-need { font-style: normal; font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--text); color: #fff; }
.or-need.point { background: var(--tangerine); color: #17161a; } .or-need.optional { background: var(--bg2); color: var(--muted); }
.or-body { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; }
.or-body .thumb { width: 56px; height: 68px; object-fit: cover; border-radius: 10px; background: #fff; display: grid; place-items: center; font-size: 22px; }
.or-body .thumb.none { color: var(--muted); border: 2px dashed var(--line); }
.or-main b { display: block; font-size: 14px; } .or-main .src { font-size: 11px; color: var(--muted); } .or-main .src.closet { color: #2f8a5a; font-weight: 700; } .or-main .mwhy { font-size: 11px; color: var(--muted); margin-top: 2px; }
.or-acts { display: flex; flex-direction: column; gap: 6px; }
.or .tiers { margin-top: 10px; display: grid; gap: 6px; }
.tiers .tier { display: grid; grid-template-columns: 28px 1fr auto; gap: 6px 10px; align-items: center; background: #fff; border-radius: 12px; padding: 8px 10px; text-decoration: none; color: var(--text); font-size: 13px; }
.tiers .tier .t { font-family: var(--display); font-weight: 800; color: var(--cobalt); } .tiers .tier .n { font-weight: 700; } .tiers .tier .p { font-weight: 700; } .tiers .tier .s, .tiers .tier .z { grid-column: 2; font-size: 11px; color: var(--muted); }
.tiers .tier .acts { grid-column: 3; grid-row: 1 / span 2; display: flex; gap: 6px; }
.more-row { display: flex; align-items: center; gap: 10px; }
.pk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.pk-item { border: 2px solid transparent; background: var(--bg); border-radius: 14px; padding: 8px; font: inherit; cursor: pointer; display: grid; gap: 4px; text-align: center; }
.pk-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; } .pk-item span { font-size: 12px; font-weight: 700; } .pk-item small { font-size: 10px; color: var(--muted); }
.pk-item:hover { border-color: var(--cobalt); }
#pick-sheet .sh-body { padding: 0 18px 20px; } #pick-sheet .sh-head { display: flex; justify-content: flex-end; padding: 10px 12px 0; } #pick-sheet .sh-close { border: 0; background: var(--bg2); width: 30px; height: 30px; border-radius: 50%; font: inherit; cursor: pointer; }
.ideas .idea { background: var(--bg); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; font-size: 13px; }

/* 카드 플립: 뒷면(사주) 먼저, 앞면은 전신 사진 + 티어 */
.card-flip { position: relative; width: min(100%, 360px); aspect-ratio: 3 / 4; margin: 0 auto 14px; perspective: 1400px; }
.cf-side { position: absolute; inset: 0; border-radius: 22px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .8s cubic-bezier(.16,1,.3,1); box-shadow: 0 20px 60px rgba(40,32,24,.14); background: var(--card); }
.cf-back { transform: rotateY(0deg); } .cf-front { transform: rotateY(180deg); }
.card-flip.front .cf-back { transform: rotateY(-180deg); } .card-flip.front .cf-front { transform: rotateY(0deg); }
.cf-back canvas { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; box-shadow: none; transform: none; }
.cf-front img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cf-front::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(23,22,26,.72) 0%, rgba(23,22,26,.2) 40%, transparent 62%); pointer-events: none; }
.cf-front .sc-tier { width: 46px; height: 46px; font-size: 22px; left: 14px; top: 14px; } .cf-front .sc-tier.wait { background: #999; }
.cf-front .sc-body { padding: 16px; } .cf-front .sc-score b { font-size: 44px; } .cf-front .sc-tags i { font-size: 11px; }
.cf-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 30px; font-size: 14px; color: var(--muted); line-height: 1.6; background: var(--bg); }
.card-panel .card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
body[data-view=photos] .top, body[data-view=photos] nav, body[data-view=photos] .dev-chip { display: none; }
body[data-view=photos] main { max-width: none; padding: 0; }

/* 상품 목록 썸네일 */
.tiers .tier { grid-template-columns: 44px 28px 1fr auto; }
.tiers .tier .tp { grid-row: 1 / span 2; width: 44px; height: 54px; border-radius: 8px; background: var(--bg2); display: grid; place-items: center; font-weight: 800; color: var(--muted); overflow: hidden; }
.tiers .tier .tp img { width: 100%; height: 100%; object-fit: cover; }
.tiers .tier .s, .tiers .tier .z { grid-column: 3; }
.tiers .tier .acts { grid-column: 4; }
.or-body .thumb.shop { font-weight: 800; color: var(--muted); background: var(--bg2); }

/* 왜 이 기운인가: 세 줄 */
.why-3 { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.why-3 li { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start; font-size: 14px; line-height: 1.55; }
.why-3 .src { font-style: normal; font-size: 11px; font-weight: 800; padding: 4px 0; border-radius: 8px; background: var(--text); color: #fff; text-align: center; margin-top: 2px; }
/* 자세히: 카드 격자 → 누르면 시트 */
.dcards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 24px; }
@media (min-width: 761px) { .dcards { grid-template-columns: repeat(4, 1fr); } }
.dcard { position: relative; text-align: left; background: var(--card); border: 0; border-radius: 18px; padding: 16px 14px 14px; font: inherit; color: var(--text); cursor: pointer; box-shadow: var(--shadow-s); display: grid; gap: 4px; animation: rise .6s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--i) * 60ms); transition: transform .25s; }
.dcard:hover { transform: translateY(-2px); }
.dcard .dc-ic { font-family: var(--title); font-size: 26px; font-weight: 800; color: var(--cobalt); line-height: 1; }
.dcard b { font-size: 15px; }
.dcard .dc-sub { font-size: 12px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dcard::after { content: '›'; position: absolute; right: 12px; top: 12px; color: var(--line); font-size: 18px; }
.detail-sheet { width: min(560px, 100vw); max-width: 100vw; max-height: 88vh; max-height: 88dvh; border-radius: 22px; }
@media (max-width: 760px) { .detail-sheet { margin: auto 0 0; border-radius: 22px 22px 0 0; } }
.detail-sheet .sh-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.detail-sheet .sh-title { font-family: var(--title); font-size: 18px; font-weight: 700; }
.detail-sheet .sh-close { border: 0; background: var(--bg2); width: 30px; height: 30px; border-radius: 50%; font: inherit; cursor: pointer; }
.detail-sheet .sh-body { padding: 4px 18px calc(24px + env(safe-area-inset-bottom)); }
.detail-sheet .sh-body > div { display: block; }
.detail-sheet .rd-item { background: var(--bg); }

/* ---------- 홈: FFFF 타이포 모션 ---------- */
.ff-mark { display: inline-flex; gap: .18em; font-family: var(--display); font-weight: 800; font-size: clamp(34px, 5vw, 64px); letter-spacing: -.02em; line-height: 1; margin: 0 0 18px; color: var(--text); }
.ff { display: inline-flex; align-items: baseline; overflow: hidden; border-radius: 10px; padding: .06em .12em; transition: background .5s, color .5s; }
.ff b { font-weight: 800; }
.ff i { font-style: normal; font-weight: 700; font-size: .62em; letter-spacing: 0; max-width: 0; opacity: 0; white-space: nowrap; transition: max-width .7s cubic-bezier(.16,1,.3,1), opacity .4s; }
.ff.on { background: var(--text); color: #fff; }
.ff.on i { max-width: 6em; opacity: 1; }
.ff[style*="--k:0"].on { background: var(--cobalt); } .ff[style*="--k:1"].on { background: var(--tangerine); color: #17161a; } .ff[style*="--k:2"].on { background: var(--text); } .ff[style*="--k:3"].on { background: var(--checker); background-size: 14px 14px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.hm-hero { padding-top: 40px; padding-bottom: 36px; min-height: 0; }
.hm-sub { font-size: clamp(18px, 1.5vw + 10px, 24px); margin: 18px 0 26px; }
/* ---------- 홈: 카드 슬라이드 스트립(애플 홈 식 가로 이동) ---------- */
.hm-strip { overflow: hidden; padding: 10px 0 40px; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.hm-track { display: flex; gap: 22px; width: max-content; animation: strip 48s linear infinite; }
.hm-strip:hover .hm-track { animation-play-state: paused; }
.hm-track .sc-card { position: static; flex: none; --w: 220px; width: var(--w); animation: sc-in 1.2s cubic-bezier(.16,1,.3,1) both; transform: rotate(0); }
.hm-track .sc-card:nth-child(odd) { transform: translateY(14px); }
@keyframes strip { to { transform: translateX(-50%); } }
body.app .al-strip { padding: 0 0 8px; margin: 0 -22px; }
body.app .al-strip .hm-track { gap: 12px; animation-duration: 36s; }
body.app .al-strip .sc-card { --w: 140px; }
body.app .al-slide[data-title="소개"] { justify-content: flex-start; padding-top: 14px; }
.al-top { position: relative; z-index: 2; }
body.app .ff-mark { font-size: 30px; margin: 14px 0 10px; }
body.app .al-title { font-size: clamp(34px, 10vw, 44px); margin-bottom: 8px; }
body.app .al-sub { font-size: 15px; } .al-sub em { font-style: normal; color: var(--cobalt); }
@media (prefers-reduced-motion: reduce) { .hm-track { animation: none; } .ff i { transition: none; } }

/* ---------- 그날의 사주 인트로(3초 이해): 사주·관상·손금 → 점수 → 기운이 모이는 곳 ---------- */
.intro { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -6px 0 16px; padding: 12px 14px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow-s); }
.intro > *, .intro .in-chip { opacity: 0; }
.intro.play > * , .intro.play .in-chip { animation: rise .6s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--i, 0) * 260ms + 120ms); }
.in-src { display: flex; gap: 6px; flex-wrap: wrap; }
.in-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--bg2); color: var(--muted); }
.in-chip.on { background: var(--text); color: #fff; } .in-chip em { font-style: normal; font-size: 10px; letter-spacing: .08em; opacity: .7; }
.in-arrow { width: 34px; height: 2px; background: var(--line); position: relative; } .in-arrow i { position: absolute; inset: 0; background: var(--cobalt); transform-origin: left; animation: barx 1s cubic-bezier(.16,1,.3,1) both; animation-delay: 900ms; }
.in-out { display: flex; align-items: baseline; gap: 6px; } .in-out b { font-family: var(--display); font-size: 30px; font-weight: 800; color: var(--cobalt); line-height: 1; } .in-out span { font-size: 12px; color: var(--muted); }
.in-line { flex: 1 1 100%; font-size: 13px; color: var(--muted); } .in-line em { font-style: normal; font-weight: 800; color: var(--text); background: linear-gradient(transparent 60%, var(--butter) 60%); } .in-line b { color: var(--cobalt); }
/* ---------- 플랜 스테퍼 ---------- */
.flow { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 14px 0 6px; }
.flow-line { position: absolute; left: 10%; right: 10%; top: 22px; height: 3px; background: var(--line); border-radius: 2px; }
.flow-line i { display: block; height: 100%; background: var(--checker); background-size: 6px 6px; transform-origin: left; transform: scaleX(0); transition: transform .7s cubic-bezier(.16,1,.3,1); border-radius: 2px; }
.fs { position: relative; z-index: 1; border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; display: grid; justify-items: center; gap: 6px; padding: 0; }
.fs .fs-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-s); display: grid; place-items: center; font-size: 20px; transition: transform .35s cubic-bezier(.34,1.56,.64,1), background .3s; }
.fs b { font-size: 12px; font-weight: 700; }
.fs.on { color: var(--text); } .fs.on .fs-ic { background: var(--text); transform: scale(1.15); box-shadow: 0 0 0 4px var(--cobalt-s); animation: fspulse 1.8s ease-in-out infinite; }
.fs.done .fs-ic { background: var(--cobalt-s); } .fs.done .fs-ic::after { content: '✓'; position: absolute; right: -2px; top: -2px; width: 16px; height: 16px; border-radius: 50%; background: var(--cobalt); color: #fff; font-size: 10px; display: grid; place-items: center; }
.fs .fs-ic { position: relative; }
@keyframes fspulse { 50% { box-shadow: 0 0 0 9px rgba(43,71,201,.12); } }
.flow-say { font-family: var(--title); font-size: 17px; font-weight: 700; margin: 10px 0 14px; min-height: 1.5em; }
.flow-say.play { animation: rise .5s cubic-bezier(.16,1,.3,1) both; }
.flow-next { display: flex; justify-content: space-between; gap: 10px; margin: 4px 0 30px; }
.flow-next .btn.big { margin-left: auto; }
/* ---------- 카드 듀오: 왼쪽 뒷면 · 오른쪽 앞면 ---------- */
.card-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.cd-side { display: grid; gap: 6px; } .cd-label { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.cd-card { position: relative; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: var(--bg); box-shadow: var(--shadow-s); }
.cd-back canvas { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; box-shadow: none; transform: none; background: #fff; }
.cd-front { border: 2px dashed var(--line); background: var(--bg2); } .cd-front.made { border: 0; }
.cd-front img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: cardin 1s cubic-bezier(.16,1,.3,1) both; }
@keyframes cardin { from { opacity: 0; transform: scale(.94) translateY(12px); } }
.cd-front.made::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(23,22,26,.72) 0%, rgba(23,22,26,.2) 40%, transparent 62%); pointer-events: none; }
.cd-front .cf-empty { font-size: 13px; padding: 16px; background: transparent; } .cd-front .cf-empty small { display: block; margin-top: 6px; font-size: 11px; font-weight: 400; }
.cd-front .sc-tier { width: 40px; height: 40px; font-size: 19px; left: 10px; top: 10px; z-index: 2; } .cd-front .sc-body { padding: 10px; z-index: 2; } .cd-front .sc-score b { font-size: 30px; } .cd-front .sc-tags i { font-size: 9.5px; }
.sc-tier.stamp { animation: stamp .7s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes stamp { 0% { opacity: 0; transform: scale(2.4) rotate(-14deg); } 60% { opacity: 1; transform: scale(.92) rotate(3deg); } 100% { opacity: 1; transform: scale(1) rotate(-4deg); } }
/* ---------- 카드 만드는 과정 ---------- */
.card-proc { margin: 4px 0 14px; }
.pr-list { display: grid; gap: 6px; }
.pr { display: grid; grid-template-columns: 34px 1fr 12px; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--bg); opacity: .45; transition: opacity .4s, background .4s, transform .4s; animation: rise .5s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--i) * 70ms); }
.pr b { display: block; font-size: 13px; } .pr span { font-size: 11px; color: var(--muted); }
.pr .pr-ic { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 17px; font-family: var(--title); font-weight: 800; color: var(--cobalt); }
.pr .pr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.pr.on { opacity: 1; background: var(--card); box-shadow: var(--shadow-s); transform: translateX(4px); } .pr.on .pr-dot { background: var(--cobalt); animation: pkblink .8s infinite alternate; } .pr.on .pr-ic { animation: fspulse 1.6s infinite; }
.pr.done { opacity: .8; } .pr.done .pr-dot { background: #2f8a5a; } .pr.done .pr-ic { background: var(--mint-s); }
.pr-result { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--text); color: #fff; animation: rise .6s cubic-bezier(.16,1,.3,1) both; }
.pr-result .sc-tier { position: static; width: 52px; height: 52px; font-size: 24px; } .pr-result b { font-family: var(--title); font-size: 17px; display: block; } .pr-result span { font-size: 12px; opacity: .8; }
.pr-result.err { grid-template-columns: 1fr; background: #fdecec; color: #b3261e; }
@media (prefers-reduced-motion: reduce) { .intro.play > *, .intro.play .in-chip, .in-arrow i, .fs.on .fs-ic, .pr, .pr.on .pr-ic, .sc-tier.stamp, .cd-front img { animation: none !important; opacity: 1; } }
.palette[hidden] { display: none; }

/* ---------- 인트로 SVG: 세 구슬 → 링 ---------- */
.intro { display: block; padding: 8px 10px 10px; }
.in-svg { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.in-path { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 220; stroke-dashoffset: 220; }
.intro.play .in-path { animation: in-draw 1.2s cubic-bezier(.16,1,.3,1) forwards; animation-delay: calc(var(--i) * 250ms + 400ms); }
@keyframes in-draw { to { stroke-dashoffset: 0; } }
.in-orb { opacity: 0; transform-origin: center; transform-box: fill-box; } .intro.play .in-orb { animation: in-pop .6s cubic-bezier(.34,1.56,.64,1) forwards; animation-delay: calc(var(--i) * 220ms); }
@keyframes in-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.in-orb text { font-size: 9px; font-weight: 800; fill: #fff; font-family: var(--font); } .in-orb:not(.on) circle:first-child { opacity: .5; } .in-orb:not(.on) text { fill: #fff; }
.in-orb .in-dot { opacity: 0; } .intro.play .in-orb.on .in-dot { opacity: 1; }
.in-ring-bg { fill: var(--card); stroke: var(--bg2); stroke-width: 7; }
.in-ring { fill: none; stroke-width: 7; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 230px 78px; stroke-dasharray: var(--c); stroke-dashoffset: var(--c); }
.intro.play .in-ring { animation: in-fill 1.3s cubic-bezier(.16,1,.3,1) forwards; animation-delay: 1.4s; }
@keyframes in-fill { to { stroke-dashoffset: var(--o); } }
.in-num { font-family: var(--display); font-size: 26px; font-weight: 800; fill: var(--text); }
.in-cap { font-size: 9px; fill: var(--muted); font-family: var(--font); font-weight: 700; }
.intro.play .in-line { animation-delay: 2.2s; }
/* ---------- 모션 그래픽 격자 ---------- */
.mg-grid { display: grid; gap: 14px; margin-bottom: 8px; }
@media (min-width: 761px) { .mg-grid { grid-template-columns: 1fr 1fr 1fr; } }
.mgx .panel-title { margin-bottom: 10px; }
/* ① 네 기둥: 세워지는 기둥 */
.px-stage { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; margin-bottom: 12px; }
.px { position: relative; display: grid; justify-items: center; gap: 3px; padding: 10px 4px 12px; border-radius: 14px; background: var(--bg); transform-origin: bottom; animation: px-rise .9s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--i) * 180ms); }
@keyframes px-rise { from { opacity: 0; transform: scaleY(.2) translateY(20px); } 60% { opacity: 1; } to { transform: none; } }
.px.me { background: var(--text); color: #fff; } .px.me .px-pos, .px.me .px-ss { color: #cfcac0; } .px.off { opacity: .5; }
.px-pos { font-size: 10px; font-weight: 700; color: var(--muted); }
.px-col { display: grid; gap: 2px; }
.px-ch { font-family: var(--title); font-size: 30px; line-height: 1.1; font-weight: 800; display: block; transform: rotateX(90deg); animation: px-flip .7s cubic-bezier(.34,1.56,.64,1) forwards; animation-delay: calc(var(--i) * 180ms + var(--j) * 140ms + 500ms); }
.px.me .px-ch { color: #fff !important; }
@keyframes px-flip { to { transform: none; } }
.px-ko { font-size: 12px; font-weight: 700; } .px-ss { font-size: 9.5px; color: var(--muted); text-align: center; }
.px-base { position: absolute; left: 10%; right: 10%; bottom: 4px; height: 3px; border-radius: 2px; background: var(--checker); background-size: 5px 5px; transform: scaleX(0); animation: barx .6s cubic-bezier(.16,1,.3,1) forwards; animation-delay: calc(var(--i) * 180ms + 900ms); }
#mgx-pillars .ilgan { font-size: 12.5px; line-height: 1.5; }
/* ② 오행 레이더 */
.ex-svg { width: 100%; max-width: 260px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.ex-grid { fill: none; stroke: var(--line); stroke-width: 1; } .ex-axis { stroke: var(--line); stroke-width: 1; }
.ex-poly { fill-opacity: .22; stroke-width: 2.5; stroke-linejoin: round; }
.ex-lab text { font-size: 12px; font-weight: 800; font-family: var(--font); opacity: 0; animation: rise .6s cubic-bezier(.16,1,.3,1) forwards; animation-delay: calc(var(--i) * 120ms + 700ms); }
.ex-lab .ex-pct { font-size: 10px; fill: var(--muted); font-weight: 600; }
.ex-lab.yong text:first-child { animation-name: rise, ex-glow; animation-duration: .6s, 1.8s; animation-iteration-count: 1, infinite; animation-delay: calc(var(--i) * 120ms + 700ms), 1.5s; }
@keyframes ex-glow { 50% { filter: drop-shadow(0 0 6px currentColor); } }
.ex-legend { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; }
.ex-legend span { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--bg); animation: rise .6s cubic-bezier(.16,1,.3,1) both; animation-delay: 1.4s; }
/* ③ 일진 도장 */
.ij { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-bottom: 10px; }
.ij-side { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; background: var(--bg); }
.ij-cap { font-size: 10px; font-weight: 700; color: var(--muted); }
.ij-pair { display: flex; gap: 4px; } .ij-pair b { font-family: var(--title); font-size: 34px; font-weight: 800; line-height: 1; }
.ij-ko { font-size: 11px; font-weight: 700; }
.ij-side.stamp .ij-pair b { opacity: 0; animation: stamp .7s cubic-bezier(.34,1.56,.64,1) forwards; animation-delay: calc(var(--j) * 220ms + 600ms); }
.ij-link { position: relative; display: grid; justify-items: center; gap: 4px; min-width: 70px; }
.ij-link i { display: block; width: 100%; height: 3px; border-radius: 2px; background: var(--line); transform: scaleX(0); transform-origin: left; animation: barx .6s cubic-bezier(.16,1,.3,1) forwards; animation-delay: 1.2s; }
.ij-link i:nth-child(2) { animation-delay: 1.35s; } .ij-link i:nth-child(3) { animation-delay: 1.5s; }
.ij-link.hap i { background: #2f8a5a; } .ij-link.chung i { background: #c04a5c; animation-name: barx, ij-shake; animation-duration: .6s, .5s; animation-delay: 1.2s, 1.9s; }
.ij-link.same i { background: var(--cobalt); } .ij-link.calm i { background: var(--line); }
@keyframes ij-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.ij-link em { font-style: normal; font-size: 10.5px; font-weight: 800; text-align: center; white-space: nowrap; opacity: 0; animation: rise .5s both; animation-delay: 1.7s; }
.ij-link.hap em { color: #2f8a5a; } .ij-link.chung em { color: #c04a5c; } .ij-link.same em { color: var(--cobalt); }
.ij-ss { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; margin-bottom: 6px; } .ij-ss b { font-weight: 800; }
#mgx-iljin #iljin { font-size: 12.5px; line-height: 1.5; } #mgx-iljin #iljin br { display: none; } #mgx-iljin .tagline { display: block; margin-top: 4px; font-weight: 600; }
/* 풀이 전문 UI */
.rd2 .rd-head { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; margin-bottom: 12px; }
.rd2 .rd-dm { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; font-family: var(--title); font-size: 30px; font-weight: 800; color: #fff; animation: stamp .7s cubic-bezier(.34,1.56,.64,1) both; }
.rd2 .rd-title { font-size: 20px; line-height: 1.3; }
.rd2 .rd-text { font-size: 14px; line-height: 1.7; background: var(--bg); border-radius: 14px; padding: 12px 14px; margin: 0 0 12px; }
.rd2 .rd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 760px) { .rd2 .rd-grid { grid-template-columns: 1fr; } }
.rd2 .rd-item { background: var(--card); box-shadow: var(--shadow-s); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; line-height: 1.6; animation: rise .6s cubic-bezier(.16,1,.3,1) both; }
.rd2 .rd-item .k { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--cobalt); margin-bottom: 6px; }
.rd2 .rd-item .k::before { content: ''; width: 10px; height: 4px; border-radius: 2px; background: var(--checker); background-size: 4px 4px; }
.rd2 .rd-item.wide { grid-column: 1 / -1; }
.tags-more { display: inline-flex; align-items: center; gap: 6px; margin: 12px 0 0; border: 0; background: var(--card); box-shadow: var(--shadow-s); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.tags-more.open { background: var(--text); color: #fff; } .tags-more.open .muted { color: #cfcac0; }
#tag-cats { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .in-path, .in-orb, .in-ring, .px, .px-ch, .px-base, .ex-lab text, .ex-legend span, .ij-side.stamp .ij-pair b, .ij-link i, .ij-link em, .rd2 .rd-dm, .rd2 .rd-item { animation: none !important; opacity: 1 !important; transform: none !important; stroke-dashoffset: var(--o, 0) !important; } }
.ij-side.stamp .ij-pair b { transform-origin: center; }
