:root{
  --bg:#fff5f8; --card:#ffffff; --ink:#3b2b33; --sub:#9a7f8c;
  --pink:#ff5c8a; --pink-soft:#ffd6e2; --purple:#8b6cff; --gold:#ffb84d;
  --radius:18px; --shadow:0 4px 18px rgba(255,92,138,.12);
}
*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{
  font-family:"Pretendard","Apple SD Gothic Neo","Noto Sans KR",system-ui,sans-serif;
  background:var(--bg); color:var(--ink); line-height:1.65;
  min-height:100vh; display:flex; flex-direction:column;
}
.top{padding:14px 18px; background:#fff; box-shadow:0 1px 0 rgba(0,0,0,.04); position:sticky; top:0; z-index:10}
.logo{font-weight:800; font-size:18px; color:var(--pink); text-decoration:none}
.wrap{width:100%; max-width:560px; margin:0 auto; padding:24px 18px 48px; flex:1}
h1{font-size:28px; font-weight:800; text-align:center; margin-bottom:6px}
h2{font-size:19px; font-weight:700; margin:22px 0 12px; text-align:center}
h3{font-size:16px; margin:18px 0 8px; color:var(--pink)}
.sub{text-align:center; color:var(--sub); margin-bottom:10px}
.step{animation:fade .35s ease}
@keyframes fade{from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:none}}

/* 성별 토글 */
.gender-row{display:flex; gap:10px; justify-content:center; margin:16px 0 4px}
.g-btn{
  border:2px solid var(--pink-soft); background:#fff; color:var(--sub);
  padding:9px 18px; border-radius:999px; font-size:15px; font-weight:700; cursor:pointer;
}
.g-btn.active{background:var(--pink); border-color:var(--pink); color:#fff}

/* 유형 그리드 */
.grid{display:grid; grid-template-columns:repeat(4,1fr); gap:10px}
.cell{
  background:var(--card); border:2px solid transparent; border-radius:var(--radius);
  padding:10px 4px 8px; text-align:center; cursor:pointer; box-shadow:var(--shadow);
  transition:transform .12s ease, border-color .12s ease;
}
.cell:active{transform:scale(.94)}
.cell:hover{border-color:var(--pink)}
.cell img{width:100%; max-width:74px; aspect-ratio:7/9; object-fit:cover; object-position:top; border-radius:12px; display:block; margin:0 auto 6px}
.cell b{font-size:14px; display:block}
.cell span{font-size:11px; color:var(--sub)}

.back{background:none; border:none; color:var(--sub); font-size:14px; cursor:pointer; margin:14px 0 6px}
.test-link{text-align:center; margin-top:18px; font-size:14px; color:var(--sub)}
.test-link a{color:var(--purple); font-weight:800; text-decoration:none}

/* 결과 */
.couple{display:flex; justify-content:center; gap:14px; margin:18px 0 10px}
.couple img,.char{width:130px; aspect-ratio:7/9; object-fit:cover; object-position:top; border-radius:16px; box-shadow:var(--shadow)}
.pair-title{text-align:center; font-size:20px; font-weight:800; margin-bottom:10px}
.pair-title .heart,h1 .heart{color:var(--pink)}
.score-box{
  text-align:center; background:var(--card); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:22px 16px 18px; margin-bottom:18px;
}
.score{font-size:64px; font-weight:900; color:var(--pink); letter-spacing:-2px}
.unit{font-size:22px; font-weight:700; color:var(--sub); margin-left:2px}
.tier{font-size:20px; font-weight:800; margin-top:2px}
.report p, .match p{
  background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow);
  padding:14px 16px; margin-bottom:10px; font-size:15px;
}
.golden{border-left:4px solid var(--gold)}
.one{
  background:none !important; box-shadow:none !important;
  text-align:center; font-weight:800; font-size:16px; color:var(--purple);
  padding:4px 8px !important; margin-bottom:14px;
}
.sec-h{text-align:center; margin:22px 0 10px; font-size:17px}
.feat{list-style:none; margin:0 0 6px}
.feat li{
  background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow);
  padding:13px 16px; margin-bottom:10px; font-size:15px;
}
.golden-list li{border-left:4px solid var(--gold)}
.golden-head{
  text-align:center; font-weight:800; color:var(--gold); margin:18px 0 10px; font-size:17px;
}

