/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #e8a020;
  --primary-dark: #c47d10;
  --secondary: #1a1a2e;
  --accent: #c0392b;
  --white: #ffffff;
}
html, body {
  width: 100%;
  min-height: 100vh;
  font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  background: var(--secondary);
  color: #333;
  overflow-x: hidden;
}
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  position: relative;
}

/* ── Screen ── */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  animation: fadeIn 0.35s ease;
}
.screen.active { display: flex; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Header ── */
.header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 18px 20px 14px;
  text-align: center;
  flex-shrink: 0;
}
.header-logo { font-size: 20px; font-weight: 800; color: #e8a020; letter-spacing: -0.5px; }
.header-logo span { color: #fff; }
.header-sub { font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 3px; }

/* ── Card ── */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 22px 20px;
  margin: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.card-title { font-size: 17px; font-weight: 700; color: #1a1a2e; margin-bottom: 8px; text-align: center; }
.card-sub { font-size: 13px; color: #666; text-align: center; line-height: 1.65; margin-bottom: 18px; }

/* ── Buttons ── */
.btn {
  display: block;
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  letter-spacing: -0.3px;
}
.btn:active { transform: scale(0.96); }
.btn-gold { background: linear-gradient(135deg,#f0c040,#e8a020); color: #1a1a2e; box-shadow: 0 4px 14px rgba(232,160,32,0.35); }
.btn-blue { background: linear-gradient(135deg,#1976d2,#1565c0); color: #fff; box-shadow: 0 4px 14px rgba(25,118,210,0.3); }
.btn-red { background: linear-gradient(135deg,#e53935,#c62828); color: #fff; box-shadow: 0 4px 14px rgba(229,57,53,0.3); }
.btn-green { background: linear-gradient(135deg,#43a047,#2e7d32); color: #fff; box-shadow: 0 4px 14px rgba(67,160,71,0.3); }
.btn-gray { background: #f0f0f0; color: #666; }
.btn-outline { background: #fff; color: #666; border: 2px solid #ddd; }
.btn-sm { padding: 11px; font-size: 13px; border-radius: 10px; }
.btn-amen { background: linear-gradient(135deg,#f0c040,#e8a020); color: #1a1a2e; font-size: 20px; font-weight: 800; padding: 18px; border-radius: 14px; box-shadow: 0 6px 20px rgba(232,160,32,0.4); letter-spacing: 2px; }
.btn-o { background: linear-gradient(135deg,#1976d2,#1565c0); color: #fff; font-size: 32px; font-weight: 900; padding: 20px; border-radius: 16px; box-shadow: 0 4px 15px rgba(25,118,210,0.3); flex: 1; }
.btn-x { background: linear-gradient(135deg,#e53935,#c62828); color: #fff; font-size: 32px; font-weight: 900; padding: 20px; border-radius: 16px; box-shadow: 0 4px 15px rgba(229,57,53,0.3); flex: 1; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .btn { flex: 1; margin: 0; }

/* ── Age Hero ── */
.age-hero {
  background: linear-gradient(160deg,#1a1a2e 0%,#16213e 50%,#0f3460 100%);
  padding: 36px 20px 28px;
  text-align: center;
}
.age-icon {
  width: 76px; height: 76px;
  background: rgba(232,160,32,0.13);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  border: 2px solid rgba(232,160,32,0.3);
}
.age-icon i { font-size: 34px; color: #e8a020; }
.age-title { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.age-desc { font-size: 14px; color: rgba(255,255,255,0.62); line-height: 1.7; }

/* ── Video ── */
.video-container { position: relative; background: #000; width: 100%; aspect-ratio: 16/9; flex-shrink: 0; cursor: pointer; }
.video-container video { width: 100%; height: 100%; object-fit: contain; }
.video-badge { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.7); color: #fff; font-size: 11px; padding: 4px 10px; border-radius: 20px; font-weight: 600; pointer-events: none; }
.reject-btn-video { position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,0.6); color: rgba(255,255,255,0.8); font-size: 11px; padding: 6px 12px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.3); cursor: pointer; font-weight: 500; display: none; z-index: 10; }
.reject-btn-video.visible { display: block; }
.video-progress-bar { height: 3px; background: #333; width: 100%; }
.video-progress-fill { height: 100%; background: #e8a020; width: 0%; transition: width 0.5s linear; }

/* ── 동영상 플레이/일시정지 오버레이 ── */
.video-play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.25);
  transition: opacity 0.25s;
  pointer-events: none;
}
.video-play-overlay.playing { opacity: 0; }
.video-play-overlay.playing:hover { opacity: 1; }
.play-icon-wrap {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid #e8a020;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
}
.play-icon-wrap i { font-size: 26px; color: #e8a020; margin-left: 4px; }
.video-play-overlay.playing .play-icon-wrap i { margin-left: 0; }
.video-info { padding: 12px 16px 8px; background: #fafafa; border-bottom: 1px solid #eee; }
.video-step { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #888; margin-bottom: 3px; }
.video-step-dot { width: 7px; height: 7px; border-radius: 50%; background: #e8a020; }
.video-title-text { font-size: 15px; font-weight: 700; color: #1a1a2e; }

/* ── Step Bar ── */
.step-bar { display: flex; padding: 10px 16px; background: #fafafa; border-bottom: 1px solid #eee; gap: 4px; align-items: center; flex-shrink: 0; }
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: #ddd; flex-shrink: 0; transition: all 0.3s; }
.step-dot.active { background: #e8a020; width: 20px; border-radius: 4px; }
.step-dot.done { background: #43a047; }
.step-label { font-size: 12px; color: #999; margin-left: 8px; }

/* ── Question Card ── */
.question-card { background: linear-gradient(135deg,#fff9e6,#fff3cc); border: 2px solid rgba(232,160,32,0.3); border-radius: 16px; padding: 22px 18px; margin: 14px; text-align: center; }
.question-icon { font-size: 30px; margin-bottom: 12px; }
.question-main { font-size: 15px; font-weight: 700; color: #1a1a2e; line-height: 1.65; margin-bottom: 10px; background: rgba(232,160,32,0.12); padding: 12px 14px; border-radius: 10px; border-left: 4px solid #e8a020; text-align: left; }
.question-guide { font-size: 13px; color: #666; margin-bottom: 18px; font-style: italic; }
.ox-row { display: flex; gap: 16px; margin-top: 16px; }
.red-choices { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

/* ── Form ── */
.form-group { margin-bottom: 14px; }
.form-label { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 6px; display: block; }
.form-input { width: 100%; padding: 13px 15px; border: 2px solid #e0e0e0; border-radius: 10px; font-size: 16px; outline: none; transition: border-color 0.2s; background: #fafafa; }
.form-input:focus { border-color: #e8a020; background: #fff; }

/* ── Time Chips ── */
.time-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { padding: 10px 14px; border-radius: 25px; border: 2px solid #ddd; background: #fff; font-size: 13px; font-weight: 600; color: #666; cursor: pointer; transition: all 0.2s; }
.chip.active { border-color: #e8a020; background: rgba(232,160,32,0.1); color: #c47d10; }
.time-input-wrap { display: none; margin-top: 8px; }
.time-input-wrap.show { display: block; }

/* ── Complete Hero ── */
.complete-hero { background: linear-gradient(160deg,#1a1a2e 0%,#0f3460 100%); padding: 48px 20px 38px; text-align: center; flex-shrink: 0; }
.complete-icon { width: 86px; height: 86px; background: rgba(232,160,32,0.13); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; border: 3px solid rgba(232,160,32,0.4); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(232,160,32,0.4); } 50% { transform: scale(1.03); box-shadow: 0 0 0 12px rgba(232,160,32,0); } }
.complete-icon i { font-size: 40px; color: #e8a020; }
.complete-title { font-size: 21px; font-weight: 800; color: #fff; line-height: 1.5; margin-bottom: 10px; }
.complete-sub { font-size: 14px; color: rgba(255,255,255,0.62); line-height: 1.7; }

/* ── Consent Note ── */
.consent-note { background: #f8f0ff; border: 1px solid #ce93d8; border-radius: 10px; padding: 12px 14px; font-size: 13px; color: #4a148c; margin-bottom: 14px; line-height: 1.6; }

/* ── Loading ── */
.loading-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 999; }
.loading-overlay.show { display: flex; }
.spinner { width: 46px; height: 46px; border: 4px solid rgba(255,255,255,0.2); border-top-color: #e8a020; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.scroll-pad { padding-bottom: 28px; }

/* ── Consent Warning (부모동의 사전안내) ── */
.consent-warning {
  background: linear-gradient(135deg,#fff3e0,#fce4ec);
  border: 2px solid #ef9a9a;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: #4a148c;
  line-height: 1.75;
  margin-bottom: 4px;
}
.consent-warning strong { color: #b71c1c; font-size: 14px; }

/* ── Prayer Hero ── */
.prayer-hero {
  background: linear-gradient(160deg,#1b5e20 0%,#2e7d32 50%,#388e3c 100%);
  padding: 28px 20px 22px;
  text-align: center;
  flex-shrink: 0;
}
.prayer-icon { font-size: 40px; margin-bottom: 10px; }
.prayer-title { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 6px; letter-spacing: -0.5px; }
.prayer-sub { font-size: 13px; color: rgba(255,255,255,0.8); line-height: 1.7; }

/* ── Prayer 레이아웃: 스크롤 영역 + 고정 버튼 ── */
/* .screen의 min-height를 override → 정확히 100vh로 고정해야 버튼이 항상 하단 고정 */
#screen-prayer {
  display: none;
  flex-direction: column;
  height: 100vh !important;
  min-height: unset !important;
  overflow: hidden;
}
#screen-prayer.active { display: flex; }
.prayer-scroll-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #f9f9f9;
}
.prayer-footer {
  flex-shrink: 0;
  padding: 12px 16px 24px;
  background: #fff;
  border-top: 2px solid #e8f5e9;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.10);
}

/* ── Prayer Card & Text ── */
.prayer-card {
  background: linear-gradient(135deg,#f1f8e9,#e8f5e9);
  border: 2px solid #a5d6a7;
  margin-bottom: 0;
}
.prayer-text {
  background: #fff;
  border-radius: 14px;
  padding: 24px 20px;
  border-left: 6px solid #43a047;
  line-height: 2.3;
  font-size: 17px;
  color: #1a1a2e;
  font-weight: 600;
  text-align: center;
}
.prayer-text p { margin: 0 0 4px 0; }
.prayer-text p:last-child { margin-bottom: 0; }
.prayer-amen {
  font-size: 18px;
  font-weight: 900;
  color: #1b5e20;
  margin-top: 10px !important;
  padding-top: 12px;
  border-top: 2px dashed #a5d6a7;
  letter-spacing: 0.5px;
}

/* ── OX 버튼 - 어두운색장 퀴즈에서 answerDark 기록용 ── */
.btn-o-wrap, .btn-x-wrap { flex: 1; }
