/* 로판 운명 상대 — 웹소설 표지 느낌
   Layout: 연분홍·연보라 하늘에 꽃잎이 흩날리고, 금빛 이중 테두리 책 한 장 안에 표지(초상)와 이야기.
   한 가지 모습으로 고정 (호스트 테마와 무관) */
:root {
  color-scheme: light;
  --blush: #F6E3EC;    /* 배경 위 */
  --lilac: #E3DAF4;    /* 배경 아래 */
  --paper: #FFFDFB;    /* 책 종이 */
  --rose: #C2457A;     /* 장미 포인트 */
  --rose-deep: #8E2A57;
  --gold: #C9A45C;     /* 금장식 */
  --ink: #3A2235;      /* 글자 */
  --ink-soft: #7A5C72;
  --f-title: "Nanum Myeongjo", "Gowun Batang", serif;
  --f-body: "Gowun Batang", "Nanum Myeongjo", serif;
  --f-latin: "Cormorant Garamond", "Times New Roman", serif;
}
html, body { min-height: 100%; }
body {
  margin: 0; color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.7;
  background: linear-gradient(170deg, var(--blush), var(--lilac)) fixed; background-color: var(--blush);
  padding-inline: 16px; padding-block: 20px 40px; word-break: keep-all; overflow-wrap: anywhere; overflow-x: clip;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }

