/* ============================================================
   K-Saju Match 2027 — styles
   Two inks on black: rose for A, jade for B, gold for the frame.
   ============================================================ */

:root {
  --ink: #09070d;
  --ink-2: #100b18;
  --ink-3: #171022;
  --panel: rgba(27, 20, 39, 0.74);
  --panel-solid: #1b1427;
  --gold: #d9ba7c;
  --gold-bright: #f0d9a6;
  --gold-dim: rgba(217, 186, 124, 0.5);
  --line: rgba(217, 186, 124, 0.15);
  --line-strong: rgba(217, 186, 124, 0.34);
  --text: #f3edf5;
  --muted: #aaa0b6;
  --muted-2: #7e7489;
  --a: #e08f88;
  --a-bright: #f4b8b2;
  --a-soft: rgba(224, 143, 136, 0.14);
  --b: #8cc0a8;
  --b-bright: #b3ddc9;
  --b-soft: rgba(140, 192, 168, 0.13);
  --accent: var(--a);
  --accent-bright: var(--a-bright);
  --accent-soft: var(--a-soft);
  --red: #b8452f;
  --red-bright: #d4553a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif KR", "Noto Serif CJK KR", "Nanum Myeongjo", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans KR", "Noto Sans CJK KR", "Apple SD Gothic Neo", "Liberation Sans", sans-serif;
  --radius: 20px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.48);
}

