:root { color-scheme: dark; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #212121; color: #f5f5f5; font-synthesis: none; }
* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
.shell { width: min(100%, 860px); min-height: 100dvh; margin: auto; padding: 0 clamp(22px, 5vw, 62px) max(22px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.topbar { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #383838; }
.wordmark { color: inherit; font-size: 27px; letter-spacing: -1.7px; font-weight: 710; text-decoration: none; }
.cursor-mark { color: #e5e5e5; font-weight: 400; }
.top-actions { display: flex; align-items: center; gap: 26px; }
.story-index, .eyebrow, .footer { color: #aaa; font-size: 11px; letter-spacing: 0.15em; font-weight: 650; }
.text-button, .footer button, .end-actions button { color: #d8d8d4; background: none; border: 0; padding: 9px 0; }
.text-button { font-size: 13px; white-space: nowrap; }
.game { flex: 1; padding-top: clamp(28px, 5vh, 54px); padding-bottom: 24px; }
.eyebrow { color: #e5e5e5; margin: 0 0 20px; }
.transcript { display: flex; flex-direction: column; gap: 10px; }
.line { margin: 0; white-space: pre-line; font-size: clamp(17px, 2.5vw, 21px); line-height: 1.48; letter-spacing: -0.025em; max-width: 650px; }
.scene { color: #f5f5f5; }
.command { margin-top: 14px; color: #b4b4b4; font-size: clamp(17px, 2.4vw, 20px); padding-left: 24px; position: relative; }
.command::before { content: '›'; position: absolute; left: 0; }
.response { color: #e5e5e5; }
.hint { margin-top: 8px; color: #cfcfcf; font-size: clamp(16px, 2.2vw, 19px); }
.end-actions { margin-top: 36px; }
.end-actions button { text-decoration: underline; text-underline-offset: 5px; }
.composer { display: flex; align-items: center; gap: 14px; background: #2f2f2f; border: 1px solid #444; border-radius: 22px; padding: 13px 14px 13px 22px; min-height: 74px; box-shadow: 0 14px 36px #0004; }
.prompt { color: #e5e5e5; font-size: 28px; line-height: 1; }
.composer input { background: transparent; border: 0; outline: none; color: #fff; width: 100%; min-width: 0; font-size: 18px; }
.composer input::placeholder { color: #888985; opacity: 1; }
.send { border: 0; border-radius: 13px; width: 44px; height: 44px; flex: none; color: #111; background: #e9e9e5; font-size: 25px; line-height: 1; }
.send:hover { background: #e5e5e5; }
.footer { display: flex; justify-content: space-between; align-items: center; min-height: 56px; gap: 16px; font-size: 10px; }
.footer button { color: #aeb1ad; font-size: 10px; letter-spacing: inherit; font-weight: inherit; }
.footer button:hover, .text-button:hover, .end-actions button:hover { color: #e5e5e5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid #e5e5e5; outline-offset: 3px; }
[hidden] { display: none !important; }
@media (max-width: 560px) { .shell { padding-inline: 22px; } .topbar { min-height: 76px; } .wordmark { font-size: 24px; } .top-actions { gap: 13px; } .story-index { font-size: 10px; } .game { padding-top: 36px; } .line { font-size: 18px; } .composer { border-radius: 19px; min-height: 68px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
.choices { display: grid; gap: 10px; margin-top: 32px; max-width: 650px; }
.choice { width: 100%; border: 1px solid #494949; border-radius: 13px; background: #303030; color: #f1f1f1; text-align: left; padding: 16px 18px; font-size: 16px; line-height: 1.4; }
.choice:hover, .choice:focus-visible { background: #404040; border-color: #777; }
#restart { margin-top: 28px; }
.modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: #000b; padding: 22px; }
.modal-card { width: min(100%, 420px); display: grid; gap: 18px; padding: 28px; border-radius: 20px; background: #303030; border: 1px solid #505050; }
.modal-card label { font-size: 20px; line-height: 1.4; }
.modal-card input { min-width: 0; padding: 13px 14px; border-radius: 10px; border: 1px solid #666; background: #212121; color: white; font-size: 17px; }
.modal-card button { border: 0; border-radius: 10px; padding: 13px; background: #eee; color: #222; font-size: 16px; }

.choice-card { width: min(100%, 540px); padding: 16px; max-height: min(75dvh, 700px); overflow-y: auto; }
.choice-card .choices { display: grid; gap: 10px; margin: 0; }
.choice-card .choice { background: #383838; }
/* Reading surface and decision sheet */
.game { padding-bottom: 70px; }
.line { white-space: pre-wrap; line-height: 1.85; font-size: clamp(17px, 2.4vw, 20px); max-width: 680px; cursor: pointer; }
.next-button { display: block; margin-top: 34px; padding: 13px 22px; background: #eee; color: #161616; border: 0; border-radius: 10px; font-weight: 700; font-size: 16px; }
.modal { background: rgba(0, 0, 0, .78); }
.choice-card { background: #f2f1ec; border: 1px solid #fff; color: #181818; box-shadow: 0 24px 80px #000c; padding: 24px; }
.choice-title { margin: 0 0 4px; font-size: 18px; font-weight: 750; color: #181818; }
.choice-card .choice { background: #fff; color: #181818; border: 1px solid #bcbab2; font-weight: 650; font-size: 17px; padding: 18px; }
.choice-card .choice:hover, .choice-card .choice:focus-visible { background: #e4e2d9; border-color: #555; }
.choice-card .choice:focus-visible { outline: 3px solid #245ca1; outline-offset: 2px; }
@media (max-width: 560px) { .choice-card { padding: 20px; } .line { line-height: 1.8; } }
.chapter-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; margin-bottom: 26px; }
.chapter-row .eyebrow { margin: 0; }
.chapter-picker { display: flex; align-items: center; gap: 8px; color: #bbb; font-size: 13px; }
.chapter-picker select { max-width: 230px; border: 1px solid #626262; border-radius: 8px; padding: 8px 10px; background: #292929; color: #f5f5f5; font: inherit; font-size: 14px; }
.chapter-list { display: flex; flex-wrap: nowrap; gap: 7px; width: 100%; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.chapter-button { padding: 8px 10px; background: #303030; border: 1px solid #666; color: #eee; border-radius: 8px; font-size: 13px; }
.chapter-button { flex: none; scroll-snap-align: start; }
.chapter-button[aria-current="step"] { border-color: #eee; background: #454545; }
.chapter-button:disabled { color: #aaa; background: #262626; border-color: #484848; cursor: not-allowed; }
.speed-control { display: flex; align-items: center; gap: 6px; color: #c9c9c9; white-space: nowrap; font-size: 13px; }
.speed-control select { padding: 7px 5px; border: 1px solid #666; border-radius: 7px; background: #282828; color: #f3f3f3; font: inherit; }
@media (max-width: 560px) { .top-actions { gap: 10px; } .speed-control { font-size: 12px; } .speed-control select { max-width: 84px; } }
.records { margin-top: 38px; padding: 20px; border: 1px solid #555; border-radius: 12px; color: #d5d5d5; }
.records h2 { margin: 0 0 10px; font-size: 16px; }
.records ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.9; }

.line, .scene, .choice-title, .choices, .footer, .game { word-break: keep-all; overflow-wrap: break-word; }
