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

:root {
  --primary: #D4A574;
  --primary-dark: #B8895A;
  --primary-light: #E8C9A0;
  --secondary: #8B6914;
  --accent: #7B9E6B;
  --dark: #1C1210;
  --dark-card: #2A1F1A;
  --dark-surface: #362A22;
  --cream: #FDF5EC;
  --cream-soft: #F5EDE3;
  --text-light: #E8DDD3;
  --text-muted: #A89888;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-600: #9CA3AF;
  --gray-800: #1e293b;
  --gradient-1: linear-gradient(135deg, #D4A574 0%, #E8C9A0 100%);
  --gradient-2: linear-gradient(135deg, #8B6914 0%, #C4A882 100%);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
}

body {
  font-family: "Noto Sans KR", sans-serif;
  color: var(--text-light);
  line-height: 1.6;
  background: var(--dark);
  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.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  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(--cream);
}

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  padding: 18px 32px;
  background: var(--gradient-1);
  color: var(--dark);
  border: none;
  border-radius: 60px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: -0.3px;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(212, 165, 116, 0.35);
}

.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(--dark-surface);
  color: var(--text-light);
  border: 1px solid var(--glass-border);
  border-radius: 60px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-secondary:disabled {
  opacity: 0.4;
  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: transparent;
  color: var(--text-light);
  border: 2px solid var(--glass-border);
  border-radius: 60px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(212, 165, 116, 0.1);
  transform: translateY(-1px);
}

/* ===== Intro Screen ===== */
#screen-intro {
  background: radial-gradient(ellipse at 50% 30%, #3D2A1E 0%, var(--dark) 70%);
  position: relative;
  overflow: hidden;
}

#screen-intro::before {
  content: "";
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(212, 165, 116, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.intro-hero {
  position: relative;
  margin-bottom: 32px;
}

.intro-cup {
  font-size: 100px;
  display: block;
  animation: cupFloat 3s ease-in-out infinite;
}

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

.intro-steam {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.intro-steam span {
  display: block;
  width: 3px;
  height: 30px;
  background: linear-gradient(to top, rgba(212, 165, 116, 0.4), transparent);
  border-radius: 3px;
  animation: steam 2s ease-in-out infinite;
}

.intro-steam span:nth-child(1) { animation-delay: 0s; height: 24px; }
.intro-steam span:nth-child(2) { animation-delay: 0.3s; height: 32px; }
.intro-steam span:nth-child(3) { animation-delay: 0.6s; height: 28px; }

@keyframes steam {
  0% { opacity: 0; transform: translateY(0) scaleY(0.5); }
  50% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-20px) scaleY(1.2); }
}

.intro-beans {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
  opacity: 0.5;
}

.intro-beans span {
  font-size: 20px;
  animation: beanPulse 3s ease infinite;
}

.intro-beans span:nth-child(1) { animation-delay: 0s; }
.intro-beans span:nth-child(2) { animation-delay: 0.5s; }
.intro-beans span:nth-child(3) { animation-delay: 1s; }
.intro-beans span:nth-child(4) { animation-delay: 1.5s; }
.intro-beans span:nth-child(5) { animation-delay: 2s; }

@keyframes beanPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.15); }
}

.intro-title {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 14px;
  color: var(--cream);
  letter-spacing: -1px;
}

.intro-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 48px;
  letter-spacing: -0.2px;
}

.intro-credit {
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

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

/* ===== Gender Screen ===== */
#screen-gender {
  background: var(--dark);
}

.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(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
  backdrop-filter: blur(8px);
}

.gender-card:hover {
  border-color: var(--primary);
  background: rgba(212, 165, 116, 0.1);
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(212, 165, 116, 0.15);
}

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

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

/* ===== Question Screen ===== */
#screen-question {
  background: var(--dark);
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
}

