@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@700;800;900&display=swap');

:root {
  /* meditation-app 톤의 따뜻한 파스텔 팔레트 */
  --primary: #FF7A63;
  --primary-dark: #E85A42;
  --primary-light: #FFE3DC;
  --accent-pink: #FF6B9D;
  --accent-pink-light: #FFE5EE;
  --accent-mint: #3AAFBD;
  --accent-mint-light: #DCF3F3;
  --accent-amber: #F0B93E;
  --accent-blue: #6EC3E0;
  --bg-main: #FDF4E9;
  --bg-card: #FFFFFF;
  --text-primary: #1E3A45;
  --text-secondary: #6B7C82;
  --text-muted: #9CA8AC;
  --border: #F1E6D8;
  --shadow-sm: 0 2px 10px rgba(45, 33, 90, 0.06);
  --shadow-md: 0 10px 28px rgba(45, 33, 90, 0.10);
  --radius-md: 18px;
  --radius-lg: 26px;
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: 'Pretendard', 'Malgun Gothic', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  word-break: keep-all; /* 한글 단어 중간에서 어색하게 줄바꿈되는 것 방지 (예: "스타일은?" -> "은?" 혼자 남는 문제) */
  overflow-wrap: break-word;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 28px 20px 60px; width: 100%; }

.serif { font-family: 'Lato', 'Pretendard', sans-serif; }

/* ===== 배경 앰비언트 블롭 (크림 바탕 + 코랄/틸/머스터드) ===== */
.bg-blob-layer { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.bg-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; animation: blob-float 16s ease-in-out infinite; }
.bg-blob.b1 { width: 320px; height: 320px; background: #FFC9B8; top: -80px; left: -80px; animation-delay: 0s; }
.bg-blob.b2 { width: 260px; height: 260px; background: #BDEAEA; top: 140px; right: -100px; animation-delay: -5s; }
.bg-blob.b3 { width: 280px; height: 280px; background: #FBE3A8; bottom: -100px; left: 25%; animation-delay: -9s; }
@keyframes blob-float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(20px,-24px) scale(1.08); } }
.wrap { position: relative; z-index: 1; }

/* ===== 헤더 ===== */
.hub-header { text-align: center; padding: 20px 0 8px; }
.hub-logo { font-family: 'Lato', sans-serif; font-size: 15px; font-weight: 800; color: var(--primary-dark); letter-spacing: .5px; }
.date-chip {
  display: inline-flex; align-items: center; gap: 6px; margin: 14px 0 6px; padding: 6px 14px;
  border-radius: 999px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  font-size: 12.5px; font-weight: 700; color: var(--primary-dark);
}
.hub-title { font-family: 'Lato', 'Pretendard', sans-serif; font-size: clamp(24px, 5.5vw, 38px); font-weight: 900; margin: 10px 0 6px; line-height: 1.25; letter-spacing: -.5px; }
.hub-sub { font-size: clamp(14px, 2.2vw, 16px); color: var(--text-secondary); line-height: 1.6; margin: 0 auto; max-width: 480px; }

/* ===== 커버카드 갤러리 (meditation-app 스타일: 히어로 1장 + 파스텔 그리드) ===== */
.cover-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 30px; }
.cover-card {
  position: relative; display: block; aspect-ratio: 1 / 1.08; border-radius: 26px; overflow: hidden;
  text-decoration: none; color: #fff; box-shadow: 0 10px 22px rgba(30, 40, 40, .14);
  transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s ease;
}
.cover-hero { grid-column: 1 / -1; aspect-ratio: 2.5 / 1; }
.cover-card:hover { transform: translateY(-6px) scale(1.015); box-shadow: 0 16px 30px rgba(30, 40, 40, .2); }
.cover-card:active { transform: translateY(-2px) scale(.99); }

