/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #08060f;
  --bg2:          #0e0b1a;
  --surface:      rgba(255,255,255,.04);
  --surface2:     rgba(255,255,255,.07);
  --border:       rgba(255,255,255,.08);
  --border2:      rgba(180,140,255,.3);
  --gold:         #c9a84c;
  --gold-light:   #e8c96a;
  --gold-dim:     rgba(201,168,76,.15);
  --purple:       #7c5cbf;
  --purple-light: #a07ee0;
  --purple-soft:  rgba(124,92,191,.15);
  --text:         #e8e0f5;
  --text-dim:     rgba(232,224,245,.5);
  --muted:        #7a7090;
  --radius:       12px;
  --shadow:       0 16px 48px rgba(0,0,0,.6);
  --transition:   .18s ease;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(100,60,200,.2) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(180,100,255,.06) 0%, transparent 60%);
}

/* 星屑 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 8%  12%, rgba(255,255,255,.55) 0%, transparent 100%),
    radial-gradient(1px 1px at 22% 38%, rgba(255,255,255,.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 47%  8%, rgba(255,255,255,.45) 0%, transparent 100%),
    radial-gradient(1px 1px at 68% 52%, rgba(255,255,255,.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 83% 22%, rgba(255,255,255,.5)  0%, transparent 100%),
    radial-gradient(1px 1px at 92% 68%, rgba(255,255,255,.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 35% 75%, rgba(255,255,255,.3)  0%, transparent 100%),
    radial-gradient(1px 1px at 58% 88%, rgba(255,255,255,.4)  0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 15% 60%, rgba(201,168,76,.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 75% 15%, rgba(160,126,224,.4) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

main, header, footer { position: relative; z-index: 1; }

a { color: var(--gold); text-decoration: none; }

/* ── Header ── */
header {
  background: rgba(8,6,15,.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

.header-inner {
  max-width: 680px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(201,168,76,.4);
}

.header-badge {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: .25rem .75rem;
  border-radius: 2px;
}

/* ── Main ── */
main {
  flex: 1;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

/* ── Luna Intro ── */
.luna-intro {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 3rem 0 2rem;
}

.luna-avatar {
  position: relative;
  flex-shrink: 0;
}

.luna-avatar-inner {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(124,92,191,.3);
}

.luna-avatar-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, transparent 60%, rgba(160,126,224,.2) 80%, transparent 100%);
  animation: spin 8s linear infinite;
  z-index: 1;
  pointer-events: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

.luna-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.luna-glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,92,191,.15), transparent 70%);
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: .6; transform: scale(1); }
  50%       { opacity: 1;  transform: scale(1.1); }
}

.luna-profile { flex: 1; }

.luna-title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: .25rem;
}

.luna-name {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--purple-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: .6rem;
}

.luna-desc {
  font-size: .85rem;
  color: var(--text-dim);
  line-height: 1.9;
  font-style: italic;
  border-left: 2px solid var(--purple);
  padding-left: .85rem;
}

/* ── Sub head ── */
.sub-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--muted);
}

.sub-head-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Usage ── */
.usage-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin-bottom: 1.5rem;
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .5px;
}

.usage-dots { display: flex; gap: .4rem; }

.usage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: 1px solid rgba(255,255,255,.1);
  transition: all var(--transition);
}

.usage-dot.used {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(201,168,76,.5);
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

/* ── Section Label ── */
.section-label {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--gold);
  margin-bottom: 1rem;
}

.label-opt {
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 1px;
  font-size: .6rem;
}

/* ── Form ── */
.birth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.form-group:last-child { margin-bottom: 0; }

.form-group label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .5px;
}

input[type="date"],
input[type="text"],
select,
textarea {
  width: 100%;
  padding: .7rem 1rem;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(.3);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,92,191,.15);
  background: rgba(255,255,255,.06);
}

select option { background: #12101e; color: var(--text); }

/* ── Gender buttons ── */
.gender-group {
  display: flex;
  gap: .5rem;
}

.gender-btn {
  flex: 1;
  padding: .55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: .3px;
}

.gender-btn:hover {
  border-color: var(--purple);
  color: var(--purple-light);
}

.gender-btn.active {
  background: var(--purple-soft);
  border-color: var(--purple);
  color: var(--text);
}

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.75rem 0;
}

/* ── Situation Buttons ── */
.situation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}

.situation-btn {
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  letter-spacing: .3px;
}

.situation-btn:hover {
  border-color: var(--purple);
  color: var(--purple-light);
}

.situation-btn.active {
  background: var(--purple-soft);
  border-color: var(--purple);
  color: var(--text);
}

/* ── Tag Grid ── */
.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .4rem;
}

.tag-btn {
  padding: .35rem .8rem;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.tag-btn:hover { border-color: var(--purple); color: var(--purple-light); }

.tag-btn.active {
  background: var(--purple-soft);
  border-color: var(--purple);
  color: var(--text);
}

/* ── Textarea ── */
textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.7;
}

textarea::placeholder { color: rgba(122,112,144,.4); }

.char-count {
  text-align: right;
  font-size: .7rem;
  color: var(--muted);
  margin-top: .3rem;
}

/* ── Submit ── */
.btn-submit {
  display: block;
  width: 100%;
  padding: 1rem;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-family: inherit;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold-dim);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-submit:hover:not(:disabled)::before { opacity: 1; }
