/* Photo-backed reading surfaces share one palette with the rest of the app. */
:root{--paper:#190f16;--surface:#281b24;--ink:#f5e9ef;--muted:#bfa8b4;--rose:#e5a0b7;--line:#e5a0b72e;--green:#b3cfbf;--glass:#281b24e8;--soft-radius:16px}
body{background:var(--paper);color:var(--ink)}
::selection{background:#824b62;color:#fff5fa}
input,textarea{caret-color:var(--rose);accent-color:var(--rose)}
::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-thumb{background:#bfa8b455;border-radius:6px}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline-color:var(--rose)}
.button,.goal,.glass-button{border-radius:14px}.button.primary{background:#e5a0b7;color:#30141f;box-shadow:none}.button.primary:hover{background:#f0b4c8}
.button.quiet{border-color:#e5a0b74d;background:#ffffff05;color:#f5e9ef}.text-button,em{color:#e5a0b7}
.sidebar{background:#20151eeb;border-color:var(--line)}.brand{color:#f2ccd9}.brand span,.date-label,.sidebar .mode,.settings,.bottom-note{color:var(--muted)}
.nav-item{border-radius:14px}.nav-item.active{background:#e5a0b71c;color:#f4c7d7}.nav-more summary{color:#d8bfcb}.nav-more>div{background:#2b1c26;border-color:var(--line);box-shadow:none}
.page-header h1{font-size:clamp(25px,3vw,35px);letter-spacing:0;line-height:1.6}.hero{background:#2b1c26;border-radius:24px}.hero h2{letter-spacing:0}.hero p,.hero-copy>small{color:#ceb6c2}
.hero-photo:after{background:linear-gradient(0deg,#190f16dc,transparent 55%),linear-gradient(90deg,#2b1c26,transparent 32%)}
.hero-photo,.auth-art{background:#2b1c26 url('/assets/scenes/lamplight-v3.webp') center/cover no-repeat}.hero-photo .portrait,.auth-art>.portrait{background:transparent}
.hero-number,.photo-caption span{color:#f3d4df}.photo-caption p{color:#fff2f7}
.doc-card,.account-card,.character-card,.user-row{border-color:var(--line);border-radius:var(--soft-radius);background:#281b24;box-shadow:none}
.doc-cover,.doc-card:nth-child(2n) .doc-cover{background:#392432;color:#e8c1d0}.progress-track{background:#ffffff12}.progress-track i{background:#d995ae}
.doc-meta,.doc-meta span,.card-footer small,.doc-cover small,.character-role,.character-description p,.document-chip span,.page-description{color:#bfa8b4}
.character-card.selected{border-color:#e5a0b7;box-shadow:0 0 0 2px #e5a0b724}.character-card>.portrait{background:#35232f}.select-label{border-color:var(--line);color:#efb8cc}
.goal{background:#ffffff04;border-color:var(--line);color:#cbb3c0}.goal.active{background:#e5a0b71c;color:#f3c4d5;border-color:#e5a0b780}
.document-chip,.notice,.chat-bubble,.quiz-feedback{background:#34232e;color:#e0c9d5;border-radius:14px}.chat-bubble.user{background:#49303e}.chat-bubble small{color:#e5a0b7}
.dropzone{background:#271a23;border-color:#a5768a;border-radius:24px}.dropzone:hover,.dropzone.dragging{background:#35222e;border-color:#e5a0b7}.dropzone p,.dropzone small,.privacy-note,.fine-print,.format-label,.import-aside p,.import-aside ul{color:var(--muted)}
.empty-card,.empty-state{border-radius:var(--soft-radius);border-color:#9d7486;background:#ffffff03}.empty-card p,.empty-state{color:#bfa8b4}
.stack-form label,.account-card>p,.user-details p{color:#ccb4c1}.stack-form input,#notes,#question{background:#1f141c;color:#f5e9ef;border-color:#806173;border-radius:14px}
.user-role,.user-avatar{background:#49303e;color:#efc0d1}.user-row>small{color:#cbb3c0}
.modal-backdrop{background:#100a11a6;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.modal{background:var(--glass);border:1px solid #e5a0b73b;border-radius:24px;color:#f5e9ef;box-shadow:none}.modal p,.modal .muted{color:#cbb3c0}.modal h2{letter-spacing:0}
.gift-options button,.quiz-options button,.chapter-list button{border-color:#ba8c9f55;border-radius:14px;background:#ffffff04;color:#f5e9ef}.gift-options button.selected,.chapter-list button.active{background:#e5a0b71f;border-color:#e5a0b7}
.quiz-options button.correct{background:#314539;color:#eef9f0}.quiz-options button.incorrect{background:#57303b;color:#ffe7ed}
#toast{background:#392431;color:#fff1f7;border-radius:14px;box-shadow:0 8px 28px #0004}
.wait-panel,.preparation-content,.preparation-companion{color:#f5e9ef}.preparation-companion,.preparation-companion>.portrait{background:#35232f}.preparation-companion>div:last-child{color:#efd1df}.preparation-content .muted,.preparation-chapter,.preparation-stage,.preparation-detail{color:#bfa8b4}
.boot-screen{background:#190f16}.preparation-content h1,.preparation-status h2{color:#f5e9ef}.preparation-status p,.preparation-timing,#preparation-long-wait,.preparation-footnote{color:#bfa8b4}.preparation-steps li{border-color:#e5a0b733;color:#bfa8b4}.preparation-steps li[data-state=current]{border-color:#e5a0b7;color:#f4c7d7}.preparation-steps li[data-state=done]{border-color:#b3cfbf;color:#b3cfbf}
/* Status text must remain legible on the dark theme, including slow and failed requests. */
.wait-detail,.wait-elapsed,.action-status{color:#cbb3c0}.wait-mark,.selection-response>span{color:#e5a0b7}.action-status.is-error{color:#ffb9c9}.form-error{color:#ffb9c9!important}form[aria-busy=true] .form-error{color:#cbb3c0!important}
.game-scene .sound-volume,.game-scene .sound-panel p{color:#cbb3c0}.game-scene .sound-panel .sound-error{color:#ffb9c9}.game-scene .sound-preview{background:#e5a0b7;color:#30141f;border-color:transparent}
.story-save-status{grid-column:1/-1;margin:4px 0;font-size:12px}.story-save-status button{min-height:44px;margin-left:8px}

/* The glass separates readable text from the photograph underneath. */
body.in-game{background:#190f16;--game-ivory:#f5e9ef;--game-gold:#e5a0b7;--game-muted:#bfa8b4;--game-wine:#281b24}
.game-scene.actor-stage{background:#190f16;padding-top:calc(62px + env(safe-area-inset-top,0px))}
.game-scene.actor-stage::before{filter:saturate(.65) brightness(.84)}
.game-scene.actor-stage::after{background:linear-gradient(0deg,#190f16b3,transparent 58%)}
.game-header{height:calc(62px + env(safe-area-inset-top,0px));padding:env(safe-area-inset-top,0px) 84px 0 24px;gap:16px;background:none;color:#f5e9ef}
.game-header button,.game-scene .scene-menu summary{border:1px solid #f5e9ef20;border-radius:22px;background:#21141e99;color:#f5e9ef;min-height:44px}
.game-header button{padding:8px 14px}.game-header .game-chapter{border:0;background:transparent;font:13px var(--sans)}
.game-back span{font-size:23px;letter-spacing:1px}.game-source-toggle span{font:13px var(--sans)}.game-scene .companion-top{top:calc(9px + env(safe-area-inset-top,0px));right:24px}
.game-scene.actor-stage .dialogue-card{border:1px solid #f4c6d82e;border-radius:24px;background:var(--glass);box-shadow:none;padding:16px 20px 12px;column-gap:12px;scroll-padding-bottom:62px}
.game-scene[data-dialogue-mode=reaction] .dialogue-card,.game-scene[data-dialogue-mode=chat] .dialogue-card{background:var(--glass);border-color:#f4c6d83d}
.game-scene .dialogue-heading{min-height:36px;margin-bottom:6px;gap:12px}.game-scene .dialogue-heading strong{color:#f2c4d5;font-size:24px;letter-spacing:1px}.game-scene .dialogue-heading:after{display:none}
.game-scene .source-chip{font:12px var(--sans);color:#cbb3c0}.game-scene .actor-direction{font:12px/1.6 var(--sans);color:#c5adba;min-height:0;margin:0 0 8px}
.game-scene .dialogue-scroll>p,.game-scene[data-dialogue-mode=reaction] .dialogue-scroll>p{font:18px/1.8 var(--sans);color:#f5e9ef}
.game-scene .actor-dialogue-hint{color:#c5adba}.game-scene .actor-chat-open{font:12px var(--sans);color:#efb8cc;border-radius:12px}.game-scene .actor-chat input{border-color:#af819777;border-radius:14px;background:#190f168c;font:16px var(--sans);color:#f5e9ef}.game-scene .actor-chat input::placeholder{color:#bfa8b4}
.game-scene .actor-chat button[type=submit]{border:0;border-radius:14px;background:#e5a0b7;color:#30141f;font-family:var(--sans)}
.game-scene .actor-choices button{background:#f5e9ef0a;border:1px solid #f4c6d82b;border-radius:14px;font:15px/1.5 var(--sans);color:#f5e9ef;min-height:46px;padding:10px 30px 10px 14px;max-width:none}
.game-scene .actor-choices button:hover{background:#e5a0b71f;border-color:#e5a0b77d}.game-scene .actor-choices button:active{background:#e5a0b735}.game-scene .actor-choices button:after{color:#dca1b8;font-size:20px}
.game-scene .dialogue-controls,.game-scene:not([data-dialogue-mode=lesson]) .dialogue-controls{background:#281b24;border-top:1px solid #f4c6d81f;padding-top:7px;margin-top:10px;gap:4px}
.game-scene .dialogue-controls .button{background:#e5a0b7;color:#30141f;border:0;border-radius:14px;font:14px var(--sans);padding:9px 14px;min-height:44px}
.game-scene .dialogue-controls .icon-button,.game-scene .voice-toggle{color:#cbb3c0;border-radius:12px;font:12px var(--sans)}.game-scene .dialogue-controls>span{font:12px var(--sans);color:#bfa8b4}
.game-scene .dialogue-actions>button{color:#dfb1c4;border-radius:12px}.game-scene .game-tools{background:#1f141ddb;border-radius:22px 22px 0 0;border-top:1px solid #f4c6d81f;gap:12px;padding:8px 24px calc(8px + env(safe-area-inset-bottom,0px))}
.game-scene .game-tools .interaction-rail{gap:8px}.game-scene .interaction-button,.game-scene .whisper-button,.game-scene .sound-toggle,.game-scene .sound-settings{border-radius:14px;color:#e6c5d4;font-family:var(--sans)}
.game-scene .interaction-button{background:#f5e9ef08}.game-scene .interaction-button small{color:#d9bac9;font-family:var(--sans)}.game-scene .whisper-button{background:#e5a0b712}.game-scene .heart-button svg{fill:#e5a0b71f;stroke:#e5a0b7}
.game-scene .scene-menu>div,.game-scene .sound-panel{background:var(--glass);border:1px solid #f4c6d833;border-radius:20px;box-shadow:none;color:#f5e9ef}.game-scene .scene-menu button,.game-scene .scene-menu label{color:#e2cbd7;font-family:var(--sans)}.game-scene .scene-menu select{background:#3a2633;color:#f5e9ef;border-radius:10px}
.company-invitation{background:#281b24d9;border-color:#efb8cc40;border-radius:18px;color:#f0c7d8;font-family:var(--sans)}
.game-body .source-pane{background:#281b24ed;color:#f5e9ef;border:1px solid #f4c6d82e;border-radius:24px;box-shadow:none}.drawer-heading,.game-body .source-toolbar,.game-body .source-footer{border-color:#e5a0b726}.drawer-heading span,.drawer-close,.game-body .source-footer,.game-body .paper-label{color:#bfa8b4}.game-body .paper-paragraph{font:16px/2 var(--sans)}.game-body .paper-paragraph.highlight{background:#e5a0b71c;box-shadow:none;border-radius:8px}.game-body .source-content .muted{color:#bfa8b4}
.in-game button:focus-visible,.in-game summary:focus-visible,.in-game input:focus-visible,.in-game select:focus-visible,.in-game .source-pane textarea:focus-visible{outline-color:#e5a0b7}.in-game ::selection{background:#824b62;color:#fff5fa}

.auth-page{background:#190f16;grid-template-columns:1.08fr 1fr;color:#f5e9ef}.auth-art{background-color:#281b24}.auth-art>.portrait{width:100%;height:100%}.auth-art:after{background:linear-gradient(0deg,#190f16f2,transparent 75%)}.auth-art h1{letter-spacing:2px}.auth-art>div:last-child{color:#f5e9ef}
.auth-panel{background:#190f16;padding:40px 6%}.auth-form-wrap{max-width:430px;padding:30px;border:1px solid #f4c6d82e;border-radius:28px;background:var(--glass)}
.auth-form-wrap>h1{font-size:30px;letter-spacing:0;color:#f5e9ef}.auth-form-wrap .auth-intro{color:#cbb3c0;font:15px/1.8 var(--sans);margin-bottom:24px}.auth-seal{border-color:#e5a0b740;color:#e5a0b7}
.auth-page #login-form label{color:#ddc3d1;font-size:14px}.auth-page #login-form input{background:#190f1680;border:1px solid #ba8c9f66;color:#f5e9ef;border-radius:14px;min-height:52px;font-size:16px}.auth-page #login-form input::placeholder{color:#bfa8b4}.auth-page #login-form input:focus{outline-color:#e5a0b7}
.auth-page #login-form>.button{background:#e5a0b7;color:#30141f;border-radius:16px;min-height:52px}.auth-page #login-form>.button:hover{background:#f0b4c8}.auth-page .auth-footer{border-color:#f4c6d826;color:#bfa8b4;font:12px/1.8 var(--sans)}.auth-form-wrap>.ambient-control{color:#d9bac9}

@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
 :root{--glass:#281b24dc}
 .game-scene.actor-stage .dialogue-card,.game-scene .scene-menu>div,.game-scene .sound-panel,.game-body .source-pane,.modal,.auth-form-wrap{backdrop-filter:blur(22px) saturate(115%);-webkit-backdrop-filter:blur(22px) saturate(115%)}
 .game-header button,.game-scene .scene-menu summary,.game-scene .game-tools,.company-invitation{backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
 .sidebar{backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
 .game-header .game-chapter{backdrop-filter:none;-webkit-backdrop-filter:none;border-radius:0}
 .auth-panel{background:transparent}.auth-page{background:#190f16 url('/assets/scenes/lamplight-v3.webp') center/cover fixed}.auth-page .auth-panel{background:#190f16d9}
}
@media(min-width:1000px){
 .game-scene.actor-stage{grid-template-columns:minmax(0,1.28fr) minmax(340px,.92fr);grid-template-rows:minmax(0,1fr) auto;column-gap:16px}
 .game-scene.actor-stage>.portrait{grid-column:1;grid-row:1;height:100%;min-height:0;justify-self:stretch}
 .game-scene.actor-stage .dialogue-card{grid-column:2;grid-row:1;align-self:end;justify-self:start;width:calc(100% - 28px);max-width:780px;min-height:min(340px,calc(var(--game-height) - 170px));margin:0 28px 28px 0;max-height:calc(var(--game-height) - 170px);padding:24px 28px 18px}
 .game-scene .dialogue-scroll{max-height:clamp(190px,32dvh,360px)}.game-scene .dialogue-scroll>p,.game-scene[data-dialogue-mode=reaction] .dialogue-scroll>p{font-size:20px;line-height:1.85}.game-scene .actor-choices{flex-direction:column;gap:10px;margin-top:14px}.game-scene .game-tools{grid-column:1/-1;grid-row:2}
 .game-scene .romance-touch{left:0;right:43%;top:calc(62px + env(safe-area-inset-top,0px));bottom:var(--tools-height,64px)}.game-scene .company-invitation{left:28px;bottom:calc(var(--tools-height,64px) + 18px)}
}
@media(min-width:1000px) and (max-width:1199px){.game-scene.actor-stage .dialogue-card{padding:20px 22px 14px}.game-scene .dialogue-scroll>p,.game-scene[data-dialogue-mode=reaction] .dialogue-scroll>p{font-size:18px}}
@media(max-width:999px){
 .game-scene.actor-stage{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(110px,1fr) auto auto}
 .game-scene.actor-stage .dialogue-card{width:calc(100% - 20px);max-width:680px;margin:0 10px 8px;max-height:min(38dvh,calc(var(--game-height)*.38));padding:10px 16px 8px;border-radius:24px}
 .game-scene .dialogue-heading{min-height:32px;margin:0;gap:8px}.game-scene .dialogue-heading strong{font-size:21px}.game-scene .actor-direction{font-size:11px;line-height:1.5;margin-bottom:5px}.game-scene .dialogue-scroll{max-height:78px}.game-scene .dialogue-scroll>p,.game-scene[data-dialogue-mode=reaction] .dialogue-scroll>p{font:16px/1.65 var(--sans)}
 .game-scene .actor-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px}.game-scene .actor-choices[hidden]{display:none}.game-scene .actor-choices button{font-size:14px;padding:9px 26px 9px 12px;min-height:44px;overflow-wrap:anywhere}
 .game-scene .dialogue-controls{margin-top:7px;padding-top:5px}.game-scene .dialogue-controls .button{font-size:13px;padding:8px 12px}.game-scene .actor-chat-open{font-size:12px}.game-scene .game-tools{padding:7px 10px calc(7px + env(safe-area-inset-bottom,0px));min-height:64px;gap:6px}
 .game-scene .game-tools .interaction-rail{gap:4px}.game-scene .interaction-button{padding:4px 6px}.game-scene .interaction-button small{font-size:10px}.game-scene .whisper-button{padding:4px 8px}.game-scene .sound-toggle{font-size:11px}.game-scene .interaction-buttons{gap:4px}
 .game-header{padding-left:12px;padding-right:66px;gap:8px}.game-header button{padding:7px 10px}.game-back span{font-size:19px}.game-scene .companion-top{right:12px}.game-source-toggle span{font-size:12px}
 .game-scene .romance-touch{top:calc(62px + env(safe-area-inset-top,0px));left:0;right:0;bottom:calc(var(--dialogue-height,240px) + var(--tools-height,64px))}
 .game-body .source-pane{top:calc(66px + env(safe-area-inset-top,0px));right:8px;bottom:8px;width:calc(100% - 16px);border-radius:24px}
}
@media(max-width:550px){
 .hero-photo{inset:0}.hero-photo:after{background:linear-gradient(0deg,#190f16f5 2%,#190f16c9 40%,transparent 78%)}.hero .pill{background:#281b24dc;border-color:#e5a0b74d;color:#efc0d1}
 .main:not(.reading-main){padding-left:18px;padding-right:18px}.hero{border-radius:22px}.hero-copy{padding:26px 22px}.hero h2{font-size:27px}.hero-actions{gap:10px}.hero-actions .button{min-height:46px;padding:12px 15px}
 .auth-page{display:block;min-height:100svh;background-attachment:scroll}.auth-art{height:190px;min-height:0;background:none}.auth-art>.portrait{left:auto;right:0;width:58%;height:100%}.auth-art:after{background:linear-gradient(90deg,#190f16dd,transparent 90%)}.auth-art>div:last-child{left:24px;bottom:35px;max-width:50%}.auth-art h1{font-size:27px}.auth-art p{font:12px/1.8 var(--sans)}
 .auth-panel{padding:0 16px 24px;background:transparent!important}.auth-form-wrap{padding:22px;border-radius:24px;max-width:460px}.auth-form-wrap>h1{font-size:27px}.auth-form-wrap .auth-intro{font-size:14px;margin-bottom:20px}#login-form{gap:14px}.auth-footer{margin-top:16px;padding-top:14px}
 .modal-backdrop{padding:16px}.modal{padding:28px 22px;max-height:calc(100dvh - 32px)}.modal h2{font-size:24px}.preparation-companion>div:last-child{color:#efd1df}
}
@media(max-width:360px){.game-header{padding-left:8px;gap:5px}.game-header button{padding:7px 8px}.game-back span{font-size:17px}.game-source-toggle span{font-size:11px}.game-scene.actor-stage .dialogue-card{width:calc(100% - 16px);margin-left:8px;margin-right:8px;padding-left:12px;padding-right:12px}.game-scene .dialogue-heading strong{font-size:19px}.game-scene .dialogue-controls .button{font-size:12px;padding:8px}.game-scene .game-tools{gap:2px;padding-left:6px;padding-right:6px}.game-scene .game-tools .interaction-rail{gap:2px}.game-scene .whisper-button{min-width:50px;padding:4px}.game-scene .interaction-buttons{gap:2px}.auth-form-wrap{padding:20px}}
@media(max-height:620px) and (max-width:999px){.game-scene.actor-stage{padding-top:52px;grid-template-rows:minmax(90px,1fr) auto auto}.game-header{height:52px;padding-top:0}.game-scene .companion-top{top:4px}.game-scene.actor-stage .dialogue-card{max-height:min(49dvh,calc(var(--game-height) - 52px - 90px - var(--tools-height,64px) - 8px));padding-top:7px;padding-bottom:6px}.game-scene .dialogue-scroll{max-height:56px}.game-scene .dialogue-heading strong{font-size:19px}.game-scene .game-tools{min-height:58px;padding-top:4px;padding-bottom:4px}.game-scene .romance-touch{top:52px}.auth-art{height:145px}}
@media(prefers-reduced-transparency:reduce){:root{--glass:#281b24}.game-scene.actor-stage .dialogue-card,.game-scene .scene-menu>div,.game-scene .sound-panel,.game-body .source-pane,.modal,.auth-form-wrap,.game-scene .game-tools,.sidebar,.game-header button,.company-invitation{backdrop-filter:none;-webkit-backdrop-filter:none;background:#281b24}}
