/* ============================================
   투자 유형 테스트 — 캐주얼/밈 스타일 v2
   나노바나나 | Mobile-First
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Jua&family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #FF6B6B;
  --primary-dark: #E85D5D;
  --accent: #FFE66D;
  --bg: #FFF9F0;
  --surface: #FFFFFF;
  --text: #2D2D2D;
  --text-muted: #888888;
  --border: #F0E8DA;
  --shadow: 0 4px 16px rgba(255, 107, 107, 0.12);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --font-jua: 'Jua', 'Noto Sans KR', sans-serif;
  --font-body: 'Noto Sans KR', sans-serif;
}

html,
body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* === SCREEN SYSTEM === */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
}

.screen.active {
  display: flex;
}

/* === LANG TOGGLE === */
.lang-toggle {
  display: flex;
  gap: 6px;
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
}

.lang-btn {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ===========================
   START SCREEN
   =========================== */
.start-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 72px 24px 40px;
  flex: 1;
}

.start-emoji {
  font-size: 72px;
  margin-bottom: 16px;
  animation: floatBounce 2.5s ease-in-out infinite;
}

@keyframes floatBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

.start-title {
  font-family: var(--font-jua);
  font-size: 32px;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 12px;
}

.start-sub {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
}

.start-hook {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 36px;
  padding: 10px 16px;
  background: #FFF0E0;
  border-radius: 12px;
  border-left: 3px solid var(--primary);
}

.btn-primary {
  display: block;
  width: 100%;
  max-width: 320px;
  padding: 18px 24px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--primary) 0%, #FF9F43 100%);
  color: #fff;
  font-family: var(--font-jua);
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(255, 107, 107, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.start-meta {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===========================
   QUESTION SCREEN
   =========================== */
.question-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 12px;
}

.btn-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.btn-back:hover {
  background: var(--bg);
  border-color: var(--primary);
}

.progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 10px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #FF9F43);
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.question-body {
  padding: 8px 24px 16px;
}

.q-badge {
  display: inline-block;
  padding: 4px 14px;
  background: linear-gradient(135deg, var(--primary), #FF9F43);
  color: #fff;
  font-family: var(--font-jua);
  font-size: 14px;
  border-radius: 50px;
  margin-bottom: 14px;
}

.q-text {
  font-family: var(--font-jua);
  font-size: 22px;
  line-height: 1.4;
  color: var(--text);
}

/* === CHOICES === */
.choices-list {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: var(--shadow-card);
  text-align: left;
  width: 100%;
}

.choice-card:hover {
  border-color: var(--primary);
  background: #FFF5F5;
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(255, 107, 107, 0.15);
}

.choice-card:active {
  transform: scale(0.98);
}

.choice-card.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, #FFF5F5, #FFEFE0);
  box-shadow: 0 4px 20px rgba(255, 107, 107, 0.2);
}

.choice-emoji {
  font-size: 26px;
  flex-shrink: 0;
  width: 38px;
  text-align: center;
}

.choice-text {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
}

/* ===========================
   RESULT SCREEN
   =========================== */
.result-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 32px;
}

.result-title-wrap {
  text-align: center;
  padding: 28px 24px 8px;
}

.result-eyebrow {
  font-family: var(--font-jua);
  font-size: 26px;
  color: var(--primary);
  margin-bottom: 4px;
}

.result-desc {
  font-size: 14px;
  color: var(--text-muted);
}

/* === RESULT CARD === */
.result-card {
  margin: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 2px solid #FFE0D0;
}