body[data-mode="bestie"] {
  --accent: var(--b);
  --accent-bright: var(--b-bright);
  --accent-soft: var(--b-soft);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(900px 560px at 18% -6%, rgba(224, 143, 136, 0.15), transparent 62%),
    radial-gradient(820px 540px at 88% 8%, rgba(140, 192, 168, 0.11), transparent 64%),
    radial-gradient(720px 620px at 50% 100%, rgba(217, 186, 124, 0.06), transparent 66%),
    linear-gradient(180deg, #0e0a15 0%, var(--ink) 48%, #070509 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.008) 0 1px, transparent 1px 4px);
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(18px + env(safe-area-inset-top)) 0 10px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(9, 7, 13, 0.95) 34%, rgba(9, 7, 13, 0));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.brand { display: flex; align-items: center; gap: 9px; }

.brand-seal {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(150deg, #d2685f 0%, #8f3b3a 46%, #2f5d50 100%);
  color: #ffe9dc;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 2px 12px rgba(184, 69, 47, 0.36), inset 0 0 0 1px rgba(255, 220, 190, 0.24);
}

.brand-text {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.13em;
  color: var(--gold-bright);
}

.brand-year { color: var(--muted); font-size: 12px; letter-spacing: 0.1em; margin-left: 6px; }

.top-actions { display: flex; align-items: center; gap: 8px; }

.lang-toggle {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lang-btn.is-on { background: var(--gold); color: #221708; }

.ghost-mini {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
}

/* ---------- screens ---------- */
.screen { display: none; animation: fadeUp 0.45s ease both; }
.screen.is-active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

html[lang="ko"] .display { letter-spacing: -0.035em; }
html[lang="ko"] .chem-title { letter-spacing: -0.03em; }

/* ---------- hero ---------- */
.hero { padding: 26px 0 8px; position: relative; }

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.hero-top .eyebrow { margin: 4px 0 0; }

.year-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  border: 1px solid rgba(217, 186, 124, 0.22);
  border-radius: 12px;
  background: rgba(217, 186, 124, 0.05);
  flex: none;
}

.yb-hanja {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}

.yb-text {
  font-size: 8.5px;
  line-height: 1.45;
  letter-spacing: 0.14em;
  color: var(--muted-2);
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.display {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(35px, 9.4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #f9f3ea;
}

.display em { font-style: italic; color: var(--accent-bright); }

.hero-sub {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  max-width: 31em;
}

/* ---------- mode picker ---------- */
.mode-picker { margin-top: 26px; }

.field-label {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
  font-weight: 600;
}

.optional {
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted-2);
  font-weight: 400;
  font-style: normal;
}

.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 15px 14px 14px;
  border: 1px solid rgba(217, 186, 124, 0.16);
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
  color: var(--muted);
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.mode-card:active { transform: scale(0.99); }

.mode-emoji { font-size: 22px; line-height: 1.2; margin-bottom: 3px; }

.mode-title {
  font-family: var(--serif);
  font-size: 16.5px;
  color: #f2e9dc;
  letter-spacing: -0.01em;
}

.mode-sub { font-size: 11.5px; line-height: 1.45; color: var(--muted-2); }

.mode-card.is-on {
  border-color: rgba(224, 143, 136, 0.6);
  background:
    radial-gradient(220px 120px at 20% 0%, var(--accent-soft), transparent 70%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
}

body[data-mode="bestie"] .mode-card.is-on { border-color: rgba(140, 192, 168, 0.62); }

.mode-card.is-on .mode-title { color: var(--accent-bright); }

.mode-card.is-on::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

/* ---------- offer ---------- */
.offer { display: grid; gap: 9px; margin: 22px 2px 0; }
.offer-row { display: flex; align-items: flex-start; gap: 10px; }

.offer-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  min-width: 58px;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  margin-top: 1px;
  border-radius: 999px;
  border: 1px solid rgba(140, 192, 168, 0.45);
  color: var(--b);
}

.offer-tag.paid { border-color: rgba(217, 186, 124, 0.4); color: var(--gold); min-width: 54px; }
.offer-tag b { font-weight: 800; font-size: 11px; }

.offer-row p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }

.offer-promo {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 1px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #f0c9b6;
  line-height: 1.4;
}

.offer-promo .price-was { font-size: 10px; }
.offer-desc { display: block; }

/* ---------- panels & forms ---------- */
.panel {
  position: relative;
  margin-top: 24px;
  padding: 20px 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(217, 186, 124, 0.06);
  border-radius: 15px;
  pointer-events: none;
}

.pair-form { position: relative; display: grid; gap: 4px; min-width: 0; }

.person-block {
  position: relative;
  min-width: 0;
  padding: 14px 2px 0;
}

.person-a { border-top: 1px solid rgba(224, 143, 136, 0.22); }
.person-b { border-top: 1px solid rgba(140, 192, 168, 0.2); }
.person-a { padding-top: 12px; }

.person-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.person-seal {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.person-a .person-seal {
  color: #2a1210;
  background: linear-gradient(160deg, #f0b0a9, #d2776f);
  box-shadow: 0 0 16px rgba(224, 143, 136, 0.28);
}

.person-b .person-seal {
  color: #0d241c;
  background: linear-gradient(160deg, #b7dfcb, #7fb59d);
  box-shadow: 0 0 16px rgba(140, 192, 168, 0.24);
}

.person-head strong { display: block; font-size: 13.5px; color: var(--text); letter-spacing: 0.02em; }
.person-head span:not(.person-seal) { display: block; font-size: 11px; color: var(--muted-2); }

.field { display: block; min-width: 0; margin-bottom: 14px; }
.person-block .field:last-child { margin-bottom: 6px; }

input[type="text"],
input[type="date"],
input[type="time"] {
  width: 100%;
  min-width: 0;
  padding: 12px 13px;
  background: rgba(8, 6, 12, 0.62);
  border: 1px solid rgba(217, 186, 124, 0.17);
  border-radius: 11px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  color-scheme: dark;
}

input:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(217, 186, 124, 0.1);
}

input::placeholder { color: var(--muted-2); }

.field-hint { display: block; margin-top: 7px; font-size: 12px; color: var(--muted-2); }

.time-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.time-row input { flex: 1; min-width: 0; }

.check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.check input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(217, 186, 124, 0.35);
  border-radius: 5px;
  background: rgba(9, 7, 15, 0.6);
  cursor: pointer;
  position: relative;
  flex: none;
}

.check input:checked { background: var(--gold); border-color: var(--gold); }
.check input:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #221708;
  font-size: 12px;
  font-weight: 700;
}

.link-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 2px;
  color: var(--gold-dim);
}

.link-divider::before,
.link-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 186, 124, 0.22), transparent);
}

