* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* 브라우저 전체 바운스 및 주소창 들썩임 방지 */
html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  inset: 0;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

body {
  background: linear-gradient(135deg, #fdf2f8 0%, #f5f3ff 50%, #eff6ff 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #1e293b;
  padding: 0;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
}

/* ================= 1. 튜토리얼 스타일 ================= */
.tutorial-container {
  width: 100%;
  max-width: 440px;
  height: 100%;
  height: 100dvh;
  margin: auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.tutorial-container.fade-out-screen {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.card {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 32px;
  padding: 28px 22px;
  box-shadow: 0 20px 40px -10px rgba(148, 163, 184, 0.25), 0 0 25px rgba(236, 72, 153, 0.08);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.header-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f3e8ff;
  border: 1px solid #e9d5ff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #7e22ce;
}

.ai-dot {
  width: 7px;
  height: 7px;
  background: #a855f7;
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

.step-indicator {
  font-size: 0.82rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 1px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  margin-bottom: 20px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 14.28%;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.step-content {
  width: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.step-content.active {
  display: flex;
  animation: stepFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.step-content.fade-out {
  animation: stepFadeOut 0.25s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

.step-content.fade-out-back {
  animation: stepFadeOutBack 0.25s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

.character-container {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #fce7f3;
  box-shadow: 0 10px 25px rgba(236, 72, 153, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  padding: 8px;
  overflow: hidden;
}

.character-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pulse {
  animation: float 2.5s ease-in-out infinite;
}

.glow-ring {
  box-shadow: 0 0 25px rgba(236, 72, 153, 0.4);
  border-color: #f472b6;
  animation: float 2.5s ease-in-out infinite;
}

.main-title {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 12px;
  color: #0f172a;
}

.main-title .highlight {
  background: linear-gradient(120deg, #9333ea, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 14px;
  color: #0f172a;
}

.sub-desc {
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.55;
  margin-bottom: 24px;
}

.highlight-quote {
  background: #ffffff;
  border: 1px solid #f3e8ff;
  box-shadow: 0 6px 18px rgba(147, 51, 234, 0.05);
  border-radius: 20px;
  padding: 20px 16px;
  font-size: 1rem;
  line-height: 1.6;
  color: #334155;
  margin-bottom: 18px;
  width: 100%;
}

.highlight-quote strong {
  color: #db2777;
  font-weight: 800;
}

.benefit-badge {
  background: #fdf2f8;
  color: #db2777;
  border: 1px solid #fbcfe8;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.benefit-head {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
}

.benefit-body {
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.6;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.03);
  border-radius: 20px;
  padding: 18px 16px;
  margin-bottom: 20px;
  width: 100%;
}

.benefit-body strong {
  color: #db2777;
  font-weight: 700;
}

.detail-text {
  font-size: 0.86rem;
  color: #64748b;
  display: inline-block;
}

.final-desc {
  font-size: 0.94rem;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 24px;
}

.final-desc strong {
  color: #db2777;
  font-weight: 700;
}

.action-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 8px;
}

.next-btn {
  width: 100%;
  padding: 15px;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.next-btn:active {
  background: #f8fafc;
  transform: scale(0.98);
}

.glow-button {
  width: 100%;
  padding: 15px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(236, 72, 153, 0.35);
  animation: pulse-btn 1.8s infinite;
  transition: all 0.2s ease;
}

.glow-button:active {
  transform: scale(0.96);
}

.prev-text-btn {
  background: none;
  border: none;
  font-size: 0.86rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 8px;
}

/* 모달 팝업 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: #ffffff;
  border: 1px solid #fce7f3;
  border-radius: 28px;
  padding: 30px 22px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(236, 72, 153, 0.25);
  animation: scaleUp 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 10px;
}

.modal-desc {
  font-size: 0.94rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 18px;
}

.modal-desc strong {
  color: #db2777;
}

.warning-box {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #e11d48;
  font-size: 0.86rem;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 22px;
  line-height: 1.45;
}

.modal-close-btn {
  width: 100%;
  padding: 15px;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.3);
  transition: opacity 0.2s;
}

/* ================= 2. 제미나이(Gemini) 스타일 채팅 화면 ================= */
.chat-screen-container {
  width: 100%;
  max-width: 480px;
  height: 100%;
  height: 100dvh;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 10;
  animation: fadeInChat 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (min-width: 481px) {
  .chat-screen-container {
    height: 94vh;
    max-height: 850px;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 25px 60px -15px rgba(148, 163, 184, 0.35), 0 0 30px rgba(168, 85, 247, 0.1);
  }
}

.chat-screen-container.hidden {
  display: none;
}

/* 상단 헤더 (고정) */
.gemini-header {
  padding: 12px 18px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  z-index: 20;
}

.gemini-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gemini-sparkle {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: white;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.brand-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.model-tag {
  font-size: 0.68rem;
  font-weight: 700;
  background: #fdf2f8;
  color: #db2777;
  border: 1px solid #fbcfe8;
  padding: 2px 7px;
  border-radius: 999px;
}

.brand-status {
  font-size: 0.74rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
}

.header-avatar {
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-avatar:hover {
  transform: scale(1.12);
}

.header-avatar:active {
  transform: scale(0.92);
}

.header-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fbcfe8;
  object-fit: cover;
  box-shadow: 0 3px 8px rgba(236, 72, 153, 0.15);
}

/* ================= 대화 영역 (오직 여기만 스크롤 가능하도록 격리) ================= */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.chat-welcome {
  text-align: left;
  margin: 6px 0 14px 0;
  padding: 16px;
  background: linear-gradient(135deg, #fdf4ff 0%, #f5f3ff 100%);
  border: 1px solid #fae8ff;
  border-radius: 22px;
}

.welcome-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #9333ea;
  background: #ffffff;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(147, 51, 234, 0.1);
}

.welcome-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.35;
  color: #0f172a;
  margin-bottom: 8px;
}

.welcome-subtitle {
  font-size: 0.86rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 16px;
}

.welcome-subtitle strong {
  color: #db2777;
}

.suggestion-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chip {
  text-align: left;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 13px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.chip:active {
  background: #fdf2f8;
  border-color: #fbcfe8;
  color: #db2777;
  transform: scale(0.99);
}

.message-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.ai {
  justify-content: flex-start;
  align-items: flex-start;
}

.ai-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #fbcfe8;
  padding: 3px;
  flex-shrink: 0;
}

.ai-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.message-bubble {
  max-width: 80%;
  padding: 12px 15px;
  font-size: 0.92rem;
  line-height: 1.55;
  border-radius: 20px;
  word-break: break-word;
}

.message-row.user .message-bubble {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.25);
  font-weight: 500;
}

.message-row.ai .message-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #f1f5f9;
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.message-row.ai .message-bubble strong {
  color: #db2777;
}

/* 1초 로딩 퐁퐁 인디케이터 */
.loading-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 13px 18px;
  min-height: 40px;
}

.loading-dot {
  width: 7px;
  height: 7px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border-radius: 50%;
  animation: dotBounce 1.1s infinite ease-in-out;
}

.loading-dot:nth-child(1) { animation-delay: 0s; }
.loading-dot:nth-child(2) { animation-delay: 0.18s; }
.loading-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes dotBounce {
  0%, 80%, 100% {
    transform: translateY(0) scale(0.85);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-6px) scale(1.15);
    opacity: 1;
  }
}

/* 타이핑 커서 */
.typing-cursor::after {
  content: '▋';
  display: inline-block;
  vertical-align: baseline;
  color: #a855f7;
  animation: blink 0.7s infinite;
  margin-left: 2px;
}

/* 하단 입력창 (고정) */
.gemini-footer {
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)) 14px;
  border-top: 1px solid #f1f5f9;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  z-index: 20;
}

.input-box-wrapper {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  padding: 4px 6px 4px 16px;
  transition: border-color 0.2s;
}

.input-box-wrapper:focus-within {
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

#user-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.94rem;
  color: #0f172a;
}

#user-input::placeholder {
  color: #94a3b8;
}

#send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}

#send-btn:active {
  transform: scale(0.92);
}

.footer-disclaimer {
  text-align: center;
  font-size: clamp(0.55rem, 2.3vw, 0.68rem);
  letter-spacing: -0.4px;
  white-space: nowrap;
  color: #94a3b8;
  margin-top: 6px;
}

/* 날아가는 포차코 비행체 */
.flying-pochacco-clone {
  position: fixed;
  z-index: 9999;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #f472b6;
  box-shadow: 0 10px 30px rgba(236, 72, 153, 0.5);
  object-fit: contain;
  padding: 4px;
  pointer-events: none;
  transition: top 0.75s cubic-bezier(0.25, 1, 0.35, 1),
              left 0.75s cubic-bezier(0.25, 1, 0.35, 1),
              width 0.75s cubic-bezier(0.25, 1, 0.35, 1),
              height 0.75s cubic-bezier(0.25, 1, 0.35, 1),
              transform 0.75s cubic-bezier(0.25, 1, 0.35, 1),
              box-shadow 0.75s ease,
              border-color 0.75s ease;
}

/* 애니메이션 */
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes stepFadeOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-16px) scale(0.97); }
}

@keyframes stepFadeOutBack {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(16px) scale(0.97); }
}

@keyframes fadeInChat {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes scaleUp {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes pulse-btn {
  0%, 100% { box-shadow: 0 8px 25px rgba(236, 72, 153, 0.35); }
  50% { box-shadow: 0 10px 35px rgba(236, 72, 153, 0.65); transform: translateY(-1px); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