.result-card::before {
  content: '';
  display: block;
  height: 8px;
  background: linear-gradient(90deg, var(--primary), #FF9F43, var(--accent));
}

.result-emoji {
  text-align: center;
  font-size: 64px;
  padding: 24px 20px 8px;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.result-name {
  font-family: var(--font-jua);
  font-size: 34px;
  text-align: center;
  color: var(--text);
  padding: 0 20px 8px;
}

.result-tagline {
  font-size: 14px;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
  padding: 0 24px 16px;
  line-height: 1.5;
}

.result-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 0 20px 20px;
}

.keyword-pill {
  padding: 6px 14px;
  background: #FFF0E0;
  border: 1.5px solid #FFD4B3;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  color: #E87040;
}

/* === MEME IMAGE FRAME === */
.meme-frame {
  margin: 0 20px 20px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #F8F0E8;
  border: 2px dashed #FFD4B3;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.meme-img {
  width: 100%;
  height: auto;
  display: none;
  border-radius: calc(var(--radius-sm) - 2px);
}

.meme-img.loaded {
  display: block;
}

.meme-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.meme-ph-emoji {
  font-size: 64px;
}

/* ===========================
   OPPOSITE CARD (정반대 유형)
   =========================== */
.opposite-card {
  margin: 0 20px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}

.opposite-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.opposite-type-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.opposite-emoji {
  font-size: 36px;
  flex-shrink: 0;
}

.opposite-name {
  font-family: var(--font-jua);
  font-size: 22px;
  color: var(--text);
}

/* 말풍선 스타일 */
.meet-bubble {
  background: #FFF5E8;
  border: 1.5px solid #FFD4B3;
  border-radius: 14px;
  padding: 12px 16px;
  position: relative;
}

.meet-bubble::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 24px;
  border-width: 0 8px 10px 8px;
  border-style: solid;
  border-color: transparent transparent #FFD4B3 transparent;
}

.meet-bubble::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 25px;
  border-width: 0 7px 9px 7px;
  border-style: solid;
  border-color: transparent transparent #FFF5E8 transparent;
}

.meet-tag {
  display: block;
  font-family: var(--font-jua);
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 6px;
}

.opposite-meet {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  font-style: italic;
}

/* ===========================
   SHARE SECTION
   =========================== */
.share-section {
  margin: 8px 20px 16px;
  padding: 18px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-card);
}

.share-title {
  font-family: var(--font-jua);
  font-size: 16px;
  color: var(--text);
  margin-bottom: 14px;
  text-align: center;
}

.share-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 4px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.share-btn:hover {
  transform: translateY(-3px);
}

.share-btn:active {
  transform: scale(0.95);
}

.share-icon {
  font-size: 22px;
  line-height: 1;
}

.share-btn.kakao {
  background: #FEE500;
  color: #3C1E1E;
}

.share-btn.kakao .share-icon {
  font-size: 20px;
}

.share-btn.twitter {
  background: #000000;
  color: #FFFFFF;
  font-size: 22px;
}

.share-btn.twitter .share-icon {
  font-size: 20px;
  font-weight: 900;
  font-style: normal;
  font-family: 'Georgia', serif;
}

.share-btn.whatsapp {
  background: #25D366;
  color: #FFFFFF;
}

.share-btn.facebook {
  background: #1877F2;
  color: #FFFFFF;
  font-size: 22px;
}

.share-btn.facebook .share-icon {
  font-size: 22px;
  font-weight: 900;
  font-family: 'Georgia', serif;
}

.share-btn.copylink {
  background: #F3F3F3;
  color: #555;
}

/* ===========================
   RETRY
   =========================== */
.retry-wrap {
  padding: 0 20px;
}

.btn-retry {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-retry:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===========================
   TOAST
   =========================== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #2D2D2D;
  color: #fff;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 999;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Entry animations */
@keyframes slideUp {
  from {
    transform: translateY(24px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.choice-card {
  animation: slideUp 0.3s ease both;
}

.choice-card:nth-child(1) {
  animation-delay: 0.05s;
}

.choice-card:nth-child(2) {
  animation-delay: 0.10s;
}

.choice-card:nth-child(3) {
  animation-delay: 0.15s;
}

.choice-card:nth-child(4) {
  animation-delay: 0.20s;
}

/* Responsive */
@media (min-width: 480px) {
  .screen {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
  }

  body {
    background: #F5EDE0;
  }
}