/* ================= 간격 조정용 변수 ================= */
:root {
  --space-text-to-promo: 48px;      /* 본문 → 홍보 이미지 */
  --space-promo-to-funding: 12px;   /* 홍보 이미지 → 펀딩 버튼 */
  --space-funding-to-share: 72px;   /* 펀딩 버튼 → 공유하기 */
  --space-share-to-result: 24px;    /* 공유하기 → 다시하기 */

  --side-padding: 24px;             /* 결과페이지 버튼/공유 영역 좌우 여백 */
}

/* ========= 폰트(전체 + 버튼까지) ========= */
* {
  font-family: "NanumSquareNeo", -apple-system, BlinkMacSystemFont, "Noto Sans KR", sans-serif;
}

button,
a,
input,
textarea,
select {
  font-family: inherit; /* ✅ 버튼에 폰트 안 먹는 문제 해결 핵심 */
}

/* ========= 기본 리셋 ========= */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden; /* 바깥 스크롤 막기 */
}

body {
  background-color: #355c4c;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ========= 모바일 프레임 공통 ========= */
.mobile-frame {
  width: 100%;
  max-width: 390px;
  height: 100vh;
  background-color: #ffffff;
  overflow: hidden;   /* 프레임 자체 스크롤 금지 */
  position: relative;
  margin: 0 auto;
}

/* PC/태블릿에서 390x844 고정 */
@media (min-width: 768px) {
  .mobile-frame {
    width: 390px;
    max-width: 390px;
    height: 844px;
    border-radius: 24px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
  }
}

/* ========= 화면 전환 ========= */
.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease-in-out;
  overflow: hidden; /* ✅ 기본: 모든 화면 스크롤 금지 */
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
}

/* ================= 인트로 화면 ================= */
#screen-intro {
  padding: 40px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

/* 상단 로고 */
.logo-wrap {
  display: flex;
  justify-content: center;
}

.logo-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}

#screen-intro .logo-wrap {
  margin-bottom: 32px;
}

.title {
  text-align: center;
  font-size: 22px;
  line-height: 1.4;
  color: #9b3c30;
  font-weight: 700;
  margin: 0 0 16px 0;
}

.subtitle {
  text-align: center;
  font-size: 14px;
  color: #333;
  margin: 0 0 32px 0;
  line-height: 1.6;
}

.hero-placeholder {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 32px;
}

.hero-img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.primary-btn {
  width: 100%;
  padding: 16px 0;
  border-radius: 999px;
  border: none;
  background-color: #9b3c30;
  color: #fff;
  font-size: 16px;
  margin-bottom: 24px;
  cursor: pointer;
  font-weight: 600;
}

.primary-btn:hover {
  background-color: #863127;
}

/* 하단 로고 */
.footer-logo {
  display: flex;
  justify-content: center;
}

.footer-img {
  width: 51px;
  height: 16px;
}

.q1-footer {
  margin-top: auto;
}

/* ================= Q1~Q8 공통 ================= */
.question-screen {
  padding: 40px 24px 32px;
  color: #fff;
}

.q1-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.q1-logo {
  margin-bottom: 24px;
}

.q-title {
  font-size: 28px;
  font-weight: 800; /* ExtraBold 느낌 */
  text-align: center;
  margin: 0 0 8px 0;
  color: #fff;
}

.q-desc {
  font-size: 14px;
  text-align: center;
  margin: 0 0 32px 0;
  color: #fff;
  line-height: 1.6;
}

.q-options {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.option-btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: 999px;
  border: none;
  background-color: #fff;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  line-height: 1.4;
  transition: background-color 0.3s ease-out, color 0.3s ease-out, box-shadow 0.3s ease-out;
}

.option-btn:hover {
  background-color: #A73E3A;
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.6), 0 0 24px rgba(255, 255, 255, 0.4);
}

.option-btn:active {
  transform: scale(0.98);
  background-color: #8d322f;
  color: #fff;
}

/* 배경 */
#screen-q1 { background: url("images/q1bg.png") center/cover no-repeat; }
#screen-q2 { background: url("images/q2bg.png") center/cover no-repeat; }
#screen-q3 { background: url("images/q3bg.png") center/cover no-repeat; }
#screen-q4 { background: url("images/q4bg.png") center/cover no-repeat; }
#screen-q5 { background: url("images/q5bg.png") center/cover no-repeat; }
#screen-q6 { background: url("images/q6bg.png") center/cover no-repeat; }
#screen-q7 { background: url("images/q7bg.png") center/cover no-repeat; }
#screen-q8 { background: url("images/q8bg.png") center/cover no-repeat; }

/* ================= 결과 화면 ================= */
.result-screen {
  background-color: #f5f2ef;
  color: #4a3a35;
}

/* ✅ 결과 화면만 스크롤 허용 */
.result-screen .result-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 캡쳐 영역 */
.result-capture {
  background-color: #f5f2ef;
}

/* ✅ 상단 이미지 박스: 390x514 고정 */
.result-top {
  width: 100%;
  height: 514px;
  background: linear-gradient(180deg, #9b3c30 0%, #7a322a 100%);
}

.result-card-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover; /* ✅ 빨간 박스를 “꽉” 채움 */
}

/* 하단 흰 영역(본문) */
.result-content {
  background-color: #fff;
  padding: 32px 24px 40px;
  text-align: center;
}

.result-label {
  font-size: 12px;
  color: #8a6a63;
  margin: 0 0 6px 0;
}

.result-name {
  font-size: 24px;
  font-weight: 900; /* Heavy 느낌 */
  color: #b34a3e;
  margin: 0 0 24px 0;
}

.result-text {
  font-size: 14px;
  line-height: 1.6;
  color: #4a3a35;
  margin: 0 0 24px 0;
}

/* ✅ 버튼/공유 영역: 좌우 여백 유지용 래퍼 */
.result-actions {
  padding: 0 var(--side-padding) 40px;
  background-color: #f5f2ef;
}

/* 프로모션 */
.promo-image-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: var(--space-text-to-promo);
  margin-bottom: var(--space-promo-to-funding);
}

.promo-image {
  width: 342px;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

/* 버튼 공통 */
.funding-btn,
.result-btn {
  display: block;
  width: 100%;
  padding: 16px 0;
  border-radius: 999px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

/* 텀블벅 */
.funding-btn {
  background-color: #8d322f;
  color: #fff;
  text-decoration: none;
  margin: 0 0 var(--space-funding-to-share) 0;
}

.funding-btn:hover {
  background-color: #FFF79A;
  color: #000;
}

/* 다시 테스트 */
.result-btn {
  background-color: #8d322f;
  color: #fff;
  margin-top: 0;
}

.result-btn:hover {
  background-color: #953b31;
}

/* 공유 섹션 */
.share-section {
  margin-bottom: var(--space-share-to-result);
}

.share-title {
  font-size: 14px;
  font-weight: 800;
  color: #8d322f;
  text-align: center;
  margin: 0 0 12px 0;
}

.share-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.share-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.share-icon-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

/* 캡쳐 중 숨김 */
.hide-on-capture {
  display: none !important;
}
