:root {
  --bg: #0f1226;
  --card: #171b36;
  --line: #2c3160;
  --gold: #e6c27a;
  --gold-2: #f3dca6;
  --text: #ecebf5;
  --muted: #a7a9c9;
  color-scheme: dark;
  --wood: #5cb85c; --fire: #e8574a; --earth: #d9a441; --metal: #cfd3de; --water: #4d8fe0;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.7; word-break: keep-all;
}
h1, h2, h3 { font-family: "Noto Serif KR", "Batang", serif; line-height: 1.35; margin: 0 0 .6em; }
h2 { color: var(--gold-2); font-size: 1.45rem; }
a { color: inherit; }
.fine { color: var(--muted); font-size: .85rem; }
.sub { color: var(--muted); margin-top: -.3em; }
.eyebrow { color: var(--gold); letter-spacing: .15em; font-size: .85rem; margin: 0 0 .4em; }

.top {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: .7rem 1.2rem; background: rgba(15, 18, 38, .85); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.logo { text-decoration: none; font-family: "Noto Serif KR", serif; color: var(--gold); font-size: 1.2rem; }
.logo span { color: var(--text); font-size: .9rem; margin-left: .3em; }
.top nav a { text-decoration: none; margin-left: 1rem; color: var(--muted); font-size: .95rem; }
.top nav a:hover { color: var(--gold); }

.hero {
  min-height: 78vh; display: flex; align-items: center; justify-content: center; text-align: center;
  background-size: cover; background-position: center; position: relative;
}
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,18,38,.35), rgba(15,18,38,.85)); }
.hero-inner { position: relative; padding: 2rem 1.2rem; max-width: 720px; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.lead { color: #dcdcf0; text-shadow: 0 1px 6px rgba(0,0,0,.7); }

.btn {
  display: inline-block; border: 0; border-radius: 999px; padding: .8rem 1.6rem; cursor: pointer;
  font-size: 1rem; font-weight: 700; text-decoration: none;
}
.btn.primary { background: linear-gradient(135deg, var(--gold), #c99a45); color: #1b1630; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.btn.wide { width: 100%; margin-top: .6rem; }

.panel {
  max-width: 760px; margin: 1.6rem auto; padding: 1.6rem 1.4rem; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px;
}
.image-panel { background-size: cover; background-position: center; padding: 0; overflow: hidden; }
.overlay { background: linear-gradient(180deg, rgba(15,18,38,.72), rgba(15,18,38,.92)); padding: 1.6rem 1.4rem; }

form .row { display: flex; gap: 1rem; flex-wrap: wrap; }
form label { flex: 1 1 220px; display: flex; flex-direction: column; font-size: .9rem; color: var(--muted); margin-bottom: .8rem; }
form input, form select {
  margin-top: .3rem; padding: .7rem .8rem; border-radius: 10px; border: 1px solid var(--line);
  background: #0f1330; color: var(--text); font-size: 1rem; color-scheme: dark;
}
.checks .check { flex-direction: row; align-items: center; gap: .4rem; flex: 0 1 auto; color: var(--text); }
.checks input { margin: 0; width: 18px; height: 18px; }

.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin: 1rem 0; }
.pillar { text-align: center; background: #10142f; border: 1px solid var(--line); border-radius: 14px; padding: .7rem .3rem; }
.pillar .label { color: var(--muted); font-size: .8rem; }
.pillar .ch { font-family: "Noto Serif KR", serif; font-size: 2rem; line-height: 1.2; margin: .2rem 0; }
.pillar .ko { font-size: .8rem; color: var(--muted); }
.pillar .god { font-size: .75rem; color: var(--gold); }
.pillar.empty .ch { color: var(--line); }
.e0 { color: var(--wood); } .e1 { color: var(--fire); } .e2 { color: var(--earth); } .e3 { color: var(--metal); } .e4 { color: var(--water); }
.pillar.me { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }

.bars { display: grid; gap: .5rem; margin: 1rem 0; }
.bar { display: grid; grid-template-columns: 3.2rem 1fr 2rem; align-items: center; gap: .6rem; }
.bar .track { height: 12px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 99px; transition: width .6s ease; }
.bar .n { text-align: right; color: var(--muted); }

.symbol { font-family: "Noto Serif KR", serif; font-size: 1.25rem; color: var(--gold); }
.today { margin-top: 1.2rem; padding: 1rem 1.1rem; border-radius: 14px; background: #10142f; border-left: 3px solid var(--gold); }
.today h3 { font-size: 1rem; color: var(--gold-2); margin-bottom: .3rem; }
.today h3 span { color: var(--muted); font-size: .85rem; font-weight: 400; }
.today p { margin: 0; }

.locked-wrap { padding: 0; overflow: hidden; }
.paid-head { background-size: cover; background-position: center; }
.paid-body { padding: 1.4rem; position: relative; }
.paid-body.blur { max-height: 260px; overflow: hidden; filter: blur(5px); user-select: none; pointer-events: none; }
.paid-body h3 { color: var(--gold-2); margin-top: 1.2rem; }
.paid-body h3:first-child { margin-top: 0; }
.lock { padding: 1.4rem; text-align: center; border-top: 1px solid var(--line); }
.lock-title { font-weight: 700; color: var(--gold-2); margin: 0 0 .2rem; }
.code-row { display: flex; gap: .5rem; max-width: 380px; margin: 1rem auto .5rem; }
.code-row input {
  flex: 1; padding: .7rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: #0f1330;
  color: var(--text); font-size: 1rem; text-transform: uppercase; letter-spacing: .08em;
}
.code-msg { min-height: 1.4em; font-size: .9rem; margin: 0 0 .8rem; }
.code-msg.ok { color: #7ed69a; } .code-msg.err { color: #ff8a80; }
.paid-actions { padding: 0 1.4rem 1.4rem; text-align: center; }

.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: 1rem 0; }
.price { background: rgba(16,20,47,.85); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.price b { display: block; font-size: 1.3rem; color: var(--gold); }
.price span { color: var(--muted); font-size: .9rem; }
.steps { color: var(--text); padding-left: 1.2rem; margin: 0; }

.foot { background-size: cover; background-position: center; margin-top: 2rem; text-align: center; }
.foot .overlay { padding: 3rem 1.2rem; }

@media (max-width: 560px) {
  .pillar .ch { font-size: 1.6rem; }
  .price-grid { grid-template-columns: 1fr; }
  .top nav a { margin-left: .7rem; }
  .panel { margin: 1rem .6rem; }
}

@media print {
  body { background: #fff; color: #222; }
  .top, .hero, #form, #price, .foot, .lock, .paid-actions { display: none !important; }
  .panel { border: 1px solid #ccc; background: #fff !important; break-inside: avoid; }
  .overlay { background: #fff; }
  .pillar .ko, .bar .n, .fine, .sub { color: #555; }
  h2, .symbol, .paid-body h3 { color: #6b4b12; }
  .pillar { background: #fff; }
  .paid-head .overlay { background: #fff; }
  .paid-head { background: none !important; }
}
