/* apps/xmastype/style.css — 크리스마스 성격 테스트: 크림색 종이 + 전나무 초록 잉크 + 베리 빨강·금색 포인트, 귀여운 연말 캐릭터 그림(tools/art.js).
 * 결과 페이지는 그 결과 색(--c-main 강조 · --c-deep 글자 · --c-ink 옅은 바탕)으로 물든다.
 * 모바일 한 줄(--app-width 480px). 글꼴은 언어 파일 fonts → :root 변수(--font-display 등, 생성기가 이 파일 뒤에 둔다).
 * 공통 타이틀 바(G.topBar)·끝 화면(data-mg-end)은 --mg-* 변수로만 색을 맞춘다.
 */
:root {
  --paper: #fbf5ea;
  --paper-2: #fffbf4;
  --pine: #1d4a37;
  --pine-ink: #1d3b2f;
  --berry: #c8323f;
  --berry-deep: #9c1f2b;
  --gold: #f2b705;
  --ink: #1d3b2f;
  --ink-dim: #46594f;
  --ink-faint: #7d8c84;
  --card: #ffffff;
  --line: rgba(29, 74, 55, 0.18);
  --snow: rgba(29, 74, 55, 0.11);
  /* 결과 색 (결과 페이지 body 의 style 이 덮어쓴다) */
  --c-main: #c8323f;
  --c-deep: #1d4a37;
  --c-ink: #fdf3e4;

  --font-display: 'Nunito', var(--font-sans);
  --display-weight: 800;
  --wb: normal;
  --hyphens: manual;

  /* 공통 타이틀 바 · 언어 선택 */
  --mg-top-fg: var(--pine);
  --mg-top-badge-bg: var(--berry);
  --mg-top-badge-fg: #fff;
  --lang-bg: #fff;
  --lang-fg: var(--pine);
  --lang-border: rgba(29, 74, 55, 0.25);
  /* 공통 끝 화면 */
  --mg-star-on: var(--gold);
  --mg-star-off: rgba(29, 74, 55, 0.18);
  --mg-heart-bg: #fff0f1;
  --mg-heart-border: #f4b3b9;
  --mg-heart-fg: #c8323f;
  --mg-heart-on: #d93a48;
  --mg-share-bg: #fff;
  --mg-share-border: rgba(29, 74, 55, 0.16);
  --mg-x: var(--pine-ink);
  --mg-tiktok: var(--pine-ink);
  --mg-faq-bg: #fff;
  --mg-faq-border: rgba(29, 74, 55, 0.14);
  --mg-end-retry-bg: var(--pine);
  --mg-end-retry-fg: #fff;
  --toast-bg: rgba(29, 59, 47, 0.95);
}

html { background: var(--paper); }
body.xt-body {
  min-height: 100vh;
  background-color: var(--paper);
  background-image: radial-gradient(var(--snow) 2px, transparent 2.2px), radial-gradient(var(--snow) 1.4px, transparent 1.6px);
  background-size: 34px 34px, 22px 22px;
  background-position: 0 0, 11px 17px;
  color: var(--ink);
  line-height: 1.6;
  word-break: var(--wb);
  hyphens: var(--hyphens);
  -webkit-hyphens: var(--hyphens);
}
body.xt-result-page {
  background-image:
    radial-gradient(ellipse 120% 40% at 50% -8%, color-mix(in srgb, var(--c-main) 26%, transparent), transparent 70%),
    radial-gradient(var(--snow) 2px, transparent 2.2px), radial-gradient(var(--snow) 1.4px, transparent 1.6px);
  background-size: auto, 34px 34px, 22px 22px;
  background-position: 0 0, 0 0, 11px 17px;
}
[hidden] { display: none !important; }
a { color: inherit; }

/* 제목·버튼 글꼴: base.css 의 :lang(zh|th|vi) 규칙보다 뒤에서 다시 지정 */
.xt-h1, .xt-kicker, .xt-h1-main, .xt-h1-main em, .xt-badge, .xt-btn, .xt-q-text, .xt-q-num, .xt-result-name, .xt-eyebrow, .xt-vibe, .xt-sub,
.xt-loading-text, .xt-cta strong, .xt-doc h1, .xt-progress-num, .xt-meta span, .xt-keys li, .xt-pair-label, .xt-pair-name, .xt-perfect {
  font-family: var(--font-display);
}