.progress-ring {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.progress-ring svg {
  transform: rotate(-90deg);
  width: 56px;
  height: 56px;
}

.progress-ring-bg {
  fill: none;
  stroke: var(--dark-surface);
  stroke-width: 4;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 150.8;
  stroke-dashoffset: 150.8;
  transition: stroke-dashoffset 0.5s ease;
}

.progress-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
}

/* Legacy progress bar - hidden, kept for JS compatibility */
.progress-bar {
  display: none;
}

.progress-fill {
  display: none;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--gray-600);
  font-family: "Noto Sans KR", sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0;
  margin: 8px 0 0;
  float: left;
  transition: color 0.2s;
}

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

.btn-back:active {
  color: var(--primary-dark);
}

.btn-back svg {
  flex-shrink: 0;
}

.question-number {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  clear: both;
}

.question-text {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 36px;
  color: var(--cream);
  min-height: 60px;
  letter-spacing: -0.5px;
}

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

.answer-btn {
  width: 100%;
  padding: 18px 24px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  text-align: left;
  transition: all 0.3s;
  line-height: 1.4;
  backdrop-filter: blur(8px);
}

@media (hover: hover) {
  .answer-btn:hover {
    border-color: var(--primary);
    background: rgba(212, 165, 116, 0.1);
    transform: translateX(4px);
  }
}

.answer-btn:active,
.answer-btn.selected {
  border-color: var(--primary);
  background: rgba(212, 165, 116, 0.2);
  color: var(--primary-light);
  font-weight: 600;
  transform: translateX(4px);
}

/* ===== Ad Screen ===== */
#screen-ad {
  background: radial-gradient(ellipse at 50% 50%, #3D2A1E 0%, var(--dark) 70%);
}

.ad-card {
  background: var(--dark-card);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 40px 24px;
  backdrop-filter: blur(8px);
}

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

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

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

.ad-desc {
  font-size: 15px;
  color: var(--text-muted);
  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: 60px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
}

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

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

.badge-link--google {
  background: var(--dark-surface);
  color: var(--text-light);
  border: 1px solid var(--glass-border);
}

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


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

/* ===== Confetti Canvas ===== */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* ===== Result Reveal Animations ===== */
@keyframes resultRevealUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

#screen-result.active .result-card {
  animation: resultRevealUp 0.7s ease forwards;
}

#screen-result.active .result-stats {
  opacity: 0;
  animation: resultRevealFade 0.5s ease forwards;
  animation-delay: 0.3s;
}

#screen-result.active .result-compat {
  opacity: 0;
  animation: resultRevealFade 0.5s ease forwards;
  animation-delay: 0.5s;
}

#screen-result.active .result-content-section {
  opacity: 0;
  animation: resultRevealFade 0.5s ease forwards;
}

#screen-result.active .result-content-section:nth-child(1) {
  animation-delay: 0.6s;
}
#screen-result.active .result-content-section:nth-child(2) {
  animation-delay: 0.7s;
}
#screen-result.active .result-content-section:nth-child(3) {
  animation-delay: 0.8s;
}

#screen-result.active .result-actions {
  opacity: 0;
  animation: resultRevealFade 0.5s ease forwards;
  animation-delay: 0.7s;
}

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

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

.result-card {
  background: var(--dark-card);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
  margin-bottom: 24px;
}

/* ===== Shimmer Loading ===== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.img-loading {
  background-image: linear-gradient(90deg, var(--gray-200) 25%, #ffffff 50%, var(--gray-200) 75%) !important;
  background-size: 200% 100% !important;
  animation: shimmer 4s infinite ease-in-out !important;
  color: transparent !important;
  overflow: hidden;
}

/* ===== Result Image ===== */
.result-image {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--dark-surface);
  display: block;
}

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