.link-divider span { font-family: var(--serif); font-size: 14px; letter-spacing: 0.05em; }

.time-hint { margin: 2px 2px 14px; }

/* ---------- viral link ---------- */
.viral {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 2px;
  padding: 14px;
  border: 1px dashed rgba(224, 143, 136, 0.32);
  border-radius: 15px;
  background: linear-gradient(160deg, rgba(224, 143, 136, 0.07), rgba(140, 192, 168, 0.03));
}

body[data-mode="bestie"] .viral { border-color: rgba(140, 192, 168, 0.34); }

.viral-copy strong { font-size: 13.5px; color: var(--text); }
.viral-copy p { margin: 3px 0 0; font-size: 12px; line-height: 1.55; color: var(--muted-2); }
.viral .ghost-btn { align-self: flex-start; }

.ghost-btn.small { padding: 10px 16px; font-size: 13px; }

.link-box {
  margin-top: 12px;
  padding: 13px;
  border: 1px solid rgba(217, 186, 124, 0.24);
  border-radius: 14px;
  background: rgba(8, 6, 12, 0.5);
  animation: fadeUp 0.3s ease both;
}

.link-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 7px;
}

.link-row { display: flex; gap: 7px; }
.link-row input { flex: 1; font-size: 12px; padding: 10px; color: var(--muted); }
.link-box .fine { margin-top: 8px; }

.invite-banner {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 12px 13px;
  border: 1px solid rgba(224, 143, 136, 0.42);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(224, 143, 136, 0.13), rgba(140, 192, 168, 0.05));
}

body[data-mode="bestie"] .invite-banner { border-color: rgba(140, 192, 168, 0.44); }

.invite-icon { font-size: 20px; line-height: 1.2; }
.invite-banner strong { display: block; font-size: 13.5px; color: #fff4ea; }
.invite-banner p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }

.form-error {
  margin: 12px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(184, 69, 47, 0.14);
  border: 1px solid rgba(184, 69, 47, 0.4);
  color: #f0b7a8;
  font-size: 13px;
}

/* ---------- buttons ---------- */
.primary-btn {
  border: 0;
  border-radius: 999px;
  padding: 15px 22px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #23180a;
  background: linear-gradient(180deg, #f4e0b4 0%, #ddb975 52%, #c39c52 100%);
  box-shadow: 0 8px 24px rgba(217, 186, 124, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.primary-btn:active { transform: translateY(1px) scale(0.995); }
.primary-btn:disabled { opacity: 0.5; cursor: default; }
.primary-btn.wide { width: 100%; margin-top: 4px; }

.ghost-btn {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 15px 22px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--gold-bright);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.ghost-btn:hover { background: rgba(217, 186, 124, 0.08); }
.ghost-btn.wide { width: 100%; }

.small-btn {
  border: 0;
  border-radius: 9px;
  padding: 10px 16px;
  background: var(--gold);
  color: #23180a;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.text-btn {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  padding: 10px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(167, 159, 183, 0.35);
}

.text-btn.strong { color: var(--gold); text-decoration: none; font-weight: 600; }
.text-btn.test { color: var(--muted-2); font-size: 12px; }

.fine { font-size: 12px; color: var(--muted-2); line-height: 1.55; margin: 10px 0 0; }
.center { text-align: center; }

.disclaimer {
  margin: 20px 4px 8px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted-2);
  text-align: center;
}

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 30px 0 10px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  border-top: 1px solid rgba(217, 186, 124, 0.08);
  margin-top: 26px;
}

.footer a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted rgba(167, 159, 183, 0.35); }
.footer a:hover { color: var(--gold-bright); }
.footer .dot { opacity: 0.5; }

/* ---------- result top ---------- */
.result-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0 6px;
}

.back-btn {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: var(--gold);
  cursor: pointer;
}

.back-btn svg { width: 18px; height: 18px; }

.result-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.result-name { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-birth { font-size: 11.5px; color: var(--muted-2); letter-spacing: 0.03em; }

.mode-mini {
  display: flex;
  gap: 6px;
  margin: 8px 0 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 7, 13, 0.45);
}

