:root {
  --bg-dark: #0b0914;
  --bg-card: rgba(24, 19, 40, 0.85);
  --bg-card-inner: rgba(36, 29, 59, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-gold: rgba(245, 197, 108, 0.45);
  --accent-primary: #e879f9;
  --accent-secondary: #8b5cf6;
  --accent-gold: #f5c56c;
  --accent-rose: #fb7185;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(232, 121, 249, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(245, 197, 108, 0.12) 0%, transparent 50%);
  color: var(--text-main);
  line-height: 1.65;
  min-height: 100vh;
  padding-bottom: 90px;
}

.app-shell {
  max-width: 540px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

/* 실시간 소셜 프루프 티커 */
.live-ticker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  margin-right: 7px;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseDot 1.6s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.admin-trigger-btn {
  background: rgba(245, 197, 108, 0.14);
  border: 1px solid var(--border-gold);
  color: var(--accent-gold);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-trigger-btn:hover {
  background: rgba(245, 197, 108, 0.28);
}

/* 히어로 헤더 */
.hero-header {
  text-align: center;
  padding: 18px 10px 22px;
}

.hero-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(232,121,249,0.2), rgba(245,197,108,0.2));
  border: 1px solid var(--border-gold);
  color: var(--accent-gold);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.hero-title {
  font-size: 1.72rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #ffffff 15%, #f5c56c 55%, #e879f9 95%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* 모드 선택 탭 */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.mode-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
  text-align: center;
}

.mode-tab .tab-icon {
  display: block;
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.mode-tab.active {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.35), rgba(232, 121, 249, 0.22));
  border-color: var(--accent-gold);
  color: #fff;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.25);
}

/* 카드 공통 */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  margin-bottom: 16px;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.form-input, .form-select {
  background: rgba(15, 11, 29, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 11px 12px;
  color: #fff;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-primary);
}

/* 관계 유형 칩 */
.relation-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.rel-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 9px 10px;
  color: var(--text-muted);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.rel-chip.active {
  background: rgba(232, 121, 249, 0.2);
  border-color: var(--accent-primary);
  color: #fff;
}

.primary-cta-btn {
  width: 100%;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 55%, #f59e0b 100%);
  border: none;
  border-radius: 14px;
  padding: 15px 18px;
  color: #fff;
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(236, 72, 153, 0.38);
  transition: transform 0.15s, box-shadow 0.15s;
  margin-top: 8px;
}

.primary-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(236, 72, 153, 0.5);
}

/* 만세력 8글자 원국표 */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0 16px;
}

.pillar-box {
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
}

.pillar-header {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.pillar-char {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 3px 0;
}

.pillar-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* 오행 바 */
.element-bars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.el-chip {
  border-radius: 10px;
  padding: 7px 4px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* 점수 대시보드 */
.score-hero {
  text-align: center;
  padding: 16px 10px;
  background: radial-gradient(circle at center, rgba(232,121,249,0.16), transparent 70%);
  border-radius: 16px;
  margin-bottom: 14px;
}

.score-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(245, 197, 108, 0.16);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  color: var(--accent-gold);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.score-number {
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
}

.score-number span {
  font-size: 1.1rem;
  color: var(--accent-gold);
}

.sub-meters {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 14px 0;
}

.meter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}

.meter-label {
  width: 92px;
  color: var(--text-muted);
  font-weight: 600;
}

.meter-track {
  flex: 1;
  height: 9px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b5cf6, #ec4899, #f5c56c);
  transition: width 0.6s ease;
}

.meter-val {
  width: 42px;
  text-align: right;
  font-weight: 700;
  color: var(--accent-gold);
}

/* 무료 요약 텍스트 박스 */
.free-insight-box {
  background: var(--bg-card-inner);
  border-left: 3px solid var(--accent-primary);
  border-radius: 10px;
  padding: 13px 14px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--text-main);
}

.teaser-quote {
  background: linear-gradient(135deg, rgba(245,197,108,0.14), rgba(232,121,249,0.12));
  border: 1px dashed var(--border-gold);
  border-radius: 12px;
  padding: 14px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fde68a;
  text-align: center;
  margin-top: 12px;
}

/* 바이럴 공유 버튼 바 */
.share-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.share-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  padding: 11px 10px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.share-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* 유료 잠금 시크릿 챕터 */
.secret-chapter {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(245, 197, 108, 0.28);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  overflow: hidden;
}

.secret-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(245, 197, 108, 0.14);
  padding: 3px 9px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.secret-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}

.secret-preview {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.secret-locked-body {
  font-size: 0.92rem;
  color: var(--text-main);
  white-space: pre-line;
  filter: blur(6.5px);
  user-select: none;
  pointer-events: none;
  transition: filter 0.45s ease;
}

.secret-chapter.unlocked .secret-locked-body {
  filter: none;
  user-select: text;
  pointer-events: auto;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.secret-chapter.unlocked .lock-overlay {
  display: none;
}

.lock-overlay {
  position: absolute;
  inset: auto 0 0 0;
  height: 62%;
  background: linear-gradient(to bottom, rgba(11, 9, 20, 0.15), rgba(11, 9, 20, 0.94) 65%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 16px;
}

.lock-pill {
  background: rgba(245, 197, 108, 0.18);
  border: 1px solid var(--border-gold);
  color: var(--accent-gold);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

/* 페이월 결제 박스 */
.paywall-card {
  background: linear-gradient(155deg, rgba(44, 25, 77, 0.95), rgba(20, 14, 38, 0.98));
  border: 2px solid var(--accent-gold);
  border-radius: 22px;
  padding: 22px 18px;
  margin: 22px 0;
  text-align: center;
  box-shadow: 0 14px 40px rgba(245, 197, 108, 0.18);
}

.price-strike {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-decoration: line-through;
}

.price-now {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--accent-gold);
  margin: 4px 0 12px;
}

.unlock-code-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.unlock-btn {
  background: var(--accent-gold);
  color: #111;
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 800;
  font-size: 0.86rem;
  cursor: pointer;
  white-space: nowrap;
}

/* 모달 (크리에이터 스튜디오 & 공유 카드) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 999;
}

.modal-backdrop.open {
  display: flex;
}

.modal-panel {
  background: #161226;
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px 18px;
}

.viral-post-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.84rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  margin: 10px 0;
}

.hidden {
  display: none !important;
}