/* ---------------- 배경: 천천히 떠다니는 장식 (고정, 가로 넘침 없음) ---------------- */
.xt-sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.xt-float {
  position: absolute; font-size: 26px; line-height: 1; opacity: 0.24;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  animation: xt-drift 9s ease-in-out infinite alternate;
}
.xt-float-1 { top: 14%; left: calc(50% - 240px - 54px); }
.xt-float-2 { top: 38%; right: calc(50% - 240px - 50px); animation-delay: -3s; }
.xt-float-3 { top: 70%; left: calc(50% - 240px - 46px); animation-delay: -6s; }
.xt-float-4 { top: 84%; right: calc(50% - 240px - 56px); animation-delay: -1.5s; }
@keyframes xt-drift { from { transform: translateY(10px) rotate(-8deg); } to { transform: translateY(-12px) rotate(8deg); } }

.mg-top, .xt-shell { position: relative; z-index: 1; }

/* ---------------- 공통 레이아웃 ---------------- */
.xt-shell { max-width: var(--app-width); margin: 0 auto; padding: 8px 16px 0; }
.xt-screen { padding-top: 12px; }

.xt-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 58px;
  padding: 12px 20px;
  border: 0; border-radius: 16px;
  font-size: 21px; font-weight: var(--display-weight);
  line-height: 1.25;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.xt-btn-primary {
  background: var(--berry);
  color: #fff;
  border: 3px solid var(--pine-ink);
  box-shadow: 0 5px 0 var(--pine-ink);
}
.xt-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--pine-ink); }
.xt-btn:focus-visible, .xt-choice:focus-visible, .xt-back:focus-visible { outline: 3px dashed var(--pine); outline-offset: 4px; }

/* ---------------- 그림 ---------------- */
.xt-hero { position: relative; display: grid; place-items: center; width: 188px; height: 188px; margin: 10px auto 0; }
.xt-art {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  filter: drop-shadow(0 10px 18px color-mix(in srgb, var(--h-main) 30%, transparent));
}
.xt-char { transform-box: view-box; transform-origin: 100px 170px; animation: xt-sway 3.2s ease-in-out infinite; }
@keyframes xt-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-3px); } }
.xt-q {
  position: absolute; right: -2px; top: -2px; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold); color: var(--pine-ink); border: 3px solid var(--pine-ink);
  font: 900 28px/1 'Nunito', sans-serif;
  box-shadow: 0 4px 0 var(--pine-ink);
  animation: xt-bob 2.2s ease-in-out infinite reverse;
}
@keyframes xt-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-4px) rotate(4deg); } }
.xt-hero-loading { width: 170px; height: 170px; margin-bottom: 14px; }
.xt-hero-loading .xt-char { animation-duration: 0.7s; }
.xt-hero-result { width: 180px; height: 180px; margin: 0 auto; }

/* ---------------- 시작 화면 (티징만) ---------------- */
.xt-start { text-align: center; padding-top: 16px; }
.xt-badge {
  display: inline-block; margin: 0 0 4px; max-width: 100%;
  padding: 5px 14px; border-radius: 999px;
  background: #fff; border: 2px solid var(--pine);
  color: var(--pine); font-size: 15px; font-weight: var(--display-weight); line-height: 1.3;
}
.xt-h1 { margin: 12px 0 10px; line-height: 1.15; font-weight: var(--display-weight); }
.xt-kicker { display: block; margin-bottom: 8px; font-size: 17px; color: var(--berry-deep); letter-spacing: 0.02em; }
.xt-h1-main { display: block; font-size: 35px; line-height: 1.22; color: var(--pine); overflow-wrap: break-word; }
.xt-h1-main em {
  font-style: normal;
  background: linear-gradient(transparent 58%, rgba(242, 183, 5, 0.55) 58%);
  padding: 0 2px;
}
.xt-hook { margin: 0 auto 14px; max-width: 390px; font-size: 16px; color: var(--ink-dim); }
.xt-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; font-size: 15px; color: var(--ink-dim); }
.xt-meta span { padding: 4px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }

