/* Layout: 밤하늘 쪽빛 위에 괴황지 부적 카드. 히어로는 좌측 문구+폼, 우측 부채꼴 카드 덱.
   이후 결과 → 궁합(VS) → 도감·상성표 순으로 세로 흐름. 의도적인 단일 다크 테마. */
:root {
  --night: #121A3A;
  --night-2: #19224C;
  --night-3: #26315F;
  --line: #34407A;
  --fg: #F2EDE2;
  --muted: #A3A9C9;
  --paper: #EAC96E;
  --paper-2: #E2BC5A;
  --ink-red: #B8322A;
  --ink-brown: #2A1A12;
  --wood: #4DB386;
  --fire: #EC6A50;
  --earth: #E8B847;
  --metal: #E6E1D4;
  --water: #7E9BEA;

  --f-display: "Hahmlet", "Noto Serif KR", serif;
  --f-hanja: "Noto Serif KR", "Batang", serif;
  --f-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;

  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.86rem);
  --step-0: clamp(0.95rem, 0.92rem + 0.15vw, 1.03rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2: clamp(1.45rem, 1.3rem + 0.75vw, 1.95rem);
  --step-3: clamp(1.9rem, 1.6rem + 1.5vw, 2.9rem);
  --step-4: clamp(2.3rem, 1.8rem + 2.6vw, 4.1rem);

  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--night);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(242,237,226,.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 34% 62%, rgba(242,237,226,.35) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 72% 24%, rgba(242,237,226,.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 86% 70%, rgba(242,237,226,.4) 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 8%, rgba(242,237,226,.45) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 84%, rgba(242,237,226,.3) 50%, transparent 51%),
    radial-gradient(900px 500px at 80% -10%, rgba(126,155,234,.14), transparent 70%),
    radial-gradient(700px 500px at -10% 40%, rgba(184,50,42,.08), transparent 70%);
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: 20px; }

/* ---------- 헤더 ---------- */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: rgba(18,26,58,.82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(52,64,122,.6);
}
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.logo { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.logo__hanja { font-family: var(--f-hanja); font-weight: 900; font-size: 1.25rem; color: var(--paper); letter-spacing: .04em; }
.logo__ko { font-family: var(--f-display); font-weight: 600; font-size: 1rem; }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; font-size: var(--step--1); color: var(--muted); padding: 6px 12px; border-radius: 999px; }
.nav a:hover { color: var(--fg); background: var(--night-2); }

