/* saju-kpop — 파스텔 네온 K-팝 테마 */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,500&display=swap');

:root {
  --bg-0: #17102b;
  --bg-1: #1f1638;
  --surface: #271c46;
  --surface-2: #2f2254;
  --border: #4a3a75;

  --text: #fbf7ff;
  --text-dim: #c3b3e6;
  --text-faint: #8b7ab0;

  --neon-pink: #ff7ad1;
  --neon-purple: #b083ff;
  --neon-blue: #6fe3ff;
  --neon-yellow: #ffe873;

  --grad-primary: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  --grad-glow: radial-gradient(circle, rgba(176, 131, 255, 0.35), transparent 70%);

  --grade-good-bg: #2a1e46;
  --grade-good-fg: #ff9de0;
  --grade-same-bg: #1c2c4a;
  --grade-same-fg: #7ce8ff;
  --grade-clash-bg: #3a2038;
  --grade-clash-fg: #ffd166;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --font-display: 'Fredoka', 'Apple SD Gothic Neo', sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Apple SD Gothic Neo', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100%;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(255, 122, 209, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(111, 227, 255, 0.14), transparent),
    var(--bg-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 0 3rem;
  position: relative;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
}
.site-header .logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.site-header .logo .spark { color: var(--neon-pink); }

/* ---------- View sections ---------- */
.view { display: none; padding: 0 1.25rem; }
.view.active { display: block; animation: fadein 0.35s ease; }

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

@media (prefers-reduced-motion: reduce) {
  .view.active { animation: none; }
}

/* ---------- Landing ---------- */
.hero {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
}
.hero .badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--neon-blue);
  background: rgba(111, 227, 255, 0.1);
  border: 1px solid rgba(111, 227, 255, 0.35);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  line-height: 1.25;
  font-weight: 600;
  margin: 0 0 0.9rem;
  text-wrap: balance;
}
.hero p.lede {
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 34ch;
  margin: 0 auto 1.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--grad-primary);
  color: #1a0f2e;
  box-shadow: 0 8px 24px rgba(255, 122, 209, 0.35);
  width: 100%;
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(255, 122, 209, 0.5); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  width: 100%;
}

.btn-whatsapp {
  background: #25d366;
  color: #08350f;
  width: 100%;
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  padding: 0.7rem 1rem;
}

.trust-note {
  color: var(--text-faint);
  font-size: 0.8rem;
  margin-top: 1rem;
}

.info-box {
  margin-top: 2rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
}
.info-box-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.info-box-text {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}
.info-box-text strong {
  color: var(--text);
}

.hero-orb {
  width: 220px;
  height: 220px;
  margin: 0.5rem auto 1.5rem;
  border-radius: 50%;
  background: var(--grad-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  filter: drop-shadow(0 0 40px rgba(176, 131, 255, 0.45));
}

/* ---------- Form step (birth date) ---------- */
.step-head { text-align: center; padding: 1.5rem 0 0.5rem; }
.step-head h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.step-head p {
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 32ch;
  margin: 0 auto;
}

.field {
  margin: 1.75rem 0 0.5rem;
}
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
.field input[type="date"] {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  padding: 0.9rem 1rem;
  font-variant-numeric: tabular-nums;
}
.field input[type="date"]:focus {
  outline: none;
  border-color: var(--neon-pink);
  box-shadow: 0 0 0 3px rgba(255, 122, 209, 0.2);
}

.date-parts {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 0.6rem;
}
.date-part {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.date-part input,
.date-part select {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  padding: 0.9rem 0.7rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
}
.date-part select {
  text-align: center;
  text-align-last: center;
}
.date-part input:focus,
.date-part select:focus {
  outline: none;
  border-color: var(--neon-pink);
  box-shadow: 0 0 0 3px rgba(255, 122, 209, 0.2);
}
.date-part-label {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.03em;
}

.privacy-note {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  color: var(--text-faint);
  font-size: 0.78rem;
  margin: 1rem 0 1.75rem;
}

/* ---------- Search step ---------- */
.search-box {
  position: relative;
  margin: 1.25rem 0 1.5rem;
}
.search-box input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.9rem 1.2rem 0.9rem 2.8rem;
}
.search-box input:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 3px rgba(111, 227, 255, 0.2);
}
.search-box .icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.idol-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  padding-bottom: 1rem;
}
.idol-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.idol-card:hover, .idol-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--neon-pink);
  outline: none;
}
.idol-card .thumb {
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(160deg, var(--surface-2), var(--bg-1));
  display: block;
  object-fit: cover;
}
.idol-card .cap {
  padding: 0.5rem 0.4rem 0.65rem;
}
.idol-card .cap .name {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.idol-card .cap .grp {
  font-size: 0.68rem;
  color: var(--text-faint);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 2.5rem 1rem;
  font-size: 0.92rem;
}

.group-filter {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.9rem;
  margin-bottom: 0.3rem;
  scrollbar-width: none;
}
.group-filter::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active {
  background: var(--grad-primary);
  color: #1a0f2e;
  border-color: transparent;
}

/* ---------- Results ---------- */
.result-hero {
  text-align: center;
  padding: 1.5rem 0 1rem;
}
.result-hero .grade-emoji { font-size: 2.6rem; display: block; margin-bottom: 0.4rem; }
.result-hero h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}
.result-hero p { color: var(--text-dim); font-size: 0.95rem; margin: 0 auto; max-width: 36ch; }

