/* ===== Reset & Variables ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #FE304A;
  --primary-dark: #e52b42;
  --primary-light: #ff6b7a;
  --secondary: #ff8fa3;
  --accent: #10b981;
  --dark: #1a1a2e;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --gradient-1: linear-gradient(135deg, #FE304A 0%, #ff6b7a 100%);
  --gradient-2: linear-gradient(135deg, #ff8fa3 0%, #ffb3c1 100%);
}

body {
  font-family: "Noto Sans KR", sans-serif;
  color: var(--gray-800);
  line-height: 1.6;
  background: var(--gray-50);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ===== Screen System ===== */
.screen {
  display: none;
  min-height: 100dvh;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.screen.active {
  display: flex;
  animation: fadeIn 0.4s ease;
}

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

.screen-inner {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.screen-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--dark);
}

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  padding: 16px 32px;
  background: var(--gradient-1);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(254, 48, 74, 0.3);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 280px;
  padding: 14px 24px;
  background: var(--gray-100);
  color: var(--gray-800);
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-200);
  transform: translateY(-1px);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  padding: 14px 24px;
  background: #fff;
  color: var(--gray-800);
  border: 2px solid var(--gray-200);
  border-radius: 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.btn-outline:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-text {
  display: inline-block;
  padding: 12px 24px;
  background: none;
  color: var(--gray-600);
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

/* ===== Intro Screen ===== */
#screen-intro {
  background: linear-gradient(180deg, #fff5f6 0%, #fff 40%);
}

.intro-emojis {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.intro-emojis span {
  font-size: 36px;
  animation: bounce 2s ease infinite;
}

.intro-emojis span:nth-child(1) { animation-delay: 0s; }
.intro-emojis span:nth-child(2) { animation-delay: 0.15s; }
.intro-emojis span:nth-child(3) { animation-delay: 0.3s; }
.intro-emojis span:nth-child(4) { animation-delay: 0.45s; }
.intro-emojis span:nth-child(5) { animation-delay: 0.6s; }
.intro-emojis span:nth-child(6) { animation-delay: 0.75s; }
.intro-emojis span:nth-child(7) { animation-delay: 0.9s; }
.intro-emojis span:nth-child(8) { animation-delay: 1.05s; }
.intro-emojis span:nth-child(9) { animation-delay: 1.2s; }
.intro-emojis span:nth-child(10) { animation-delay: 1.35s; }

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

.intro-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
  color: var(--dark);
}

.intro-subtitle {
  font-size: 16px;
  color: var(--gray-600);
  margin-bottom: 40px;
}

.intro-credit {
  margin-top: 20px;
  font-size: 13px;
  color: var(--gray-600);
}

.woota-logo-text {
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.woota-logo-img {
  height: 20px;
  width: auto;
  vertical-align: middle;
  border-radius: 4px;
  margin-left: 2px;
}

/* ===== Gender Screen ===== */
#screen-gender {
  background: #fff;
}

.gender-cards {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.gender-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 140px;
  height: 160px;
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.gender-card:hover {
  border-color: var(--primary);
  background: #fff5f6;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(254, 48, 74, 0.12);
}

.gender-icon {
  font-size: 48px;
}

.gender-label {
  font-size: 17px;
  font-weight: 600;
  color: var(--dark);
}

/* ===== Question Screen ===== */
#screen-question {
  background: #fff;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
  margin-bottom: 32px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-1);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

.question-number {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
}

.question-text {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 32px;
  color: var(--dark);
  min-height: 60px;
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-btn {
  width: 100%;
  padding: 16px 20px;
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-800);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  line-height: 1.4;
}

@media (hover: hover) {
  .answer-btn:hover {
    border-color: var(--primary-light);
    background: #fff5f6;
  }
}

.answer-btn:active,
.answer-btn.selected {
  border-color: var(--primary);
  background: #fff0f2;
  color: var(--primary-dark);
  font-weight: 600;
}

/* ===== Ad Screen ===== */
#screen-ad {
  background: linear-gradient(180deg, #fff5f6 0%, #fff 100%);
}

.ad-card {
  background: #fff;
  border-radius: 24px;
  padding: 40px 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.ad-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin-bottom: 20px;
}

.ad-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
}

.ad-brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 16px;
}

.ad-brand .woota-logo-text {
  font-size: 22px;
  font-weight: 800;
}

.ad-desc {
  font-size: 15px;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 28px;
}

.ad-badges {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  margin-bottom: 24px;
}

