/* ============ 내 인생의 꽃 — 수묵담채 · 한지 무드 ============ */
/* 시니어 UI 근거: 서울디지털재단 고령층 친화 표준(큰 글씨·글자 병기·한 화면 한 과업),
   WCAG 대비 4.5:1, 터치 타깃 44px 이상 (리서치 2026-07-06) */
:root {
  --hanji: #FBF7EE;         /* 한지 아이보리 */
  --paper: #FFFFFF;
  --ink: #2B2A26;           /* 먹색 */
  --ink-soft: #5C594F;
  --pine: #2E5E4E;          /* 소나무 녹 */
  --pine-deep: #234A3D;
  --dancheong: #B0533E;     /* 단청 주홍(차분하게) */
  --gold: #C29A4B;          /* 금박 포인트 */
  --line: #E6DFCE;
  --radius: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 18px; }                 /* 시니어 기본 크게 */
html.font-lg { font-size: 22px; }         /* [가+] 글자 크게 모드 */
body {
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  background: var(--hanji);
  color: var(--ink);
  line-height: 1.7;
  letter-spacing: -0.01em;
}
h1, h2, h3, .serif {
  font-family: 'Noto Serif KR', 'Nanum Myeongjo', 'Batang', 'Georgia', serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }

/* ---------- 화면 전환 ---------- */
.screen { display: none; min-height: 100vh; min-height: 100dvh; padding: 20px 22px calc(32px + env(safe-area-inset-bottom)); animation: fadeIn .5s ease; }
.screen.active { display: flex; flex-direction: column; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 접근성 바 ---------- */
.a11y-bar { display: flex; justify-content: flex-end; }
.btn-a11y {
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-size: .88rem; font-weight: 700; color: var(--pine-deep);
  cursor: pointer; font-family: inherit; min-height: 44px;
}
.btn-a11y.on { background: var(--pine); color: #fff; border-color: var(--pine); }
.a11y-plus { color: var(--dancheong); font-weight: 800; }
.btn-a11y.on .a11y-plus { color: #FFD9A0; }

/* ---------- 홈 ---------- */
.home-hero { text-align: center; padding-top: 3vh; }
.home-hero img { width: min(82%, 340px); border-radius: var(--radius); margin-bottom: 16px; }
.brand-eyebrow { font-size: .85rem; letter-spacing: .3em; color: var(--gold); margin-bottom: 8px; font-weight: 700; }
.brand-title { font-size: 2.7rem; line-height: 1.15; color: var(--ink); }
.brand-sub { font-size: 1.08rem; color: var(--pine-deep); margin-top: 10px; font-weight: 600; }
.brand-desc { font-size: 1rem; color: var(--ink-soft); margin-top: 14px; }
.brand-desc b { color: var(--pine-deep); }
.home-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.btn {
  border: none; cursor: pointer; width: 100%;
  padding: 18px 20px; border-radius: var(--radius);
  font-size: 1.15rem; font-weight: 700; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 56px;
  transition: transform .12s ease;
}
.btn:active { transform: scale(.98); }
.btn small { font-weight: 400; font-size: .82rem; opacity: .85; }
.btn-primary { background: var(--pine); color: #fff; box-shadow: 0 6px 16px rgba(35,74,61,.25); }
.btn-second { background: #F6EEDD; color: #7A5A1E; border: 1.5px solid #E2CFA4; }
.btn-ghost { background: var(--paper); color: var(--pine-deep); border: 1.5px solid var(--line); }
.home-note { font-size: .92rem; color: var(--ink-soft); text-align: center; margin-top: 18px; line-height: 1.75; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.home-note b { color: var(--pine-deep); }
.disclaimer { font-size: .78rem; color: #A29883; text-align: center; margin-top: 22px; line-height: 1.6; }
.credit { font-size: .78rem; color: #B3A88F; text-align: center; margin-top: 12px; }

/* ---------- 검사 ---------- */
.test-header { display: flex; align-items: center; gap: 12px; margin-bottom: 5vh; }
.btn-back { background: none; border: none; font-size: 1.5rem; color: var(--ink-soft); cursor: pointer; padding: 8px 10px; min-width: 44px; min-height: 44px; }
.progress-track { flex: 1; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--pine), var(--gold)); border-radius: 4px; transition: width .35s ease; }
.progress-label { font-size: .92rem; color: var(--ink-soft); min-width: 56px; text-align: right; font-weight: 700; }
.test-body { flex: 1; display: flex; flex-direction: column; }
.q-guide { font-size: .88rem; color: var(--gold); font-weight: 700; margin-bottom: 14px; }
.q-img { display: none; width: 100%; max-height: 26vh; object-fit: cover; border-radius: var(--radius); margin-bottom: 16px; border: 1.5px solid var(--line); }
.q-text { font-size: 1.45rem; font-weight: 700; line-height: 1.6; min-height: 3em; font-family: 'Noto Serif KR', 'Nanum Myeongjo', 'Batang', serif; }
.btn-tts {
  align-self: flex-start; background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 10px 18px; font-size: .95rem; font-weight: 700; color: var(--pine-deep);
  cursor: pointer; font-family: inherit; margin-top: 10px; min-height: 46px;
}
.btn-tts:active { background: #EFF3EE; }
.btn-tts.disabled { color: #A29883; background: #F3EFE6; border-color: var(--line); cursor: default; }
.q-options { display: flex; flex-direction: column; gap: 18px; margin-top: 26px; }
.q-opt {
  background: var(--paper); border: 2.5px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; font-size: 1.35rem; font-weight: 700; font-family: inherit; color: var(--ink);
  cursor: pointer; text-align: left; transition: border-color .15s, background .15s, box-shadow .15s;
  display: flex; align-items: center; gap: 18px; min-height: 84px;
}
.q-opt .mark {
  width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 800; border: 2.5px solid transparent;
}
/* 색약 대비: 색뿐 아니라 ○/✕ 모양·테두리로도 구분 (황반변성·백내장 배려) */
.q-opt.yes .mark { background: #E7F0EB; color: var(--pine-deep); border-color: var(--pine); }
.q-opt.no .mark { background: #F7ECE7; color: var(--dancheong); border-color: var(--dancheong); }
.q-opt.yes:active, .q-opt.yes.picked { border-color: var(--pine); background: #E7F0EB; box-shadow: 0 0 0 2px var(--pine) inset; }
.q-opt.no:active, .q-opt.no.picked { border-color: var(--dancheong); background: #F7ECE7; box-shadow: 0 0 0 2px var(--dancheong) inset; }
.btn-prev {
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius);
  color: var(--pine-deep); font-size: 1.05rem; font-weight: 700; font-family: inherit;
  margin-top: 26px; padding: 16px; cursor: pointer; width: 100%;
  min-height: 56px; display: none;
}
.btn-prev:active { background: #EFF3EE; }
.btn-prev.show { display: block; }

/* ---------- 결과: 꽃 공개 ---------- */
.reveal-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 0; }
.reveal-msg { color: var(--ink-soft); font-size: 1.2rem; margin-bottom: 20px; }
.reveal-card {
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 22px;
  padding: 30px 26px; width: min(88vw, 380px);
  box-shadow: 0 14px 40px rgba(61,56,41,.12);
  animation: bloom 1.1s cubic-bezier(.2,.7,.25,1);
}
@keyframes bloom { from { opacity: 0; transform: scale(.92) translateY(14px); } to { opacity: 1; transform: none; } }
.reveal-card img { width: 82%; border-radius: 14px; margin-bottom: 14px; }
.reveal-card .flower-name { font-size: 1.05rem; letter-spacing: .3em; color: var(--gold); font-weight: 700; }
.reveal-card .type-nick { font-size: 1.85rem; margin-top: 8px; }
.reveal-card .type-tag { font-size: 1.15rem; color: var(--ink-soft); margin-top: 12px; line-height: 1.65; }
.reveal-actions { width: min(88vw, 380px); margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- 결과: 리포트 ---------- */
.report { animation: fadeIn .5s ease; }
.report-section { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 24px 22px; margin-bottom: 14px; }
.report-section h3 { font-size: 1.3rem; color: var(--pine-deep); display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.report-section h3 .no { color: var(--gold); font-size: .92rem; letter-spacing: .1em; font-family: inherit; }
.report-hero { text-align: center; padding: 30px 22px; }
.report-hero img { width: min(64%, 240px); border-radius: 14px; margin-bottom: 12px; }
.report-hero .flower-name { font-size: 1rem; letter-spacing: .3em; color: var(--gold); font-weight: 700; }
.report-hero h2 { font-size: 1.95rem; margin-top: 8px; }
.report-hero .type-tag { color: var(--dancheong); font-size: 1.18rem; margin-top: 12px; font-weight: 600; }
.report-hero .type-summary { color: var(--ink); font-size: 1.18rem; margin-top: 16px; text-align: left; background: #F8F3E7; border-radius: 12px; padding: 17px 19px; line-height: 1.85; }
.report-hero .basis-line { font-size: .95rem; color: var(--ink-soft); margin-top: 14px; text-align: left; border-left: 3px solid var(--gold); padding-left: 12px; line-height: 1.7; }
.dogam-card .hint { font-size: .82rem; color: var(--ink-soft); margin-top: 4px; line-height: 1.5; }
ul.plain { list-style: none; }
ul.plain li { padding-left: 26px; position: relative; margin-bottom: 13px; font-size: 1.2rem; line-height: 1.75; }
ul.plain li::before { content: '❀'; position: absolute; left: 0; top: .2em; color: var(--gold); font-size: 1rem; }
.field-chip { display: inline-block; background: #EFF3EE; color: var(--pine-deep); border-radius: 999px; padding: 11px 18px; font-size: 1.1rem; font-weight: 700; margin: 0 6px 10px 0; }
.chip-note { font-size: .98rem; color: var(--ink-soft); margin-top: 8px; line-height: 1.7; }

/* 나의 세 갈래 */
.axes-rows { display: flex; flex-direction: column; gap: 12px; }
.axis-row { display: flex; align-items: baseline; gap: 12px; }
.axis-word { font-family: 'Noto Serif KR', 'Nanum Myeongjo', 'Batang', serif; font-weight: 700; font-size: 1.28rem; color: var(--pine-deep); min-width: 3.8em; }
.axis-desc { font-size: 1.1rem; color: var(--ink-soft); line-height: 1.6; }

/* 함께하면 좋은 꽃 */
.partner-card { display: flex; align-items: center; gap: 16px; background: #F8F3E7; border-radius: 12px; padding: 16px 18px; }
.partner-card img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.partner-card .p-name { font-weight: 700; font-size: 1.18rem; color: var(--ink); }
.partner-card .p-reason { font-size: 1.08rem; color: var(--ink-soft); margin-top: 5px; line-height: 1.65; }

.result-actions { display: flex; gap: 10px; margin: 18px 0 8px; }
.result-actions .btn { padding: 16px; font-size: 1.15rem; }

/* 참고문헌 */
.refs { background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: 15px 17px; margin-top: 18px; }
.refs summary { font-size: 1.02rem; font-weight: 700; color: var(--pine-deep); cursor: pointer; min-height: 34px; }
.refs ul { list-style: none; margin-top: 12px; }
.refs li { font-size: .9rem; color: var(--ink-soft); line-height: 1.7; padding-left: 14px; position: relative; margin-bottom: 9px; }
.refs li::before { content: '·'; position: absolute; left: 2px; color: var(--gold); font-weight: 700; }
.refs-note { font-size: .78rem; color: #A29883; margin-top: 10px; line-height: 1.6; }

/* 캡처용 공유 카드 */
.capture-overlay { position: fixed; inset: 0; z-index: 100; background: linear-gradient(165deg, #234A3D, #16302A); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; animation: fadeIn .3s ease; }
.capture-card { background: var(--hanji); border-radius: 20px; padding: 28px 26px; width: min(88vw, 350px); text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.capture-card img { width: 74%; border-radius: 14px; margin: 10px 0 12px; }
.cc-brand { font-size: .74rem; letter-spacing: .22em; color: var(--gold); font-weight: 800; }
.cc-flower { font-size: .88rem; letter-spacing: .3em; color: var(--dancheong); font-weight: 700; margin-top: 4px; }
.cc-nick { font-size: 1.45rem; margin-top: 4px; }
.cc-tag { font-size: .95rem; color: var(--ink-soft); margin-top: 10px; line-height: 1.6; }
.cc-guide { color: #DCEDE4; font-size: .98rem; margin-top: 18px; font-weight: 600; text-align: center; line-height: 1.6; }
.cc-close { width: min(88vw, 350px); margin-top: 12px; }

/* ---------- 도감 ---------- */
.dogam-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.dogam-header h2 { font-size: 1.3rem; }
.dogam-desc { font-size: .92rem; color: var(--ink-soft); margin: 4px 0 18px 40px; }
.dogam-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.dogam-card {
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 16px 14px; text-align: center; cursor: pointer; transition: transform .12s ease, border-color .15s;
  min-height: 44px;
}
.dogam-card:active { transform: scale(.97); border-color: var(--pine); }
.dogam-card img { width: 86%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; margin-bottom: 10px; background: #F3EEE1; }
.dogam-card .flower { font-size: .78rem; letter-spacing: .22em; color: var(--gold); font-weight: 700; }
.dogam-card .nick { font-size: 1rem; font-weight: 700; margin-top: 3px; line-height: 1.45; }
.img-fallback { width: 86%; aspect-ratio: 1; border-radius: 12px; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; background: #F3EEE1; color: var(--pine-deep); font-size: 1.5rem; font-family: 'Noto Serif KR', 'Batang', serif; font-weight: 700; }

/* PC에서도 단정하게 */
@media (min-width: 720px) {
  body { background: #F1EADB; }
  #app { max-width: 520px; box-shadow: 0 0 60px rgba(61,56,51,.08); background: var(--hanji); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