.mode-mini button {
  flex: 1;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
  padding: 8px 10px;
  cursor: pointer;
}

.mode-mini button.is-on { background: var(--accent-soft); color: var(--accent-bright); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }

/* ---------- hero card ---------- */
.hero-card {
  position: relative;
  overflow: hidden;
  margin-top: 6px;
  padding: 24px 20px 20px;
  border: 1px solid rgba(217, 186, 124, 0.28);
  border-radius: 24px;
  background:
    linear-gradient(165deg, #1d1529 0%, #120d1c 55%, #0b0812 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(217, 186, 124, 0.11);
  border-radius: 17px;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(6px);
}

.glow-a { top: -130px; left: -90px; background: radial-gradient(circle, rgba(224, 143, 136, 0.3), transparent 66%); }
.glow-b { bottom: -150px; right: -100px; background: radial-gradient(circle, rgba(140, 192, 168, 0.24), transparent 66%); }

.card-kicker {
  position: relative;
  margin: 0 0 10px;
  font-size: 9.5px;
  letter-spacing: 0.28em;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 600;
}

.pair-names {
  position: relative;
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.chem-title {
  position: relative;
  margin: 9px 0 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(31px, 8.6vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #fbf4e8;
}

.chem-sub {
  position: relative;
  margin: 10px auto 0;
  max-width: 26em;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--accent-bright);
}

.chem-dot { margin: 0 7px; color: var(--muted-2); }

.score-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(8, 6, 12, 0.46);
  border: 1px solid rgba(217, 186, 124, 0.12);
  text-align: left;
}

.score-dial { position: relative; width: 82px; height: 82px; flex: none; }
.score-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial-track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 7; }
.dial-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.score-number {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 25px;
  color: var(--gold-bright);
}

.score-copy { min-width: 0; }
.score-label {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 7px;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(217, 186, 124, 0.25);
  background: rgba(217, 186, 124, 0.055);
  color: var(--gold-bright);
  white-space: nowrap;
}

/* ---------- blocks ---------- */
.block {
  position: relative;
  margin-top: 24px;
  padding: 21px 18px;
  scroll-margin-top: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.008)), rgba(20, 15, 29, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.block-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20.5px;
  letter-spacing: -0.01em;
  color: #f4e9d3;
}

.block-note { font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.04em; white-space: nowrap; }
.block-sub { margin: -6px 0 14px; font-size: 13px; color: var(--muted); }

/* ---------- people cards ---------- */
.people-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.person-card {
  display: flex;
  flex-direction: column;
  padding: 13px 12px;
  border-radius: 15px;
  border: 1px solid rgba(224, 143, 136, 0.22);
  background: linear-gradient(165deg, rgba(224, 143, 136, 0.08), rgba(255, 255, 255, 0.01));
  min-width: 0;
}

.person-card.b { border-color: rgba(140, 192, 168, 0.22); background: linear-gradient(165deg, rgba(140, 192, 168, 0.08), rgba(255, 255, 255, 0.01)); }