.btn-submit:hover:not(:disabled) { box-shadow: 0 0 24px rgba(201,168,76,.25); }

.btn-submit:disabled {
  opacity: .3;
  cursor: not-allowed;
}

/* ── Loading ── */
.loading {
  display: none;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: .82rem;
  letter-spacing: 1px;
}

.loading.visible { display: block; }

.loading-crystal {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  border: 1px solid var(--purple);
  border-top-color: var(--gold);
  animation: spin 1.2s linear infinite;
  box-shadow: 0 0 16px rgba(124,92,191,.3);
}

/* ── Response ── */
.response-area { display: none; margin-top: 1.5rem; }
.response-area.visible { display: block; }

/* Score */
.score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1rem;
  box-shadow: var(--shadow), 0 0 40px rgba(201,168,76,.05);
}

.score-label {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--muted);
  margin-bottom: 1rem;
}

.score-display { line-height: 1; margin-bottom: 1.25rem; }

.score-value {
  font-size: 5rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: -3px;
  text-shadow: 0 0 30px rgba(201,168,76,.3);
}

.score-unit {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gold);
  opacity: .7;
}

.score-bar-wrap {
  max-width: 240px;
  margin: 0 auto .75rem;
  height: 2px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  border-radius: 99px;
  transition: width 1.4s cubic-bezier(.4,0,.2,1);
}

.score-note {
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
  min-height: 1.2em;
}

/* Result Sections */
.result-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: .75rem;
  backdrop-filter: blur(8px);
}

.result-section-title {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: .85rem;
  text-transform: uppercase;
}

.result-section-body {
  font-size: .9rem;
  color: var(--text);
  line-height: 1.9;
  opacity: .9;
}

.result-section-body p { margin-bottom: .6rem; }
.result-section-body p:last-child { margin-bottom: 0; }

.result-section-body ul { list-style: none; padding: 0; }

.result-section-body ul li {
  padding: .3rem 0 .3rem 1.2rem;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.result-section-body ul li:last-child { border-bottom: none; }

.result-section-body ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--purple);
  font-size: .8rem;
}

/* Luna message section */
.result-section--luna {
  border-color: rgba(201,168,76,.2);
  background: linear-gradient(135deg, rgba(201,168,76,.04), rgba(124,92,191,.04));
}

.result-section--luna .result-section-title { color: var(--gold); }

.result-section--luna .result-section-body {
  font-style: italic;
  color: var(--gold-light);
  opacity: .85;
  font-size: .88rem;
  line-height: 2.1;
}

/* Message boxes */
.message-box {
  border: 1px solid var(--border);
  border-left: 2px solid var(--purple);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  margin-top: .6rem;
  background: rgba(124,92,191,.04);
}

.message-box + .message-box { margin-top: .6rem; }

.message-label {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--purple-light);
  text-transform: uppercase;
  margin-bottom: .4rem;
}

.message-text {
  font-size: .88rem;
  line-height: 1.75;
  color: var(--text);
}

.message-hint {
  font-size: .75rem;
  color: var(--muted);
  margin-top: .4rem;
  padding-top: .4rem;
  border-top: 1px solid var(--border);
  font-style: italic;
}

/* ── Affiliate Banner ── */
.affiliate-banner {
  display: none;
  margin-top: .75rem;
}

.affiliate-banner.visible { display: block; }

.affiliate-inner {
  background: var(--surface);
  border: 1px solid rgba(201,168,76,.2);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
}

.affiliate-eyebrow {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--muted);
  margin-bottom: .6rem;
}

.affiliate-inner h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: .4rem;
}

.affiliate-inner p {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
  line-height: 1.8;
}

.btn-affiliate {
  display: inline-block;
  padding: .65rem 1.75rem;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 4px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  transition: all var(--transition);
}

.btn-affiliate:hover {
  background: var(--gold-dim);
  color: var(--gold-light);
  box-shadow: 0 0 16px rgba(201,168,76,.2);
}

/* ── Paywall ── */
.paywall {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem 1.75rem;
  text-align: center;
  margin-top: 1.5rem;
}

.paywall.visible { display: block; }

.paywall-eyebrow {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--muted);
  margin-bottom: .6rem;
}

.paywall h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .5rem;
}

.paywall p {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

.btn-upgrade {
  display: inline-block;
  padding: .7rem 2rem;
  border: 1px solid var(--purple);
  color: var(--purple-light);
  border-radius: 4px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  transition: all var(--transition);
}

.btn-upgrade:hover {
  background: var(--purple-soft);
  color: var(--text);
}

/* ── Error ── */
.error-msg {
  display: none;
  background: rgba(200,30,30,.1);
  border: 1px solid rgba(200,30,30,.25);
  border-radius: 6px;
  padding: .7rem 1rem;
  color: #f87171;
  font-size: .82rem;
  margin-top: 1rem;
  text-align: center;
  letter-spacing: .3px;
}

.error-msg.visible { display: block; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: .7rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  letter-spacing: .5px;
  opacity: .6;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .luna-intro { flex-direction: column; text-align: center; gap: 1.25rem; }
  .luna-desc { border-left: none; border-top: 1px solid var(--border); padding: .75rem 0 0; text-align: left; }
  .birth-grid { grid-template-columns: 1fr; }
  .situation-grid { grid-template-columns: 1fr; }
  .card { padding: 1.25rem; }
  .score-value { font-size: 3.5rem; }
}
