/* ==========================================================================
   2027 K-Saju Minhwa Tarot — Midnight Lacquer & Gold-Leaf UI
   Mobile-first, zero-build CSS with future beige theme variables ready
   ========================================================================== */

:root {
  --bg-deep: #070b1a;
  --bg-mid: #0d1530;
  --surface: rgba(16, 25, 54, 0.72);
  --surface-strong: rgba(20, 31, 66, 0.88);
  --border-gold: rgba(224, 185, 108, 0.32);
  --border-gold-strong: rgba(242, 211, 138, 0.7);
  --gold-1: #c89639;
  --gold-2: #f7e3a8;
  --gold-3: #d6a447;
  --crimson: #d94b38;
  --jade: #46a070;
  --text-main: #fbf3de;
  --text-sub: #d7ccb5;
  --text-muted: #9f9684;
  --radius-lg: 22px;
  --radius-md: 14px;
  --shadow-gold: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(214, 164, 71, 0.12);
  --font-serif: "Gowun Batang", "Noto Serif KR", "Shippori Mincho", "Cormorant Garamond", Georgia, serif;
  --font-display: "Cinzel", "Gowun Batang", "Shippori Mincho", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: var(--bg-deep);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  background: radial-gradient(circle at 50% 0%, #15214a 0%, #090f24 48%, #060916 100%);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.55;
}

/* Ambient celestial backdrop */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.22;
}

.orb-1 {
  width: 340px;
  height: 340px;
  top: -80px;
  right: -60px;
  background: radial-gradient(circle, #d94b38 0%, transparent 70%);
}

.orb-2 {
  width: 380px;
  height: 380px;
  bottom: -100px;
  left: -80px;
  background: radial-gradient(circle, #d6a447 0%, transparent 70%);
}

.starfield {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 14% 22%, rgba(255, 240, 190, 0.65), transparent),
    radial-gradient(1.5px 1.5px at 78% 15%, rgba(255, 240, 190, 0.55), transparent),
    radial-gradient(1px 1px at 88% 42%, rgba(255, 240, 190, 0.45), transparent),
    radial-gradient(1.5px 1.5px at 25% 68%, rgba(255, 240, 190, 0.4), transparent),
    radial-gradient(1px 1px at 66% 80%, rgba(255, 240, 190, 0.5), transparent);
}

/* Topbar */
.topbar {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 18px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  color: var(--text-main);
  cursor: pointer;
}

.brand-glyph {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-gold-strong);
  background: linear-gradient(145deg, rgba(214, 164, 71, 0.22), rgba(13, 21, 48, 0.9));
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-2);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold-2);
}

.brand-text small {
  opacity: 0.7;
  font-weight: 500;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(11, 18, 42, 0.8);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn.is-active {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2));
  color: #161005;
}

/* Main Shell */
.app-shell {
  max-width: 500px;
  margin: 0 auto;
  padding: 10px 18px 44px;
}

.step-view {
  animation: fadeSlideUp 0.4s ease both;
}

.step-view[hidden] {
  display: none !important;
}

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

/* Step 1 Hero (10-second cut) */
.hero-compact {
  text-align: center;
  padding: 8px 0 18px;
}

.hero-card-teaser {
  position: relative;
  width: 96px;
  aspect-ratio: 9 / 16;
  margin: 0 auto 14px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-gold-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 22px rgba(214, 164, 71, 0.24);
}

.hero-card-teaser img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.teaser-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 240, 185, 0.18) 0%, transparent 45%, rgba(217, 75, 56, 0.12) 100%);
}

.eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold-3);
  text-transform: uppercase;
}

.hero-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(26px, 6.8vw, 34px);
  font-weight: 700;
  line-height: 1.28;
  white-space: pre-line;
  background: linear-gradient(180deg, #fff8e4 0%, #e7c982 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-hook {
  margin: 0;
  font-size: 14px;
  color: var(--text-sub);
}

/* Glass Panels */
.glass-panel {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-gold);
}

/* Form Controls */
.field-group {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-2);
}

.date-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 8px;
}

input[type="number"],
select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(224, 185, 108, 0.28);
  background: rgba(8, 13, 32, 0.88);
  color: var(--text-main);
  font-size: 15px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--gold-2) 50%),
    linear-gradient(135deg, var(--gold-2) 50%, transparent 50%);
  background-position: calc(100% - 16px) 20px, calc(100% - 11px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

input[type="number"]:focus,
select:focus {
  border-color: var(--gold-2);
  box-shadow: 0 0 0 3px rgba(214, 164, 71, 0.16);
}

.gender-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pill-option {
  position: relative;
  cursor: pointer;
}

.pill-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(224, 185, 108, 0.26);
  background: rgba(8, 13, 32, 0.7);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.pill-option input:checked + span {
  border-color: var(--gold-2);
  background: rgba(214, 164, 71, 0.2);
  color: var(--gold-2);
  box-shadow: inset 0 0 12px rgba(247, 227, 168, 0.15);
}

.form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(217, 75, 56, 0.16);
  border: 1px solid rgba(217, 75, 56, 0.5);
  color: #ffb4a8;
  font-size: 13px;
}

