@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&family=Noto+Serif+KR:wght@500;600;700;900&display=swap');

:root {
  --ink: #1d2019;
  --muted: #65675e;
  --paper: #f2eee3;
  --paper-light: #f8f5ec;
  --jade: #31584f;
  --jade-dark: #203f39;
  --red: #a83e2f;
  --brass: #a77a35;
  --line: rgba(38, 44, 35, 0.16);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 6%, rgba(167, 122, 53, 0.09), transparent 23rem),
    radial-gradient(circle at 86% 38%, rgba(49, 88, 79, 0.08), transparent 28rem),
    repeating-linear-gradient(90deg, rgba(35, 37, 30, 0.018) 0 1px, transparent 1px 5px),
    var(--paper);
  font-family: 'Noto Sans KR', sans-serif;
  min-height: 100vh;
}

body::before,
body::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: -1;
  border: 1px solid rgba(40, 47, 38, 0.08);
  border-radius: 50%;
}

body::before { width: 520px; height: 520px; left: -340px; top: 18%; }
body::after { width: 680px; height: 680px; right: -470px; bottom: -260px; }

button { font: inherit; }

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 30px; }

.masthead { text-align: center; margin-bottom: 34px; }
.eyebrow, .section-kicker {
  margin: 0 0 13px;
  color: var(--jade);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
}
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 12px; }
.eyebrow span { width: 28px; height: 1px; background: var(--jade); opacity: 0.5; }
.masthead h1 {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 14px;
  margin: 0;
  font-family: 'Noto Serif KR', serif;
  font-size: clamp(38px, 6vw, 62px);
  font-weight: 900;
  letter-spacing: -0.07em;
}
.masthead h1 small { color: var(--red); font-size: 17px; letter-spacing: 0.16em; }
.intro { margin: 12px 0 0; color: var(--muted); font-family: 'Noto Serif KR', serif; font-size: 15px; }
.library-link { display: inline-flex; align-items: center; gap: 9px; margin-top: 15px; color: var(--jade); font-size: 11px; font-weight: 700; text-decoration: none; }
.library-link span { color: var(--red); transition: transform .2s ease; }
.library-link:hover span { transform: translateX(4px); }

