/* reader.css: the inline visual-novel player of the chapter pages (see reader.js). Uses the variables of story.css. */
[hidden] { display: none !important; }

/* with JavaScript the text region is hidden until "Show full text"; without it nothing here applies */
html.vn-on:not(.vn-text) #textregion { display: none; }
html.vn-text #stage { display: none; }

.chapbar a.step[data-play] { background: var(--yellow); }

/* toggle bar above the stage */
.vn-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 1.4rem 0 .6rem; padding: .5rem .8rem; background: var(--ink); border: 4px solid var(--ink); scroll-margin-top: 4.6rem; }
.vn-toggle-label { font: 400 1.5rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--g, #ffcf33); }
.vn-toggle-hint { flex: 1 1 16rem; font-size: .85rem; color: var(--cream); }
.vn-tbtn { font: 400 1.25rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); background: var(--cream); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--g, #ffcf33); padding: .6rem 1rem; min-height: 2.75rem; cursor: pointer; }
.vn-tbtn:hover { background: var(--yellow); }
.vn-tbtn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--g, #ffcf33); }

/* the stage: a fixed 16:9 frame, so stepping never changes the page height */
.vn { position: relative; display: flex; flex-direction: column; width: 100%; aspect-ratio: 16 / 9; min-height: 30rem; max-height: calc(100vh - 6rem); margin: 0 0 1.6rem; overflow: hidden; background: var(--ink); color: var(--ink); font-family: var(--body); border: 5px solid var(--ink); box-shadow: 0 0 0 4px var(--g, #ffcf33); outline: none; --sc: var(--g, #ffcf33); }
.vn:focus-visible { box-shadow: 0 0 0 4px var(--yellow), 0 0 0 8px var(--ink); }
.vn:fullscreen { aspect-ratio: auto; max-height: none; min-height: 0; width: 100vw; height: 100vh; border: 0; box-shadow: none; }
.vn-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--g, #ffcf33) 35%, transparent), transparent 70%), var(--vn-bg, none) center / cover, #101018; filter: saturate(.85) brightness(.55); }
.vn-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(11,11,15,.65), rgba(11,11,15,.1) 35%, rgba(11,11,15,.75)); }
.vn > * { position: relative; }
.vn > .vn-bg { position: absolute; }

.vn-top { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; padding: .4rem .7rem; background: var(--ink); border-bottom: 4px solid var(--g, #ffcf33); z-index: 2; }
.vn-ctl { display: inline-flex; gap: .4rem; }
.vn-grow { flex: 1; }
.vn-title { font: 400 1.5rem/1 var(--display); letter-spacing: .08em; color: var(--g, #ffcf33); }
.vn-count { font-weight: 700; font-size: .95rem; color: var(--cream); background: rgba(255,251,232,.12); padding: .25rem .6rem; font-variant-numeric: tabular-nums; }
.vn-b { font: inherit; font-weight: 700; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); background: var(--cream); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--g, #ffcf33); padding: .4rem .75rem; min-height: 2.75rem; min-width: 2.75rem; cursor: pointer; }
.vn-b:hover { background: var(--yellow); }
.vn-b:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--g, #ffcf33); }
.vn-b.on, .vn-b[aria-pressed="true"] { background: var(--mint); }
.vn-b:focus-visible, .vn-opt:focus-visible, .vn-panel button:focus-visible, .vn select:focus-visible, .vn a:focus-visible, .vn-tbtn:focus-visible { outline: 4px solid var(--yellow); outline-offset: 2px; box-shadow: 0 0 0 4px var(--ink); }
.vn.vn-min .vn-ctl { display: none; }
.vn-prog { height: 7px; background: rgba(11,11,15,.9); z-index: 2; }
.vn-prog i { display: block; height: 100%; width: 0; background: var(--g, #ffcf33); transition: width .2s; }

.vn-stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: .6rem .8rem .9rem; cursor: pointer; }
.vn-pwrap { width: min(62rem, 100%); flex: 1 1 auto; min-height: 0; display: flex; align-items: flex-end; justify-content: flex-start; margin-bottom: .2rem; }
.vn-pic { height: min(100%, 20rem); max-height: 100%; aspect-ratio: 1; border: 5px solid var(--ink); background: var(--sc, #ddd); box-shadow: 6px 6px 0 rgba(11,11,15,.7); display: grid; place-items: center; overflow: hidden; transition: filter .2s, opacity .2s; }
.vn-pic img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.vn-pic span { font: 400 clamp(3rem, 8vw, 7rem)/1 var(--display); color: var(--ink); }
.vn-pic.dim { filter: grayscale(.6) brightness(.7); opacity: .75; }

.vn-box { position: relative; width: min(62rem, 100%); max-height: 54%; overflow: auto; background: var(--cream); border: 5px solid var(--ink); box-shadow: 7px 7px 0 rgba(11,11,15,.7); padding: 1.7rem 1.4rem 1.2rem; font-size: clamp(1rem, .9vw + .75rem, 1.4rem); line-height: 1.55; border-top: 12px solid var(--sc, var(--cream)); }
.vn-box.narr { background: #fff0a8; font-style: italic; border-top-color: #e0a800; }
.vn-box.mech { background: #fff; border-left: 14px solid var(--red); font-style: normal; }
.vn-name { position: sticky; top: -1.7rem; display: inline-block; margin: -1.3rem 0 .5rem -.4rem; padding: .1rem .9rem .05rem; background: var(--sc, #ddd); color: var(--ink); border: 4px solid var(--ink); font: 400 1.5rem/1.2 var(--display); letter-spacing: .06em; text-transform: uppercase; box-shadow: 3px 3px 0 var(--ink); z-index: 1; }
.vn-text .spk { font-size: .92em; }
.vn-hid { visibility: hidden; }
.vn-more { position: absolute; right: .9rem; bottom: .4rem; font-size: 1rem; opacity: 0; animation: vn-blink 1s ease-in-out infinite; }
.vn-box.done .vn-more { opacity: 1; }
@keyframes vn-blink { 50% { transform: translateY(4px); } }

.vn-card, .vn-choice { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: min(46rem, 92%); max-height: 92%; overflow: auto; text-align: center; background: var(--g, #ffcf33); border: 6px solid var(--ink); box-shadow: 8px 8px 0 rgba(11,11,15,.7); padding: 1.4rem 1.2rem 1.6rem; cursor: pointer; }
.vn-card h2, .vn-choice h2 { margin: .3rem 0; font: 400 clamp(1.8rem, 5vw, 3.6rem)/1.05 var(--display); letter-spacing: .05em; text-transform: uppercase; color: var(--ink); border: 0; padding: 0; }
.vn-card .vn-big { font-size: clamp(3rem, 11vw, 7rem); letter-spacing: .1em; }
.vn-kicker { display: block; font-weight: 700; font-size: .85rem; letter-spacing: .18em; text-transform: uppercase; }
.vn-card .kind { font-size: .9rem; margin-top: .4rem; }
.vn-card.t-boss { background: var(--red); transform: translate(-50%, -50%) rotate(-1.5deg); }
.vn-tape { display: block; height: 18px; margin: -1.4rem -1.2rem .8rem; background: repeating-linear-gradient(-45deg, #ffcf33 0 16px, var(--ink) 16px 32px); border-bottom: 4px solid var(--ink); }
.vn-tape + h2 + .vn-tape { margin: .8rem -1.2rem -1.6rem; border-bottom: 0; border-top: 4px solid var(--ink); }
.vn-card.t-unlock { background: var(--mint); transform: translate(-50%, -50%) rotate(-2deg); width: fit-content; max-width: 92%; padding-inline: 2.2rem; }
.vn-card.t-unlock h2 { font-size: clamp(1.5rem, 4vw, 2.6rem); }
.vn-card.t-tag { background: #fff; border-style: dashed; }
.vn-card.t-tag h2 { font-size: 1.6rem; }
.vn-card.t-end, .vn-card.t-gear { background: var(--g, #ffcf33); }
.vn-card p, .vn-choice p { margin: .6rem 0 0; font-size: .95rem; background: rgba(255,251,232,.85); padding: .4rem .7rem; }
.vn-choice { background: var(--pink); cursor: default; }
.vn-opts { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin: 1rem 0 .4rem; }
.vn-opt { font: 400 1.4rem/1.1 var(--display); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; color: var(--ink); background: var(--cream); border: 4px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); padding: .7rem 1.2rem; min-height: 3rem; cursor: pointer; }
.vn-opt:hover { background: var(--yellow); }
.vn-opt:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }

.vn-panel { position: absolute; z-index: 5; top: 3.6rem; right: .8rem; width: min(24rem, calc(100% - 1.6rem)); max-height: calc(100% - 4.8rem); overflow: auto; background: var(--cream); border: 5px solid var(--ink); box-shadow: 6px 6px 0 rgba(11,11,15,.7); padding: .4rem 1rem 1rem; }
.vn-panel h3 { font: 400 1.5rem/1.1 var(--display); letter-spacing: .05em; text-transform: uppercase; margin: .6rem 0; }
.vn-scenes ol { list-style: none; margin: 0; padding: 0; }
.vn-scenes li { margin: .3rem 0; }
.vn-scenes button { width: 100%; text-align: left; font: inherit; font-size: .92rem; color: var(--ink); background: #fff; border: 3px solid var(--ink); padding: .45rem .6rem; min-height: 2.75rem; cursor: pointer; }
.vn-scenes button:hover { background: var(--yellow); }
.vn-scenes button[aria-current] { background: var(--g, #ffcf33); font-weight: 700; }
.vn-scenes .kind { margin-right: .3rem; }
.vn-settings label { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin: .6rem 0; font-weight: 700; }
.vn-settings select { font: inherit; padding: .4rem; border: 3px solid var(--ink); background: #fff; min-height: 2.5rem; }
.vn-settings .vn-check { justify-content: flex-start; }
.vn-settings input[type="checkbox"] { width: 1.5rem; height: 1.5rem; accent-color: var(--ink); }
.vn-keys { font-size: .8rem; color: var(--muted); margin: .8rem 0 0; }
.vn-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 760px) {
  .vn { aspect-ratio: auto; height: min(80vh, 40rem); min-height: 26rem; }
  .vn-top { padding: .35rem .5rem; gap: .3rem; }
  .vn-title { display: none; }
  .vn-b { padding: .4rem .45rem; font-size: .8rem; min-width: 2.5rem; }
  .vn-b span { display: none; }
  .vn-count { padding: .25rem .4rem; }
  .vn-b[data-act="full"] { display: none; }
  .vn-stage { padding: .4rem .5rem .6rem; }
  .vn-box { max-height: 58%; padding: 1.5rem .9rem .9rem; border-width: 4px; border-top-width: 10px; box-shadow: 4px 4px 0 rgba(11,11,15,.7); }
  .vn-pic { height: min(100%, 10rem); }
  .vn-panel { top: 3.4rem; left: .5rem; right: .5rem; width: auto; }
  .vn-card, .vn-choice { top: 42%; padding: 1.2rem .8rem 1.4rem; }
  .vn-opt { font-size: 1.2rem; padding: .7rem 1rem; }
  .vn-toggle-label { font-size: 1.25rem; }
}
@media (max-height: 520px) { .vn-pwrap { display: none; } .vn-box { max-height: 70%; } }
@media (prefers-reduced-motion: reduce) { .vn-more, .vn-prog i, .vn-pic { animation: none !important; transition: none !important; } }
@media print { .vn, .vn-toggle { display: none !important; } html.vn-on #textregion { display: block !important; } }