/* Buttons */
.btn-gold-primary {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #c69132 0%, #f8e4a8 50%, #cf9d3d 100%);
  color: #160f04;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(214, 164, 71, 0.3);
  transition: transform 0.16s ease, box-shadow 0.2s ease;
}

.btn-gold-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(214, 164, 71, 0.42);
}

.btn-gold-primary:active {
  transform: scale(0.985);
}

.btn-gold-outline {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border-gold-strong);
  border-radius: var(--radius-md);
  background: rgba(214, 164, 71, 0.1);
  color: var(--gold-2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-gold-outline:hover {
  background: rgba(214, 164, 71, 0.2);
}

.btn-ghost {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ghost:hover {
  border-color: var(--border-gold);
  color: var(--text-main);
}

.privacy-note {
  margin: 12px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Step 2: 2026 Review Page */
.step-header {
  text-align: center;
  margin-bottom: 18px;
}

.mini-identity-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-gold);
  background: rgba(214, 164, 71, 0.12);
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--gold-2);
}

.section-title {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(22px, 5.8vw, 28px);
  font-weight: 700;
  line-height: 1.32;
  white-space: pre-line;
  color: var(--text-main);
}

.section-sub {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-sub);
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.review-item {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-gold);
  background: var(--surface);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.review-item:hover {
  border-color: var(--border-gold-strong);
}

.review-item.is-checked {
  border-color: var(--gold-2);
  background: linear-gradient(135deg, rgba(214, 164, 71, 0.2), rgba(217, 75, 56, 0.14));
  box-shadow: 0 0 20px rgba(214, 164, 71, 0.16);
}

.review-check-box {
  flex: 0 0 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 6px;
  border: 1.5px solid var(--gold-3);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #160f04;
  transition: all 0.2s ease;
}

.review-item.is-checked .review-check-box {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2));
  border-color: var(--gold-2);
}

.review-summary {
  padding: 15px 18px;
  margin-bottom: 18px;
}

.review-meter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.review-prompt {
  font-size: 12px;
  color: var(--text-muted);
}

.review-count {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-2);
}

.review-reaction {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-main);
}

.step-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

/* Step 3: Result & Signature 9:16 Card */
.result-archetype {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 700;
  color: var(--gold-2);
}

.result-quote {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--text-sub);
}

.card-stage {
  margin: 18px 0 16px;
  text-align: center;
}

.card-frame-shell {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-gold-strong);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.7), 0 0 32px rgba(214, 164, 71, 0.22);
  background: #090f24;
}

.card-preview-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.card-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 13, 32, 0.85);
  color: var(--gold-2);
  font-size: 14px;
}

.card-loader[hidden] {
  display: none;
}

.card-hint-mobile {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
}

.primary-share-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

/* Locale-Aware Share Panel */
.share-panel,
.info-panel,
.teaser-panel {
  margin-bottom: 14px;
}

.panel-eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-2);
  text-transform: uppercase;
  text-align: center;
}

.share-buttons-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.share-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-gold);
  background: rgba(9, 15, 36, 0.85);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-chip:hover {
  border-color: var(--gold-2);
  background: rgba(214, 164, 71, 0.16);
  transform: translateY(-1px);
}

.share-guide {
  margin: 12px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Info Panels */
.panel-title {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--gold-2);
}

/* Four Pillars Grid */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.pillar-card {
  padding: 12px 6px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(224, 185, 108, 0.22);
  background: rgba(8, 13, 32, 0.72);
  text-align: center;
}

.pillar-card.is-day {
  border-color: var(--gold-2);
  background: rgba(214, 164, 71, 0.12);
}

.pillar-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.pillar-hanja {
  display: block;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-main);
  line-height: 1.2;
}

.pillar-sub {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--gold-3);
}

/* Five Elements Balance Chart */
.elements-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.el-row {
  display: grid;
  grid-template-columns: 74px 1fr 40px;
  align-items: center;
  gap: 10px;
}

.el-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
}

.el-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.el-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.el-pct {
  font-size: 12.5px;
  font-weight: 700;
  text-align: right;
  color: var(--text-main);
}

.elements-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(224, 185, 108, 0.16);
}

.meta-stat {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(8, 13, 32, 0.65);
  border: 1px solid rgba(224, 185, 108, 0.18);
}

.meta-stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.meta-stat-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-2);
}

/* 2027 Reading Blocks */
.fortune-blocks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fortune-item {
  padding: 13px 14px;
  border-radius: 12px;
  background: rgba(8, 13, 32, 0.65);
  border-left: 3px solid var(--gold-3);
}

.fortune-item h4 {
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-2);
}

.fortune-item p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.6;
}

.lucky-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

/* Future Product Teaser */
.teaser-panel {
  text-align: center;
  border-style: dashed;
  background: rgba(14, 22, 48, 0.55);
}

.teaser-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(214, 164, 71, 0.18);
  color: var(--gold-2);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}

.teaser-title {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 15.5px;
  color: var(--text-main);
}

.teaser-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 14px 16px 32px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-gold {
  font-family: var(--font-display);
  color: var(--gold-3);
  letter-spacing: 0.08em;
}

.footer-dot {
  margin: 0 8px;
  opacity: 0.45;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 24px);
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(22, 33, 70, 0.96);
  border: 1px solid var(--gold-2);
  color: var(--gold-2);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 100;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