.cv-tarot   { background: linear-gradient(120deg, #FF9478 0%, #F4694F 100%); }
.cv-love    { background: linear-gradient(120deg, #FF9BB8 0%, #F0577E 100%); }
.cv-loneliness { background: linear-gradient(120deg, #5FC9D3 0%, #2E97A4 100%); }
.cv-stress  { background: linear-gradient(120deg, #FBCF6C 0%, #E0A72A 100%); }
.cv-mood    { background: linear-gradient(120deg, #8FCBE8 0%, #4E9FC4 100%); }

/* 카드 안에 둥둥 떠 있는 유기적인 블롭 텍스처(반투명 원) — meditation-app 특유의 레이어드 블롭 느낌 */
.cover-sparkle {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.cover-sparkle::before, .cover-sparkle::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.18);
}
.cover-sparkle::before { width: 70%; aspect-ratio: 1; top: -20%; right: -18%; }
.cover-sparkle::after { width: 45%; aspect-ratio: 1; bottom: -14%; left: -10%; background: rgba(255,255,255,.12); }

.cover-frame { display: none; }
.cover-corner { display: none; }

.cover-badge {
  position: absolute; top: 12px; right: 12px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.28); backdrop-filter: blur(4px);
  font-size: 10.5px; font-weight: 800; letter-spacing: .3px; z-index: 2; color: #fff;
}
.cover-icon {
  position: absolute; top: 6%; left: 50%; right: 0; bottom: 42%; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center;
}
.cover-hero .cover-icon { left: 14%; right: auto; bottom: 8%; top: 8%; transform: none; }
.cover-icon img {
  width: 50%; max-width: 110px; height: auto;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.18));
}
.cover-hero .cover-icon img { width: auto; height: 84%; max-width: none; }
.cover-body {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px 16px;
}
.cover-hero .cover-body { left: 42%; right: 16px; bottom: 0; top: 0; display: flex; flex-direction: column; justify-content: center; padding: 0; }
.cover-eyebrow { font-family: 'Lato', sans-serif; font-size: 12px; letter-spacing: 1.2px; opacity: .95; text-transform: uppercase; margin: 0 0 5px; font-weight: 800; }
.cover-title {
  font-family: 'Lato', 'Pretendard', sans-serif; font-weight: 800; font-size: clamp(17px, 4.2vw, 20px); line-height: 1.3; margin: 0 0 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cover-hero .cover-title { font-size: clamp(20px, 4.6vw, 26px); -webkit-line-clamp: 2; }
.cover-tag {
  font-size: clamp(12.5px, 3vw, 14px); opacity: .95; line-height: 1.45; margin: 0; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.pill-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 12px 0 4px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.pill-love { background: var(--accent-pink-light); color: #C0356E; }
.pill-new { background: #FFF4DC; color: #9A6100; }

/* ===== 검사 진행 화면 ===== */
.test-page { max-width: 560px; }
.progress-bar { height: 6px; border-radius: 4px; background: var(--border); overflow: hidden; margin-bottom: 22px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent-pink)); transition: width .25s ease; }
.q-num { font-size: 13px; color: var(--primary-dark); font-weight: 700; margin-bottom: 8px; }
.q-text { font-size: clamp(18px, 4vw, 23px); font-weight: 700; line-height: 1.5; margin: 0 0 22px; }
.opt-list { display: flex; flex-direction: column; gap: 10px; }
.opt-btn {
  text-align: left; padding: 16px 18px; border-radius: 14px; border: 1.5px solid var(--border);
  background: var(--bg-card); font-size: 15.5px; font-family: inherit; color: var(--text-primary);
  cursor: pointer; transition: all .15s ease;
}
/* hover는 마우스가 있는 기기에서만 — 터치 기기는 탭 시 :hover가 남아
   다음 문항에서 같은 위치 버튼이 "이미 선택된 것"처럼 보이는 버그 방지 */
@media (hover: hover) and (pointer: fine) {
  .opt-btn:hover { border-color: var(--primary); background: var(--primary-light); }
}
.opt-btn.selected { border-color: var(--primary); background: var(--primary-light); font-weight: 700; }

/* ===== 인트로 화면 ===== */
.intro-box { text-align: center; padding: 26px 4px 10px; }
.intro-badge { display: inline-block; padding: 5px 14px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: .5px; margin-bottom: 14px; }
.intro-emoji { font-size: 56px; animation: bob 2.2s ease-in-out infinite; }
.intro-icon-img { width: 96px; height: 96px; display: block; margin: 0 auto; filter: drop-shadow(0 8px 14px rgba(45,33,90,.18)); }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.intro-title { font-size: clamp(20px, 4.2vw, 26px); font-weight: 800; margin: 14px 0 10px; line-height: 1.4; font-family: 'Lato', 'Pretendard', sans-serif; }
.intro-hook { font-size: 15px; color: var(--text-secondary); line-height: 1.7; margin: 0 auto 20px; max-width: 420px; }

.checklist-box {
  text-align: left; margin: 0 auto 22px; max-width: 400px; background: #fff; border: 1px solid var(--border);
  border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.checklist-label { font-size: 12px; font-weight: 800; color: var(--text-muted); margin: 0 0 10px; letter-spacing: .3px; }
.checklist-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; padding: 5px 0; color: var(--text-primary); }
.checklist-item .ck { flex: none; color: var(--primary); font-weight: 800; }

.intro-meta-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.intro-meta-chip { font-size: 12px; color: var(--text-secondary); background: var(--bg-main); border: 1px solid var(--border); padding: 5px 12px; border-radius: 999px; }

/* ===== 결과 화면 ===== */
.result-card {
  text-align: center; padding: 30px 20px 24px; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  animation: pop-in .35s ease;
}
@keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(6px); } to { opacity: 1; transform: none; } }
.shared-badge { text-align: center; font-size: 13px; font-weight: 700; color: var(--primary-dark); background: var(--primary-light); border-radius: 999px; padding: 7px 14px; display: block; width: fit-content; margin: 0 auto 14px; }
.result-eyebrow { font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); font-weight: 800; margin: 0 0 10px; }
.result-emoji { font-size: 52px; margin-bottom: 6px; }
.result-band { font-family: 'Lato', 'Pretendard', sans-serif; font-size: 22px; font-weight: 700; margin: 0 0 18px; }
.gauge { height: 12px; border-radius: 8px; background: var(--border); overflow: hidden; max-width: 320px; margin: 0 auto; }
.gauge-fill { height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--accent-mint), var(--accent-amber), var(--accent-pink)); transition: width 1s cubic-bezier(.22,1,.36,1); }
.gauge-label { font-size: 13px; color: var(--text-secondary); margin: 10px 0 18px; }
.result-desc { text-align: center; font-size: 15px; color: var(--text-secondary); line-height: 1.7; margin: 0 auto; max-width: 420px; }

/* ===== 유형(연애스타일) 결과 카드 ===== */
.type-card {
  position: relative; text-align: center; padding: 34px 22px 26px; border-radius: var(--radius-lg);
  overflow: hidden; color: #fff; animation: pop-in .35s ease;
  background: linear-gradient(135deg, #FF9BB8 0%, #F0577E 100%);
}
.type-card .cover-sparkle { animation-duration: 3.4s; }
.type-eyebrow { position: relative; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; opacity: .85; margin: 0 0 10px; }
.type-emoji { position: relative; font-size: 54px; margin-bottom: 8px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.25)); }
.type-title { position: relative; font-family: 'Lato', 'Pretendard', sans-serif; font-size: 23px; font-weight: 700; margin: 0 0 10px; }
.type-desc { position: relative; font-size: 14px; line-height: 1.7; opacity: .95; max-width: 380px; margin: 0 auto 18px; }
.type-traits { position: relative; display: flex; flex-direction: column; gap: 8px; max-width: 340px; margin: 0 auto 16px; text-align: left; }
.type-trait { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-radius: 12px; padding: 9px 12px; }
.type-match { position: relative; display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 8px 16px; font-size: 12.5px; font-weight: 700; }

.share-row { display: flex; gap: 10px; justify-content: center; align-items: center; margin: 16px 0; flex-wrap: wrap; }
.btn-share {
  padding: 12px 22px; border-radius: 999px; border: none;
  background: linear-gradient(90deg, var(--primary), var(--accent-pink)); color: #fff;
  font-weight: 700; font-size: 14.5px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.btn-share:hover { filter: brightness(1.05); }
.btn-share-link {
  padding: 12px 18px; border-radius: 999px; border: 1.5px solid var(--primary);
  background: #fff; color: var(--primary-dark); font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.btn-share-link:hover { background: var(--primary-light); }

.basis-box {
  margin-top: 22px; border: 1px solid var(--border); border-radius: 14px; padding: 4px 16px; background: #fff;
}
.basis-box summary { padding: 12px 0; font-size: 13.5px; font-weight: 700; color: var(--text-secondary); cursor: pointer; }
.basis-body { font-size: 13px; color: var(--text-secondary); line-height: 1.8; padding-bottom: 14px; }
.basis-body ul { margin: 6px 0; padding-left: 18px; }

.cta-box {
  margin-top: 20px; padding: 20px 18px; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border); text-align: center;
}
.cta-box-urgent {
  background: linear-gradient(135deg, var(--primary-light), var(--accent-pink-light));
  border-color: transparent;
}
.cta-lead { font-size: 13.5px; line-height: 1.7; margin: 0 0 16px; color: var(--text-secondary); }
.cta-box-urgent .cta-lead { color: var(--text-primary); font-size: 14.5px; }
.cta-buttons { display: flex; flex-direction: column; gap: 9px; }
.cta-btn {
  display: block; padding: 12px 14px; border-radius: 14px; text-decoration: none;
  font-weight: 600; font-size: 13.5px; background: #fff; color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.cta-btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; font-size: 15px; padding: 14px; border-radius: 999px; }
.cta-note { margin: 16px 0 0; font-size: 11.5px; color: var(--text-muted); }

/* ===== 자세한 결과 설명(하위 영역 + 맞춤 조언) ===== */
.dim-box {
  margin-top: 18px; padding: 18px 18px 16px; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border); text-align: left;
}
.dim-title { font-size: 12.5px; font-weight: 800; color: var(--text-muted); letter-spacing: .3px; margin: 0 0 14px; }
.dim-row { margin-bottom: 12px; }
.dim-row:last-child { margin-bottom: 0; }
.dim-row-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.dim-row-pct { color: var(--text-secondary); font-weight: 600; }
.dim-bar { height: 8px; border-radius: 6px; background: var(--border); overflow: hidden; }
.dim-bar-fill { height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--primary), var(--accent-pink)); transition: width 1s cubic-bezier(.22,1,.36,1); }

.tips-box {
  margin-top: 18px; padding: 18px 18px 16px; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border); text-align: left;
}
.tips-box-alert { background: #FFF8EE; border-color: #F5E0BE; }
.tips-title { font-size: 13.5px; font-weight: 800; margin: 0 0 12px; }
.tips-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.tips-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; line-height: 1.6; color: var(--text-secondary); }
.tips-box-alert .tips-list li { color: #8A5A1E; }

.type-match-alert { display: flex; width: fit-content; background: rgba(0,0,0,.14); margin: 8px auto 0; }
.tips-list li::before { content: '·'; color: var(--primary); font-weight: 900; font-size: 18px; line-height: 1.2; }

/* ===== 공통 버튼/링크 ===== */
.btn-next {
  display: block; width: 100%; padding: 15px; margin-top: 22px; border: none; border-radius: 999px;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 16px; cursor: pointer;
  font-family: 'Lato', 'Pretendard', sans-serif; box-shadow: 0 8px 18px rgba(255,122,99,.28);
}
.btn-next:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--text-secondary); text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--primary-dark); }

.disclaimer { margin-top: 34px; text-align: center; font-size: 12px; color: var(--text-muted); line-height: 1.7; }

@media (max-width: 380px) {
  .cover-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-blob, .cover-sparkle, .intro-emoji, .cover-card { animation: none !important; transition: none !important; }
}

/* ===== 태블릿/데스크톱: 화면이 넓어져도 카드는 항상 2열(2x2)로 고정, 갤러리 폭만 넓게 ===== */
@media (min-width: 760px) {
  .home-wrap { max-width: 820px; }
  .cover-grid { gap: 18px; }
}
@media (min-width: 1100px) {
  .home-wrap { max-width: 900px; }
  .cover-grid { gap: 20px; }
  .cover-card { border-radius: 26px; }
}
@media (min-width: 1100px) and (hover: hover) {
  .cover-card:hover { transform: translateY(-8px) scale(1.02); }
}
