:root {
  color-scheme: dark;
  --night: #0b0922;
  --velvet: #1b1039;
  --gold: #f4ca76;
  --bright: #ffebad;
  --paper: #f9edcf;
  --ink: #fcf7ff;
  --muted: #d0c3e4;
  --rim: #8572a54d;
  --view-height: 100vh;
  --display: Georgia, 'Noto Serif', serif;
  --safe-top: max(0px, var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
  --safe-bottom: max(0px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--night);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100vh; min-height: var(--view-height); }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #f9ce77; outline-offset: 2px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { line-height: 1.52; }
input[type="range"], input[type="checkbox"] { accent-color: var(--gold); }
.icon { width: 21px; height: 21px; flex: 0 0 auto; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sky { position: fixed; z-index: -1; top:0;right:0;bottom:0;left:0;inset:0; overflow: hidden; pointer-events: none; background:
  radial-gradient(ellipse at 76% 84%, #432261 0%, transparent 51%),
  radial-gradient(ellipse at 6% 38%, #2d1c57 0%, transparent 52%),
  linear-gradient(155deg,#0b0922,#13102e 50%,#170d30); }
.sky::before, .sky::after { content: ''; position: absolute; top:-6%;right:-6%;bottom:-6%;left:-6%;inset:-6%; pointer-events: none; }
.sky::before {
  background-image:
    radial-gradient(1.5px 1.5px at 12% 27%, #ffe6a6, transparent),
    radial-gradient(1px 1px at 27% 67%, #d5acfb, transparent),
    radial-gradient(1.5px 1.5px at 73% 40%, #fff0c4, transparent),
    radial-gradient(1.1px 1.1px at 46% 20%, #e2c6ff, transparent),
    radial-gradient(1px 1px at 82% 83%, #ffe7b0, transparent);
  background-size: 177px 211px; opacity: .53; animation: shimmer 5s ease-in-out infinite alternate;
}
.sky::after { background: radial-gradient(ellipse at 23% 90%,#9259d42a 2%,transparent 37%),radial-gradient(ellipse at 88% 14%,#6553d22d 0%,transparent 40%); animation: drift 16s ease-in-out infinite alternate; }
@keyframes shimmer { from { opacity: .33; } to { opacity: .72; } }
@keyframes drift { from { transform: translate3d(-1%,4%,0); } to { transform: translate3d(3%,-2%,0); } }
@keyframes appear { from { opacity: .65; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes kindle { 45% { filter: brightness(1.38) drop-shadow(0 0 26px #f3b14b80); transform: scale(1.06); } }
:root[data-appearance="night"] .sky { opacity: .38; }
:root[data-reduced="true"] *, :root[data-reduced="true"] *::before, :root[data-reduced="true"] *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.shell { max-width: 900px; min-height: 100vh; min-height: var(--view-height); margin-inline: auto; padding: var(--safe-top) max(11px, env(safe-area-inset-right, 0px)) var(--safe-bottom) max(11px, env(safe-area-inset-left, 0px)); }
.screen, .detail, .reader-wrap, .player { margin: auto; animation: appear .26s ease-out; }
.screen { padding: 9px 3px calc(93px + var(--safe-bottom)); }
.gold, .soft, .plate, .chip, .round, .link, .skip { min-height: 44px; border: 1px solid transparent; background: none; }
.gold, .soft, .round, .chip { border-radius: 999px; }
.gold, .chip[aria-pressed="true"] {
  color: #29192b; font-weight: 720; border-color: #ffdfa0;
  background: linear-gradient(170deg,#fff1af 0%,#f7cf75 40%,#e79a37 93%);
  box-shadow: inset 0 1px #fff7d4, inset 0 -2px 5px #ffe095, 0 3px 15px #e2983e3d;
}
.soft, .plate, .chip, .round { background: linear-gradient(135deg,#33225d,#21163e 62%,#261747); border-color: var(--rim); box-shadow: inset 0 1px 0 #ccb6ef18, 0 3px 9px #08051d54; }
button { transition: transform .16s, filter .16s, border-color .18s; }
button:not(:disabled):active { transform: scale(.96); filter: brightness(1.18); }
button.soft:hover, button.plate:hover, button.round:hover { border-color: #d5ab65a1; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-width: 0; padding: 8px 14px; text-align: center; }
.text-button .icon { color: var(--gold); }
.gold .icon { color: inherit; }
.round { display: inline-grid; width: 44px; min-width: 44px; height: 44px; padding: 0; place-items: center; color: var(--gold); }
.round[aria-pressed="true"] .icon { fill: var(--gold); filter: drop-shadow(0 0 8px #ffc05980); }
.link, .skip { color: var(--muted); padding: 5px 4px; }
.link .icon { width: 14px; height: 14px; }
.bottom { position: fixed; z-index: 5; top:auto;right:max(10px, env(safe-area-inset-right, 0px));bottom:max(8px, var(--safe-bottom));left:max(10px, env(safe-area-inset-left, 0px));inset:auto max(10px, env(safe-area-inset-right, 0px)) max(8px, var(--safe-bottom)) max(10px, env(safe-area-inset-left, 0px)); display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 2px; max-width: 645px; margin-inline: auto; padding: 4px 6px; border: 1px solid #a591bb63; border-radius: 26px; background: linear-gradient(145deg,#2c1a4b,#17102e 75%); box-shadow: 0 -5px 22px #0a051fcc,inset 0 1px #edca9c28; }
.bottom button { display: grid; place-items: center; align-content: center; gap: 4px; min-height: 55px; padding: 4px 0; font-size: clamp(9px, 2.9vw, 12px); border-radius: 18px; border: 0; background: transparent; color: var(--ink); }
.bottom [aria-current] { color: var(--bright); background: radial-gradient(ellipse at 50% 40%, #6d4b6e9c, transparent 75%); }
.bottom [aria-current] .icon { fill: var(--gold); filter: drop-shadow(0 0 7px #f7bd68ad); }
.mast { display: grid; place-items: center; padding: 10px 0 17px; min-height: 66px; }
.mast h1 { display: flex; gap: 11px; align-items: center; font: 700 clamp(25px,7vw,34px)/1.15 var(--display); }
.mast .icon { width: 31px; height: 31px; color: var(--gold); }
.bar { display: grid; grid-template-columns: 1fr minmax(0,auto) 1fr; gap: 7px; align-items: center; min-height: 53px; padding: 3px 0; }
.bar > :last-child { justify-self: end; }
.bar strong { font-size: 14px; text-align: center; }
.bar .round { background: transparent; border-color: transparent; box-shadow: none; }
.bar > .round { justify-self: start; }
.bar > .round:last-child { justify-self: end; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-title h2 { display: flex; gap: 7px; align-items: center; font: 700 17px/1.25 system-ui,sans-serif; text-wrap: initial; }
.section-title .icon { color: var(--gold); width: 17px; height: 17px; }
.section-title .link { font-size: 12px; white-space: nowrap; }
.shelf { margin-block: 15px 20px; }
.shelf .section-title { min-height: 39px; }
.greeting { display: grid; grid-template-columns: 57px minmax(0,1fr) auto; align-items: center; gap: 11px; min-height: 71px; margin-bottom: 8px; }
.greeting h1 { font-size: clamp(17px,5vw,23px); line-height: 1.2; }
.greeting h1 span { color: var(--gold); margin-left: 4px; text-shadow: 0 0 10px #ffc975; }
.greeting p { font-size: 13px; color: var(--muted); }
.owl { width: 57px; height: 57px; object-fit: cover; border-radius: 17px; border: 1px solid #c69577; box-shadow: 0 0 17px #7859cc61; }
.chips { display: flex; align-items: stretch; gap: 7px; padding: 3px 0; overflow-x: auto; scrollbar-width: thin; }
.chip { display: flex; gap: 5px; align-items: center; justify-content: center; padding: 5px 9px; white-space: nowrap; font-size: 12px; }
.chip .icon { color: var(--gold); width: 17px; height: 17px; }
.chip[aria-pressed="true"] .icon { color: inherit; }
.quick { display: grid; grid-template-columns: 1fr 1fr 1.2fr 1.12fr; }
.quick .chip { flex-direction: column; min-height: 67px; gap: 7px; padding: 7px 3px; border-radius: 17px; font-size: clamp(9px,2.8vw,12px); }
.quick .chip .icon { width: 23px; height: 23px; }
.quick .chip:nth-child(2) { border-color: #efc57595; box-shadow: inset 0 -3px 9px #efaa5228,0 0 15px #e8a65b30; }
.grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-block: 10px; }
.grid > .empty { grid-column: 1/-1; }
.cover { position: relative; min-width: 0; border-radius: 19px; border: 1px solid #d7b775ab; box-shadow: 0 5px 14px #050316aa; background: #1a143a; }
.cover-open { display: block; position: relative; overflow: hidden; width: 100%; height: 100%; aspect-ratio: 1.05 / 1.2; padding: 0; border: 0; border-radius: inherit; background: #2a1749; }
.cover-open::after { content: ''; position: absolute; pointer-events: none; top:0;right:0;bottom:0;left:0;inset:0; background: linear-gradient(transparent 26%,#110c2a1a 47%,#1a1038d6 76%,#100922 100%); }
.cover-open img { width: 100%; height: 100%; object-fit: cover; }
.cover-text { position: absolute; z-index: 1; top:auto;right:6px;bottom:8px;left:6px;inset:auto 6px 8px; color: #ffe9af; text-shadow: 0 2px 4px #170b21,0 0 10px #170b21; }
.cover-text h3 { font: 700 clamp(13px,4.25vw,20px)/1.1 var(--display); }
.cover-text small { display: block; margin-top: 4px; color: #eee1fc; font-size: 10px; }
.cover .round { position: absolute; z-index: 2; top: 4px; right: 4px; width: 44px; height: 44px; background: #120c2bc2; border-color: #ffe4a860; }
.cover .round .icon { width: 19px; height: 19px; }
.edge-star { position: absolute; pointer-events: none; left: 50%; bottom: -9px; transform: translateX(-50%); color: #ffde92; line-height: 18px; text-shadow: 0 0 9px #ffd57e; }
.featured .cover-open { aspect-ratio: 1.75; }
.featured .cover-text { text-align: left; top:auto;right:14px;bottom:12px;left:14px;inset:auto 14px 12px; }
.featured .cover-text h3 { font-size: clamp(21px,6vw,30px); }
.featured .cover-open img { object-position: center 44%; }
.search-row { display: grid; grid-template-columns: 1fr minmax(100px,32%); gap: 7px; margin-bottom: 10px; }
.search,.age { display: flex; align-items: center; gap: 6px; min-height: 48px; background: #20163dbb; border: 1px solid #b193d583; border-radius: 18px; padding: 0 10px; }
.search input,.age select { width: 100%; min-width: 0; min-height: 44px; color: var(--ink); background: transparent; border: 0; font-size: 14px; }
.search input::placeholder { color: var(--muted); }
.age .icon,.search .icon { color: var(--gold); width: 17px; height: 17px; }
.plate { border-radius: 17px; }
.empty { display: grid; place-items: center; gap: 11px; min-height: 129px; text-align: center; padding: 18px; color: var(--muted); border: 1px solid var(--rim); border-radius: 18px; background: #211637ab; }
.empty .icon { width: 34px; height: 34px; color: var(--gold); }
.notice, .toast { padding: 8px 12px; border: 1px solid var(--rim); border-radius: 12px; background: #30204d; color: var(--ink); }
.toast { position: fixed; z-index: 10; top:auto;right:14px;bottom:92px;left:14px;inset:auto 14px 92px; max-width: 420px; margin: auto; text-align: center; box-shadow: 0 5px 24px #08041e; }

.welcome { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: calc(100vh - var(--safe-top) - var(--safe-bottom)); min-height: calc(var(--view-height) - var(--safe-top) - var(--safe-bottom)); max-width: 540px; margin: auto; padding: clamp(88px,19vh,165px) 13px 14px; overflow: hidden; text-align: center; }
.curtains { position: absolute; z-index: -1; top: 0; width: 100%; height: auto; mask-image: linear-gradient(#000 65%,transparent); }
.skip { position: absolute; top: 7px; right: 9px; text-shadow: 0 1px 6px #130b2b; color: #fff2d9; }
.welcome-wordmark { display: grid; justify-items: center; margin-top: 3px; line-height: .9; }
.welcome-wordmark > .icon { color: var(--gold); width: 48px; height: 41px; filter: drop-shadow(0 0 10px #ffe99354); margin-bottom: 7px; }
.welcome-wordmark span { font: 700 clamp(29px,9vw,53px)/.88 var(--display); }
.welcome-wordmark h1 { font: 700 clamp(42px,14vw,76px)/.95 var(--display); letter-spacing: -.06em; text-shadow: 0 1px #ffdf83, 0 6px 37px #dfa3474d; color: var(--gold); }
.welcome-art { width: min(90%,420px); height: min(39vh,340px); object-fit: contain; mix-blend-mode: lighten; mask-image: radial-gradient(ellipse,#000 51%,transparent 77%); margin-block: -4px -15px; }
.welcome.opening .welcome-art { animation: kindle .32s ease-out; }
.welcome p { max-width: 260px; line-height: 1.3; font-size: clamp(16px,4.5vw,22px); text-shadow: 0 2px 14px #080621; }
.welcome-enter { width: min(100%,345px); min-height: 54px; margin-top: 8px; }
.welcome-enter .icon:last-child { margin-left: 9px; }
.dots { display: flex; align-items: center; }
.dots button { width: 44px; height: 44px; border: 0; background: none; padding: 0; display: grid; place-items: center; }
.dots button::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #9c80ac; }
.dots button[aria-pressed="true"]::after { background: #ffdf83; box-shadow: 0 0 14px #f7ac4a; }

.detail, .reader-wrap, .player { max-width: 660px; padding-bottom: 15px; }
.story-hero { position: relative; overflow: hidden; min-height: 220px; border: 1px solid #a88a603f; border-radius: 19px 19px 25px 25px; background: #211539; }
.story-hero img { width: 100%; height: clamp(223px,69vw,380px); object-fit: cover; object-position: center 44%; }
.story-hero::after { content: ''; position: absolute; top:0;right:0;bottom:0;left:0;inset:0; background: linear-gradient(transparent 38%,#16102c60 64%,#17102c 100%); pointer-events: none; }
.story-hero h1 { position: absolute; z-index: 1; top:auto;right:11px;bottom:20px;left:11px;inset:auto 11px 20px; text-align: center; color: #ffe9ae; font: 700 clamp(22px,7vw,37px)/1.03 var(--display); text-shadow: 0 2px 7px #11071d; }
.hero-flourish { position: absolute; z-index: 1; top:auto;right:0;bottom:2px;left:0;inset:auto 0 2px; text-align: center; color: var(--gold); }
.hero-flourish::before,.hero-flourish::after { content: ''; display: inline-block; vertical-align: middle; height: 1px; width: 12%; margin-inline: 4px; background: linear-gradient(90deg,transparent,#e3aa62); }
.hero-flourish::after { transform: rotate(180deg); }
.detail-copy { padding: 9px 2px 0; }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-bottom: 10px; }
.badges span { display: flex; gap: 5px; align-items: center; padding: 5px 10px; border: 1px solid var(--rim); border-radius: 99px; background: #2c2051; font-size: 11px; }
.badges .icon { width: 14px; height: 14px; color: var(--gold); }
.synopsis { font-size: 14px; margin: 9px 6px 13px; }
.two { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.download { width: 100%; margin-top: 9px; font-size: 13px; }
.author-row,.history-row { display: grid; width: 100%; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; }
.author-row { margin-top: 10px; }
.author-row .icon, .history-row .icon { color: var(--gold); }
.author-row small, .author-row strong, .history-row small, .history-row strong { display: block; }
.author-row small,.history-row small,.editorial-note { font-size: 11px; color: var(--muted); }
.author-row strong,.history-row strong { font-size: 14px; }
.editorial-note { margin: 7px 2px 0; }
.history-row { margin: 7px 0; }
.history-row img { width: 56px; height: 53px; object-fit: cover; border: 1px solid #eac78a94; border-radius: 8px; }
progress { width: 100%; height: 7px; border: 0; border-radius: 20px; overflow: hidden; accent-color: var(--gold); background: #86749847; }
progress::-webkit-progress-bar { background: #86749847; }
progress::-webkit-progress-value { background: linear-gradient(90deg,#da9a48,#ffe09a); border-radius: 20px; }

.profile,.parent,.author { max-width: 520px; }
.profile-castle { width: 100%; aspect-ratio: 2.25; object-fit: cover; object-position: center 51%; mix-blend-mode: lighten; mask-image: linear-gradient(transparent,#000 18%,#000 77%,transparent); margin: -9px auto 6px; }
.preference,.language,.profile > .plate,.parent .plate { margin: 8px 0; width: 100%; }
.preference,.language { min-height: 52px; padding: 7px 11px; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.preference .icon, .language .icon { color: var(--gold); }
.preference span { flex: 1; }
.preference select,.field select { border: 1px solid var(--rim); min-height: 44px; max-width: 155px; border-radius: 13px; padding: 5px; background: #1c1337; color: var(--ink); }
.language { display: grid; grid-template-columns: auto 1fr; }
.language .two { grid-column: 1/-1; }
.preference input { position: absolute; opacity: 0; }
.switch { display: block; cursor: pointer; width: 45px; height: 26px; border: 1px solid #bda4df6b; border-radius: 50px; background: #2b1e46; }
.switch::after { content: ''; display: block; width: 20px; height: 20px; border-radius: 50%; margin: 2px; background: #d0c6dc; transition: transform .2s; }
.preference input:focus-visible + .switch { outline: 2px solid var(--gold); outline-offset: 4px; }
.preference input:checked + .switch { background: #e49c3d; }
.preference input:checked + .switch::after { transform: translateX(19px); background: #fff2c7; }
.profile > button.plate { justify-content: start; text-align: left; }
.article-card,.gate { padding: 20px; }
.article-card h1,.gate h1,.premium-title h1 { color: var(--bright); font: 700 clamp(22px,7vw,33px)/1.12 var(--display); }
.article-card p,.gate p { margin: 10px 0; }
.article-card > .icon { color: var(--gold); margin-bottom: 9px; }
.gate label { display: grid; gap: 6px; }
.gate input { min-height: 44px; max-width: 180px; border: 1px solid var(--rim); border-radius: 9px; background: #120d29; color: var(--ink); padding: 8px; }
.gate [role="alert"] { color: #ffb2b4; }
.premium-title { text-align: center; padding: 10px; }
.premium-title .icon,.parent li .icon,.premium-note .icon { color: var(--gold); }
.parent ul { display: grid; gap: 9px; list-style: none; padding: 0; }
.parent li,.premium-note { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }

.reader-tools { display: flex; align-items: center; }
.reader-tools .round { min-width: 40px; width: 40px; }
.reading { --paper-color: #f8edcf; --paper-edge: #dfc398; --paper-ink: #302119; --paper-reverse: #e4cb9e; --paper-line: #a57440; overflow: hidden; border-radius: 17px; border: 1px solid #dcb77b; color: var(--paper-ink); background: var(--paper-color); box-shadow: 0 10px 38px #050213b5,0 1px 11px #d391594c; }
.paper-light { --paper-color: #fff9ee; --paper-edge: #ede2cc; --paper-ink: #271c23; --paper-reverse: #e8d9bc; }
.paper-dark { --paper-color: #221930; --paper-edge: #352642; --paper-ink: #fff2e2; --paper-reverse: #65526e; --paper-line: #e5b780; }
.paper-window { position: relative; height: clamp(225px, calc(100vh - 174px - var(--safe-top) - var(--safe-bottom)), 1060px); height: clamp(225px, calc(var(--view-height) - 174px - var(--safe-top) - var(--safe-bottom)), 1060px); overflow: hidden; }
.paper-window.scrolling { overflow-y: auto; }
.paged,.paged .paper-scroll { touch-action: pan-y; }
.active-paper,.facing-paper,.curl-replica { position: absolute; top:0;right:0;bottom:0;left:0;inset:0; background: radial-gradient(ellipse at 47% 38%,var(--paper-color) 61%,var(--paper-edge) 132%); }
.active-paper { z-index: 2; }
.paper-scroll { height: 100%; overflow-y: auto; overscroll-behavior-y: contain; }
.paper-sheet { padding: 13px clamp(16px,5vw,41px) 22px; min-height: 100%; }
.scrolling .paper-sheet + .paper-sheet { border-top: 1px solid color-mix(in srgb,var(--paper-line),transparent 55%); }
.paper-sheet img { width: 100%; height: clamp(123px, 28vh, 300px); height: clamp(123px, calc(var(--view-height) * .28), 300px); object-fit: cover; border-radius: 14px 14px 31% 30% / 14px 14px 10% 10%; }
.paper-text { margin: 10px auto 0; max-width: 62ch; font-family: var(--display); }
.chapter-kicker { display: block; text-align: center; font-weight: 700; font-size: 13px; }
.paper-text h2 { margin: 3px 0 11px; text-align: center; font-size: clamp(20px,5.5vw,28px); line-height: 1.15; }
.paper-text p { font-size: var(--reading-size); line-height: var(--reading-spacing); white-space: pre-line; margin: 0 0 .63em; overflow-wrap: anywhere; }
.reader-dock { position: relative; display: flex; align-items: center; gap: 8px; padding: 5px 10px 0; box-shadow: 0 -4px 14px #6b422235; }
.reader-position { flex: 1; display: grid; gap: 3px; text-align: center; font-size: 12px; font-weight: 650; padding: 6px 0; }
.reader-dock .round { background: transparent; border-color: color-mix(in srgb,var(--paper-line),transparent 65%); color: var(--paper-ink); box-shadow: none; }
.paper-actions { display: flex; gap: 6px; justify-content: center; padding: 2px 8px 4px; }
.paper-actions .soft { color: var(--paper-ink); background: transparent; border-color: transparent; box-shadow: none; font-size: 12px; }
.paper-actions .icon { color: var(--paper-line); width: 16px; }
.curl-layer { position: absolute; z-index: 3; top:0;right:0;bottom:0;left:0;inset:0; overflow: hidden; pointer-events: none; }
.curl-layer::after { content: ''; position: absolute; z-index: 55; top: 0; bottom: 0; left: var(--fold); width: 28px; transform: translateX(-8px); background: linear-gradient(90deg,transparent,#2d190f,transparent); opacity: var(--shadow); }
.curl-slice { position: absolute; overflow: hidden; left: 0; top: 0; bottom: 0; transform-origin: left center; contain: size layout paint; }
.curl-slice::after { content: ''; position: absolute; top:0;right:0;bottom:0;left:0;inset:0; background: #482a21; opacity: var(--shade); pointer-events: none; }
.curl-slice.reverse { background: var(--paper-reverse); }
.curl-slice.reverse .curl-replica { opacity: .09; }
.curl-replica .paper-scroll { overflow: hidden; }
.sheet { width: min(calc(100% - 20px), 445px); border: 1px solid #a88bc777; border-radius: 22px; padding: 16px; background: #21153d; color: var(--ink); }
.sheet::backdrop { background: #09051ed5; }
.sheet-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet-title h2 { color: var(--bright); font: 700 24px var(--display); }
.field,.range-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 49px; }
.range-label { flex-wrap: wrap; margin-block: 7px; }
.range-label input { width: 100%; }
.sheet .row { display: flex; align-items: center; gap: 9px; width: 100%; margin-top: 7px; padding: 8px 12px; }

.player-body { max-width: 440px; margin: 4px auto; display: grid; justify-items: center; gap: 9px; text-align: center; padding: 0 5px; }
.player-art { width: 100%; max-height: 350px; aspect-ratio: 1.2; object-fit: cover; border-radius: 24px; border: 1px solid #d6b070ab; box-shadow: 0 10px 37px #0a061ccc, 0 0 23px #77519774; }
.player h1 { font: 700 clamp(23px,7vw,34px)/1.12 var(--display); color: var(--bright); }
.player input[type="range"], .player .time { width: 100%; }
.player .time { display: flex; justify-content: space-between; color: var(--muted); font-variant-numeric: tabular-nums; }
.player-controls { display: flex; align-items: center; justify-content: center; gap: 15px; }
.player-controls .round { width: 54px; height: 54px; }
.player-controls .primary-play { width: 65px; height: 65px; color: #321d22; }
.primary-play .icon { fill: currentColor; }
.player-options { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.player-options .field { font-size: 13px; }

@media (min-width: 640px) {
  .shell { padding-inline: 20px; }
  .screen { padding-inline: 16px; }
  .home-screen { max-width: 760px; }
  .welcome-art { width: min(92%,400px); }
  .grid:not(.picks) { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .grid.picks { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .detail > .detail-copy { padding-inline: 10px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .welcome { padding-top: 46px; }
  .welcome-art { height: 145px; }
  .welcome-wordmark h1 { font-size: 48px; }
  .paper-window { height: max(155px,calc(100vh - 151px)); height: max(155px,calc(var(--view-height) - 151px)); }
  .paper-sheet img { height: 109px; }
}

/* Keep native image dragging and text selection from taking over a page turn. */
.paged { user-select: none; -webkit-user-select: none; }
.paged img { -webkit-user-drag: none; }

/* Shared materials and motion for the illustrated edition. */
:root { --ease: cubic-bezier(.2,.75,.25,1); --transition: 240ms; }
body { background: transparent; }
.sky { background: radial-gradient(ellipse at 20% 4%,#45256455,transparent 44%),
  radial-gradient(ellipse at 98% 63%,#3c246b65,transparent 46%),linear-gradient(160deg,#08091e,#1a1037 57%,#100c29); }
.nebula { position: absolute; top:-15%;right:-15%;bottom:-15%;left:-15%;inset:-15%; opacity: .7; background:
  radial-gradient(ellipse at 80% 80%,#8b58bd2b,transparent 23%),
  radial-gradient(ellipse at 15% 45%,#5266aa26,transparent 32%),
  radial-gradient(ellipse at 60% 10%,#9368ae20,transparent 20%);
  animation: drift 22s ease-in-out infinite alternate; }
.stardust { position:absolute; top:0;right:0;bottom:0;left:0;inset:0; opacity:.55; background-image:
  radial-gradient(1px 1px at 22px 32px,#ffe6a7,transparent),
  radial-gradient(1px 1px at 93px 85px,#c6d1f7,transparent);
  background-size:149px 191px; mask-image:linear-gradient(#000,transparent 75%); }
.constellation { position:absolute; width:140px;height:100px;top:7%;right:8%;opacity:.25;transform:rotate(-20deg); }
.constellation span { position:absolute;width:4px;height:4px;border-radius:50%;background:#ffe6b1;box-shadow:0 0 10px #ffd77b; }
.constellation span::after { content:'';position:absolute;top:1px;left:2px;height:1px;width:35px;transform-origin:left;background:linear-gradient(90deg,#edce9a77,transparent);transform:rotate(25deg); }
.constellation span:nth-child(2) {left:32px;top:14px}
.constellation span:nth-child(3) {left:60px;top:29px}
.constellation span:nth-child(4) {left:90px;top:7px}
.constellation span:nth-child(5) {left:110px;top:41px}
.constellation span:nth-child(6) {left:80px;top:67px}
.gold { position:relative; isolation:isolate; overflow:hidden;
  background:linear-gradient(178deg,#fff5bd 0%,#ffe49d 18%,#f5c065 59%,#e79a36 100%);
  box-shadow:inset 0 2px 3px #fff8df,inset 0 -2px 4px #b9752c52,0 5px 17px #f5ae3e37; }
.gold::after { content:'';position:absolute;top:0;right:0;bottom:0;left:0;inset:0;pointer-events:none;border-radius:inherit;
  background:linear-gradient(115deg,transparent 20%,#fff8d666 47%,transparent 64%);
  transform:translateX(-150%);transition:transform 650ms var(--ease); }
.gold:active::after,.gold:hover::after { transform:translateX(150%); }
.plate,.soft,.chip,.bottom { background:linear-gradient(140deg,#49316a85,#25173fe8 40%,#1c1338f0);
  border-color:#b199cb66;box-shadow:inset 0 1px #ead7ff2e,inset 0 -1px #09051f80,0 5px 14px #05031450; }
.cover { border:1px solid #f0cf93b0;box-shadow:0 0 0 2px #78573935,inset 0 0 0 1px #ffe6ae4d,0 8px 20px #070317aa; }
.cover::after {content:'';position:absolute;top:0;right:0;bottom:0;left:0;inset:0;pointer-events:none;border-radius:inherit;box-shadow:inset 0 2px 2px #ffedb273,inset 0 -2px #8a5f264d; }
.cover .cover-open { aspect-ratio:.79; }
.featured .cover-open { aspect-ratio:1.65; }
.cover-open::after {background:linear-gradient(transparent 38%,#17102b3d 54%,#18102be8 82%,#130c26 100%);}
.cover-text h3 {font-weight:600;letter-spacing:-.015em;line-height:1.12;}
.cover-text small {line-height:1.4;color:#eee1c4;}
.shelf {margin-block:12px 21px}
.section-title h2 {font-family:var(--display);font-size:21px;font-weight:600}
.section-title .icon {fill:#f5cc7844;filter:drop-shadow(0 0 3px #edb96366)}
.bottom {backdrop-filter:blur(16px);padding-block:4px 5px}
.screen,.detail,.reader-wrap,.player {animation:arrive var(--transition) var(--ease)}
@keyframes arrive {from{opacity:.2;transform:translate3d(0,9px,0)}to{opacity:1;transform:none}}
@keyframes heartBurst {40%{transform:scale(1.16);filter:drop-shadow(0 0 9px #e5ad57)}}
.heart-burst {animation:heartBurst 340ms var(--ease)}
.chest-stage {position:relative;width:100%;display:grid;place-items:center;margin-block:-7px -5px;}
.chest-stage .welcome-art {width:100%;max-width:425px;mix-blend-mode:lighten;margin:0;mask-image:radial-gradient(ellipse,#000 42%,transparent 74%);}
.chest-light {position:absolute;top:15%;right:8%;bottom:5%;left:8%;inset:15% 8% 5%;z-index:-1;background:radial-gradient(ellipse,#ffc86d46,transparent 62%);opacity:.55;animation:breathe 5s ease-in-out infinite alternate;}
.sparks {position:absolute;top:0;right:0;bottom:0;left:0;inset:0;pointer-events:none;overflow:hidden;}
.sparks i {position:absolute;top:57%;left:calc(14% + var(--i)*6%);width:3px;height:3px;border-radius:50%;background:#ffe5a1;box-shadow:0 0 10px #ffd773;
  animation:rise calc(3s + var(--i)*.16s) ease-in-out infinite;animation-delay:calc(var(--i)*-.61s);}
@keyframes rise {0%{opacity:0;transform:translateY(30px) scale(.3)}30%{opacity:.8}100%{opacity:0;transform:translateY(-160px) scale(.8)}}
@keyframes breathe {to{opacity:.95;transform:scale(1.07)}}
.welcome {padding-top:clamp(103px,16vh,140px);gap:7px;}
.welcome-wordmark h1 {font-size:clamp(49px,15vw,76px)}
.welcome-wordmark span {font-size:clamp(32px,10vw,53px)}
.welcome.opening .chest-stage {animation:chestOpen 620ms var(--ease) both;}
.welcome.opening .chest-light {animation:chestFlash 620ms ease-out both;}
@keyframes chestOpen {45%{transform:perspective(700px) rotateX(-9deg) scale(1.09);filter:brightness(1.25)}100%{transform:scale(1.15);opacity:0;filter:brightness(1.8)}}
@keyframes chestFlash {40%{opacity:1;transform:scale(1.4)}100%{opacity:0;transform:scale(2)}}
.detail .bar {margin-bottom:2px}
.story-hero {border-color:#d8b76c55;box-shadow:0 8px 25px #08041966;}
.story-hero h1 {font-weight:600;bottom:23px;line-height:1.08}
.profile-castle {aspect-ratio:2.6;object-position:center 46%}
.player-art {border-radius:26px;box-shadow:0 0 0 3px #9d754535,0 15px 40px #070317,inset 0 2px #ffe5ac;}
.player-body {gap:12px;}
.audio-credit {font-size:12px;color:var(--muted);}
[data-scene="read"] .sky *,[data-scene="read"] .sky::before,[data-scene="read"] .sky::after {animation-play-state:paused;}
.paper-sheet {background-image:radial-gradient(#a5753210 .6px,transparent .6px);background-size:5px 6px;}
.curl-slice.reverse {background:var(--paper-color);}
.curl-layer::after {width:52px;filter:blur(5px);transform:translateX(-22px);}
.curl-slice.reverse .curl-replica {opacity:.045;}
@media (min-width:640px) {.compact-shelf:has(.cover:only-child){grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:639px) {.compact-shelf:has(.cover:only-child){grid-template-columns:repeat(2,minmax(0,1fr))}.compact-shelf .cover .cover-open{aspect-ratio:.87}}
@media (prefers-reduced-motion:reduce) {.sparks,.chest-light{display:none}}
[data-reduced="true"] .sparks {display:none;}
.sheet:not([open]) {display:none;}
.dialog-backdrop {position:fixed;top:0;right:0;bottom:0;left:0;inset:0;z-index:90;background:#09051ed5;}
.legacy-dialog[open] {display:block;position:fixed;top:50%;right:auto;bottom:auto;left:50%;inset:50% auto auto 50%;transform:translate(-50%,-50%);margin:0;z-index:91;max-height:calc(100vh - 32px);overflow:auto;}
[data-lite="true"] .nebula,[data-lite="true"] .sparks,[data-lite="true"] .chest-light {display:none;}
[data-lite="true"] .sky::before,[data-lite="true"] .sky::after {animation:none;}
[data-lite="true"] .bottom {backdrop-filter:none;}

@supports (height: 100dvh) { :root { --view-height: 100dvh; } }

@supports not (aspect-ratio: 1) {
  .cover .cover-open {height:235px;}
  .featured .cover-open {height:210px;}
  .profile-castle {height:170px;}
  .player-art {height:260px;}
}
