/* 메뉴 슬라이더 · 입력 폼 · 궁합 · 타로 · 회원 등 확장 컴포넌트 */

/* ───── 상단 링크 · 메뉴 슬라이더 (그룹별 메뉴) ───── */
.top-actions { display: flex; align-items: center; gap: 10px; }
.join-link { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--brand); color: var(--brand); font-weight: 700; font-size: 14px; text-decoration: none; }
.join-link:hover, .join-link.on { background: var(--brand); color: #fff; }
#menu { margin-top: 8px; }
.menu_area { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.menu_track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.menu_track::-webkit-scrollbar { display: none; }
.menu_slide { flex: 0 0 100%; scroll-snap-align: start; padding: 18px 18px 6px; }
.menu_tit { display: flex; align-items: center; gap: 10px; font: 700 18px/1.3 var(--sans); margin-bottom: 12px; }
.menu_ico { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); font-size: 22px; }
.menu_li { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.menu_li a { display: flex; align-items: center; min-height: 46px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 500; background: var(--surface-2); }
.menu_li a:hover { border-color: var(--brand); }
.menu_li li.on a { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.menu_num { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 8px 0 12px; font-size: 14px; color: var(--muted); }
.menu_num button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 16px; }
.menu_num button:hover { border-color: var(--brand); }

/* ───── 페이지 머리 · 개인정보 입력 ───── */
.unse_info { margin: 20px 0 6px; }
.unse_info h2 { font-size: clamp(22px, 5vw, 28px); }
.unse_txt { color: var(--muted); margin: 8px 0 4px; }
.txt_s { font-size: 14px; color: var(--muted); margin: 0; }
.txt_purple { color: var(--brand); font-weight: 700; }
.inp_area h3 { font-size: 19px; margin: 0 0 4px; }
.inp_ul { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 16px; }
.inp_li > .k { display: block; font-weight: 700; margin-bottom: 6px; }
.inp_row { display: grid; grid-template-columns: 1.15fr 1.1fr 1fr 1fr; gap: 8px; }
.inp_two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.inp_area .check { margin-top: 12px; }
.btn_area { margin-top: 22px; display: grid; gap: 10px; }
.hr-gap { margin-top: 26px; padding-top: 22px; border-top: 1px dashed var(--line); }
.inline-form { margin-top: 0; }

/* ───── 궁합 · 링 · 연간 차트 ───── */
.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; text-align: center; }
.pair .who { padding: 12px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.pair .who b { display: block; font-size: 17px; }
.pair .who .pn { font: 700 22px/1.3 var(--serif); }
.pair .heart { font-size: 26px; color: var(--seal); }
.ring { --p: 70; width: 140px; height: 140px; border-radius: 50%; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--line) 0); display: grid; place-items: center; margin: 4px auto; }
.ring::before { content: ""; width: 112px; height: 112px; border-radius: 50%; background: var(--surface); grid-area: 1 / 1; }
.ring b { grid-area: 1 / 1; font-size: 34px; line-height: 1; }
.ring b small { font-size: 14px; font-weight: 500; }
.center { text-align: center; }
.cat-list { display: grid; gap: 12px; margin-top: 14px; }
.cat-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 6px 10px; align-items: center; }
.cat-row .cd { font-size: 12.5px; color: var(--muted); grid-column: 1 / -1; margin-top: -2px; }
.cat-row .track { height: 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.cat-row .fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.points li { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--line); font-size: 15px; }
.points li.good { border-left-color: var(--brand); }
.points li.care { border-left-color: var(--seal); }
.week-chart.y12 { grid-template-columns: repeat(12, 1fr); gap: 3px; }
.y12 .wcol { cursor: default; padding: 4px 0; }
.y12 .wcol:hover { background: none; }
.y12 .bar { width: min(22px, 80%); }
.y12 .dw { font-size: 12.5px; }
.y12 .wcol.now { background: var(--accent-soft); }
.organ { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); display: grid; gap: 6px; }
.organ h3 { font: 700 16px/1.4 var(--sans); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.organ p { margin: 0; font-size: 15px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--el1-bg); color: var(--el1); }
.stack { display: grid; gap: 12px; }
.year-list { display: grid; gap: 8px; }
.year-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: center; font-size: 15px; }
.year-row.best { font-weight: 700; }
.year-row .track { height: 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.year-row .fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.animals { display: flex; flex-wrap: wrap; gap: 8px; }
.animal { padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: 14.5px; }
.animal b { display: block; font-size: 15.5px; }
.animal.bad { border-color: var(--seal); }

/* ───── 타로 ───── */
.tarot-row { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin: 18px 0 8px; }
.tslot { display: grid; gap: 8px; justify-items: center; }
.tslot .pos { font-size: 13px; font-weight: 700; color: var(--muted); }
.tcard { display: block; width: 150px; height: 261px; perspective: 900px; cursor: pointer; background: none; border: 0; padding: 0; }
.tcard-in { display: block; position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s; }
.tcard.flipped .tcard-in { transform: rotateY(180deg); }
.tface { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 14px; display: grid; place-items: center; padding: 10px; text-align: center; border: 2px solid var(--brand); box-shadow: var(--shadow); }
.tback { background: repeating-linear-gradient(45deg, var(--brand) 0 9px, #5238b8 9px 18px); color: #fff; font-size: 46px; }
.tfront { background: #f3ead2; transform: rotateY(180deg); padding: 0; overflow: hidden; }
.tfront img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tfront.rev img { transform: rotate(180deg); }
.tcap { font-size: 14px; font-weight: 700; text-align: center; visibility: hidden; }
.tcap em { font-style: normal; color: var(--seal); font-size: 12.5px; }
.tcard.flipped + .tcap { visibility: visible; }
.tmsg { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.tmsg h3 { font: 700 17px/1.4 var(--sans); margin-bottom: 4px; }
.tmsg .kw { font-size: 13.5px; color: var(--brand); font-weight: 700; margin-bottom: 6px; }
.tmsg .timg { font-size: 14px; margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--line); }
/* 단계 표시 · 질문 */
.tsteps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; counter-reset: none; }
.tsteps li { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); text-align: center; }
.tsteps li span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); font-weight: 700; background: var(--surface); }
.tsteps li.done span { border-color: var(--accent); color: var(--accent); }
.tsteps li.on { color: var(--ink); font-weight: 700; }
.tsteps li.on span { background: var(--brand); border-color: var(--brand); color: #fff; }
/* 질문 입력칸: 카드 안에서 바로 눈에 띄도록 강조 상자 + 굵은 테두리 */
.tq-field { margin-top: 16px; padding: 14px; border-radius: 16px; background: var(--accent-soft); border: 2px solid var(--brand); }
.tq-label { display: block; font: 700 18px/1.3 var(--sans); margin: 0 0 8px; color: var(--ink); }
#tQ { width: 100%; min-height: 56px; padding: 12px 16px; font-size: 17px; font-weight: 500; color: var(--ink); background: var(--surface); border: 2px solid var(--brand); border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
#tQ::placeholder { color: var(--muted); opacity: 1; font-weight: 400; }
#tQ:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 2px 8px rgba(0, 0, 0, .08); }
.tq-help { margin: 6px 2px 0; font-size: 13.5px; color: var(--muted); }
/* 카드 장수 4가지 */
.tcounts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tcounts span { text-align: center; justify-items: center; padding: 12px 6px; }
.tcnt-n { font-size: 22px; line-height: 1.1; color: var(--brand); }
.tcounts input:checked + span .tcnt-n { color: var(--ink); }
.tvars { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.thints p { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; }
.ttips { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.tq { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.tq-q { font-weight: 700; font-size: 16px; flex: 1 1 220px; }
/* 스프레드 선택 */
.tspreads { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.tspreads label { position: relative; cursor: pointer; }
.tspreads input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tspreads span { display: grid; gap: 2px; height: 100%; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); }
.tspreads b em { font-style: normal; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.tspreads small { color: var(--muted); font-size: 13px; }
.tspreads input:checked + span { border-color: var(--brand); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.tspreads input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
/* 섞기 */
.tdeck { position: relative; width: 110px; height: 172px; margin: 30px auto 22px; }
.tdeck span { position: absolute; inset: 0; border-radius: 12px; border: 2px solid var(--brand); background: repeating-linear-gradient(45deg, var(--brand) 0 8px, #5238b8 8px 16px); box-shadow: var(--shadow); }
.tdeck span:nth-child(1) { transform: translate(-6px, 6px) rotate(-4deg); }
.tdeck span:nth-child(2) { transform: translate(-2px, 2px) rotate(-1deg); }
.tdeck span:nth-child(3) { transform: translate(3px, -2px) rotate(2deg); }
.tdeck.shuffling span:nth-child(1) { animation: tshufL .9s ease-in-out infinite; }
.tdeck.shuffling span:nth-child(2) { animation: tshufR .9s ease-in-out .45s infinite; }
.tdeck.shuffling span:nth-child(3) { animation: tshufR .9s ease-in-out infinite; }
.tdeck.shuffling span:nth-child(4) { animation: tshufU .9s ease-in-out .2s infinite; }
.tshuf-msg { text-align: center; font-weight: 700; font-size: 17px; margin: 0; }
.tdots::after { content: ''; display: inline-block; width: 1.5em; text-align: left; animation: tdots 1.2s steps(4) infinite; }
@keyframes tdots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.tprog { height: 6px; max-width: 240px; margin: 14px auto 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.tprog span { display: block; height: 100%; width: 0; background: var(--brand); animation: tprog linear forwards; }
@keyframes tprog { to { width: 100%; } }
@keyframes tshufL { 0%, 100% { transform: translate(-6px, 6px) rotate(-4deg); } 40% { transform: translate(-70px, 0) rotate(-14deg); } }
@keyframes tshufR { 0%, 100% { transform: translate(3px, -2px) rotate(2deg); } 40% { transform: translate(70px, 4px) rotate(12deg); } }
@keyframes tshufU { 0%, 100% { transform: none; } 55% { transform: translateY(-40px) rotate(6deg); } }
/* 펼친 78장 — 겹쳐 놓고 왼쪽 가장자리를 눌러 고른다 */
.tfan { display: flex; flex-wrap: wrap; justify-content: center; padding: 18px 0 4px 22px; }
.tfan .tb { position: relative; width: 46px; height: 76px; margin: 0 0 10px -22px; padding: 0; border-radius: 7px; border: 1.5px solid var(--brand); background: repeating-linear-gradient(45deg, var(--brand) 0 5px, #5238b8 5px 10px); box-shadow: -2px 1px 4px rgba(0, 0, 0, .25); cursor: pointer; transition: transform .15s, opacity .15s; }
.tfan .tb:hover, .tfan .tb:focus-visible { transform: translateY(-6px); z-index: 1; }
.tfan .tb:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.tfan .tb[aria-pressed="true"] { transform: translateY(-14px); z-index: 2; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
.tfan .tb[data-n]::after { content: attr(data-n); position: absolute; top: -8px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 2px 6px; border-radius: 999px; background: var(--accent); color: #fff; font: 700 11px/1.3 var(--sans); }
/* 마음 상담: AI 상담 */
.chat-mode { display: grid; gap: 6px; margin-bottom: 12px; }
.chat-mode p { margin: 0; }
.ai-consent { margin-bottom: 14px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); border: 2px solid var(--brand); font-size: 14.5px; }
.ai-consent ul { margin: 8px 0 12px; padding-left: 18px; display: grid; gap: 6px; }
.ai-consent-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-consent.nudge { animation: nudge .45s ease-in-out; }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.ai-badge { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 6px; background: var(--brand); color: #fff; font-size: 11px; line-height: 1.6; vertical-align: 1px; }
.msg .ai-body p { margin: 0 0 8px; }
.msg .ai-body ul { margin: 4px 0 8px; padding-left: 20px; display: grid; gap: 4px; }
.msg .ai-wait { color: var(--muted); margin: 0; }
.msg .ai-note { margin: 8px 0 0; padding: 6px 10px; border-radius: 8px; background: var(--accent-soft); font-size: 13.5px; }
.msg .ai-foot { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.chat-form button:disabled { opacity: .55; cursor: wait; }
@media (prefers-reduced-motion: reduce) { .ai-consent.nudge { animation: none; } }
/* 카드 크게 보기: 마우스 미리보기(.tpeek) · 누르면 여는 창(.tzoom) */
.tarot-row .tcard.flipped, .tlay .tcard.flipped { cursor: zoom-in; }
.tpeek { position: fixed; z-index: 60; display: grid; gap: 6px; justify-items: center; padding: 8px; border-radius: 14px; background: var(--surface); border: 2px solid var(--brand); box-shadow: 0 12px 40px rgba(0, 0, 0, .35); pointer-events: none; opacity: 0; transform: scale(.96); transition: opacity .15s, transform .15s; }
.tpeek.on { opacity: 1; transform: none; }
.tpeek img, .tzoom img { display: block; width: auto; max-width: 100%; aspect-ratio: 300 / 522; border-radius: 8px; background: #f3ead2; }
.tpeek img.rev, .tzoom img.rev { transform: rotate(180deg); }
.tzoom-cap { font-weight: 700; font-size: 15px; text-align: center; }
.tzoom { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .72); cursor: zoom-out; }
.tzoom-in { display: grid; gap: 10px; justify-items: center; padding: 12px; border-radius: 16px; background: var(--surface); max-height: 100%; }
.tzoom img { height: min(522px, calc(100vh - 150px)); max-width: calc(100vw - 56px); object-fit: contain; }
.tzoom-close { min-width: 120px; }
@media (prefers-reduced-motion: reduce) { .tpeek { transition: none; } }
/* 타로 탭 (타로 보기 / 카드 도감 / 내 기록) */
.ttabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.ttabs button { min-height: 44px; border: 0; border-radius: 10px; background: none; cursor: pointer; font-weight: 500; color: var(--ink); }
.ttabs button:hover { background: var(--surface-2); }
.ttabs button[aria-selected="true"] { background: var(--brand); color: #fff; font-weight: 700; }
/* 질문 모음 · 이용 안내 */
.tqs { margin-top: 12px; display: grid; gap: 6px; }
.tqs .topic-chips button { min-height: 40px; padding: 6px 12px; font-size: 14px; text-align: left; }
.tqs .topic-chips em { font-style: normal; font-size: 12px; color: var(--brand); font-weight: 700; margin-left: 2px; }
.tabout { margin-top: 18px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14.5px; }
.tabout summary { cursor: pointer; font-weight: 700; min-height: 32px; display: list-item; }
.tabout ul { margin: 8px 0 2px; padding-left: 18px; display: grid; gap: 6px; }
/* 해석 · 메모 · 복사 */
.ttopic { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); font-size: 14.5px; }
.tmemo { margin-top: 16px; display: grid; gap: 6px; }
.tmemo label { font-weight: 700; }
.tmemo textarea { width: 100%; font: inherit; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); resize: vertical; }
.tread-btns { grid-template-columns: 1fr 1fr; max-width: 420px; margin-left: auto; margin-right: auto; }
/* 카드 도감 */
.tsuits { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 4px; }
.tdict-filter { margin-bottom: 4px; }
.tdict { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; margin-top: 14px; }
.tdict button { display: grid; gap: 4px; justify-items: center; padding: 6px 4px 8px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-size: 12.5px; line-height: 1.3; color: var(--ink); }
.tdict button:hover { border-color: var(--brand); }
.tdict button[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--accent-soft); font-weight: 700; }
.tdict img { width: 100%; aspect-ratio: 300 / 522; object-fit: cover; border-radius: 5px; background: #f3ead2; }
.tdetail { display: grid; grid-template-columns: 170px 1fr; gap: 16px; margin-top: 14px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--brand); background: var(--surface-2); scroll-margin-top: 12px; }
.tdetail:focus { outline: none; }
.tdetail img { width: 100%; border-radius: 8px; box-shadow: var(--shadow); }
.tdetail h3 { font: 700 19px/1.35 var(--sans); margin: 0 0 4px; }
.tdetail h3 small { font-size: 13px; font-weight: 500; color: var(--muted); }
.tdetail h4 { font: 700 15px/1.4 var(--sans); margin: 12px 0 2px; }
.tdetail p { margin: 0; }
.tdetail .kw { color: var(--brand); font-weight: 700; margin-bottom: 8px; }
.ttopics { margin: 4px 0 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
/* 내 기록 */
.tlog { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tlog-item { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); display: grid; gap: 8px; }
.tlog-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.tlog-q { margin: 0; font-weight: 700; }
.tlog-cards { display: flex; flex-wrap: wrap; gap: 4px; }
.tlog-cards img { width: 38px; aspect-ratio: 300 / 522; object-fit: cover; border-radius: 4px; background: #f3ead2; }
.tlog-cards img.rev { transform: rotate(180deg); }
.tlog-memo { margin: 0; font-size: 14.5px; white-space: pre-wrap; }
.tlog-memo.muted { color: var(--muted); }
.tlog-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tlog-btns .btn { min-height: 40px; padding: 6px 14px; font-size: 14px; }
@media (max-width: 620px) {
  .tdetail { grid-template-columns: 1fr; }
  .tdetail img { max-width: 170px; justify-self: center; }
  .tdict { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .tdict button { font-size: 11.5px; padding: 4px 2px 6px; }
  .ttabs button { font-size: 14px; padding: 0 4px; }
}
/* 스프레드 안내 · 양자택일 선택지 */
.tsp-note { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; }
.topts { margin-top: 12px; padding: 12px 14px; border-radius: 12px; border: 1.5px dashed var(--brand); }
.topt span { display: block; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.topt input { width: 100%; }
/* 배열 모양 (양자택일 V자 · 켈틱 크로스) — 카드 크기는 칸 너비에 맞춤 */
.tlay { margin: 18px auto 8px; }
.tlay .tslot { min-width: 0; gap: 4px; }
.tlay .tcard { width: 100%; height: auto; aspect-ratio: 300 / 522; }
.tlay .tface { border-radius: 8px; }
.tlay .pos { font-size: 12px; line-height: 1.25; text-align: center; min-height: 2.5em; display: flex; align-items: flex-end; justify-content: center; }
.tlay .tcap { font-size: 12px; line-height: 1.3; }
.tchoice { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; max-width: 480px; align-items: start; }
.tchoice .p2 { grid-area: 1 / 1; }
.tchoice .p4 { grid-area: 1 / 4; }
.tchoice .p3 { grid-area: 2 / 2; }
.tchoice .p5 { grid-area: 2 / 3; }
.tchoice .p1 { grid-area: 3 / 2 / 4 / 4; justify-self: center; width: calc(50% - 6px); }
.tceltic { display: flex; gap: 14px; justify-content: center; align-items: center; max-width: 440px; }
.tcross { flex: 3 1 0; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: ". c3 ." "c5 c1 c6" ". c4 ."; gap: 8px; align-items: center; }
.tcross .p1, .tcross .p2 { grid-area: c1; }
.tcross .p3 { grid-area: c3; }
.tcross .p4 { grid-area: c4; }
.tcross .p5 { grid-area: c5; }
.tcross .p6 { grid-area: c6; }
/* 2번 카드는 1번 위에 가로로 겹쳐 놓는다 (이름표는 자리만 차지해 두 카드의 중심을 맞춤) */
.tcross .p2 { z-index: 2; transform: rotate(90deg) scale(.7); }
.tcross .p2 .pos, .tcross .p2 .tcap { visibility: hidden !important; }
.tstaff { flex: 1 1 0; min-width: 0; display: grid; gap: 8px; }
/* 양자택일 비교 */
.tcmp { display: grid; gap: 8px; }
.tcmp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--line); }
.tcmp-row small { color: var(--muted); font-weight: 700; font-size: 13px; }
.tcmp-bar { grid-column: 1 / -1; height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.tcmp-bar i { display: block; height: 100%; background: var(--h2); }
.tcmp-row.best { border-color: var(--h5); }
.tcmp-row.best .tcmp-bar i { background: var(--h5); }
.tcmp-row.best small { color: var(--seal); }
.tfan .tb.dim { opacity: .45; cursor: default; }
.tfan .tb.dim:hover { transform: none; }
.tpickcnt { margin: 6px 0 0; font-weight: 700; color: var(--brand); }
/* 해석 */
.tstory { margin-top: 16px; padding: 16px 18px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid var(--brand); display: grid; gap: 8px; }
.tstory h3 { font: 700 18px/1.4 var(--sans); margin: 0; }
.tstory p { margin: 0; }
.tyn { padding: 12px 14px; border-radius: 12px; border-left: 6px solid var(--h3); background: var(--surface); }
.tyn b { font-size: 17px; }
.tyn p { margin: 4px 0 0; }
.tyn.good { border-left-color: var(--h5); }
.tyn.care { border-left-color: var(--h1); }
@media (prefers-reduced-motion: reduce) {
  .tdeck.shuffling span, .tdots::after { animation: none !important; }
  .tcard-in, .tfan .tb { transition: none; }
}

/* ───── 회원 ───── */
.notice { padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); font-size: 14.5px; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.people li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.people .del { border: 0; background: none; color: var(--seal); cursor: pointer; font-weight: 700; min-height: 40px; padding: 0 8px; }

@media (max-width: 620px) {
  .inp_row { grid-template-columns: 1fr 1fr; }
  .pair { grid-template-columns: 1fr; }
  .pair .heart { transform: rotate(90deg); }
  .cat-row { grid-template-columns: 84px 1fr auto; }
  .week-chart.y12 { gap: 1px; }
  .y12 .dw { font-size: 11px; }
  .tcard { width: 128px; height: 223px; }
  .tarot-row { gap: 10px; }
  .tarot-row.n3 .tcard { width: 92px; height: 160px; }
  .tarot-row.n3 .tcap { font-size: 12.5px; max-width: 92px; }
  .tfan { padding-left: 14px; }
  .tfan .tb { width: 38px; height: 62px; margin-left: -14px; }
  .tsteps li { font-size: 12px; }
  .tcounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ───── 행운 번호 ───── */
.lotto { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.lotto li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lotto .lab { width: 22px; font-weight: 700; color: var(--muted); }
.lotto .ball { width: 40px; height: 40px; font-size: 16px; }
.ball.lk { background: var(--surface); color: var(--brand); box-shadow: inset 0 0 0 3px var(--brand); }
@media (max-width: 620px) { .lotto .ball { width: 36px; height: 36px; font-size: 15px; } }

/* ───── 로고 이미지 ───── */
.brand-logo { width: 48px; height: 48px; border-radius: 50%; flex: none; object-fit: cover; box-shadow: 0 0 0 1px var(--line), 0 2px 8px rgba(20, 20, 50, .12); background: #fff; }

/* ───── 브랜드 이름: 붓글씨체 ───── */
.brand-text strong { font-family: "Nanum Brush Script", "Noto Serif KR", serif; font-weight: 400; font-size: 42px; line-height: 1; letter-spacing: .02em; }
.brand-text small { margin-top: 2px; }
@media (max-width: 620px) { .brand-text strong { font-size: 35px; } .top-inner { gap: 8px; } .join-link { padding: 6px 12px; } }

/* ───── 배경: 오래된 한지 위의 붓글씨 한자 ───── */
:root {
  --paper: #e8d8b4; --paper-hi: #f2e7ca; --paper-lo: #c9b083;
  --ink-hj: 36, 25, 16; --hj-alpha: .14; --hj-blend: multiply;
  --surface: #fbf6e8; --surface-2: #f4ecd7; --line: #d8c8a2; --muted: #6a604f;
  --shadow: 0 1px 2px rgba(80, 55, 20, .10), 0 8px 24px rgba(80, 55, 20, .10);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #241d14; --paper-hi: #31281b; --paper-lo: #140e08;
    --ink-hj: 236, 216, 170; --hj-alpha: .11; --hj-blend: screen;
    --surface: #2a231b; --surface-2: #322a20; --line: #4a3e2d; --ink: #f0e7d3; --muted: #b9ad95; --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  --paper: #241d14; --paper-hi: #31281b; --paper-lo: #140e08;
  --ink-hj: 236, 216, 170; --hj-alpha: .11; --hj-blend: screen;
  --surface: #2a231b; --surface-2: #322a20; --line: #4a3e2d; --ink: #f0e7d3; --muted: #b9ad95; --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px rgba(0, 0, 0, .3);
}
body { background: radial-gradient(ellipse 90% 70% at 50% 30%, var(--paper-hi) 0%, var(--paper) 58%, var(--paper-lo) 100%) fixed; }
.bg-hanja { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; user-select: none; -webkit-user-select: none;
  box-shadow: inset 0 0 120px 10px rgba(96, 62, 22, .38), inset 0 0 300px rgba(96, 62, 22, .16);
  background:
    radial-gradient(260px 200px at 18% 34%, rgba(120, 78, 30, .13), transparent 70%),
    radial-gradient(340px 260px at 82% 66%, rgba(120, 78, 30, .11), transparent 70%),
    radial-gradient(180px 150px at 62% 10%, rgba(120, 78, 30, .10), transparent 70%),
    radial-gradient(220px 180px at 10% 88%, rgba(120, 78, 30, .10), transparent 70%); }
.bg-hanja::before { content: ""; position: absolute; inset: 0; mix-blend-mode: multiply; opacity: .75;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900'%3E%3Cfilter id='b' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.004 .006' numOctaves='3' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55  0 0 0 0 .38  0 0 0 0 .16  0 0 0 1.1 -.42'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23b)'/%3E%3C/svg%3E"), url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.008 .45' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .32  0 0 0 0 .17  1.5 0 0 0 -.62'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E"), url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36  0 0 0 0 .25  0 0 0 0 .12  0 0 0 .6 -.05'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 900px 900px, 600px 600px, 320px 320px; }
:root[data-theme="dark"] .bg-hanja::before { opacity: .35; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bg-hanja::before { opacity: .35; } }
.hj { position: absolute; font-family: "Ma Shan Zheng", "Noto Serif KR", serif; color: rgba(var(--ink-hj), var(--hj-alpha)); mix-blend-mode: var(--hj-blend); line-height: 1.05; white-space: nowrap; animation: ink 2.4s ease-out both; }
.col-a, .col-b, .col-c, .col-d { writing-mode: vertical-rl; text-orientation: upright; letter-spacing: .08em; }
.col-a { left: 1.5vw; top: 4vh; font-size: clamp(64px, 10vw, 150px); }
.col-b { right: 1.5vw; top: 6vh; font-size: clamp(56px, 8.5vw, 130px); animation-delay: .25s; }
.col-c { left: 14vw; top: 46vh; font-size: clamp(30px, 3.6vw, 54px); animation-delay: .5s; }
.col-d { right: 14vw; top: 42vh; font-size: clamp(28px, 3.2vw, 48px); animation-delay: .7s; }
.big-1 { left: 8vw; bottom: -6vh; font-size: clamp(200px, 30vw, 420px); transform: rotate(-6deg); animation-delay: .3s; }
.big-2 { right: 6vw; top: 30vh; font-size: clamp(120px, 16vw, 240px); transform: rotate(5deg); animation-delay: .6s; }
.big-3 { left: 30vw; top: 62vh; font-size: clamp(110px, 14vw, 210px); transform: rotate(-3deg); animation-delay: .9s; }
.big-4 { right: 26vw; bottom: 2vh; font-size: clamp(100px, 12vw, 180px); transform: rotate(4deg); animation-delay: 1.1s; }
@keyframes ink { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: blur(0); } }
.top, #menu, main, .foot { position: relative; z-index: 1; }
.card, .menu_area { background-color: color-mix(in srgb, var(--surface) 93%, transparent); }
.menu_li a, .tmsg, .organ, .animal, .mini, .pair .who { border-color: var(--line); }
@media (max-width: 760px) {
  .hj { --hj-alpha: .12; }
  :root[data-theme="dark"] .hj { --hj-alpha: .13; }
  .col-c, .col-d { display: none; }
  .col-a { left: -2vw; font-size: 26vw; top: 2vh; }
  .col-b { right: -2vw; font-size: 22vw; top: 10vh; }
  .big-1 { left: -8vw; font-size: 78vw; bottom: -4vh; }
  .big-2 { right: -6vw; font-size: 42vw; top: 44vh; }
  .big-3, .big-4 { display: none; }
}
@media print { .bg-hanja { display: none; } }

/* 한자 위에 놓인 본문 글씨 가독성 */
.unse_info h1, .unse_txt, .unse_info .txt_s, .foot p { text-shadow: 0 0 8px var(--paper-hi), 0 0 2px var(--paper-hi); }
:root[data-theme="dark"] .unse_info h1, :root[data-theme="dark"] .unse_txt, :root[data-theme="dark"] .unse_info .txt_s, :root[data-theme="dark"] .foot p { text-shadow: none; }


/* ───── 가독성 보정: 밝은 화면(특히 스마트폰)에서 글씨가 또렷하도록 ───── */
:root { --paper: #efe4c8; --paper-hi: #f8f1dd; --paper-lo: #dac89c; --hj-alpha: .1; --ink: #1f1810; --muted: #4a4030; }
:root[data-theme="light"] { --paper: #efe4c8; --paper-hi: #f8f1dd; --paper-lo: #dac89c; --hj-alpha: .1; --ink: #1f1810; --muted: #4a4030; }
.bg-hanja { box-shadow: inset 0 0 90px 6px rgba(96, 62, 22, .24), inset 0 0 220px rgba(96, 62, 22, .1); }
.bg-hanja::before { opacity: .42; }
/* 제목·설명 글씨 밑에 종이색 받침을 깔아 배경 한자와 겹쳐도 읽히게 */
.unse_info { background: color-mix(in srgb, var(--paper-hi) 86%, transparent); border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 14px; padding: 16px 18px; }
.unse_info h1 { color: var(--ink); }
.unse_txt, .unse_info .txt_s { color: var(--muted); text-shadow: none; }
.unse_info h1, .foot p { text-shadow: none; }
.foot p { color: var(--muted); }
.foot { background: color-mix(in srgb, var(--paper-hi) 80%, transparent); border-radius: 14px; padding: 14px 18px; margin-bottom: 40px; }
.txt_purple { color: #5a3bc4; }
@media (max-width: 760px) { :root { --hj-alpha: .09; } :root[data-theme="light"] .hj { --hj-alpha: .09; } }

/* 어두운 화면은 기존 대비 유지 */
:root[data-theme="dark"] { --ink: #f0e7d3; --muted: #cbbfa6; --hj-alpha: .11; }
:root[data-theme="dark"] .unse_info { background: color-mix(in srgb, var(--paper-hi) 70%, transparent); }
:root[data-theme="dark"] .foot { background: color-mix(in srgb, var(--paper-hi) 60%, transparent); }
:root[data-theme="dark"] .txt_purple { color: #c9b8ff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ink: #f0e7d3; --muted: #cbbfa6; --hj-alpha: .11; }
  :root:not([data-theme="light"]) .unse_info { background: color-mix(in srgb, var(--paper-hi) 70%, transparent); }
  :root:not([data-theme="light"]) .foot { background: color-mix(in srgb, var(--paper-hi) 60%, transparent); }
  :root:not([data-theme="light"]) .txt_purple { color: #c9b8ff; }
}


/* ───── 달력: 음력 · 손 없는 날 · 절기 ───── */
.cell { position: relative; aspect-ratio: auto; min-height: 68px; gap: 1px; padding: 6px 2px; }
.cell .n { line-height: 1.1; }
.cell .lu { font-size: 10.5px; line-height: 1.1; opacity: .92; font-weight: 500; }
.cell .jg { font-size: 10px; font-weight: 700; line-height: 1.25; padding: 0 5px; border-radius: 6px; background: rgba(255, 255, 255, .68); color: #222; max-width: 100%; white-space: nowrap; }
.cell .jg.ev { color: #8a1010; }
.son { position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: #1f9d55; box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
.son.inline { position: static; display: inline-block; vertical-align: middle; margin-right: 2px; }
.son-chip { background: #dff3e6; color: #12703b; }
:root[data-theme="dark"] .son-chip { background: #183524; color: #7fe0a5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .son-chip { background: #183524; color: #7fe0a5; } }
@media (max-width: 620px) {
  .cell { min-height: 62px; padding: 5px 1px; }
  .cell .n { font-size: 15px; }
  .cell .lu { font-size: 10px; }
  .cell .jg { font-size: 9.5px; padding: 0 3px; }
  .son { top: 3px; right: 3px; width: 8px; height: 8px; }
}

.detail .chips { margin-bottom: 12px; }
#todayDetail .chips { margin-bottom: 4px; }