.match-card {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}
.match-card .match-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.match-card .plus { margin-top: 3.2rem; }
.match-card .match-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-dim);
  max-width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-card .avatar {
  width: 118px;
  height: 148px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface);
}
.match-card .avatar.user {
  border-radius: 50%;
  width: 108px;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  background: var(--grad-primary);
}
.match-card .plus {
  font-size: 1.3rem;
  color: var(--neon-yellow);
}

.grade-pill {
  display: inline-block;
  margin: 0 auto;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.4rem 1rem;
  border-radius: 999px;
}
.grade-pill.good { background: var(--grade-good-bg); color: var(--grade-good-fg); }
.grade-pill.same { background: var(--grade-same-bg); color: var(--grade-same-fg); }
.grade-pill.clash { background: var(--grade-clash-bg); color: var(--grade-clash-fg); }

.saju-box {
  margin: 1.3rem 0;
  padding: 1.2rem 1.3rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  border-left-width: 5px;
  background: var(--surface);
}
.saju-box-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.saju-box p {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text);
}
.saju-box.good { border-left-color: var(--grade-good-fg); }
.saju-box.good .saju-box-label { color: var(--grade-good-fg); }
.saju-box.same { border-left-color: var(--grade-same-fg); }
.saju-box.same .saju-box-label { color: var(--grade-same-fg); }
.saju-box.clash { border-left-color: var(--grade-clash-fg); }
.saju-box.clash .saju-box-label { color: var(--grade-clash-fg); }

.photo-credit {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: -0.8rem;
  margin-bottom: 1.2rem;
}
.photo-credit a { color: var(--text-faint); }

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}
.detail-card h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}
.detail-row:first-of-type { border-top: none; }
.detail-row .k { color: var(--text-dim); }
.detail-row .v { font-weight: 700; font-variant-numeric: tabular-nums; }

.share-stack {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 1.5rem 0;
}

.cta-row {
  display: flex;
  gap: 0.6rem;
}
.cta-row .btn { flex: 1; }

.retry-link {
  display: block;
  text-align: center;
  margin-top: 1.2rem;
}

/* ---------- 포토카드 / 행운의 부적 ---------- */
.card-section {
  margin: 2rem 0 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.card-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  margin: 0 0 1rem;
  color: var(--text);
}
.card-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
.card-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 0.6rem;
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card-choice:hover, .card-choice:focus-visible {
  border-color: var(--neon-pink);
  transform: translateY(-2px);
  outline: none;
}
.card-choice.active {
  border-color: var(--neon-pink);
  box-shadow: 0 0 0 2px rgba(255, 122, 209, 0.25);
}
.card-choice-emoji { font-size: 1.8rem; }

.card-preview-wrap {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}
.card-preview-img {
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}
.card-preview-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 320px;
}
.card-preview-actions .btn-primary { width: 100%; }
.btn-ghost-small {
  background: none;
  border: none;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem 1.5rem;
  color: var(--text-faint);
  font-size: 0.76rem;
  line-height: 1.7;
}
.site-footer a { color: var(--text-faint); }
.site-footer .links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

/* ---------- Credits page ---------- */
.credits-page { max-width: 720px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.credits-page h1 { font-family: var(--font-display); font-size: 1.6rem; }
.credits-page .intro { color: var(--text-dim); margin-bottom: 2rem; }
.credits-group { margin-bottom: 1.8rem; }
.credits-group h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--neon-pink);
  margin-bottom: 0.6rem;
}
.credits-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.credits-list li {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 0.5rem 0.7rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
}
.credits-list a { color: var(--neon-blue); text-decoration: none; }
.credits-list a:hover { text-decoration: underline; }
.back-link { display: inline-block; margin-bottom: 1.5rem; color: var(--text-dim); text-decoration: none; font-weight: 700; }

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (min-width: 540px) {
  .app-shell { max-width: 560px; }
  .idol-grid { grid-template-columns: repeat(4, 1fr); }
}