.badge-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 220px;
  padding: 12px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.badge-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.badge-link--apple {
  background: #000;
  color: #fff;
}

.badge-link--google {
  background: #fff;
  color: var(--dark);
  border: 1.5px solid #e5e7eb;
}

#ad-countdown {
  font-size: 14px;
  opacity: 0.7;
}

/* ===== Calculating Screen ===== */
#screen-calculating {
  background: linear-gradient(180deg, #fff5f6 0%, #fff 60%);
}

.calc-emoji {
  font-size: 72px;
  margin-bottom: 24px;
  animation: spin 1.5s ease infinite;
}

@keyframes spin {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.15) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.calc-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.5;
  margin-bottom: 20px;
}

.calc-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.calc-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  animation: dotPulse 1.2s ease infinite;
}

.calc-dots span:nth-child(2) { animation-delay: 0.2s; }
.calc-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ===== Result Screen ===== */
#screen-result {
  background: var(--gray-50);
  padding-top: 32px;
  padding-bottom: 48px;
}

#screen-result .screen-inner {
  max-width: 420px;
}

.result-card {
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
}

.result-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--gray-100);
  display: block;
}

.result-info {
  padding: 24px 20px 20px;
}

.result-name {
  font-size: 26px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 4px;
}

.result-type {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
}

.result-desc {
  font-size: 15px;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 16px;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.result-tag {
  display: inline-block;
  padding: 6px 14px;
  background: #fff0f2;
  color: var(--primary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.result-oneliner {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
  padding: 10px 16px;
  background: var(--gray-50);
  border-radius: 12px;
  line-height: 1.5;
}

.result-rarity {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 8px;
  padding: 8px 14px;
  background: var(--gray-50);
  border-radius: 10px;
  display: inline-block;
}

.result-rarity strong {
  color: var(--primary);
}

.result-watermark {
  font-size: 12px;
  color: var(--gray-200);
  font-weight: 600;
  text-align: center;
}

/* ===== Result Sections ===== */
.result-section {
  background: #fff;
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 20px;
  text-align: center;
}

/* ===== Stats Bars ===== */
.stats-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}

.stat-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: visible;
}

.stat-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.stat-fill--left {
  right: 50%;
  border-radius: 4px 0 0 4px;
}

.stat-fill--right {
  left: 50%;
  border-radius: 0 4px 4px 0;
}

.stat-center {
  position: absolute;
  top: -1px;
  left: 50%;
  width: 2px;
  height: 10px;
  background: var(--gray-200);
  transform: translateX(-50%);
}

.stat-dot {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--primary);
  transform: translate(-50%, -50%);
  transition: left 0.8s ease;
  z-index: 1;
}

/* ===== Compatibility ===== */
.compat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.compat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: 16px;
  text-align: center;
}

.compat-best {
  background: #fff0f2;
}

.compat-worst {
  background: var(--gray-50);
}

.compat-label {
  font-size: 14px;
  font-weight: 700;
}

.compat-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gray-100);
}

.compat-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
}

.compat-type {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
}

/* ===== Kakao Button ===== */
.btn-kakao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  padding: 16px 32px;
  background: #FEE500;
  color: #3C1E1E;
  border: none;
  border-radius: 16px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-kakao:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(254, 229, 0, 0.4);
}

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

/* ===== All Types Grid ===== */
.types-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.type-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--gray-50);
  border: 2px solid transparent;
  transition: all 0.2s;
  cursor: default;
  text-align: left;
}

.type-card.type-card--active {
  border-color: var(--primary);
  background: #fff0f2;
}

.type-card-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gray-100);
  flex-shrink: 0;
}

.type-card-info {
  min-width: 0;
}

.type-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.type-card-type {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-600);
}

/* ===== Result Actions ===== */
.result-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

/* ===== Download CTA ===== */
.download-cta {
  background: #fff;
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.cta-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.cta-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.4;
  margin-bottom: 8px;
}

.cta-subtitle {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 24px;
}

.cta-badges {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--dark);
  color: #fff;
  padding: 14px 28px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  white-space: nowrap;
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .intro-title {
    font-size: 26px;
  }

  .intro-emojis span {
    font-size: 28px;
  }

  .question-text {
    font-size: 18px;
  }

  .gender-card {
    width: 130px;
    height: 150px;
  }

  .result-name {
    font-size: 22px;
  }
}

@media (max-width: 380px) {
  .screen {
    padding: 20px 16px;
  }

  .gender-card {
    width: 120px;
    height: 140px;
  }

  .intro-title {
    font-size: 24px;
  }
}