/* ---------- 히어로 ---------- */
.hero { padding-block: clamp(36px, 6vw, 80px) clamp(28px, 4vw, 56px); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero__kicker { font-family: var(--f-hanja); color: var(--paper); font-weight: 700; letter-spacing: .3em; font-size: var(--step--1); margin: 0 0 14px; }
.hero h1 {
  font-family: var(--f-display); font-weight: 700; font-size: var(--step-4);
  line-height: 1.18; letter-spacing: -0.02em; margin: 0 0 18px; text-wrap: balance;
}
.hero__lead { color: var(--muted); max-width: 34em; margin: 0 0 28px; }
.hero__lead b { color: var(--fg); font-weight: 600; }

/* ---------- 폼 ---------- */
.form { display: grid; gap: 14px; background: var(--night-2); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .field legend { font-size: var(--step--1); color: var(--muted); font-weight: 500; padding: 0; }
.field input[type="text"], .field input[type="date"], .field input[type="time"] {
  width: 100%; min-width: 0; font: inherit; color: var(--fg);
  background: var(--night); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.field input::placeholder { color: #6E76A0; }
.field input:focus { border-color: var(--paper); outline: none; box-shadow: 0 0 0 3px rgba(234,201,110,.18); }
fieldset.field { border: 0; margin: 0; padding: 0; }
.seg { display: inline-flex; background: var(--night); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 7px 14px; border-radius: 7px; cursor: pointer; font-size: var(--step--1); color: var(--muted); }
.seg input:checked + label { background: var(--paper); color: var(--ink-brown); font-weight: 600; }
.seg input:focus-visible + label { outline: 2px solid var(--paper); outline-offset: 2px; }
.check { display: flex; gap: 8px; align-items: center; font-size: var(--step--1); color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--paper); width: 16px; height: 16px; }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.form-error { color: var(--fire); font-size: var(--step--1); margin: 0; min-height: 1em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 12px 22px; font-weight: 600; cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: transform .15s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--paper); color: var(--ink-brown); }
.btn--primary:hover { background: #F2D684; }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--paper); }

/* ---------- 부적 카드 ---------- */
.bujeok {
  --c: var(--earth);
  position: relative; aspect-ratio: 3 / 4.4; width: 100%;
  background:
    repeating-linear-gradient(93deg, rgba(120,80,20,.05) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-2deg, rgba(255,255,255,.07) 0 1px, transparent 1px 9px),
    linear-gradient(170deg, #EFD27E, var(--paper) 45%, var(--paper-2));
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 18px 40px -18px rgba(0,0,0,.65), 0 2px 6px rgba(0,0,0,.25);
  color: var(--ink-brown);
}
.bujeok__frame {
  position: absolute; inset: 7%; border: 2px solid var(--ink-red);
  outline: 1px solid var(--ink-red); outline-offset: -6px;
  display: grid; grid-template-rows: auto 1fr auto; justify-items: center; padding: 6% 4% 8%;
}
.bujeok__top { font-family: var(--f-hanja); font-weight: 900; color: var(--ink-red); font-size: .72em; letter-spacing: .5em; padding-left: .5em; }
.bujeok__art { position: relative; width: 100%; display: grid; place-items: center; overflow: hidden; }
.bujeok__glyph {
  font-family: var(--f-hanja); font-weight: 900; line-height: 1;
  font-size: clamp(2.4rem, 9vw, 7rem); color: var(--ink-red); opacity: .9;
  text-shadow: 0 0 1px rgba(184,50,42,.6);
}
.bujeok__art.has-img .bujeok__glyph { visibility: hidden; }
.bujeok__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.bujeok__name { font-family: var(--f-display); font-weight: 700; font-size: 1.05em; letter-spacing: -.01em; }
.bujeok__seal {
  position: absolute; right: -4%; bottom: -3%;
  width: 2.4em; height: 2.4em; display: grid; place-items: center;
  background: var(--ink-red); color: var(--paper); border-radius: 3px;
  font-family: var(--f-hanja); font-weight: 900; font-size: .62em; line-height: 1.05; text-align: center;
  writing-mode: vertical-rl; letter-spacing: .05em;
  transform: rotate(-6deg); box-shadow: 0 0 0 2px rgba(184,50,42,.25);
}
.bujeok::after { /* 오행 색 리본 */
  content: ""; position: absolute; left: 50%; top: -6px; width: 22%; height: 12px; transform: translateX(-50%);
  background: var(--c); border-radius: 2px; box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.bujeok.el-wood { --c: var(--wood); }
.bujeok.el-fire { --c: var(--fire); }
.bujeok.el-earth { --c: var(--earth); }
.bujeok.el-metal { --c: var(--metal); }
.bujeok.el-water { --c: var(--water); }

.bujeok--sm { font-size: 12px; }
.bujeok--sm .bujeok__glyph { font-size: 4.2em; }
.bujeok--md { font-size: 15px; }
.bujeok--md .bujeok__glyph { font-size: 6em; }
.bujeok--lg { font-size: 20px; }
.bujeok--lg .bujeok__glyph { font-size: 8em; }

/* ---------- 덱 ---------- */
.deck { --spread: 1; position: relative; height: clamp(300px, 34vw, 420px); }
.deck__card {
  --fan: translateX(calc(-50% + var(--x) * var(--spread))) translateY(var(--y)) rotate(var(--rot));
  position: absolute; left: 50%; bottom: 8%; width: clamp(120px, 13vw, 168px);
  transform-origin: 50% 105%;
  transform: var(--fan);
  transition: transform .25s ease;
  animation: deal .9s cubic-bezier(.2,.8,.2,1) both;
  animation-delay: calc(var(--i) * 45ms + 150ms);
}
@keyframes deal { from { transform: translateX(-50%) translateY(10px) rotate(0deg); } }
.deck__card:hover { transform: translateX(calc(-50% + var(--x) * var(--spread))) translateY(calc(var(--y) - 22px)) rotate(var(--rot)); z-index: 30 !important; }
@media (prefers-reduced-motion: reduce) { .deck__card { animation: none; transition: none; } }

/* ---------- 섹션 공통 ---------- */
.section { padding-block: clamp(48px, 7vw, 96px); border-top: 1px solid rgba(52,64,122,.55); }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: clamp(24px, 3vw, 40px); }
.section__head h2 { font-family: var(--f-display); font-size: var(--step-3); line-height: 1.2; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
.section__head p { margin: 6px 0 0; color: var(--muted); max-width: 36em; }
.section__hanja { font-family: var(--f-hanja); font-weight: 900; color: var(--paper); margin-right: .35em; }

.tone-switch { display: inline-flex; gap: 4px; background: var(--night-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.tone-switch button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: var(--step--1); color: var(--muted); }
.tone-switch button[aria-pressed="true"] { background: var(--ink-red); color: var(--fg); font-weight: 600; }

.example-badge { display: inline-block; font-size: var(--step--1); color: var(--paper); border: 1px dashed rgba(234,201,110,.6); border-radius: 6px; padding: 2px 10px; margin-bottom: 12px; }

/* ---------- 결과 ---------- */
.result { display: grid; grid-template-columns: minmax(220px, 340px) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.result__card { position: sticky; top: 90px; }
.result__eyebrow { color: var(--muted); margin: 0; font-size: var(--step--1); letter-spacing: .02em; }
.result__name { font-family: var(--f-display); font-size: var(--step-4); line-height: 1.1; margin: 4px 0 6px; letter-spacing: -0.03em; }
.result__title { font-size: var(--step-1); margin: 0 0 16px; color: var(--paper); font-family: var(--f-display); }
.result__about { max-width: 38em; margin: 16px 0; }
.result__love { color: var(--muted); margin: 16px 0 0; }
.result__love strong { color: var(--fg); margin-right: 6px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chips li { border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: var(--step--1); background: var(--night-2); }
.quote {
  margin: 0; padding: 16px 20px; border-left: 3px solid var(--ink-red);
  background: linear-gradient(90deg, rgba(184,50,42,.16), rgba(184,50,42,0));
  font-family: var(--f-display); font-size: var(--step-1); line-height: 1.55; border-radius: 0 10px 10px 0;
}
.chart-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin-top: 28px; padding-top: 24px; border-top: 1px dashed var(--line); }
.mini-h { font-size: var(--step--1); color: var(--muted); font-weight: 500; margin: 0 0 10px; }
.pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pillar { display: grid; justify-items: center; gap: 4px; background: var(--night-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px 10px; }
.pillar--empty { opacity: .55; }
.pillar__label { font-size: .72rem; color: var(--muted); }
.pillar__ch { font-family: var(--f-hanja); font-weight: 900; font-size: 1.7rem; line-height: 1.1; }
.pillar__ko { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.el-wood.pillar__ch, .pillar__ch.el-wood { color: var(--wood); }
.pillar__ch.el-fire { color: var(--fire); }
.pillar__ch.el-earth { color: var(--earth); }
.pillar__ch.el-metal { color: var(--metal); }
.pillar__ch.el-water { color: var(--water); }
.pillar--empty .pillar__ch { color: var(--muted); }
.ohaeng { display: grid; gap: 8px; }
.ohaeng__row { display: grid; grid-template-columns: 4.2em minmax(0, 1fr) 1.4em; align-items: center; gap: 10px; font-size: var(--step--1); }
.ohaeng__name { font-family: var(--f-hanja); }
.ohaeng__track { height: 10px; background: var(--night-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.ohaeng__fill { display: block; height: 100%; border-radius: 999px; }
.ohaeng__num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.ohaeng__note { font-size: var(--step--1); color: var(--muted); margin: 10px 0 0; }
.el-bg-wood { background: var(--wood); } .el-bg-fire { background: var(--fire); } .el-bg-earth { background: var(--earth); } .el-bg-metal { background: var(--metal); } .el-bg-water { background: var(--water); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.copy-status { font-size: var(--step--1); color: var(--wood); min-height: 1.4em; margin: 10px 0 0; overflow-wrap: anywhere; }
.copy-input { width: 100%; margin-top: 6px; font: inherit; background: var(--night); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }

/* ---------- 궁합 ---------- */
.match-forms { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; margin-bottom: 40px; align-items: start; }
.me-mini { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; align-items: center; }
.me-mini__card .bujeok { font-size: 9px; }
.me-mini__card .bujeok__glyph { font-size: 4em; }
.me-mini b { display: block; font-family: var(--f-display); font-size: var(--step-2); line-height: 1.2; }
.me-mini span { display: block; color: var(--muted); font-size: var(--step--1); }
.form a { color: var(--paper); }
.form h3 { margin: 0; font-family: var(--f-display); font-size: var(--step-1); display: flex; align-items: center; gap: 10px; }
.form h3 .who { font-family: var(--f-hanja); font-weight: 900; color: var(--ink-red); background: var(--paper); width: 1.7em; height: 1.7em; display: inline-grid; place-items: center; border-radius: 4px; font-size: .9em; }
.invite-banner { background: rgba(234,201,110,.12); border: 1px solid rgba(234,201,110,.5); border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; }

.versus { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: clamp(12px, 3vw, 40px); max-width: 860px; margin: 0 auto; }
.versus__side { margin: 0; display: grid; justify-items: center; gap: 12px; }
.versus__side .bujeok { max-width: 230px; }
.versus__side figcaption { text-align: center; font-family: var(--f-display); font-weight: 700; font-size: var(--step-1); display: grid; }
.versus__side figcaption span { font-family: var(--f-body); font-weight: 400; font-size: var(--step--1); color: var(--muted); }
.versus__mid { display: grid; justify-items: center; gap: 6px; text-align: center; }
.seal-big {
  font-family: var(--f-hanja); font-weight: 900; font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 1;
  width: 1.5em; height: 1.5em; display: grid; place-items: center;
  background: var(--ink-red); color: var(--paper); border-radius: 8px; transform: rotate(-5deg);
  box-shadow: 0 0 0 4px rgba(184,50,42,.25), 0 14px 30px -12px rgba(184,50,42,.7);
}
.versus__label { font-family: var(--f-display); font-weight: 700; font-size: var(--step-1); margin-top: 10px; }
.versus__score { font-variant-numeric: tabular-nums; color: var(--muted); }
.versus__score b { font-family: var(--f-display); font-size: var(--step-3); color: var(--paper); margin-right: 2px; }
.versus__verdict { font-size: var(--step--1); color: var(--muted); max-width: 11em; }

.match-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 48px); align-items: center; margin-top: 40px; padding-top: 32px; border-top: 1px dashed var(--line); }
.radar { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.radar__ring { fill: none; stroke: var(--line); stroke-width: 1; }
.radar__axis { stroke: var(--line); stroke-width: 1; }
.radar__shape { fill: rgba(234,201,110,.22); stroke: var(--paper); stroke-width: 2; stroke-linejoin: round; }
.radar__dot { fill: var(--paper); }
.radar__label { fill: var(--muted); font-size: 13px; font-family: var(--f-body); }
.radar__val { fill: var(--fg); font-weight: 700; }
.match-short { font-family: var(--f-display); font-weight: 700; font-size: var(--step-2); line-height: 1.3; margin: 0 0 16px; text-wrap: balance; }
.notes { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.notes li { display: flex; gap: 10px; align-items: baseline; font-size: var(--step--1); color: var(--muted); }
.notes li span { flex: none; color: var(--paper); border: 1px solid rgba(234,201,110,.45); border-radius: 6px; padding: 0 8px; font-size: .78rem; }

/* ---------- 도감 / 상성표 ---------- */
.dex-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.dex-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 12px; }
.dex-item { background: none; border: 0; padding: 0; cursor: pointer; display: grid; gap: 8px; text-align: left; border-radius: 8px; transition: transform .2s ease; }
.dex-item:hover { transform: translateY(-4px); }
.dex-item.is-active .bujeok { box-shadow: 0 0 0 3px var(--fg), 0 18px 40px -18px rgba(0,0,0,.65); }
.dex-item__meta { font-size: .75rem; color: var(--muted); line-height: 1.35; display: grid; }
.dex-item__meta b { color: var(--fg); font-family: var(--f-display); font-size: .88rem; }

.typechart-wrap { overflow-x: auto; }
.typechart { display: grid; grid-template-columns: repeat(11, minmax(28px, 1fr)); gap: 3px; min-width: 330px; }
.tc { aspect-ratio: 1; display: grid; place-items: center; font-family: var(--f-hanja); font-weight: 900; font-size: .95rem; border-radius: 5px; }
.tc--corner { position: relative; font-family: var(--f-body); font-weight: 500; font-size: .58rem; color: var(--muted); display: block; }
.tc--corner span:first-child { position: absolute; left: 3px; bottom: 2px; }
.tc--corner span:last-child { position: absolute; right: 3px; top: 2px; }
.tc--head { background: var(--night-2); }
.tc--head.el-wood { color: var(--wood); } .tc--head.el-fire { color: var(--fire); } .tc--head.el-earth { color: var(--earth); } .tc--head.el-metal { color: var(--metal); } .tc--head.el-water { color: var(--water); }
.tc--cell { border: 0; cursor: pointer; font-size: .82rem; transition: transform .12s ease; }
.tc--cell:hover { transform: scale(1.12); z-index: 1; }
.tc--cell.is-active { outline: 2px solid var(--fg); outline-offset: 1px; transform: scale(1.12); z-index: 2; }
.rel-hap { background: var(--ink-red); color: var(--paper); }
.rel-same { background: #3A4680; color: var(--fg); }
.rel-sibling { background: #2E3A6E; color: #C9CEE6; }
.rel-feeds, .rel-fed { background: #2F6B57; color: #D7F0E4; }
.rel-leads, .rel-tempered { background: #6B4A26; color: #F5DFB8; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 14px 0 0; padding: 0; list-style: none; font-size: var(--step--1); color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.seal-sm { font-family: var(--f-hanja); font-weight: 900; display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 4px; font-size: .85rem; flex: none; }
.pair-caption { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px 16px; background: var(--night-2); border: 1px solid var(--line); border-radius: 12px; min-height: 4.6em; }
.pair-caption .seal-sm { width: 2em; height: 2em; font-size: 1rem; }

/* ---------- 계산 기준 / 푸터 ---------- */
.basis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.basis div { border-top: 2px solid var(--ink-red); padding-top: 12px; }
.basis h3 { font-family: var(--f-display); font-size: var(--step-1); margin: 0 0 6px; }
.basis p { margin: 0; color: var(--muted); font-size: var(--step--1); }
.foot { padding-block: 36px 48px; color: var(--muted); font-size: var(--step--1); border-top: 1px solid rgba(52,64,122,.55); }
.foot__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* ---------- 공유 다이얼로그 ---------- */
.share-dialog { border: 1px solid var(--line); background: var(--night-2); color: var(--fg); border-radius: 18px; padding: 20px; width: min(440px, calc(100vw - 32px)); }
.share-dialog::backdrop { background: rgba(8,12,30,.72); }
.share-dialog img { width: 100%; border-radius: 10px; }
.share-dialog p { color: var(--muted); font-size: var(--step--1); margin: 12px 0; }
.share-dialog__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- 반응형 ---------- */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .deck { order: -1; height: clamp(230px, 52vw, 340px); }
  .dex-layout { grid-template-columns: minmax(0, 1fr); }
  .basis { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .result { grid-template-columns: minmax(0, 1fr); }
  .result__card { position: static; max-width: 260px; margin: 0 auto; width: 100%; }
  .chart-grid { grid-template-columns: minmax(0, 1fr); }
  .match-forms { grid-template-columns: minmax(0, 1fr); }
  .match-detail { grid-template-columns: minmax(0, 1fr); }
  .versus { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; }
  .versus__side .bujeok { font-size: 9px; }
  .versus__side .bujeok .bujeok__glyph { font-size: 5em; }
  .dex-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .deck__card { width: clamp(78px, 22vw, 120px); }
  .deck { --spread: .62; }
}
@media (max-width: 420px) {
  .form__row { grid-template-columns: minmax(0, 1fr); }
  .seal-big { font-size: 2.2rem; }
  .versus__score b { font-size: 1.6rem; }
}