.oracle {
  position: relative;
  overflow: hidden;
  padding: 22px 34px 30px;
  color: #f7f3e8;
  border: 1px solid rgba(217, 198, 152, 0.28);
  border-radius: 4px;
  background:
    linear-gradient(115deg, rgba(255,255,255,.035), transparent 42%),
    repeating-linear-gradient(2deg, rgba(255,255,255,.018) 0 1px, transparent 1px 6px),
    var(--jade-dark);
  box-shadow: 0 20px 55px rgba(42, 48, 37, 0.16);
}
.oracle::before {
  content: '乾  坤  震  巽  坎  離  艮  兌';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-7deg);
  white-space: nowrap;
  font-family: 'Noto Serif KR', serif;
  font-size: clamp(50px, 10vw, 112px);
  color: rgba(232, 220, 183, 0.025);
  letter-spacing: .14em;
}
.status-row { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.status-row p { margin: 0; font-size: 12px; color: rgba(255,255,255,.68); }
#roundLabel { font-family: 'Noto Serif KR', serif; color: #e8dfc9; }
.gravity { display: flex; align-items: center; gap: 7px; }
.gravity i { width: 6px; height: 6px; border-radius: 50%; background: #d3ad5d; box-shadow: 0 0 12px #d3ad5d; }
.gravity strong { color: #efe3c6; font-weight: 500; }

.toss-stage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  height: 300px;
  max-width: 780px;
  margin: 4px auto 0;
  perspective: 900px;
}
.ground-shadow {
  position: absolute;
  width: 86%; height: 44px;
  left: 7%; bottom: 45px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(6, 17, 14, .52), transparent 68%);
  filter: blur(3px);
}
.coin-slot { position: relative; height: 180px; display: flex; justify-content: center; align-items: flex-start; transform-style: preserve-3d; }
.coin {
  position: relative;
  width: 122px; height: 122px;
  border-radius: 50%;
  transform-style: preserve-3d;
  will-change: transform;
  filter: drop-shadow(0 15px 10px rgba(0,0,0,.28));
}
.coin-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 5px solid #835b24;
  border-radius: 50%;
  backface-visibility: hidden;
  background:
    radial-gradient(circle at 36% 28%, rgba(255,246,176,.8) 0 2%, transparent 19%),
    repeating-radial-gradient(circle, transparent 0 11px, rgba(107,70,27,.12) 12px 13px),
    linear-gradient(135deg, #d8ad59 0%, #956526 48%, #c99442 74%, #78501e 100%);
  box-shadow:
    inset 0 0 0 3px #d3a54d,
    inset 0 0 0 7px rgba(83,53,18,.34),
    inset 0 0 24px rgba(63,36,10,.34);
}
.coin-back { transform: rotateX(180deg); background: radial-gradient(circle at 35% 26%, #d9ad57, #8b5d22 70%, #b57f33); }
.coin-edge {
  position: absolute;
  left: 1px; right: 1px; top: 49%; height: 7px;
  transform: rotateX(90deg) translateZ(3px);
  background: #6c461b;
}
.square-hole {
  position: absolute;
  width: 31px; height: 31px;
  border: 5px solid #74501f;
  background: #18352f;
  box-shadow: inset 2px 2px 4px rgba(0,0,0,.6), 0 0 0 2px rgba(236,188,91,.4);
}
.inscription { position: absolute; font-family: 'Noto Serif KR', serif; color: #67451b; font-size: 20px; font-weight: 900; text-shadow: 0 1px rgba(255,220,139,.5); }
.inscription.top { top: 12px; }
.inscription.bottom { bottom: 10px; }
.inscription.left { left: 16px; }
.inscription.right { right: 16px; }
.back-mark { color: #694719; font-size: 54px; line-height: 1; opacity: .8; }
.coin-result {
  position: absolute;
  top: 140px;
  min-width: 92px;
  padding: 5px 12px;
  text-align: center;
  color: rgba(244, 238, 222, .55);
  border: 1px solid rgba(231, 218, 184, .13);
  border-radius: 20px;
  font-size: 11px;
  transition: .25s ease;
}
.coin-result.revealed { color: #fff3d4; border-color: rgba(214, 178, 97, .55); background: rgba(8,22,18,.28); }
.coin-result.revealed strong { color: #edc56f; margin-left: 3px; }

.score-key { position: relative; display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: -18px; color: rgba(255,255,255,.66); font-size: 11px; }
.score-key > span { display: flex; align-items: center; gap: 7px; }
.score-key strong { color: #f2e7cd; font-weight: 600; }
.score-key > i { width: 1px; height: 12px; background: rgba(255,255,255,.16); }
.mini-coin { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #654416; border: 1px solid #e0bd6a; background: #b98334; font-family: serif; font-size: 10px; }

.controls { position: relative; display: flex; align-items: stretch; justify-content: center; gap: 10px; margin-top: 20px; }
.toss-button, .reset-button { border: 0; cursor: pointer; transition: transform .2s ease, background .2s ease, opacity .2s ease; }
.toss-button {
  display: flex; align-items: center; gap: 18px;
  min-width: 250px; padding: 13px 20px;
  color: #28382f; background: #e7d6aa;
  box-shadow: 0 7px 18px rgba(0,0,0,.18);
}
.toss-button:hover:not(:disabled) { transform: translateY(-2px); background: #f0e0b6; }
.toss-button:active:not(:disabled) { transform: translateY(0); }
.button-main { flex: 1; font-family: 'Noto Serif KR', serif; font-size: 16px; font-weight: 700; }
.button-sub { padding-left: 15px; border-left: 1px solid rgba(46,63,52,.25); font-size: 10px; letter-spacing: .05em; }
.toss-button:disabled { cursor: not-allowed; opacity: .52; }
.reset-button { padding: 0 18px; color: rgba(255,255,255,.67); border: 1px solid rgba(255,255,255,.2); background: transparent; font-size: 11px; }
.reset-button:hover { color: #fff; border-color: rgba(255,255,255,.4); }
.reset-button:disabled { cursor: not-allowed; opacity: .35; }
.reset-button span { display: inline-block; margin-right: 4px; font-size: 16px; }
button:focus-visible { outline: 2px solid #e2bd69; outline-offset: 4px; }

.ledger { margin-top: 20px; padding: 28px 34px 30px; border: 1px solid var(--line); background: rgba(248,245,236,.58); }
.ledger-heading { display: flex; justify-content: space-between; align-items: end; padding-bottom: 19px; border-bottom: 2px solid var(--ink); }
.section-kicker { margin-bottom: 5px; color: var(--red); }
.ledger h2 { margin: 0; font-family: 'Noto Serif KR', serif; font-size: 24px; }
.grand-score { display: flex; align-items: baseline; gap: 5px; color: var(--muted); }
.grand-score span { margin-right: 8px; font-size: 11px; }
.grand-score strong { color: var(--red); font-family: 'Noto Serif KR', serif; font-size: 35px; line-height: 1; }
.grand-score em { font-style: normal; font-size: 11px; }
.round-list { list-style: none; padding: 0; margin: 0; }
.round-row {
  display: grid;
  grid-template-columns: 150px 1fr 170px;
  align-items: center;
  min-height: 52px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  transition: background .35s ease, color .35s ease;
}
.round-no { font-family: 'Noto Serif KR', serif; font-weight: 700; }
.round-no small { margin-left: 9px; color: var(--muted); font-family: 'Noto Sans KR', sans-serif; font-weight: 400; font-size: 10px; }
.round-coins { color: var(--muted); font-size: 12px; }
.round-coins .mark { display: inline-flex; align-items: center; margin-right: 14px; }
.round-coins b { color: var(--jade); }
.round-coins i { margin-left: 3px; color: var(--muted); font-style: normal; font-size: 10px; }
.round-total { display: flex; justify-self: end; align-items: center; gap: 13px; color: var(--muted); font-size: 11px; font-weight: 500; }
.round-row.complete { background: rgba(49,88,79,.055); }
.round-row.complete .score-value { color: var(--red); font-family: 'Noto Serif KR', serif; font-size: 17px; font-weight: 700; }
.line-result { display: inline-grid; grid-template-columns: 32px auto; align-items: center; column-gap: 7px; min-width: 91px; }
.line-symbol { color: var(--jade-dark); font-family: serif; font-size: 29px; font-weight: 700; line-height: .7; letter-spacing: -0.12em; }
.line-name { color: var(--jade); font-size: 10px; font-weight: 700; white-space: nowrap; }
.line-result.changing .line-symbol,
.line-result.changing .line-name { color: var(--red); }
.line-result.changing .line-name::before { content: ''; display: inline-block; width: 4px; height: 4px; margin: 0 5px 2px 0; border-radius: 50%; background: var(--red); }
.round-row.current { box-shadow: inset 3px 0 var(--red); }

.hexagram-reading { margin-top: 34px; padding: 27px 30px 30px; border: 1px solid rgba(49,88,79,.2); background: rgba(255,255,255,.34); }
.reading-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.reading-heading h3 { margin: 0; font-family: 'Noto Serif KR', serif; font-size: 21px; }
.reading-heading > p { margin: 0; color: var(--jade); font-family: 'Noto Serif KR', serif; font-size: 12px; }
.hexagram-pair { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: center; max-width: 660px; margin: 27px auto 0; }
.hexagram-card { min-width: 0; text-align: center; }
.hexagram-card header { display: flex; justify-content: center; align-items: baseline; gap: 9px; margin-bottom: 17px; }
.hexagram-card header span { color: var(--red); font-family: 'Noto Serif KR', serif; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.hexagram-card h4 { margin: 0; font-family: 'Noto Serif KR', serif; font-size: 18px; }
.hexagram-lines { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 132px; }
.gua-line { position: relative; display: flex; justify-content: space-between; width: 138px; height: 15px; padding: 3px 0; }
.gua-line .line-half { display: block; width: 100%; height: 9px; background: var(--jade-dark); }
.gua-line.yin .line-half { width: 43%; }
.gua-line.yang .second { display: none; }
.gua-line.changing .line-half { background: var(--red); }
.gua-line > b { position: absolute; right: -15px; top: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(168,62,47,.1); }
.gua-line.placeholder { justify-content: center; }
.gua-line.placeholder i { width: 100%; height: 1px; margin-top: 4px; background: rgba(49,88,79,.16); }
.trigram-summary { margin: 15px 0 0; color: var(--muted); font-family: 'Noto Serif KR', serif; font-size: 11px; }
.change-arrow { display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--red); }
.change-arrow span { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid rgba(168,62,47,.35); border-radius: 50%; font-family: 'Noto Serif KR', serif; font-size: 11px; }
.change-arrow i { font-style: normal; font-size: 18px; }
.hexagram-reading.pending .hexagram-card header,
.hexagram-reading.pending .change-arrow,
.hexagram-reading.pending .trigram-summary { opacity: .48; }

.reading-interpretations { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 28px; }
.interpretation-card { padding: 19px 20px 20px; border-top: 2px solid var(--jade); background: rgba(49,88,79,.055); }
.interpretation-card.changed-interpretation { border-top-color: var(--red); background: rgba(168,62,47,.045); }
.interpretation-label { margin: 0 0 13px; color: var(--jade); font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.changed-interpretation .interpretation-label { color: var(--red); }
.interpretation-title { display: flex; align-items: center; gap: 13px; }
.current-hexagram-symbol { flex: 0 0 auto; color: var(--jade-dark); font-family: serif; font-size: 45px; line-height: 1; }
.changed-interpretation .current-hexagram-symbol { color: var(--red); }
.interpretation-title small { display: block; margin-bottom: 3px; color: var(--muted); font-family: 'Noto Serif KR', serif; font-size: 9px; }
.interpretation-title h5 { margin: 0; font-family: 'Noto Serif KR', serif; font-size: 15px; line-height: 1.4; }
.interpretation-text { margin: 14px 0 0; color: #555950; font-family: 'Noto Serif KR', serif; font-size: 11px; line-height: 1.8; word-break: keep-all; }
.detail-link { display: inline-flex; gap: 7px; margin-top: 13px; color: var(--jade); font-size: 10px; font-weight: 700; text-decoration: none; }
.changed-interpretation .detail-link { color: var(--red); }
.detail-link.pending { color: var(--muted); }
.detail-link span { transition: transform .2s ease; }
.detail-link:hover span { transform: translateX(3px); }
.hexagram-reading.pending .reading-interpretations { opacity: .58; }

.hexagram-help { margin-top: 15px; border: 1px solid var(--line); background: rgba(248,245,236,.7); }
.hexagram-help summary { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; cursor: pointer; list-style: none; color: var(--ink); font-family: 'Noto Serif KR', serif; font-size: 12px; user-select: none; }
.hexagram-help summary::-webkit-details-marker { display: none; }
.hexagram-help summary b { margin-right: 8px; color: var(--red); font-family: 'Noto Sans KR', sans-serif; font-size: 9px; letter-spacing: .1em; }
.hexagram-help summary i { color: var(--jade); font-family: 'Noto Sans KR', sans-serif; font-size: 17px; font-style: normal; transition: transform .25s ease; }
.hexagram-help[open] summary { border-bottom: 1px solid var(--line); }
.hexagram-help[open] summary i { transform: rotate(45deg); }
.help-intro { margin: 0; padding: 18px 18px 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.hexagram-guide-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; list-style: none; margin: 15px 0 0; padding: 1px; background: var(--line); }
.hexagram-guide-list li { min-width: 0; background: var(--paper-light); }
.hexagram-guide-list li > a { display: flex; gap: 13px; min-width: 0; height: 100%; padding: 15px 16px; color: inherit; text-decoration: none; transition: background .2s ease; }
.hexagram-guide-list li > a:hover { background: rgba(49,88,79,.07); }
.guide-symbol { flex: 0 0 auto; width: 35px; color: var(--jade-dark); font-family: serif; font-size: 35px; line-height: 1; text-align: center; }
.guide-copy { min-width: 0; }
.guide-copy p { display: flex; align-items: baseline; gap: 7px; margin: 0; }
.guide-copy small { color: var(--red); font-size: 8px; font-weight: 700; }
.guide-copy strong { font-family: 'Noto Serif KR', serif; font-size: 12px; }
.guide-copy em { overflow: hidden; color: var(--muted); font-family: 'Noto Serif KR', serif; font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.guide-copy > b { display: block; margin-top: 4px; color: var(--jade); font-size: 9px; }
.guide-copy > span { display: block; margin-top: 6px; color: #64675f; font-family: 'Noto Serif KR', serif; font-size: 9px; line-height: 1.65; word-break: keep-all; }
.guide-copy .guide-open { display: block; margin-top: 8px; color: var(--red); font-family: 'Noto Sans KR', sans-serif; font-size: 8px; font-style: normal; font-weight: 700; }

/* 64괘 서재와 상세 페이지 */
.page-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 34px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.page-nav a { color: var(--jade); font-size: 11px; font-weight: 700; text-decoration: none; }
.page-nav span { color: var(--muted); font-family: 'Noto Serif KR', serif; font-size: 10px; letter-spacing: .14em; }
.library-page, .detail-page { width: min(1120px, calc(100% - 48px)); }
.library-hero { max-width: 760px; margin: 0 auto 35px; text-align: center; }
.library-hero h1 { margin: 9px 0 13px; font-family: 'Noto Serif KR', serif; font-size: clamp(37px, 6vw, 62px); letter-spacing: -.06em; }
.library-hero h1 small { display: block; margin-top: 7px; color: var(--red); font-size: 14px; letter-spacing: .18em; }
.library-hero > p:last-child { margin: 0 auto; max-width: 610px; color: var(--muted); font-family: 'Noto Serif KR', serif; font-size: 13px; line-height: 1.9; word-break: keep-all; }
.saved-reading-banner { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 0 0 22px; padding: 15px 18px; border-left: 3px solid var(--jade); background: rgba(49,88,79,.08); }
.saved-reading-banner.matches-current { border-left-color: var(--red); background: rgba(168,62,47,.07); }
.saved-reading-banner div { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.saved-reading-banner small { width: 100%; color: var(--muted); font-size: 9px; }
.saved-reading-banner strong { font-family: 'Noto Serif KR', serif; font-size: 12px; }
.saved-reading-banner span { color: var(--red); }
.saved-reading-banner a { flex: 0 0 auto; color: var(--jade); font-size: 10px; font-weight: 700; text-decoration: none; }
.library-controls { display: grid; grid-template-columns: auto minmax(180px, 420px) 1fr; align-items: center; gap: 12px; padding: 15px 17px; border: 1px solid var(--line); background: rgba(248,245,236,.7); }
.library-controls label { color: var(--jade); font-size: 10px; font-weight: 700; }
.library-controls input { width: 100%; padding: 10px 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 0; outline: none; background: rgba(255,255,255,.55); font: inherit; font-size: 11px; }
.library-controls input:focus { border-color: var(--jade); box-shadow: 0 0 0 2px rgba(49,88,79,.09); }
.library-controls p { justify-self: end; margin: 0; color: var(--muted); font-size: 10px; }
.library-controls strong { margin-right: 3px; color: var(--red); font-family: 'Noto Serif KR', serif; font-size: 18px; }
.library-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 18px 0 0; padding: 1px; list-style: none; background: var(--line); }
.library-grid li { min-width: 0; background: var(--paper-light); }
.library-card { position: relative; display: grid; grid-template-columns: 32px 58px 1fr 18px; align-items: start; gap: 12px; min-height: 178px; padding: 22px 20px; color: inherit; text-decoration: none; transition: background .2s ease, transform .2s ease; }
.library-card:hover { z-index: 1; background: #fffdf6; box-shadow: 0 8px 24px rgba(31,42,35,.1); transform: translateY(-2px); }
.library-number { padding-top: 7px; color: var(--red); font-size: 9px; font-weight: 700; }
.library-symbol { color: var(--jade-dark); font-family: serif; font-size: 53px; line-height: 1; text-align: center; }
.library-card h2 { margin: 2px 0 5px; font-family: 'Noto Serif KR', serif; font-size: 16px; }
.library-card h2 small { margin-left: 5px; color: var(--muted); font-size: 11px; font-weight: 500; }
.library-card strong { color: var(--jade); font-size: 10px; }
.library-card p { margin: 11px 0 0; color: #60635b; font-family: 'Noto Serif KR', serif; font-size: 10px; line-height: 1.75; word-break: keep-all; }
.library-card > i { align-self: center; color: var(--red); font-style: normal; }
.library-empty { grid-column: 1 / -1; padding: 55px 20px; color: var(--muted); text-align: center; font-family: 'Noto Serif KR', serif; font-size: 12px; }

.detail-page { max-width: 980px; }
.detail-hero { display: flex; justify-content: center; align-items: center; gap: 31px; margin: 12px 0 32px; padding: 28px 0 37px; border-bottom: 2px solid var(--ink); }
.detail-symbol { color: var(--jade-dark); font-family: serif; font-size: 100px; line-height: .8; }
.detail-hero h1 { margin: 5px 0 7px; font-family: 'Noto Serif KR', serif; font-size: clamp(33px, 6vw, 55px); letter-spacing: -.055em; }
.detail-hero h1 small { display: block; margin-top: 7px; color: var(--muted); font-size: 18px; letter-spacing: .08em; }
.detail-keyword { margin: 0; color: var(--red); font-family: 'Noto Serif KR', serif; font-size: 14px; font-weight: 700; }
.detail-overview { display: grid; grid-template-columns: minmax(240px, .8fr) 1.4fr; gap: 44px; align-items: center; padding: 36px 42px; color: #f7f3e8; background: var(--jade-dark); }
.detail-diagram-wrap { text-align: center; }
.detail-diagram { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.detail-diagram .gua-line { width: 166px; }
.detail-diagram .line-half { background: #ead7a5; }
.detail-diagram-wrap > p { margin: 18px 0 0; color: rgba(255,255,255,.7); font-family: 'Noto Serif KR', serif; font-size: 11px; }
.detail-lead .section-kicker { color: #e8bf69; }
.detail-lead h2 { margin: 7px 0 13px; font-family: 'Noto Serif KR', serif; font-size: 25px; }
.detail-lead > p:last-child { margin: 0; color: rgba(255,255,255,.78); font-family: 'Noto Serif KR', serif; font-size: 13px; line-height: 2; word-break: keep-all; }
.detail-sections { display: grid; gap: 18px; margin-top: 18px; }
.detail-section { padding: 29px 32px; border: 1px solid var(--line); background: rgba(248,245,236,.64); }
.detail-section h2, .source-card h2 { margin: 5px 0 20px; font-family: 'Noto Serif KR', serif; font-size: 21px; }
.detail-section > p:last-child { color: var(--muted); font-family: 'Noto Serif KR', serif; font-size: 11px; line-height: 1.85; }
.trigram-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 17px; }
.trigram-cards article { padding: 17px; border-top: 2px solid var(--jade); background: rgba(49,88,79,.06); }
.trigram-cards small { display: block; color: var(--muted); font-size: 9px; }
.trigram-cards strong { display: block; margin-top: 6px; color: var(--jade-dark); font-family: 'Noto Serif KR', serif; font-size: 22px; }
.trigram-cards p { margin: 7px 0 0; color: var(--muted); font-family: 'Noto Serif KR', serif; font-size: 10px; }
.line-position-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; padding: 1px; list-style: none; background: var(--line); }
.classic-text-overview { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 0 14px; padding: 1px; background: rgba(167,122,53,.22); }
.classic-text-overview p { margin: 0; padding: 15px 16px; background: rgba(167,122,53,.06); }
.classic-text-overview small { display: block; margin-bottom: 7px; color: var(--red); font-size: 8px; font-weight: 700; letter-spacing: .08em; }
.classic-text-overview span { color: #444940; font-family: 'Noto Serif KR', serif; font-size: 11px; line-height: 1.75; }
.line-position-list li { display: grid; grid-template-columns: 22px 1fr 80px; align-items: center; gap: 10px; min-height: 145px; padding: 16px 15px; background: var(--paper-light); }
.line-position-number { display: grid; place-items: center; width: 20px; height: 20px; color: #fff; border-radius: 50%; background: var(--red); font-size: 9px; }
.line-position-list strong { color: var(--jade-dark); font-family: 'Noto Serif KR', serif; font-size: 11px; }
.line-statement blockquote { margin: 8px 0 9px; color: var(--ink); font-family: 'Noto Serif KR', serif; font-size: 12px; font-weight: 600; line-height: 1.65; word-break: keep-all; }
.line-position-list .line-statement p { margin: 0; color: var(--muted); font-family: 'Noto Serif KR', serif; font-size: 10px; line-height: 1.65; word-break: keep-all; }
.line-statement p small { display: block; margin-bottom: 3px; color: var(--brass); font-size: 7px; font-weight: 700; letter-spacing: .08em; }
.line-position-list .gua-line { display: flex; justify-content: space-between; width: 70px; height: 12px; padding: 3px 0; border-radius: 0; background: transparent; }
.line-position-list .gua-line .line-half { height: 7px; }
.detail-note { margin-bottom: 0; }
.reflection-section ul { margin: 0; padding: 0; list-style: none; counter-reset: reflection; }
.reflection-section li { position: relative; margin-top: 1px; padding: 16px 16px 16px 48px; background: rgba(168,62,47,.045); color: #4f534c; font-family: 'Noto Serif KR', serif; font-size: 11px; line-height: 1.7; counter-increment: reflection; }
.reflection-section li::before { content: counter(reflection); position: absolute; left: 17px; top: 15px; color: var(--red); font-family: 'Noto Sans KR', sans-serif; font-size: 10px; font-weight: 700; }
.source-card { display: flex; justify-content: space-between; align-items: center; gap: 30px; padding: 28px 32px; border: 1px solid rgba(167,122,53,.35); background: rgba(167,122,53,.07); }
.source-card h2 { margin-bottom: 7px; }
.source-card p:last-child { margin: 0; color: var(--muted); font-family: 'Noto Serif KR', serif; font-size: 10px; line-height: 1.7; }
.source-card .license-note { margin-top: 8px; color: #73746b; font-size: 8px; }
.source-card .license-note a { display: inline; padding: 0; color: var(--jade); background: none; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.source-card a { flex: 0 0 auto; padding: 11px 14px; color: #fff; background: var(--jade); font-size: 10px; font-weight: 700; text-decoration: none; }
.hexagram-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.hexagram-pagination a { display: flex; flex-direction: column; gap: 5px; padding: 18px; color: inherit; border: 1px solid var(--line); text-decoration: none; }
.hexagram-pagination a:last-child { text-align: right; }
.hexagram-pagination small { color: var(--muted); font-size: 9px; }
.hexagram-pagination strong { color: var(--jade); font-family: 'Noto Serif KR', serif; font-size: 12px; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 17px 4px 0; color: #7e7e74; font-size: 9px; letter-spacing: .05em; }
footer p { margin: 0; }
footer span { letter-spacing: .13em; }
footer a { color: var(--jade); font-weight: 700; text-decoration: none; }

@media (max-width: 700px) {
  .shell { width: min(100% - 24px, 560px); padding-top: 34px; }
  .masthead { margin-bottom: 25px; }
  .oracle { padding: 17px 14px 24px; }
  .status-row { align-items: flex-start; }
  .gravity { flex-wrap: wrap; justify-content: flex-end; }
  .toss-stage { height: 255px; }
  .coin-slot { height: 154px; }
  .coin { width: 86px; height: 86px; }
  .coin-face { border-width: 4px; }
  .square-hole { width: 22px; height: 22px; border-width: 4px; }
  .inscription { font-size: 14px; }
  .inscription.top { top: 7px; } .inscription.bottom { bottom: 6px; }
  .inscription.left { left: 10px; } .inscription.right { right: 10px; }
  .back-mark { font-size: 38px; }
  .coin-result { top: 101px; font-size: 10px; min-width: 76px; }
  .ground-shadow { bottom: 43px; }
  .score-key { margin-top: -14px; }
  .controls { flex-direction: column; }
  .toss-button { width: 100%; min-width: 0; }
  .reset-button { min-height: 40px; }
  .ledger { padding: 22px 15px; }
  .round-row { grid-template-columns: 72px 1fr 116px; min-height: 62px; padding: 0 5px; }
  .round-coins .mark { display: block; margin: 2px 0; }
  .round-total { gap: 7px; }
  .line-result { grid-template-columns: 25px auto; column-gap: 4px; min-width: 76px; }
  .line-symbol { font-size: 24px; }
  .line-name { font-size: 9px; }
  .hexagram-reading { margin-top: 26px; padding: 22px 12px 24px; }
  .reading-heading { align-items: flex-start; }
  .reading-heading > p { max-width: 150px; text-align: right; font-size: 10px; line-height: 1.5; }
  .hexagram-pair { grid-template-columns: 1fr 32px 1fr; margin-top: 22px; }
  .gua-line { width: min(106px, 28vw); }
  .change-arrow span { width: 24px; height: 24px; }
  .change-arrow i { font-size: 14px; }
  .trigram-summary { font-size: 9px; white-space: nowrap; }
  .reading-interpretations { grid-template-columns: 1fr; gap: 8px; margin-top: 22px; }
  .interpretation-card { padding: 16px; }
  .current-hexagram-symbol { font-size: 39px; }
  .hexagram-guide-list { grid-template-columns: 1fr; }
  .hexagram-help summary { padding: 14px; }
  .help-intro { padding: 15px 14px 0; }
  .hexagram-guide-list li > a { padding: 14px; }
  .library-page, .detail-page { width: min(100% - 24px, 560px); }
  .page-nav { margin-bottom: 25px; }
  .library-controls { grid-template-columns: auto 1fr; }
  .library-controls p { grid-column: 1 / -1; justify-self: start; }
  .library-grid { grid-template-columns: 1fr; }
  .library-card { grid-template-columns: 25px 48px 1fr 14px; min-height: 0; padding: 18px 14px; }
  .library-symbol { font-size: 45px; }
  .saved-reading-banner { align-items: flex-start; flex-direction: column; }
  .detail-hero { justify-content: flex-start; gap: 19px; padding-top: 18px; }
  .detail-symbol { font-size: 75px; }
  .detail-overview { grid-template-columns: 1fr; gap: 28px; padding: 30px 20px; }
  .detail-section { padding: 23px 16px; }
  .trigram-cards, .classic-text-overview, .line-position-list { grid-template-columns: 1fr; }
  .line-position-list li { grid-template-columns: 22px 1fr 65px; }
  .line-position-list .gua-line { width: 58px; }
  .source-card { align-items: flex-start; flex-direction: column; padding: 23px 19px; }
  .source-card a { width: 100%; text-align: center; }
  footer { flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
