/* 종이 결 디자인 (2026-10-07 대표가 고른 시안 D): 장부 위에 얹은 한지 쪽지 + 한지에 먹으로 그린 동그라미 글자 + 붉은 도장.
   html.paper 아래에만 건다(index.html의 <html class="paper">). 같은 결로 다른 부분도 이 파일에 이어 적는다. */

html.paper .el-card {
  --tilt: -.4deg;          /* 종이 기울기 */
  --line: #2a211d;         /* 붓 줄 색 */
  --line-h: 8px;           /* 붓 줄 굵기 */
  --pt: 30px;              /* 위 여백 */
  --px: 19px;              /* 옆 여백(본문 폭을 원래 카드와 같게) */
  --art: 98px;             /* 먹물이 크기 */
  --edge: 8px;             /* 찢긴 가장자리 두께. 그림(900px 폭)을 쪽지 폭으로 줄이는 비율과 맞춰야 솜뭉치처럼 부풀지 않는다 */
  position: relative; isolation: isolate;
  margin: 12px 0 50px; padding: var(--pt) var(--px) 46px;
  background: none; border: 0; border-radius: 0; box-shadow: none;
}
html.paper .el-card + .el-card { --tilt: .45deg; --flip: -1; }
html.paper .el-card + .el-card + .el-card { --tilt: -.3deg; --flip: 1; }

/* 종이(한지 쪽지)
   가장자리 = 한지 그림의 찢긴 테두리 18px를 --edge 두께로 줄여 아홉 조각으로 붙인다 → 모서리와 끊김 없이 이어진다
   가운데   = 같은 그림을 비율 그대로 덮어 깐다 → 결이 늘어나거나 이음매가 생기지 않는다. 글 밑 닥나무 결은 크림빛으로 한 겹 눌러 둔다 */
html.paper .el-card::before {
  content: ''; position: absolute; inset: -4px -4px -4px -5px; z-index: -1; pointer-events: none;
  border: var(--edge) solid transparent;
  border-image: url(/media/deco/hanji.webp) 18 / var(--edge) / 0 stretch;
  background: radial-gradient(closest-side, rgba(255, 251, 241, .4) 50%, rgba(255, 251, 241, 0)),
              url(/media/deco/hanji.webp) center / cover no-repeat border-box;
  background-clip: padding-box; background-color: #e6dcc8; /* 그림이 안 떠도 종이색은 남는다 */
  filter: brightness(1.075) drop-shadow(0 1.5px 1.5px rgba(70, 45, 20, .22)) drop-shadow(0 6px 9px rgba(70, 45, 20, .09));
  rotate: var(--tilt); scale: var(--flip, 1) 1; /* 이웃 쪽지는 뒤집어 깔아 찢긴 가장자리가 겹쳐 보이지 않게 */
}

