/* ============================================================
   오늘의 띠별 운세 위젯 — 사주 위젯 v3와 같은 디자인 언어
   ============================================================ */
@charset "utf-8";

.tf {
    --bg: linear-gradient(160deg, #0d1024 0%, #171c3a 55%, #101427 100%);
    --solid: #161a33;
    --card: rgba(255, 255, 255, .045);
    --card-b: rgba(255, 255, 255, .10);
    --t1: #edeaf3;
    --t2: #aaa7c0;
    --t3: #767390;
    --gold: #d9b96c;
    --gold-hi: #f0d28a;
    --gold-dim: rgba(217, 185, 108, .12);
    --red: #e07a72;
    --green: #6cbf84;
    --violet: #9187d8;
    --amber: #d9ab5e;
    --r: 18px;
    --r-sm: 12px;
    --serif: 'Noto Serif KR', 'Nanum Myeongjo', NanumMyeongjo, Batang, serif;

    font-family: 'Noto Sans KR', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: var(--r);
    color: var(--t1);
    max-width: 760px;
    margin: 0 auto;
    box-shadow: 0 16px 48px rgba(5, 6, 20, .45);
    overflow: hidden;
    line-height: 1.55;
    box-sizing: border-box;
    padding-bottom: 8px;
}

.tf[data-theme="light"] {
    --bg: linear-gradient(160deg, #faf6ec 0%, #f3ecdc 60%, #f7f2e6 100%);
    --solid: #f7f2e6;
    --card: rgba(66, 50, 20, .045);
    --card-b: rgba(66, 50, 20, .13);
    --t1: #322e3c;
    --t2: #625d70;
    --t3: #918c9e;
    --gold: #a8823c;
    --gold-hi: #8a6a2b;
    --gold-dim: rgba(168, 130, 60, .12);
    --red: #bf4f48;
    --green: #2e7d4f;
    --violet: #6a5fb8;
    --amber: #a9781f;
    border-color: rgba(66, 50, 20, .10);
    box-shadow: 0 14px 40px rgba(120, 100, 60, .16);
}

.tf *,
.tf *::before,
.tf *::after { box-sizing: border-box }

/* ---------- 헤더 ---------- */
.tf__hd {
    padding: 30px 24px 20px;
    text-align: center;
    border-bottom: 1px solid var(--card-b);
    background: radial-gradient(ellipse 90% 100% at 50% -30%, var(--gold-dim), transparent 70%);
}

.tf__hd-deco {
    font-family: var(--serif);
    font-size: 13px;
    letter-spacing: .5em;
    text-indent: .5em;
    color: var(--gold);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.tf__hd-deco::before,
.tf__hd-deco::after {
    content: "";
    width: 34px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold));
    opacity: .6;
}

.tf__hd-deco::after { background: linear-gradient(270deg, transparent, var(--gold)) }

.tf__title {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--t1);
    margin: 0;
}

.tf__date {
    font-size: 14.5px;
    color: var(--t2);
    margin: 10px 0 0;
}

.tf__iljin {
    color: var(--gold);
    font-family: var(--serif);
}

.tf__sub {
    font-size: 13.5px;
    color: var(--t3);
    margin: 4px 0 0;
}

/* ---------- TOP 3 ---------- */
.tf__best {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 20px 0;
    padding: 12px 16px;
    background: linear-gradient(150deg, var(--gold-dim), transparent 75%), var(--card);
    border: 1px solid var(--gold);
    border-radius: var(--r-sm);
}

.tf__best-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--gold);
    margin-right: 4px;
}

.tf__best-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13.5px;
    color: var(--t1);
    background: var(--card);
    border: 1px solid var(--card-b);
    border-radius: 999px;
    padding: 4px 12px;
}

.tf__best-item b { color: var(--gold) }

/* ---------- 내 띠 찾기 ---------- */
.tf__finder {
    display: flex;
    gap: 8px;
    margin: 14px 20px 0;
}

.tf__finder-input {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--card-b);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 16px;
    color: var(--t1);
    font-family: inherit;
    outline: none;
    min-width: 0;
    transition: border-color .2s, background .2s;
}

.tf__finder-input:focus {
    border-color: var(--gold);
    background: var(--gold-dim);
}

.tf__finder-btn {
    flex-shrink: 0;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--gold-hi), var(--gold));
    border: none;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 800;
    color: #221a05;
    cursor: pointer;
    font-family: inherit;
    transition: transform .2s, box-shadow .2s;
}

.tf[data-theme="light"] .tf__finder-btn { color: #fffaf0 }

.tf__finder-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(217, 185, 108, .3);
}

.tf__chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin: 12px 20px 0;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--card-b) transparent;
}

.tf__chips::-webkit-scrollbar { height: 4px }
.tf__chips::-webkit-scrollbar-thumb { background: var(--card-b); border-radius: 4px }

