:root {
  --bg: #fff8f6;
  --bg-soft: #fffdf8;
  --surface: #ffffffee;
  --surface-strong: #ffffff;
  --text: #493230;
  --muted: #856864;
  --accent: #ff8bc2;
  --accent-strong: #ef63ac;
  --mint: #9cebd7;
  --sky: #bfdcff;
  --yellow: #ffe8a6;
  --ring: #ffb6ab;
  --kakao: #fee500;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Pretendard", "Apple SD Gothic Neo", sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 15%, #ffe4ee 0%, transparent 35%),
    radial-gradient(circle at 85% 8%, #dff0ff 0%, transparent 28%),
    radial-gradient(circle at 80% 88%, #e9ffef 0%, transparent 30%),
    var(--bg);
}

.bg-glow {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.85;
  filter: blur(12px);
}

.bg-glow-1 {
  width: 280px;
  height: 280px;
  background: linear-gradient(135deg, #ffb7da, #ffd8b2);
  top: -90px;
  left: -70px;
  animation: floaty 7s ease-in-out infinite;
}

.bg-glow-2 {
  width: 320px;
  height: 320px;
  background: linear-gradient(135deg, #a8f0cf, #aacbff);
  right: -120px;
  bottom: -130px;
  animation: floaty 9s ease-in-out infinite reverse;
}

.container {
  width: min(980px, 92vw);
  margin: 38px auto 40px;
  position: relative;
  z-index: 2;
}

.hero {
  text-align: center;
  padding: 8px 10px;
  animation: pop-in 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  position: relative;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8bc2, #ffb07e);
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 12px;
  box-shadow: 0 10px 22px -14px #e26553;
}

.badge::before {
  content: "🫧";
}

.home-link {
  display: inline-block;
  margin: 0 0 10px;
  color: #8f5d72;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed #e8abc8;
}

h1 {
  margin: 0;
  font-family: "Do Hyeon", sans-serif;
  font-size: clamp(2.15rem, 6vw, 3.8rem);
  line-height: 1.1;
  color: #2f211b;
  text-shadow: 0 4px 0 #fff6f8;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.step-pills {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.step-pill {
  font-size: 0.78rem;
  font-weight: 800;
  color: #835f71;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffeaf6;
  border: 1px solid #ffd1e8;
}

.step-pill.is-active {
  color: #fff;
  background: linear-gradient(135deg, #ff8bc2, #ffad83);
  border-color: #ff90b7;
}

.name-panel {
  margin-top: 24px;
  background: linear-gradient(180deg, #fffdfd, #fff7fb);
  border: 2px solid #ffd4e7;
  border-radius: 24px;
  padding: 24px;
  box-shadow:
    0 22px 36px -30px #d17ea0,
    0 10px 0 -4px #ffeaf5;
}

.name-panel h2 {
  margin: 0;
}

.name-help {
  margin: 8px 0 0;
  color: #856864;
}

.name-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.name-input {
  flex: 0 1 160px;
  border: 2px solid #ffd3e8;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: #4f3634;
  font-size: 1.05rem;
  font-weight: 700;
  outline: none;
}

.name-input:focus {
  border-color: #ff8bc2;
  box-shadow: 0 0 0 4px #ffdfee;
}

.hero::before,
.hero::after {
  position: absolute;
  top: -4px;
  font-size: 1.5rem;
  opacity: 0.75;
}

.hero::before {
  content: "🦎";
  left: 18%;
}

.hero::after {
  content: "✨";
  right: 18%;
}

.upload-panel,
.result-panel {
  margin-top: 24px;
  background: linear-gradient(180deg, var(--surface), var(--surface-strong));
  border: 2px solid #ffd4e7;
  border-radius: 24px;
  padding: 24px;
  box-shadow:
    0 22px 36px -30px #d17ea0,
    0 10px 0 -4px #ffeaf5;
  position: relative;
  overflow: hidden;
  animation: pop-in 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.upload-panel::before,
.result-panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  border: 1px dashed #ffd8eb;
  pointer-events: none;
}

.upload-drop {
  border: 3px dashed #ffb5d8;
  background: linear-gradient(180deg, #fff8fb, #fff0f8);
  border-radius: 18px;
  min-height: 188px;
  display: grid;
  place-content: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  position: relative;
}

.upload-drop::after {
  content: "💖";
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 1.6rem;
  opacity: 0.35;
}

.upload-drop.dragover {
  transform: translateY(-2px) scale(1.01);
  border-color: var(--accent);
  background: linear-gradient(180deg, #fff0f8, #ffe5f3);
}

.upload-title {
  display: block;
  font-size: 1.18rem;
  font-weight: 800;
  color: #3f2f28;
}

.upload-desc {
  display: block;
  margin-top: 8px;
  font-size: 0.95rem;
  color: #8d6d5f;
}

.preview-wrap {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

#previewImage {
  width: 100%;
  max-height: 390px;
  object-fit: contain;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff6f0, #fff);
  border: 2px solid #ffdcca;
}

.analyze-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status {
  margin: 0;
  padding: 8px 12px;
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: #fff1f8;
  color: #845768;
  border: 1px solid #ffcfe8;
  font-size: 0.9rem;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #ff9da1);
  box-shadow: 0 12px 20px -16px #db5a94;
}

.primary-btn:hover {
  filter: brightness(1.03);
}

.primary-btn.is-loading {
  opacity: 0.8;
  cursor: progress;
}

.secondary-btn {
  color: #553f35;
  background: linear-gradient(135deg, #ffe9f6, #fff0fa);
  border: 1px solid #ffcfe7;
}

.secondary-btn:hover {
  background: linear-gradient(135deg, #ffe0f3, #ffebf9);
}

.kakao-btn {
  color: #2c1e00;
  background: var(--kakao);
  border: 1px solid #efcf00;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.45rem;
  color: #3a2c25;
}

.result-owner {
  margin: -4px 0 10px;
  color: #8a6478;
  font-weight: 700;
}

.result-card {
  background: linear-gradient(180deg, #fffdfd, #fff6fb);
  border: 2px solid #ffd8eb;
  padding: 16px;
  border-radius: 18px;
}

.result-image {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid #ffd8eb;
  background: #fff2fb;
  margin-bottom: 12px;
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.result-head h3 {
  margin: 0;
  font-size: clamp(1.2rem, 3.3vw, 1.7rem);
  color: #2f221c;
}

.score {
  font-size: 0.9rem;
  font-weight: 800;
  color: #4a5f8c;
  background: linear-gradient(135deg, #deecff, #f3e6ff);
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  padding: 6px 10px;
}

.tag-list {
  margin-top: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #5f4565;
  background: linear-gradient(135deg, #ffe3f1, #ece5ff);
  border: 1px solid #f0cce6;
}

#lizardDesc {
  margin: 12px 0 0;
  color: #6a5448;
  line-height: 1.55;
}

.top-matches {
  margin-top: 12px;
  padding: 16px;
  background: linear-gradient(180deg, #fffafe, #fff);
  border: 2px solid #ffe0f0;
  border-radius: 16px;
}

.top-matches h3 {
  margin: 0 0 10px;
  color: #4c382f;
  font-size: 1rem;
}

.top-matches ol {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #664d40;
}

.share-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hint {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #ffd7eb;
  background: #fff3fb;
  color: #835f71;
  font-size: 0.9rem;
  min-height: 1.2em;
}

.content-stack {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}

.content-block {
  background: linear-gradient(180deg, #fffdfd, #fff6fb);
  border: 2px solid #ffd8eb;
  border-radius: 18px;
  padding: 16px;
}

.content-block h3 {
  margin: 0 0 10px;
  font-size: 1.06rem;
  color: #4b352b;
}

.content-block p {
  margin: 0;
  color: #6e584c;
  line-height: 1.62;
}

.content-block ul {
  margin: 0;
  padding-left: 18px;
  color: #6e584c;
  line-height: 1.62;
  display: grid;
  gap: 6px;
}

.content-faq {
  margin: 0;
  display: grid;
  gap: 10px;
}

.content-faq dt {
  font-weight: 800;
  color: #4e3b31;
}

.content-faq dd {
  margin: 0;
  color: #6a554b;
  line-height: 1.58;
}

.ad-section {
  margin-top: 10px;
  border: 1px solid #f3dce9;
  border-radius: 12px;
  background: #fffafc;
  padding: 6px;
}

.ad-slot {
  min-height: 90px;
}

.ad-slot:empty {
  min-height: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}

.result-ad {
  margin-top: 12px;
}

.partner-slot {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid #f2d5e3;
  background: #fff;
  padding: 8px;
}

.partner-slot + .ad-slot,
.ad-slot + .partner-slot {
  margin-top: 6px;
}

.partner-slot-top {
  margin-bottom: 6px;
}

.partner-slot-bottom {
  margin-top: 6px;
}

.partner-slot-global-bottom {
  margin-top: 14px;
}

.partner-notice {
  margin: 0 0 6px;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #72534c;
  word-break: keep-all;
}

.partner-coupang-banner {
  width: 100%;
  min-height: 100px;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
}

.partner-coupang-banner iframe,
.partner-slot .kakao_ad_area {
  display: block;
  max-width: 100%;
  margin: 0 auto;
}

.service-footer {
  width: min(980px, 92vw);
  margin: 8px auto 28px;
  padding: 10px 6px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: center;
  color: #7f6761;
  border-top: 1px solid #f0cedf;
}

.service-footer a {
  color: #7f4e66;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  border-bottom: 1px dashed #e0b2cb;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@media (max-width: 720px) {
  .container {
    margin: 24px auto 34px;
  }

  .upload-panel,
  .result-panel {
    padding: 16px;
    border-radius: 18px;
  }

  .name-panel {
    padding: 16px;
    border-radius: 18px;
  }

  .upload-panel::before,
  .result-panel::before {
    inset: 8px;
    border-radius: 12px;
  }

  .result-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .share-actions button {
    flex: 1 1 calc(50% - 5px);
  }

  .name-input {
    flex: 1 1 100%;
  }

  .partner-slot {
    padding: 8px;
  }

  .partner-notice {
    font-size: 0.8rem;
  }
}