.petals { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.petals i { position: absolute; top: -20px; width: 14px; height: 10px; border-radius: 10px 0 10px 0; background: #F4B6CB; opacity: .75; animation: petal linear infinite; }
.petals i:nth-child(3n) { background: #D9C6F2; }
@keyframes petal { to { top: 105vh; margin-left: 60px; rotate: 540deg; } }

/* 책 */
.book { position: relative; z-index: 1; max-width: 460px; margin: 0 auto; background: var(--paper); border-radius: 6px;
  padding: 26px 22px 30px; box-shadow: 0 0 0 1px var(--gold), 0 0 0 6px var(--paper), 0 0 0 7px var(--gold), 0 24px 50px rgba(74, 35, 64, .18); }
.screen { display: flex; flex-direction: column; gap: 16px; }
.tohub { align-self: flex-start; font-size: 14px; color: var(--ink-soft); text-decoration: none; }
.tohub:hover { color: var(--rose); }
.eyebrow { margin: 0; text-align: center; font-family: var(--f-latin); font-style: italic; font-weight: 600; font-size: 20px; color: var(--gold); letter-spacing: .04em; }
.eyebrow::before, .eyebrow::after { content: "❦"; font-style: normal; font-size: 13px; margin: 0 10px; vertical-align: 3px; }
.title { margin: 0; text-align: center; font-family: var(--f-title); font-weight: 800; font-size: clamp(34px, 10vw, 44px); line-height: 1.22; color: var(--rose-deep); letter-spacing: -.02em; text-wrap: balance; }
.hook { margin: 0; text-align: center; color: var(--ink-soft); font-size: 15px; text-wrap: balance; }

.fan { position: relative; height: 190px; margin-top: 4px; }
.fan img { position: absolute; top: 10px; width: 116px; aspect-ratio: 3 / 4; object-fit: cover; height: auto; max-width: 100%; border-radius: 10px; box-shadow: 0 8px 18px rgba(74, 35, 64, .22); left: 50%; }
.fan img:nth-child(1) { transform: translateX(-140%) rotate(-12deg); }
.fan img:nth-child(2) { transform: translateX(-80%) rotate(-4deg); z-index: 1; }
.fan img:nth-child(3) { transform: translateX(-20%) rotate(4deg); z-index: 2; }
.fan img:nth-child(4) { transform: translateX(40%) rotate(12deg); }

.pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick legend { width: 100%; text-align: center; font-family: var(--f-title); font-weight: 700; font-size: 19px; margin-bottom: 10px; }
.gbtn { appearance: none; cursor: pointer; background: #fff; border: 1.5px solid #E8D6E2; border-radius: 14px; padding: 8px 8px 12px; display: grid; gap: 8px; justify-items: center; transition: border-color .15s, transform .15s, box-shadow .15s; }
.gbtn img { width: 100%; height: auto; max-width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; }
.gbtn span { font-family: var(--f-title); font-weight: 700; font-size: 17px; }
.gbtn[aria-pressed="true"] { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(194, 69, 122, .2); transform: translateY(-2px); }
.gbtn[aria-pressed="true"] span { color: var(--rose); }
.gbtn[aria-pressed="true"] span::before { content: "♥ "; }
.pickhint { margin: -4px 0 0; text-align: center; font-size: 14px; color: var(--ink-soft); }
.pickhint.nudge { color: var(--rose); animation: nudge .4s; }
@keyframes nudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.actions { display: grid; gap: 10px; }
.actions.locked .btn { opacity: .45; }
.btn { appearance: none; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none;
  min-height: 54px; padding: 12px 18px; border-radius: 999px; font-family: var(--f-title); font-weight: 700; font-size: 18px;
  background: linear-gradient(180deg, #D4598E, var(--rose)); color: #fff; box-shadow: 0 6px 16px rgba(194, 69, 122, .3); }
.btn:active { transform: translateY(2px); }
.btn.ghost { background: transparent; color: var(--rose-deep); border: 1.5px solid var(--gold); box-shadow: none; }
.btn input { display: none; }
.note { margin: 0; text-align: center; font-size: 13px; color: var(--ink-soft); }
.privacy { margin: 0; font-size: 13.5px; color: var(--ink-soft); border-top: 1px solid #EEDFE8; padding-top: 12px; }
.privacy b { color: var(--ink); }

.scan { align-items: center; }
.scan canvas { width: 100%; max-width: 340px; aspect-ratio: 3 / 4; border-radius: 10px; border: 1px solid var(--gold); background: var(--blush); }
.bar { width: 100%; max-width: 340px; height: 3px; background: #EEDFE8; }
.bar i { display: block; height: 100%; width: 0; background: var(--rose); transition: width .4s; }
.msg { margin: 0; font-family: var(--f-title); font-weight: 700; font-size: 18px; text-align: center; }
.oops { text-align: center; }
.oops h2 { margin: 0; font-family: var(--f-title); font-size: 24px; }
.oops p { margin: 0; color: var(--ink-soft); }

/* 결과 */
.ribbon { align-self: center; margin: 0; padding: 4px 16px; border-radius: 99px; background: var(--rose); color: #fff; font-size: 14px; }
.cover { margin: 0 auto; width: min(100%, 300px); position: relative; }
.cover img { width: 100%; height: auto; display: block; border-radius: 10px; box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--gold), 0 18px 30px rgba(74, 35, 64, .25); }
.cover figcaption { margin-top: 18px; text-align: center; font-family: var(--f-title); font-weight: 800; font-size: 21px; color: var(--rose-deep); line-height: 1.4; text-wrap: balance; }
.who { margin: 0; text-align: center; display: grid; gap: 2px; }
.who span { font-size: 14px; color: var(--ink-soft); }
.who b { font-family: var(--f-title); font-weight: 800; font-size: 28px; }
.destiny { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.destiny .track { height: 8px; border-radius: 99px; background: #EEDFE8; overflow: hidden; }
.destiny i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--rose)); transition: width 1.2s ease; }
.destiny b { font-family: var(--f-title); font-size: 20px; color: var(--rose); font-variant-numeric: tabular-nums; }
.charm { margin: 0; text-align: center; font-size: 15px; }
.traits { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.traits li { border: 1px solid var(--gold); border-radius: 99px; padding: 3px 12px; font-size: 14px; }
.line { margin: 0; text-align: center; font-family: var(--f-title); font-weight: 700; font-size: 19px; color: var(--rose-deep); line-height: 1.5; }
.line::before { content: "“"; } .line::after { content: "”"; }
.sec { margin: 6px 0 0; text-align: center; font-family: var(--f-title); font-weight: 800; font-size: 20px; }
.sec small { display: block; font-family: var(--f-latin); font-style: italic; font-weight: 600; font-size: 15px; color: var(--gold); }
.story { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.story li { display: grid; grid-template-columns: 54px 1fr; gap: 10px; align-items: start; }
.story b { font-family: var(--f-title); font-size: 13px; color: var(--rose); border: 1px solid #EEDFE8; border-radius: 8px; padding: 4px 0; text-align: center; }
.story p { margin: 0; font-size: 15.5px; }
.fate { margin: 4px 0 0; text-align: center; font-family: var(--f-title); font-weight: 700; font-size: 16px; color: var(--rose-deep); }
.sharebox { width: 100%; border: 1px solid var(--gold); border-radius: 10px; padding: 10px; font: inherit; font-size: 14px; resize: none; background: #fff; color: var(--ink); }
.ad { border: 1px dashed #DCC9D6; border-radius: 10px; min-height: 90px; display: grid; place-items: center; font-size: 12px; letter-spacing: .1em; color: #A891A3; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 18px; font-size: 14px; z-index: 5; max-width: calc(100% - 32px); text-align: center; }
.foot { position: relative; z-index: 1; margin: 18px auto 0; max-width: 460px; text-align: center; font-size: 12px; color: var(--ink-soft); line-height: 1.7; }
.foot a { color: inherit; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