/* 버튼 */
.cta-row{display:flex; flex-direction:column; gap:10px; margin:20px 0}
.btn{
  display:block; width:100%; text-align:center; background:var(--pink); color:#fff;
  border:none; border-radius:999px; padding:15px; font-size:16px; font-weight:800;
  cursor:pointer; text-decoration:none; box-shadow:0 6px 16px rgba(255,92,138,.35);
}
.btn:active{transform:scale(.98)}
.btn.ghost{background:#fff; color:var(--pink); border:2px solid var(--pink); box-shadow:none}

/* 랭킹 */
.rank-list{list-style:none; margin:14px 0}
.rank-list li a{
  display:flex; align-items:center; gap:10px; background:var(--card); border-radius:14px;
  box-shadow:var(--shadow); padding:12px 14px; margin-bottom:8px;
  color:var(--ink); text-decoration:none; font-size:15px;
}
.rank-list .rk{font-weight:900; color:var(--purple); min-width:38px}
.rank-list .pts{margin-left:auto; color:var(--sub); font-size:13px}
.extra h2{margin-top:26px}
.links{list-style:none; margin:10px 0}
.links li{margin-bottom:8px}
.links a{color:var(--purple); font-weight:700; text-decoration:none}

/* 광고 슬롯 — 광고 코드가 삽입되기 전(빈 상태)에는 렌더링하지 않음 */
.ad-slot{min-height:90px; border-radius:var(--radius); margin:18px 0}
.ad-slot:empty{display:none}

/* 유형 테스트 */
.progress{height:8px; background:var(--pink-soft); border-radius:999px; margin:20px 0 8px; overflow:hidden}
#bar-fill{height:100%; width:0; background:var(--pink); border-radius:999px; transition:width .25s ease}
.q-num{text-align:center; color:var(--sub); font-size:13px; margin-bottom:12px}
.q-card{
  background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow);
  padding:26px 20px; text-align:center;
}
.stmt{font-size:17px; font-weight:700; min-height:52px; display:flex; align-items:center; justify-content:center}
.stmt-t{color:var(--pink)}
.stmt-b{color:var(--purple)}
.dot-labels{display:flex; justify-content:space-between; font-size:12px; font-weight:700; margin:16px 2px 0}
.lab-t{color:var(--pink)}
.lab-b{color:var(--purple)}
.dot-mid{font-size:12px; color:var(--sub); margin-top:8px}
.dots{display:flex; align-items:center; justify-content:space-between; margin:10px 8px 0}
.dot{
  border:3px solid var(--pink); background:#fff; border-radius:50%; cursor:pointer;
  transition:transform .1s ease, background .1s ease;
}
.dot.d1{width:44px; height:44px}
.dot.d2{width:36px; height:36px}
.dot.d3{width:28px; height:28px; border-color:var(--sub)}
.dot.d4{width:36px; height:36px; border-color:var(--purple)}
.dot.d5{width:44px; height:44px; border-color:var(--purple)}
.dot:active{transform:scale(.9)}
.dot.picked.d1,.dot.picked.d2{background:var(--pink)}
.dot.picked.d3{background:var(--sub)}
.dot.picked.d4,.dot.picked.d5{background:var(--purple)}
.result-card{text-align:center}
.result-card .char{width:150px; margin:14px auto; display:block}
.type-desc{color:var(--sub); font-size:15px; margin:6px 0 18px}
.axis-box{background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow); padding:18px 16px; text-align:left}
.axis-row{display:flex; align-items:center; gap:10px; margin-bottom:12px}
.axis-row:last-child{margin-bottom:0}
.axis-letter{font-weight:900; width:18px; color:var(--sub)}
.axis-letter.on{color:var(--pink)}
.axis-bar{flex:1; height:10px; background:var(--pink-soft); border-radius:999px; overflow:hidden}
.axis-fill{height:100%; background:linear-gradient(90deg,var(--pink),var(--purple)); border-radius:999px}
.axis-pct{font-size:13px; font-weight:800; width:64px; text-align:right}

/* 정적 페이지 */
.match h1,.rank-page h1{font-size:26px}
.match h2{margin-top:26px}
.foot{
  text-align:center; padding:26px 16px 34px; color:var(--sub); font-size:13px; background:#fff;
}
.foot a{color:var(--sub)}
.about-page p{margin-bottom:12px}

@media (max-width:380px){
  .cell img{max-width:62px}
  .score{font-size:54px}
  .couple img,.char{width:110px}
}