.pc-head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.pc-seal {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 11.5px;
  background: var(--a);
  color: #2a1210;
}
.person-card.b .pc-seal { background: var(--b); color: #0d241c; }
.pc-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: #f6eee4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-score { flex: none; margin-left: auto; font-family: var(--serif); font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }

.pc-hanja { font-family: var(--serif); font-size: 30px; line-height: 1.1; letter-spacing: 0.06em; color: #f7eedd; }
.pc-arch { display: block; margin-top: 6px; font-size: 11.5px; line-height: 1.4; color: var(--muted); min-height: 32px; }
.pc-el { display: inline-block; margin-top: auto; padding-top: 7px; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }

/* ---------- synergy ---------- */
.legend { display: flex; gap: 14px; margin: -4px 0 12px; font-size: 10.5px; color: var(--muted-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend-a i { background: var(--a); }
.legend-b i { background: var(--b); }

.synergy-bars { display: grid; gap: 12px; }

.syn-row {
  display: grid;
  grid-template-columns: 74px 1fr 46px 38px;
  gap: 9px;
  align-items: center;
}

.syn-el { font-size: 11.5px; line-height: 1.3; color: var(--text); }
.syn-el b { display: block; font-weight: 600; }
.syn-el i { font-style: normal; font-size: 9.5px; color: var(--muted-2); }

.syn-track { display: grid; gap: 3px; }
.syn-bar { display: block; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.055); overflow: hidden; }
.syn-bar span { display: block; height: 100%; border-radius: 999px; transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.syn-bar .a { background: linear-gradient(90deg, #b9655e, var(--a)); }
.syn-bar .b { background: linear-gradient(90deg, #5f917c, var(--b)); }

.syn-pct { font-size: 10.5px; line-height: 1.35; text-align: right; font-variant-numeric: tabular-nums; }
.syn-pct span { display: block; }
.syn-pct .a { color: var(--a-bright); }
.syn-pct .b { color: var(--b-bright); }

.syn-gift {
  font-size: 8.5px;
  line-height: 1.25;
  text-align: center;
  color: var(--muted-2);
  border: 1px solid rgba(217, 186, 124, 0.14);
  border-radius: 7px;
  padding: 3px 2px;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.syn-gift.has { color: var(--gold-bright); border-color: rgba(217, 186, 124, 0.36); background: rgba(217, 186, 124, 0.06); }

.gift-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(217, 186, 124, 0.12);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
}

.gift-note p { margin: 0 0 6px; }
.gift-note p:last-child { margin-bottom: 0; }

.combined-head {
  margin: 18px 0 7px;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.combined-strip {
  display: flex;
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.combined-strip span { display: block; height: 100%; }

.combined-note { margin: 8px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--muted); }

/* ---------- summary ---------- */
.summary { margin: 0; font-size: 15px; line-height: 1.8; color: #ddd6e6; }
.formula {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(217, 186, 124, 0.12);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- story card ---------- */
.card-stage { position: relative; border-radius: 18px; overflow: hidden; background: #09070d; }

#storyCanvas { display: block; width: 100%; height: auto; border-radius: 18px; }

.card-badge {
  display: inline-block;
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(217, 186, 124, 0.1);
  border: 1px solid rgba(217, 186, 124, 0.45);
  color: var(--gold-bright);
}

.row-2 { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 9px; margin-top: 12px; }
.send-match { margin-top: 9px; font-size: 13.5px; padding: 12px 18px; }

/* ---------- locked block ---------- */
.locked-block { overflow: hidden; border-color: rgba(217, 186, 124, 0.26); }

.locked-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(300px 160px at 85% 0%, rgba(217, 186, 124, 0.1), transparent 70%);
  pointer-events: none;
}

.lock-head { display: flex; gap: 12px; align-items: flex-start; position: relative; }

.lock-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid rgba(217, 186, 124, 0.28);
  color: var(--gold);
  background: rgba(217, 186, 124, 0.06);
}

.lock-icon svg { width: 19px; height: 19px; }

.lock-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20.5px;
  color: #f4e9d3;
}

.lock-head .block-sub { margin: 4px 0 0; }

.locked-preview {
  margin: 16px 0 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(217, 186, 124, 0.18);
  background: rgba(8, 6, 12, 0.42);
  filter: blur(0.4px);
  opacity: 0.8;
  min-height: 92px;
}

.lp-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 12px; color: var(--muted); }
.lp-month { width: 44px; color: var(--muted-2); }
.lp-bar { flex: 1; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.lp-bar span { display: block; height: 100%; background: rgba(217, 186, 124, 0.5); border-radius: 999px; }
.lp-score { width: 26px; text-align: right; color: var(--muted-2); }

.feature-list { list-style: none; margin: 14px 0 16px; padding: 0; display: grid; gap: 8px; }

.feature-list li {
  position: relative;
  padding-left: 22px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #d5cddf;
}

.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold);
  font-size: 12px;
}

/* ---------- year-end price ---------- */
.price-was {
  align-self: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted-2);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(184, 69, 47, 0.85);
}

.promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -4px 0 14px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(184, 69, 47, 0.55);
  background: rgba(184, 69, 47, 0.14);
  color: #f0c9b6;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.35;
  text-transform: uppercase;
}

.promo-badge::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red-bright);
}

.promo-badge.sm { margin: 0; padding: 3px 9px; font-size: 9px; letter-spacing: 0.08em; }

.promo-badge.center {
  display: flex;
  width: max-content;
  max-width: 100%;
  margin: -4px auto 14px;
}

.lock-price {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 2px 0 12px;
}

.lock-price-now { font-family: var(--serif); font-size: 26px; color: var(--gold-bright); line-height: 1; }

/* ---------- quarters ---------- */
.months-highlight { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 16px; }

.hl {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(217, 186, 124, 0.2);
  background: rgba(217, 186, 124, 0.05);
}

.hl-caution { border-color: rgba(184, 69, 47, 0.32); background: rgba(184, 69, 47, 0.08); }
.hl-label { display: block; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 3px; }
.hl strong { font-family: var(--serif); font-size: 16px; font-weight: 500; color: var(--gold-bright); line-height: 1.3; display: block; }
.hl-caution strong { color: #f0a898; }

.quarter-list { display: grid; gap: 11px; }

.quarter-card {
  padding: 15px;
  border-radius: 16px;
  border: 1px solid rgba(217, 186, 124, 0.13);
  background: rgba(8, 6, 12, 0.36);
}

.q-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.q-label { font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); }
.q-head h3 { margin: 3px 0 0; font-family: var(--serif); font-weight: 500; font-size: 17px; color: #f4e9d3; }

.q-score {
  flex: none;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
  color: var(--gold-bright);
  padding-top: 2px;
}

.q-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 11px; }

.qm {
  padding: 7px 8px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
  font-size: 10px;
  color: var(--muted-2);
  min-width: 0;
}

.qm b { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qm span { display: block; margin-top: 3px; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.qm span i { display: block; height: 100%; background: var(--gold-dim); border-radius: 999px; }
.qm em { display: block; margin-top: 4px; font-style: normal; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qm.is-best { border-color: rgba(217, 186, 124, 0.4); background: rgba(217, 186, 124, 0.06); }
.qm.is-best em { color: var(--gold-bright); }
.qm.is-caution { border-color: rgba(184, 69, 47, 0.34); }
.qm.is-caution em { color: #f0a898; }
.qm.is-caution span i { background: var(--red-bright); }

.q-body { margin: 0; font-size: 13px; line-height: 1.7; color: #d3cbdd; }

/* ---------- deep ---------- */
.deep-list { display: grid; gap: 12px; }

.deep-card {
  padding: 15px;
  border-radius: 16px;
  border: 1px solid rgba(217, 186, 124, 0.12);
  background: rgba(8, 6, 12, 0.36);
}

.deep-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.deep-top h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 18.5px; color: #f4e9d3; }

.deep-score {
  flex: none;
  font-family: var(--serif);
  font-size: 19px;
  color: var(--gold-bright);
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(217, 186, 124, 0.24);
  background: rgba(217, 186, 124, 0.05);
}

.deep-body { margin: 0; font-size: 13.5px; line-height: 1.72; color: #d5cddf; }
.deep-moves { margin: 12px 0 0; padding: 0 0 0 18px; display: grid; gap: 6px; }
.deep-moves li { font-size: 12.5px; line-height: 1.55; color: var(--muted); }

/* ---------- cross promo ---------- */
.promo-block { display: block; }

.promo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 9px;
  padding: 12px 13px;
  border: 1px solid rgba(217, 186, 124, 0.14);
  border-radius: 14px;
  background: rgba(8, 6, 12, 0.32);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.promo-card:hover { border-color: rgba(217, 186, 124, 0.38); background: rgba(217, 186, 124, 0.05); }

.promo-mark {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(155deg, #c14e35, #8f2f1e);
  color: #ffe9d6;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1;
}

.promo-mark.jade { background: linear-gradient(155deg, #4f8a72, #2f5d50); color: #e8fff4; font-size: 13px; letter-spacing: 0.02em; }

.promo-copy { min-width: 0; flex: 1; }
.promo-copy strong { display: block; font-size: 13px; color: var(--text); }
.promo-copy span { display: block; font-size: 11.5px; line-height: 1.45; color: var(--muted-2); }
.promo-arrow { color: var(--gold); font-size: 14px; }

.result-actions { margin-top: 24px; }

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 3, 8, 0.74);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease both;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 12px 22px calc(22px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  border: 1px solid rgba(217, 186, 124, 0.22);
  border-bottom: 0;
  background:
    radial-gradient(380px 200px at 20% 0%, rgba(224, 143, 136, 0.16), transparent 70%),
    radial-gradient(360px 220px at 90% 8%, rgba(140, 192, 168, 0.1), transparent 70%),
    linear-gradient(180deg, #1b1528, #0e0b16);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
  animation: sheetUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sheetUp { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }

.sheet-grab { width: 40px; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); margin: 0 auto 16px; }

.sheet-kicker { margin: 0 0 8px; font-size: 10px; letter-spacing: 0.28em; color: var(--gold); text-align: center; }

.sheet-title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 27px;
  text-align: center;
  color: #f7f1e6;
}

.sheet-sub { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); text-align: center; line-height: 1.6; }

.features {
  list-style: none;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(8, 6, 12, 0.45);
  border: 1px solid rgba(217, 186, 124, 0.12);
  display: grid;
  gap: 9px;
}

.features li { position: relative; padding-left: 22px; font-size: 13px; line-height: 1.5; color: #d9d2e3; }
.features li::before { content: "✦"; position: absolute; left: 0; top: -1px; color: var(--gold); font-size: 11px; }

.price-row { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-bottom: 14px; }
.price { font-family: var(--serif); font-size: 40px; color: var(--gold-bright); line-height: 1; }
.price-once { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }

.restore { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(217, 186, 124, 0.1); }

.restore-box { display: flex; gap: 7px; margin: 4px 0 8px; }
.restore-box input { flex: 1; padding: 11px 12px; font-size: 14px; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(4, 3, 8, 0.74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.overlay[hidden] { display: none; }

.busy-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid rgba(217, 186, 124, 0.22);
  background: #171122;
  color: var(--muted);
  font-size: 13.5px;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(217, 186, 124, 0.25);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  max-width: min(92vw, 460px);
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid rgba(217, 186, 124, 0.28);
  background: rgba(23, 17, 34, 0.96);
  color: #ece4d6;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
}

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

.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;
}

/* ---------- wider screens ---------- */
@media (min-width: 640px) {
  .pair-form {
    grid-template-columns: 1fr 1px 1fr;
    gap: 0 16px;
    align-items: start;
  }
  .link-divider {
    flex-direction: column;
    margin: 0;
    height: 100%;
    min-height: 300px;
  }
  .link-divider::before,
  .link-divider::after {
    width: 1px;
    height: auto;
    flex: 1;
    background: linear-gradient(180deg, transparent, rgba(217, 186, 124, 0.22), transparent);
  }
  .viral { flex-direction: row; align-items: center; justify-content: space-between; }
  .viral-copy { flex: 1; }
  .viral .ghost-btn { align-self: center; flex: none; }
}

@media (min-width: 700px) {
  .app { padding: 0 28px 50px; }
  .hero { padding-top: 44px; }
  .modal { align-items: center; }
  .sheet { border-radius: 26px; max-height: 88vh; border-bottom: 1px solid rgba(217, 186, 124, 0.22); }
  .sheet-grab { display: none; }
}

@media (max-width: 340px) {
  .offer-promo { display: none; }
}

@media (max-width: 400px) {
  .brand-text { font-size: 13px; letter-spacing: 0.07em; }
  .brand-year { display: none; }
  .mode-title { font-size: 15px; }
  .mode-sub { font-size: 11px; }
  .block { padding: 19px 15px; }
  .syn-row { grid-template-columns: 66px 1fr 42px 34px; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