/* 머리: 구실 이름(작게) → 글자 칸 + 기운 이름 → 붓 줄 */
html.paper .el-card .sf-need {
  display: grid; grid-template-columns: auto minmax(0, 1fr) calc(var(--art) - 6px); align-items: center;
  column-gap: 14px; row-gap: 0; margin: 0 0 22px;
}
html.paper .el-card .ec-tag {
  grid-area: 1 / 1 / 2 / -1; justify-self: start; position: relative; z-index: 2; margin: 0 0 9px; padding: 0; border-radius: 0; background: none;
  font: 700 14.5px/20px var(--disp); letter-spacing: .05em; color: #8a5a2b;
}
html.paper .el-card .sf-need > span[class^="el-"] {
  grid-area: 2 / 1; width: 46px; height: 50px; border-radius: 2px; rotate: -3deg; /* 그림자 없는 납작한 먹 테 칸 */
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--el-ink) 32%, transparent);
}
html.paper .el-card .sf-need > b { grid-area: 2 / 2; min-width: 0; white-space: nowrap; font: 800 23px/1.25 var(--serif); color: #2a211d; } /* '불(火)'이 '불 / (火)'로 갈리지 않게 */
html.paper .el-card .sf-need::after {
  content: ''; grid-area: 3 / 1 / 4 / -1; height: var(--line-h); margin-top: 14px; background: var(--line); opacity: .85;
  -webkit-mask: url(/media/deco/stroke.webp) left center / 100% 100% no-repeat; mask: url(/media/deco/stroke.webp) left center / 100% 100% no-repeat;
}

/* 먹물이: 붓 줄 오른쪽 끝에 올라서 있다 */
html.paper .el-card .ec-art {
  --k: 1; --nudge: 0px;
  --base: calc(var(--pt) + 29px + var(--g) + 14px + var(--line-h) * .5 + 3px); /* 붓 줄 높이 = 먹물이 발끝 */
  --h: calc(var(--art) * var(--k));
  display: block; position: absolute; z-index: 1; pointer-events: none;
  right: calc(var(--px) - 8px - var(--nudge)); top: calc(var(--base) - var(--h));
  width: calc(var(--art) * var(--k)); height: var(--h); object-fit: cover; object-position: 50% 100%;
}
/* 木 그림은 나무가 키를 차지해 먹물이가 작다 → 그림을 1.5배로 키워 먹물이 크기를 다른 넷과 맞춘다.
   오른쪽 빈 여백만큼 밀어 두고, 쪽지 위로 넘치는 나무 꼭대기는 잘라 위쪽을 흐리게 풀어 둔다 */
html.paper .el-card.el-木 .ec-art {
  --k: 1.5; --nudge: calc(var(--art) * .16); --h: min(var(--art) * 1.5, var(--base) - 4px);
  -webkit-mask: linear-gradient(transparent, #000 24%); mask: linear-gradient(transparent, #000 24%);
}

/* 도장: 쪽지와 장부에 걸쳐 찍은 간인 */
html.paper .el-card .ec-seal {
  display: grid; place-items: center; position: absolute; z-index: 2; right: 22px; bottom: -22px;
  width: 40px; height: 62px; padding: 2px 0 0;
  background: url(/media/deco/seal.webp) center / 100% 100% no-repeat,
              linear-gradient(#c8372d, #c8372d) center / 80% 84% no-repeat; /* 도장 그림이 안 떠도 흰 글자가 붉은 바탕 위에 남는다 */
  writing-mode: vertical-rl; text-orientation: upright;
  font: 800 21px/1 var(--serif); letter-spacing: 2px; color: #fff6ea; rotate: 3deg;
}
html.paper .el-card + .el-card .ec-seal { rotate: -2.5deg; }
html.paper .el-card.ec-hui .ec-seal { width: 36px; height: 56px; font-size: 19px; }

html.paper .el-card p { margin: 0; color: #2a211d; }

/* 붓 줄은 그 기운의 색으로 긋는다(나무는 푸르게, 불은 붉게, 흙은 누렇게, 금은 은빛, 물은 검푸르게). 구실은 굵기로 가른다: 용신이 가장 굵다 */
html.paper .el-card.el-木 { --line: #3f8a5f; }
html.paper .el-card.el-火 { --line: #c8372d; }
html.paper .el-card.el-土 { --line: #b08a1c; }
html.paper .el-card.el-金 { --line: #8f8a80; }
html.paper .el-card.el-水 { --line: #333a4d; }

/* 구실별 */
html.paper .el-card.ec-yong { --line-h: 11px; --art: 108px; }
html.paper .el-card.ec-yong .ec-tag { color: #a3392f; }
html.paper .el-card.ec-yong .ec-seal { width: 44px; height: 68px; font-size: 23px; }
html.paper .el-card.ec-empty { --line-h: 6px; }
html.paper .el-card.ec-empty::before { opacity: .58; }
html.paper .el-card.ec-empty .sf-need::after { opacity: .3; }
html.paper .el-card.ec-empty .sf-need > span[class^="el-"] { background: none; color: var(--el-ink); box-shadow: none; outline: 1.5px dashed var(--el-ink); outline-offset: -1.5px; }
html.paper .el-card.ec-empty .ec-art { filter: grayscale(1); opacity: .26; }
html.paper .el-card.ec-empty .ec-seal {
  width: 44px; height: 44px; padding: 0; background: none; color: #c8372d; box-shadow: inset 0 0 0 2px #c8372d; border-radius: 4px; opacity: .78;
  font-size: 25px; letter-spacing: 0;
  -webkit-mask: url(/media/deco/seal.webp) center / 100% 100% no-repeat; mask: url(/media/deco/seal.webp) center / 100% 100% no-repeat;
}

/* 휴대폰: 제목('재성 3개')이 먹물이 밑으로 들어가지 않게 폭에 맞춰 먹물이·동그라미·틈을 줄인다(제목은 한 줄 그대로).
   木 그림은 나무가 옆으로도 넓어 제목 칸을 넘어오므로 1.25배까지만 키운다 */
@media (max-width: 429px) {
  html.paper .el-card { --art: 88px; }
  html.paper .el-card.ec-yong { --art: 98px; }
  html.paper .el-card .sf-need { column-gap: 10px; }
  html.paper .el-card.el-木 .ec-art { --k: 1.25; --h: min(var(--art) * 1.25, var(--base) - 4px); }
}
@media (max-width: 379px) {
  html.paper .el-card { --art: 76px; }
  html.paper .el-card.ec-yong { --art: 84px; }
  html.paper .el-card .sf-need > b { font-size: 21px; }
}
@media (max-width: 339px) {
  html.paper .el-card { --art: 62px; }
  html.paper .el-card.ec-yong { --art: 70px; }
  html.paper .el-card .sf-need { column-gap: 8px; }
  html.paper .el-card .sf-need > b { font-size: 19px; }
}

@media (min-width: 760px) {
  html.paper .el-card { --pt: 38px; --px: 46px; --art: 128px; --line-h: 10px; --edge: 14px; margin-bottom: 58px; padding-bottom: 44px; }
  html.paper .el-card.ec-yong { --line-h: 14px; }
  html.paper .el-card.ec-empty { --line-h: 7px; }
  html.paper .el-card.ec-yong { --art: 140px; }
  html.paper .el-card.ec-hui .ec-seal { width: 40px; height: 62px; font-size: 21px; }
  html.paper .el-card .ec-tag { font-size: 15.5px; }
  html.paper .el-card .sf-need > b { font-size: 25px; }
  html.paper .el-card .sf-need { margin-bottom: 26px; }
  html.paper .el-card .ec-seal { right: 40px; width: 46px; height: 70px; font-size: 24px; }
  html.paper .el-card.ec-yong .ec-seal { width: 50px; height: 76px; font-size: 26px; }
  html.paper .el-card.ec-empty .ec-seal { width: 50px; height: 50px; font-size: 28px; }
}

/* ── A에서 가져온 것: 먹 동그라미 안의 오행 글자 ── */
html.paper .el-card { --g: 66px; --wash: color-mix(in srgb, var(--el) 86%, transparent); }
html.paper .el-card.ec-yong { --g: 74px; }
html.paper .el-card.el-水 { --wash: #5b6478; }
html.paper .el-card.el-金 { --wash: #fff; }
html.paper .el-card .sf-need > span[class^="el-"] {
  grid-area: 2 / 1; position: relative; isolation: isolate; align-self: center;
  width: var(--g); height: var(--g); border-radius: 0; rotate: 0deg; box-shadow: none; outline: 0; animation: none;
  background: radial-gradient(circle calc(var(--g) * .415) at 51.7% 48.4%, var(--wash) 0 95%, transparent 100%);
  color: var(--el-fg);
}
html.paper .el-card .sf-need > span[class^="el-"]::before { content: ''; position: absolute; inset: 0; background: url(/media/deco/enso.webp) center / contain no-repeat; }
html.paper .el-card .sf-need .hz { position: relative; font: 900 calc(var(--g) * .43)/1 var(--serif); transform: translate(calc(var(--g) * .017), calc(var(--g) * -.024)); }
/* 빈 기운: 물감 없이 옅은 동그라미와 속 빈 글자 */
html.paper .el-card.ec-empty .sf-need > span[class^="el-"] { background: none; color: transparent; outline: 0; }
html.paper .el-card.ec-empty .sf-need > span[class^="el-"]::before { opacity: .32; }
html.paper .el-card.ec-empty .sf-need .hz { -webkit-text-stroke: 1.1px #54473f; }
@media (max-width: 379px) { html.paper .el-card { --g: 58px; } html.paper .el-card.ec-yong { --g: 64px; } }
@media (max-width: 339px) { html.paper .el-card { --g: 50px; } html.paper .el-card.ec-yong { --g: 56px; } }
@media (min-width: 760px) { html.paper .el-card { --g: 80px; } html.paper .el-card.ec-yong { --g: 90px; } }
