/* 한 권씩 머물러 읽는 반딧불이의 서재. 게임 장면 스타일과 분리합니다. */
#home { gap: 16px; }
#home .brand { padding: 5px 0 0; }
#home .brand-row { align-items: center; gap: 8px; }
#home .brand h1 { font-size: clamp(1.15rem, 5.2vw, 1.55rem); line-height: 1.35; }
#home .brand-actions { gap: 4px; }
#home .brand-actions > button { min-width: 38px; min-height: 44px; padding-inline: 7px; font-size: .7rem; }
#home .brand .room-name { font-size: .59rem; letter-spacing: .19em; }
#home .brand p { font-size: .75rem; }
#home .brand-meta { font-size: .63rem; min-height: 20px; }
.story-library { position: relative; outline: none; overflow: hidden; overflow: clip; }
.story-library:focus-visible { outline: 1px solid #c9a35a88; outline-offset: 5px; border-radius: 4px; }
.library-caption { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 3px 16px; color: #baa786; }
.library-caption > span:first-child { font-family: var(--display); font-size: .88rem; letter-spacing: .06em; }
.library-caption > span:last-child { font-size: .61rem; opacity: .7; }
.book-desk { position: relative; margin: 0 12px 0 3px; perspective: 1600px; }
.book-desk::before { content: ""; position: absolute; inset: 12% -8% -10%; background: radial-gradient(ellipse at 50% 85%, #bb985421, transparent 65%); pointer-events: none; }
.book-desk::after { content: ""; position: absolute; left: 4%; right: -6%; bottom: -19px; height: 32px; border-radius: 50%; background: #0009; filter: blur(12px); z-index: -1; }
.book-stack { position: absolute; inset: 5px -7px -5px 10px; border: 1px solid #716046; border-radius: 4px 13px 13px 4px; background: repeating-linear-gradient(0deg, #bfb195 0px, #bfb195 1px, #dacdb2 1px, #dacdb2 3px); box-shadow: 5px 4px 0 #3b3226, 7px 7px 0 #665640, 7px 9px 12px #0006; transform: rotate(1deg); }
.story-library .concepts { position: relative; display: block; touch-action: pan-y pinch-zoom; }
.story-library .story-book { position: relative; height: clamp(340px, calc(100svh - 317px), 550px); min-height: 0; padding: 0; margin: 0; border: 1px solid #8d7755; border-radius: 5px 11px 11px 5px; overflow: hidden; isolation: isolate; background: var(--book-cover); box-shadow: -5px 0 0 #120f0bd9, 0 19px 34px #0008, inset 2px 0 #ffffff20; }
.story-book::before { content: ""; position: absolute; z-index: 2; left: 0; top: 0; bottom: 0; width: 17px; pointer-events: none; background: linear-gradient(90deg, #0007, #ffffff0c 40%, #0004 65%, transparent); border-right: 1px solid #0006; }
.book-front { position: relative; height: 100%; padding: 21px 23px 15px 34px; display: flex; flex-direction: column; align-items: center; background-image: repeating-linear-gradient(30deg, #fff1 0, #fff1 .3px, transparent .3px, transparent 4px), radial-gradient(ellipse at 50% 20%, #d8c38b0c, #0003); }
.book-front::before { content: ""; position: absolute; inset: 11px 11px 11px 23px; border: 1px solid #cbb1704a; border-radius: 2px 5px 5px 2px; pointer-events: none; }
.book-edition { align-self: stretch; display: flex; justify-content: space-between; gap: 8px; color: #e2ce9b; font: .49rem/1.5 var(--body); letter-spacing: .16em; opacity: .8; margin-bottom: 14px; white-space: nowrap; }
.book-art { position: relative; width: 82%; min-height: 120px; flex: 1 1 180px; max-height: 230px; border-radius: 48% 48% 3px 3px / 30% 30% 3px 3px; border: 1px solid #cdb47a; outline: 1px solid #cdb47a55; outline-offset: 5px; margin: 3px 0 18px; overflow: hidden; background: #161b19; box-shadow: 0 6px 20px #0005, inset 0 0 12px #0008; }
.book-art > img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; object-position: 50% 39%; }
.book-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #080d0812, transparent 60%, #080d0870); pointer-events: none; box-shadow: inset 0 0 23px #0006; }
.cover-spark { position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%); color: #ffe4a1; text-shadow: 0 0 13px #e3c47b; z-index: 1; font-size: 1.15rem; }
.book-cover-copy { width: 100%; text-align: center; }
.book-kicker { font-size: .59rem; color: #d5c498; letter-spacing: .13em; }
.story-library .book-cover-copy h2 { font-family: var(--display); font-size: clamp(1.3rem, 6.1vw, 1.95rem); font-weight: 800; line-height: 1.5; letter-spacing: -.035em; margin: 6px 0 7px; color: #f0dfb5; text-wrap: balance; text-shadow: 0 1px #000a, 0 -1px #fff2; }
.story-library .book-cover-copy p { color: #c4bea9; font-size: .73rem; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.cover-actions { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 17px; }
.book-open { display: flex; justify-content: center; align-items: center; gap: 15px; width: 100%; min-height: 46px; font: .85rem var(--body); color: #352a18; background: linear-gradient(110deg, #e3cea0, #f4e5bf 50%, #d9c18e); border: 1px solid #f0dba7; border-radius: 3px; box-shadow: inset 0 1px #fff7, 0 4px 13px #0003; cursor: pointer; }
.book-open svg { width: 19px; height: 19px; }
.book-open:hover { filter: brightness(1.08); }
.book-resume { background: transparent; border: 0; color: #dec790; font: .65rem var(--body); min-height: 32px; padding: 3px 8px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.cover-footnote { color: #c7b58c; opacity: .65; font-size: .57rem; letter-spacing: .06em; padding-top: 2px; }
.cover-rule { display: flex; align-items: center; gap: 8px; width: 68px; color: #bda36c; margin-top: 11px; font-size: .6rem; }
.cover-rule i { height: 1px; flex: 1; background: #bda36c77; }
.veiled-art > img, .veiled-art > .unwritten-art { filter: blur(12px) saturate(.4); transform: scale(1.17); opacity: .55; }
.veiled-art::after { background: radial-gradient(ellipse at 25% 20%, #d3d3c343, transparent 65%), linear-gradient(140deg, #c0ccbd40, #161f2988); backdrop-filter: blur(2px); }
.wax-seal { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-7deg); height: 57px; width: 57px; display: grid; place-items: center; color: #dfc090; background: radial-gradient(circle at 35% 30%, #75584a, #362a29 80%); border: 1px solid #9d7862; outline: 4px solid #392b27b0; border-radius: 48% 45% 49% 43%; z-index: 1; box-shadow: inset 0 0 0 4px #30252566, 0 5px 14px #0005; }
.wax-seal svg { width: 25px; height: 25px; opacity: .9; }
.sealed-book .book-kicker { color: #c0b5aa; }
.redacted-copy { width: 88%; margin: 12px auto 0; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 31px; opacity: .3; filter: blur(3px); user-select: none; }
.redacted-copy i { display: block; background: repeating-linear-gradient(90deg, #d9d1c4 0, #d9d1c4 6px, transparent 6px, transparent 9px); width: 100%; height: 5px; }
.redacted-copy i:last-child { width: 72%; }
.sealed-date { display: flex; align-items: center; gap: 7px; font-size: .7rem; color: #cec0a7; border-top: 1px solid #cbb17033; width: 100%; justify-content: center; padding: 12px 0 5px; }
.sealed-date svg { width: 15px; height: 15px; flex: none; }
.unwritten-art { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 65% 20%, #a5995c, transparent 45%), linear-gradient(140deg, #253c40, #3d2a35); }
.unwritten-art span { font: 160px var(--display); color: #c9b28f66; }
.book-pages { height: 100%; padding-left: 16px; display: flex; flex-direction: column; background: radial-gradient(ellipse at top right, #fff7e3, transparent 65%), repeating-linear-gradient(90deg, #b49a6610 0, #b49a6610 .5px, transparent .5px, transparent 6px), #e9ddc1; color: #3e3225; box-shadow: inset 9px 0 18px -12px #4e321e; }
.chapter-header { position: relative; min-height: 49px; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 19px; border-bottom: 1px solid #66513633; }
.close-book { border: 0; background: none; color: #6c5941; font: .71rem var(--body); min-height: 44px; padding: 0 8px 0 0; cursor: pointer; }
.chapter-header > span:not(.ribbon) { font-size: .55rem; letter-spacing: .13em; margin-right: 29px; opacity: .65; }
.ribbon { position: absolute; top: 0; right: 0; width: 20px; height: 41px; padding-top: 15px; background: #745142; color: #eed9ad; text-align: center; font-size: .58rem; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 85%, 0 100%); }
.chapter-scroll { flex: 1; min-height: 0; padding: 13px 19px 12px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #b8a581 transparent; }
.chapter-kicker { color: #896e48; font-size: .53rem; letter-spacing: .13em; }
.chapter-scroll h3 { font: 800 1.4rem/1.6 var(--display); margin: 4px 0 7px; color: #34291e; text-wrap: balance; }
.story-library .chapter-blurb { font: .73rem/1.7 var(--body); color: #7a6a53; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chapter-progress { display: flex; position: relative; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0; padding-bottom: 10px; color: #7b6441; font-size: .62rem; }
.chapter-progress i { position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: #65503520; }
.chapter-progress i::after { content: ""; display: block; width: var(--progress); height: 100%; background: #88713f; transition: width .25s; }
.story-library .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.story-library .stage { min-height: 78px; padding: 9px; border: 1px solid #92764a45; border-radius: 3px; background: #fff7e83d; color: #42301d; position: relative; overflow: hidden; }
.story-library .stage .no { font-size: .46rem; letter-spacing: .1em; color: #907142; }
.story-library .stage .nm { font-size: .82rem; line-height: 1.5; margin: 4px 0; font-weight: 700; }
.story-library .stage .st { font-size: .61rem; color: #8c7859; }
.story-library .stage.clear { background: #aa975d1c; border-color: #a18b5380; }
.story-library .stage.clear .st, .story-library .stage .stars { color: #84692b; }
.story-library .stage.boss { border-color: #a7796855; }
.story-library .stage.boss .no { color: #965e4b; }
.story-library .stage:disabled { opacity: .68; }
.story-library .stage .secret-name { filter: blur(3px); opacity: .55; user-select: none; }
.story-library .stage.early { background: #baa2651f; border-color: #a68b4f; }
.story-library .stage.early em { font-size: .58rem; color: #7f5d25; display: block; margin-top: 4px; font-style: normal; }
.chapter-footer { min-height: 37px; padding: 9px 19px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .5rem; letter-spacing: .08em; color: #8d785b; border-top: 1px solid #8b72482b; }
.story-library .concept-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.story-library .concept-actions .pill { color: #7e633a; border-color: #94774977; border-radius: 4px; font-size: .7rem; }
.book-navigation { display: flex; justify-content: center; align-items: center; gap: 28px; padding-top: 24px; }
.book-turn { display: grid; place-items: center; width: 46px; min-height: 46px; border: 1px solid #a48b5b66; border-radius: 50%; color: #ceb682; background: #30281f66; cursor: pointer; transition: background .15s; }
.book-turn svg { width: 23px; height: 23px; }
.book-turn:hover:not(:disabled) { background: #59472c66; }
.book-turn:disabled { opacity: .2; cursor: default; }
.book-picker { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 105px; min-height: 44px; cursor: pointer; }
.picker-label { font-size: .55rem; letter-spacing: .14em; color: #a99677; }
.book-picker b { color: #e0cba2; font-size: .94rem; font-weight: 400; letter-spacing: .15em; font-variant-numeric: tabular-nums; }
.book-picker select { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.picker-arrow { position: absolute; right: -4px; top: 14px; color: #bca274; }
.book-picker:focus-within { outline: 2px solid var(--brass); outline-offset: 5px; border-radius: 3px; }
.book-dots { display: flex; justify-content: center; gap: 6px; margin-top: 13px; }
.book-dots i { width: 4px; height: 4px; border-radius: 50%; background: #8b785344; }
.book-dots i.active { width: 17px; border-radius: 3px; background: #bda169; }
.library-instructions { text-align: center; font-size: .59rem; line-height: 1.8; color: #97866b; margin: 12px 0 0; text-wrap: balance; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.turn-leaf { position: absolute; inset: 0; z-index: 4; pointer-events: none; transform-origin: left center; border-radius: 5px 11px 11px 5px; background: linear-gradient(90deg, #806b48 0%, #d7c6a0 4%, #eee3c9 12%, #f4ecd8 80%, #ad9a75 100%); box-shadow: 12px 0 30px #0005; backface-visibility: hidden; }
.turn-leaf::after { content: ""; position: absolute; inset: 6% 8%; border: 1px solid #7f694622; }
@media (max-width: 350px) {
  .library-caption > span:last-child { font-size: .53rem; }
  .book-front { padding-left: 29px; padding-right: 18px; }
  .book-edition { font-size: .43rem; letter-spacing: .1em; }
  .chapter-scroll { padding-inline: 13px; }
  .chapter-scroll h3 { font-size: 1.15rem; }
  .story-library .stage { padding: 8px; }
  .story-library .stage .nm { font-size: .74rem; }
}
@media (max-height: 700px) {
  #home { gap: 10px; }
  #home #siteTagline { display: none; }
  .library-caption { padding-bottom: 12px; }
  .library-caption > span:last-child { display: none; }
  .story-library .story-book { height: clamp(300px, calc(100svh - 269px), 405px); }
  .book-front { padding-top: 16px; padding-bottom: 12px; }
  .book-art { margin-bottom: 12px; min-height: 80px; }
  .book-edition { margin-bottom: 10px; }
  .book-cover-copy p { display: none !important; }
  .cover-actions { margin-top: 11px; }
  .cover-rule { margin-top: 8px; }
  .book-navigation { padding-top: 17px; }
  .library-instructions { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { .story-library *, .story-library *::after { animation: none !important; transition: none !important; } }