/* ---------------- 질문 ---------------- */
.xt-progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.xt-back {
  flex: 0 0 auto; width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 2px solid var(--pine); border-radius: 50%;
  background: #fff; color: var(--pine); cursor: pointer;
}
.xt-progress { flex: 1; height: 12px; border-radius: 999px; background: rgba(29, 74, 55, 0.1); overflow: hidden; }
.xt-progress-fill {
  height: 100%; width: 0; border-radius: inherit;
  background: repeating-linear-gradient(-45deg, var(--berry) 0 8px, #fff 8px 14px);
  transition: width 0.3s ease;
}
.xt-progress-num { flex: 0 0 auto; font-size: 16px; color: var(--ink-dim); min-width: 3.4em; text-align: right; }

.xt-q-card {
  position: relative;
  padding: 20px 16px 16px;
  border-radius: 20px;
  background: var(--card);
  border: 2.5px solid var(--pine-ink);
  box-shadow: 0 6px 0 var(--pine-ink);
  animation: xt-in 0.28s ease;
}
@keyframes xt-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.xt-q-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.xt-q-emoji { font-size: 28px; line-height: 1; }
.xt-q-num { font-size: 17px; color: var(--berry-deep); font-weight: var(--display-weight); }
.xt-q-text { margin: 0 0 16px; font-size: 21px; line-height: 1.4; font-weight: var(--display-weight); color: var(--pine); overflow-wrap: break-word; }
.xt-choices { display: flex; flex-direction: column; gap: 10px; }
.xt-choice {
  width: 100%; min-height: 54px;
  padding: 12px 16px;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 16px; line-height: 1.4; font-weight: 600;
  overflow-wrap: break-word;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
@media (hover: hover) { .xt-choice:hover { border-color: var(--pine); background: #eef6ef; } }
.xt-choice:active { transform: scale(0.985); }
.xt-choice.is-picked { border-color: var(--pine-ink); background: var(--gold); box-shadow: 0 3px 0 var(--pine-ink); }
.xt-quiz .mg-ad { margin-top: 20px; }

/* ---------------- 포장 푸는 중 ---------------- */
.xt-loading { text-align: center; padding: 40px 0; }
.xt-loading-text { margin: 0 0 4px; font-size: 23px; font-weight: var(--display-weight); color: var(--pine); }
.xt-loading-sub { margin: 0; font-size: 14px; color: var(--berry-deep); font-weight: 700; }

/* ---------------- 결과 ---------------- */
.xt-cta {
  display: flex; align-items: center; gap: 12px;
  margin: 8px 0 14px; padding: 12px 16px;
  border-radius: 16px; border: 2px solid var(--pine-ink);
  background: #eef6ef; color: var(--pine); text-decoration: none;
  box-shadow: 0 4px 0 var(--pine-ink);
}
.xt-cta-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.xt-cta-text strong { font-size: 17px; font-weight: var(--display-weight); }
.xt-cta-text span { font-size: 14px; color: var(--ink-dim); }
.xt-cta-arrow { font-size: 22px; }

.xt-card {
  position: relative;
  margin-top: 14px; padding: 18px 18px 20px;
  text-align: center;
  background: var(--card);
  border: 2.5px solid var(--pine-ink);
  border-radius: 22px;
  box-shadow: 0 7px 0 var(--pine-ink);
}
.xt-eyebrow { margin: 8px 0 0; font-size: 16px; font-weight: var(--display-weight); color: var(--ink-dim); }
.xt-result-title { margin: 4px 0 0; line-height: 1.2; }
.xt-result-name { display: block; font-size: 31px; font-weight: var(--display-weight); line-height: 1.2; color: var(--c-deep); overflow-wrap: break-word; }
.xt-vibe { margin: 10px 0 0; font-size: 18px; line-height: 1.45; font-weight: var(--display-weight); color: var(--pine); }
.xt-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.xt-keys li {
  padding: 4px 12px; border-radius: 999px;
  background: var(--c-ink); border: 1.5px solid var(--c-main);
  color: var(--c-deep); font-size: 14px; font-weight: var(--display-weight); line-height: 1.35;
}
.xt-same {
  display: inline-block; margin: 12px 0 0; padding: 4px 14px; border-radius: 999px;
  background: var(--c-ink); border: 1.5px dashed var(--c-main);
  color: var(--c-deep); font-size: 13.5px; font-weight: 800;
}
.xt-desc { margin: 14px 0 4px; font-size: 15.5px; line-height: 1.75; color: var(--ink-dim); text-align: left; }
.xt-sub { margin: 18px 0 8px; font-size: 18px; font-weight: var(--display-weight); color: var(--c-deep); text-align: left; line-height: 1.3; }

.xt-traits { margin: 0; padding: 0; list-style: none; text-align: left; }
.xt-traits li { position: relative; margin: 0 0 6px; padding: 0 0 0 26px; font-size: 15px; line-height: 1.55; color: var(--ink-dim); }
.xt-traits li::before { content: '✦'; position: absolute; left: 4px; top: 0; font-weight: 900; color: var(--c-main); }
.xt-note { margin-top: 14px; padding: 2px 14px 12px; border-radius: 14px; background: var(--c-ink); border: 1.5px dashed var(--c-main); text-align: left; }
.xt-note .xt-sub { margin: 10px 0 4px; font-size: 16px; }
.xt-perfect { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--pine); font-weight: 700; }

/* 찰떡궁합·라이벌: 보여주기만 (링크·hover·pointer 없음 — 누를 수 있어 보이지 않게) */
.xt-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.xt-pair-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0;
  padding: 10px 8px 12px; border-radius: 16px;
  background: var(--paper-2); border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent);
  cursor: default; user-select: none;
}
.xt-pair-label { font-size: 13px; font-weight: var(--display-weight); line-height: 1.3; color: var(--ink-dim); overflow-wrap: anywhere; }
.xt-pair-art { display: block; width: 64px; height: 72px; }
.xt-mini { width: 100%; height: 100%; max-width: none; }
.xt-pair-name { font-size: 15px; font-weight: var(--display-weight); line-height: 1.3; color: var(--pine); overflow-wrap: break-word; max-width: 100%; }

/* 재미용 안내 */
.xt-disclaimer { margin: 14px 0 0; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1.5px dashed rgba(29, 74, 55, 0.3); font-size: 13px; line-height: 1.5; color: var(--ink-dim); text-align: center; }

/* ---------------- 개인정보 ---------------- */
.xt-doc { padding: 16px 0; font-size: 15px; line-height: 1.75; color: var(--ink-dim); }
.xt-doc h1 { font-size: 28px; color: var(--pine); margin: 8px 0 12px; line-height: 1.3; }
.xt-doc h2 { font-size: 17px; color: var(--berry-deep); margin: 22px 0 6px; }
.xt-doc a { text-decoration: underline; }

.site-footer { position: relative; z-index: 1; color: var(--ink-faint); }

/* 언어별 조정 */
html:lang(th) .xt-body { line-height: 1.75; }
html:lang(th) :is(.xt-h1-main, .xt-result-name, .xt-q-text, .xt-vibe, .xt-pair-name) { line-height: 1.5; letter-spacing: 0; }
html:lang(th) :is(.xt-kicker, .xt-badge, .xt-pair-label) { letter-spacing: 0; }
html:lang(vi) :is(.xt-h1-main, .xt-result-name, .xt-q-text) { line-height: 1.4; }
html:lang(ru) .xt-doc h1 { line-height: 1.25; }
html:lang(de) :is(.xt-pair-label, .xt-pair-name, .xt-result-name, .xt-q-text, .xt-choice, .xt-h1-main) { hyphens: auto; -webkit-hyphens: auto; }
html:lang(ru) :is(.xt-pair-label, .xt-pair-name, .xt-result-name) { hyphens: auto; -webkit-hyphens: auto; }
html:lang(ja) :is(.xt-h1-main, .xt-result-name, .xt-q-text, .xt-vibe) { word-break: auto-phrase; }
html:lang(ko) :is(.xt-h1-main, .xt-result-name, .xt-q-text, .xt-vibe, .xt-hook, .xt-desc, .xt-traits li, .xt-perfect, .xt-pair-name) { word-break: keep-all; }

@media (max-width: 374px) {
  .xt-h1-main { font-size: 30px; }
  .xt-result-name { font-size: 28px; }
  .xt-q-text { font-size: 19px; }
  .xt-hero-result { width: 160px; height: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  .xt-float, .xt-char, .xt-q, .xt-q-card { animation: none !important; }
  .xt-progress-fill, .xt-btn, .xt-choice { transition: none; }
}