.tf__chip {
    flex-shrink: 0;
    padding: 7px 13px;
    background: var(--card);
    border: 1px solid var(--card-b);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--t2);
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: border-color .2s, color .2s, background .2s;
}

.tf__chip:hover,
.tf__chip.active {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-dim);
}

.tf__note {
    margin: 10px 22px 0;
    font-size: 12.5px;
    color: var(--t3);
    line-height: 1.6;
}

.tf__note a {
    color: var(--gold);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid var(--gold);
}

/* ---------- 카드 그리드 ---------- */
.tf__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 20px 8px;
}

.tf__card {
    background: var(--card);
    border: 1px solid var(--card-b);
    border-radius: var(--r-sm);
    padding: 16px;
    margin: 0;
    transition: border-color .3s, box-shadow .3s;
    scroll-margin-top: 90px;
}

.tf__card.focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold), 0 8px 28px rgba(217, 185, 108, .18);
}

.tf__card-hd {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tf__card-emoji { font-size: 30px }

.tf__card-name { flex: 1; min-width: 0 }

.tf__card-name h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--t1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tf__card-hanja {
    font-family: var(--serif);
    font-size: 14px;
    color: var(--gold);
    font-weight: 600;
}

.tf__rel {
    display: inline-block;
    margin-top: 3px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 1px 9px;
    border-radius: 999px;
    border: 1px solid;
}

.tf__rel--hap { color: var(--green); border-color: var(--green); background: rgba(108, 191, 132, .1) }
.tf__rel--samhap { color: var(--violet); border-color: var(--violet); background: rgba(145, 135, 216, .1) }
.tf__rel--chung { color: var(--red); border-color: var(--red); background: rgba(224, 122, 114, .1) }
.tf__rel--hyung { color: var(--amber); border-color: var(--amber); background: rgba(217, 171, 94, .1) }
.tf__rel--neutral { color: var(--t3); border-color: var(--card-b); background: var(--card) }

.tf__card-rank {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 800;
    color: #221a05;
    background: linear-gradient(135deg, var(--gold-hi), var(--gold));
    border-radius: 999px;
    padding: 3px 10px;
}

.tf[data-theme="light"] .tf__card-rank { color: #fffaf0 }

.tf__card-score {
    flex-shrink: 0;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.tf__card-score b {
    font-size: 24px;
    font-weight: 800;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}

.tf__card-score span { font-size: 12px; color: var(--t3) }

.tf__bar {
    height: 5px;
    background: var(--card);
    border: 1px solid var(--card-b);
    border-radius: 999px;
    overflow: hidden;
    margin: 12px 0;
}

.tf__bar i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-hi));
    border-radius: 999px;
}

.tf__total {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--t1);
    line-height: 1.65;
    opacity: .95;
}

.tf__rows {
    margin: 0;
    border-top: 1px dashed var(--card-b);
}

.tf__rows > div {
    display: flex;
    gap: 10px;
    padding: 7px 0;
    font-size: 13px;
    line-height: 1.6;
}

.tf__rows > div + div { border-top: 1px solid var(--card-b) }

.tf__rows dt {
    flex-shrink: 0;
    width: 34px;
    font-weight: 700;
    color: var(--gold);
    margin: 0;
}

.tf__rows dd { margin: 0; color: var(--t2) }

.tf__lucky {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--gold-dim);
    border-radius: 8px;
    font-size: 12.5px;
    color: var(--t2);
}

.tf__lucky b { color: var(--gold) }

/* 년생별 */
.tf__years { margin-top: 10px }

.tf__years summary {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--t3);
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    list-style-position: inside;
}

.tf__years summary:hover { color: var(--gold) }

.tf__years ul {
    margin: 6px 0 0;
    padding: 8px 12px;
    background: var(--card);
    border-radius: 8px;
    list-style: none;
}

.tf__years li {
    font-size: 12.5px;
    color: var(--t2);
    padding: 4px 0;
    line-height: 1.5;
}

.tf__years li + li { border-top: 1px dashed var(--card-b) }

.tf__years li b { color: var(--t1); margin-right: 6px }

.tf__years-gz {
    font-size: 11px;
    color: var(--gold);
    margin-right: 6px;
    font-family: var(--serif);
}

.tf__foot {
    margin: 8px 22px 16px;
    font-size: 12px;
    color: var(--t3);
    line-height: 1.7;
    text-align: center;
}

/* ---------- 반응형 ---------- */
@media (max-width: 560px) {
    .tf__grid { grid-template-columns: 1fr }
    .tf__finder { flex-wrap: wrap }
    .tf__finder-btn { padding: 11px 16px; flex: 1 }
    .tf__finder-input { flex-basis: 100% }
    .tf__title { font-size: 20px }
}