.result-name {
  font-size: 28px;
  font-weight: 800;
  color: var(--cream);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

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

.result-desc {
  font-size: 15px;
  color: var(--text-muted);
  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: rgba(212, 165, 116, 0.15);
  color: var(--primary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(212, 165, 116, 0.2);
}

.result-oneliner {
  font-size: 17px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 8px;
  padding: 12px 16px;
  background: var(--dark-surface);
  border-radius: 14px;
  line-height: 1.5;
  border-left: 3px solid var(--primary);
}

/* ===== Rarity Gauge ===== */
.result-rarity-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--dark-surface);
  border-radius: 14px;
  margin-bottom: 8px;
}

.rarity-gauge-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.rarity-gauge {
  width: 60px;
  height: 60px;
  transform: rotate(-90deg);
}

.rarity-gauge-bg {
  fill: none;
  stroke: var(--dark-card);
  stroke-width: 6;
}

.rarity-gauge-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 213.6;
  stroke-dashoffset: 213.6;
  transition: stroke-dashoffset 1.2s ease;
}

.rarity-tier-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.rarity-tier-badge.tier-ssr {
  color: #FFD700;
}
.rarity-tier-badge.tier-sr {
  color: #C084FC;
}
.rarity-tier-badge.tier-s {
  color: #60A5FA;
}
.rarity-tier-badge.tier-r {
  color: #34D399;
}

.rarity-text {
  text-align: left;
}

.rarity-pct {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.rarity-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

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

/* ===== Result Sections ===== */
.result-section {
  background: var(--dark-card);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 24px 20px;
  margin-bottom: 24px;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--cream);
  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(--text-muted);
}

.stat-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: var(--dark-surface);
  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(--glass-border);
  transform: translateX(-50%);
}

.stat-dot {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--dark);
  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: rgba(212, 165, 116, 0.1);
  border: 1px solid rgba(212, 165, 116, 0.2);
}

.compat-worst {
  background: var(--dark-surface);
  border: 1px solid var(--glass-border);
}

.compat-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-light);
}

.compat-img {
  width: 72px;
  height: 108px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--dark-surface);
  border: 2px solid var(--glass-border);
}

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

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

/* ===== 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: 60px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

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

.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(--dark-surface);
  border: 1px solid transparent;
  transition: all 0.2s;
  cursor: default;
  text-align: left;
}

.type-card.type-card--active {
  border-color: var(--primary);
  background: rgba(212, 165, 116, 0.1);
}

.type-card-img {
  width: 40px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--dark-card);
  flex-shrink: 0;
}

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

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

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

/* ===== Restart Card Button ===== */
.btn-restart-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 320px;
  padding: 16px 20px;
  background: transparent;
  border: 2px dashed var(--glass-border);
  border-radius: 60px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all 0.2s;
}

.btn-restart-card:hover {
  border-color: var(--primary);
  background: rgba(212, 165, 116, 0.05);
  transform: translateY(-2px);
}

.btn-restart-card .restart-icon {
  font-size: 28px;
}

.btn-restart-card .restart-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-restart-card .restart-text strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--cream);
}

