﻿/* ============================================
   투자 유형 테스트 — 캐주얼/밈 스타일 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;
}

.guide-toggle {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
}

.guide-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 2px solid #2D2D2D;
  background: var(--accent);
  color: #2D2D2D;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 2px 2px 0 rgba(45, 45, 45, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.guide-btn:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 rgba(45, 45, 45, 0.35);
}

.guide-btn:active {
  transform: translateY(0);
  box-shadow: 2px 2px 0 rgba(45, 45, 45, 0.35);
}

/* ===========================
   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: 16px;
}

.start-illustration {
  margin-bottom: 24px;
  width: 100%;
  max-width: 360px;
}

.main-character-img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  border-radius: 14px;
  border: 2px solid var(--text);
  box-shadow: 4px 4px 0 rgba(45, 45, 45, 0.3);
  background: #FFF2DF;
  padding: 14px;
}

.start-name-wrap {
  width: 100%;
  max-width: 320px;
  margin-bottom: 12px;
}

.start-name-input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: #fff;
}

.start-name-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.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);
}

.start-participants {
  margin-top: 10px;
  font-size: 12px;
  color: #6B6253;
  font-weight: 600;
}

.start-disclaimer {
  margin-top: 10px;
  max-width: 360px;
  font-size: 11px;
  line-height: 1.45;
  color: #9A8C74;
}

.start-comments-wrap {
  width: 100%;
  max-width: 380px;
  margin-top: 18px;
}

/* ===========================
   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-userline {
  font-family: var(--font-jua);
  font-size: 18px;
  color: #A86340;
  margin-bottom: 6px;
}

/* === 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;
}

.hidden {
  display: none !important;
}

.result-mix {
  margin: 0 20px 18px;
  padding: 12px 14px;
  background: #FFF7EE;
  border: 1.5px solid #FFE1C9;
  border-radius: 12px;
}

.mix-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.mix-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
}

.mix-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 700;
  text-align: right;
}

.confidence-row {
  padding-top: 8px;
  margin-top: 6px;
  border-top: 1px dashed #FFD4B3;
}

.confidence-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.confidence-badge.high {
  background: #D8F6DF;
  color: #1F7A38;
}

.confidence-badge.medium {
  background: #FFF3C4;
  color: #9A6A00;
}

.confidence-badge.low {
  background: #FFE2E2;
  color: #B53A3A;
}

.confidence-hint {
  font-size: 12px;
  color: #A86340;
  line-height: 1.45;
  margin-top: 8px;
}

/* === 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, minmax(0, 1fr));
  gap: 10px;
}

.share-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

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

.share-btn span:not(.share-icon) {
  display: none;
}

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

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

.share-btn.twitter {
  background: #000000;
  color: #FFFFFF;
}

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

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

.share-btn.facebook {
  background: #1877F2;
  color: #FFFFFF;
}

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

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

/* ===========================
   COMMENTS
   =========================== */
.comments-section {
  margin: 8px 20px 24px;
  padding: 18px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-card);
  text-align: left;
}

.start-comments-section {
  margin: 0;
  padding: 14px;
}

.comments-title {
  font-family: var(--font-jua);
  font-size: 18px;
  color: var(--text);
  margin-bottom: 12px;
  text-align: center;
}

#comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.comment-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.comment-inputs input,
#comment-content {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  background: #fff;
}

#comment-content {
  resize: vertical;
  min-height: 84px;
}

.comment-textarea-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-submit-comment {
  align-self: flex-end;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #FF9F43);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 18px;
  cursor: pointer;
}

.btn-submit-comment:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}

.start-comments-section .comments-list {
  max-height: 240px;
}

.comments-loading,
.comments-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 10px 0;
}

.comments-note {
  color: #8A6A2D;
  background: #FFF8E8;
  border: 1px solid #F3DEB2;
  border-radius: 10px;
  font-size: 12px;
  text-align: center;
  padding: 8px 10px;
}

.comment-item {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}

.comment-item.is-reply {
  margin-top: 8px;
  margin-left: 14px;
  background: #FFFCF4;
  border-style: dashed;
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.comment-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.comment-date {
  font-size: 11px;
  color: var(--text-muted);
}

.comment-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 6px;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-action-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  line-height: 1.2;
  cursor: pointer;
}

.comment-action-btn.solid {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.comment-action-btn.danger {
  color: #C33C3C;
  border-color: #F1B3B3;
}

.comment-children {
  margin-top: 8px;
}

.reply-form {
  margin-top: 8px;
  border: 1px solid #F3DEB2;
  border-radius: 10px;
  background: #FFFDF7;
  padding: 8px;
}

.reply-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 6px;
}

.reply-form input,
.reply-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: var(--font-body);
  background: #fff;
}

.reply-form textarea {
  resize: vertical;
  min-height: 64px;
}

.reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
}

@media (max-width: 420px) {
  .reply-inputs {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   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: var(--bg);
  }
}

/* ===========================
   SITE FOOTER
   =========================== */
.site-footer {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 20px 22px;
  text-align: center;
}

.site-footer-inline {
  max-width: none;
  padding: 20px 0 0;
}

.site-footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.site-footer-links a {
  font-size: 12px;
  color: #6B6253;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-footer-links a:hover {
  color: var(--text);
  border-color: #BDAE95;
}

.site-footer-copy {
  margin-top: 8px;
  font-size: 11px;
  color: #94856C;
}

.site-footer-copy a {
  color: inherit;
}