.btn-restart-card .restart-text small {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

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

/* ===== Download CTA ===== */
.download-cta {
  background: var(--dark-card);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 32px 24px;
  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(--cream);
  line-height: 1.4;
  margin-bottom: 8px;
}

.cta-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  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(--cream);
  color: var(--dark);
  padding: 14px 28px;
  border-radius: 60px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

/* ===== Instagram Story Card (hidden, for capture) ===== */
.story-card {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 540px;
  z-index: -1;
  overflow: visible;
}

.story-bg {
  width: 100%;
  min-height: 1080px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 36px 32px;
  text-align: center;
  background: linear-gradient(180deg, #2A1F1A 0%, #1C1210 40%, #2A1F1A 100%);
  color: var(--cream);
}

.story-top-label {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.story-image {
  width: 260px;
  height: 380px;
  border-radius: 20px;
  object-fit: cover;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.story-name {
  font-size: 32px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.story-type {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.story-oneliner {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 14px;
  line-height: 1.5;
  max-width: 420px;
}

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

.story-tag {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 700;
}

.story-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
  max-width: 440px;
  margin-bottom: 16px;
}

.story-phrases {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.story-phrase {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.08);
  padding: 10px 18px;
  border-radius: 12px;
  line-height: 1.4;
}

.story-rarity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
}

.story-rarity-badge {
  font-size: 20px;
  font-weight: 800;
}

.story-rarity-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-light);
}

.story-compat {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
}

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

.story-compat-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
}

.story-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.story-cta {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

.story-url {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
}

/* ===== Insta Button ===== */
.btn-insta {
  background: linear-gradient(
    45deg,
    #f09433 0%,
    #e6683c 25%,
    #dc2743 50%,
    #cc2366 75%,
    #bc1888 100%
  );
  color: #fff;
  border-color: transparent;
}

.btn-insta:hover {
  border-color: transparent;
  opacity: 0.9;
}

.btn-insta svg {
  stroke: #fff;
}

/* ===== Type Preview Modal ===== */
.type-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.type-modal-overlay.show {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.type-modal {
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  background: var(--dark-card);
  border: 1px solid var(--glass-border);
  border-radius: 28px 28px 0 0;
  padding: 32px 24px;
  text-align: center;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.type-modal-img {
  width: 140px;
  height: 210px;
  border-radius: 20px;
  object-fit: cover;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border: 2px solid var(--glass-border);
}

.type-modal-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--cream);
  margin-bottom: 4px;
}

.type-modal-type {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}

.type-modal-oneliner {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--dark-surface);
  padding: 10px 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.type-modal-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.type-modal-cta {
  margin-bottom: 8px;
  font-size: 15px;
}

.type-modal-close {
  display: inline-block;
  padding: 12px 24px;
  background: none;
  color: var(--text-muted);
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

/* ===== Friend Comparison Card ===== */
.compare-banner {
  background: rgba(212, 165, 116, 0.1);
  border: 1px solid rgba(212, 165, 116, 0.2);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  text-align: center;
}

.compare-banner-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--cream);
  line-height: 1.5;
}

.compare-section {
  background: var(--dark-card);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 24px 20px;
  margin-bottom: 24px;
  text-align: center;
}

.compare-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.compare-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.compare-person-img {
  width: 72px;
  height: 108px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  border: 2px solid var(--glass-border);
}

.compare-person-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--cream);
}

.compare-vs-icon {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.compare-gauge-wrap {
  margin-bottom: 16px;
}

.compare-pct {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary);
}

.compare-pct-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.compare-message {
  font-size: 16px;
  font-weight: 700;
  color: var(--cream);
  line-height: 1.5;
  padding: 12px 16px;
  background: var(--dark-surface);
  border-radius: 12px;
}

/* ===== Content Sections (TMI, Cafe Style, Phrases) ===== */
.result-content-section {
  background: var(--dark-card);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 24px 20px;
  margin-bottom: 24px;
}

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

/* Cafe Style */
.cafe-style-text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.8;
  text-align: center;
  padding: 16px 20px;
  background: rgba(212, 165, 116, 0.08);
  border: 1px solid rgba(212, 165, 116, 0.15);
  border-radius: 16px;
}

/* TMI List */
.tmi-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tmi-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--dark-surface);
  border-radius: 14px;
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.5;
  text-align: left;
}

.tmi-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  color: var(--dark);
}

/* Common Phrases - Speech Bubbles */
.phrases-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phrase-bubble {
  position: relative;
  padding: 14px 18px;
  background: var(--dark-surface);
  border-radius: 18px 18px 18px 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
  text-align: left;
  line-height: 1.4;
}

.phrase-bubble:nth-child(even) {
  border-radius: 18px 18px 4px 18px;
  text-align: right;
}

/* ===== Counter ===== */
.result-counter {
  text-align: center;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--dark-card);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

.counter-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.counter-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

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

  .intro-cup {
    font-size: 80px;
  }

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

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

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

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

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

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