*{box-sizing:border-box}body{margin:0;color:#433739;background:#f5eee8;font-family:system-ui,"Yu Gothic",sans-serif}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;color:inherit;background:#fff9f3;border:1px solid #d9c9c4;border-radius:8px;padding:13px 18px;min-height:48px}button:hover{background:#eee0db}button:disabled{opacity:.45;cursor:default}a{color:inherit;text-decoration:none}button:focus-visible,a:focus-visible{outline:3px solid #b26077;outline-offset:3px}[hidden]{display:none!important}header{max-width:1360px;margin:auto;display:flex;justify-content:space-between;align-items:center;padding:18px 32px;font-size:12px;letter-spacing:2px}header i{color:#ad657b;font-style:normal}header button{border:0;background:transparent}main{max-width:1280px;margin:auto;padding:10px 32px 30px}#cover{display:grid;grid-template-columns:1.3fr 1fr;background:#fffaf4;border:1px solid #decfc4;border-radius:18px;overflow:hidden;box-shadow:0 24px 65px #65423b12}.cover-picture{position:relative;min-height:600px}.cover-picture>img{width:100%;height:100%;object-fit:cover;object-position:50% 30%;position:absolute}.cover-picture>span{position:absolute;bottom:24px;left:24px;font-size:10px;letter-spacing:3px;background:#fff9efdc;padding:12px}.cover-copy{padding:65px 38px;background:radial-gradient(ellipse at 90% 100%,#ead9e5,transparent 65%)}.eyebrow{font-size:10px;letter-spacing:2px;color:#95616f}h1{font-family:"Yu Mincho",serif;font-size:clamp(28px,3vw,44px);line-height:1.65;font-weight:500;letter-spacing:2px;margin:25px 0}h1 em{font-style:normal;color:#9d536a}.cover-copy>p:not(.eyebrow){line-height:2.3;font-size:14px}.cover-buttons{display:flex;flex-wrap:wrap;gap:12px;margin:28px 0}.primary{background:#875568;border-color:#875568;color:white;box-shadow:0 6px 16px #87556822}.primary:hover{background:#6e4253}.cover-copy small{display:block;font-size:11px;line-height:2;color:#796b68}#save-status{font-size:11px;line-height:1.9;color:#766965;margin:24px 0;text-align:center}.chapter-bar{display:flex;justify-content:space-between;gap:12px;padding:14px 3px;font-size:12px;letter-spacing:1px}.story-layout{display:grid;grid-template-columns:42% 58%;border:1px solid #decfc4;border-radius:14px;overflow:hidden;background:#fffaf5;box-shadow:0 15px 50px #65423b0e}.scene-visual{position:relative;min-height:650px;overflow:hidden;background:#d8c3bd}#cast-image{width:100%;height:100%;position:absolute;object-fit:cover;object-position:16% 30%;transition:object-position .5s}.scene-visual:after{content:"";position:absolute;inset:45% 0 0;background:linear-gradient(transparent,#231b29da);pointer-events:none}.scene-caption{position:absolute;bottom:110px;left:28px;color:white;z-index:1}.scene-caption small{letter-spacing:3px}.scene-caption h2{font-family:"Yu Mincho",serif;font-weight:500;font-size:30px;margin:12px 0}.protagonist{position:absolute;bottom:12px;left:20px;display:flex;gap:12px;align-items:center;z-index:1;color:white;font-size:11px}.protagonist img{height:92px;width:78px;object-fit:contain;filter:drop-shadow(0 3px 8px #0008)}.protagonist b{font-size:14px;line-height:2}#story-panel{padding:30px 34px;outline:none}#lines p{font-size:15px;line-height:2.1;letter-spacing:.3px;margin:0 0 19px}#reply{background:#f0e3e6;border-left:3px solid #b37990;border-radius:4px;padding:14px 17px;margin-bottom:23px;font-size:13px;line-height:1.9}.choice-label{font-size:11px;color:#916d75;letter-spacing:2px;margin:26px 0 12px}#choices{display:grid;gap:10px}#choices button{text-align:left;font-size:13px;line-height:1.7;min-height:54px;padding:14px 18px;background:white;border-color:#dac6cd}#choices button:hover{background:#f3e5e9;border-color:#ad7185}.reader-actions{display:flex;justify-content:space-between;margin-top:22px}.reader-actions button{border:0;background:none;font-size:12px;padding:10px 0}#affinities{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:20px 0}.affinity{background:#fff9f3;border:1px solid #dfd0ca;border-radius:9px;padding:16px}.affinity b{font-size:13px}.affinity small{display:block;font-size:10px;color:#796b68;margin:8px 0;line-height:1.8}.affinity meter{width:100%;height:12px;accent-color:#a67187}.affinity span{font-size:11px;color:#95616f}#ending{border:1px solid #decfc4;border-radius:18px;overflow:hidden;background:#fffaf4}#ending>img{display:block;width:100%;max-height:420px;object-fit:cover;object-position:50% 25%}#ending>div{max-width:740px;margin:auto;padding:35px}#ending-text{line-height:2.3}#ending a{display:inline-block;margin:20px;font-size:12px}dialog{border:1px solid #decfc4;border-radius:14px;background:#fffaf4;color:#433739;padding:30px;max-width:min(580px,calc(100vw - 30px));max-height:85dvh;overflow:auto}dialog::backdrop{background:#33252d99;backdrop-filter:blur(4px)}.close{float:right;border:0;background:none}.memory{border-top:1px solid #decfc4;padding:18px 0}.memory h3{font-size:15px}.memory p,dialog>p{font-size:13px;line-height:1.9}#erase{margin-top:20px;font-size:12px}
@media(max-width:760px){header{padding:8px 16px;font-size:10px;letter-spacing:1px}main{padding:4px 14px 20px}#cover{display:block}.cover-picture{min-height:0;height:300px}.cover-picture>img{object-position:50% 22%}.cover-picture>span{font-size:8px;bottom:12px;left:12px}.cover-copy{padding:24px}.cover-copy h1{margin:15px 0;font-size:31px}.cover-copy>p:not(.eyebrow){font-size:13px}.cover-buttons{margin:22px 0}.story-layout{display:block}.scene-visual{min-height:0;height:260px}#cast-image{object-position:50% 22%!important}.scene-caption{bottom:8px;left:auto;right:20px;text-align:right}.scene-caption h2{font-size:22px;margin:5px 0}.scene-caption small{font-size:10px}.protagonist{bottom:6px;left:10px}.protagonist img{height:80px;width:65px}#story-panel{padding:24px 20px}#lines p{font-size:14px;line-height:2}#affinities{gap:6px}.affinity{padding:10px}.affinity small{font-size:9px}.affinity b{font-size:11px}#ending>div{padding:24px}#ending h1{font-size:28px}.chapter-bar{font-size:10px}#save-status{text-align:left}}
@media(max-height:500px) and (min-width:761px){.scene-visual{min-height:500px}.cover-picture{min-height:450px}.cover-copy{padding:25px}.scene-caption{position:sticky;top:230px;padding:15px}#story-panel{padding:24px}}@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
/* Conversation edition */
#legacy-note{font-size:11px!important;line-height:1.8!important;color:#8e6473;border-top:1px solid #dbc7ce;padding-top:14px}#album-count{letter-spacing:0;font-size:10px;margin-left:4px}.sound-bar{display:flex;align-items:center;gap:14px;padding:0 0 12px;font-size:11px;color:#775b68}.sound-bar button{padding:7px 14px;min-height:38px;font-size:12px;border-radius:30px}.sound-bar label{margin-left:auto;display:flex;align-items:center;gap:10px}.sound-bar input{width:88px;accent-color:#946477}.novel-stage{position:relative;height:610px;overflow:hidden;border-radius:16px;background:#282333;isolation:isolate;box-shadow:0 18px 50px #3b253a22}#backdrop{position:absolute;inset:0;background-image:url('assets/art/romance-backgrounds.webp');background-size:200% 300%;z-index:-4}.stage-shade{position:absolute;inset:0;background:linear-gradient(#17132245,transparent 30%,#18101c85);z-index:-3}.location-label{position:absolute;top:22px;left:24px;color:#fff9ef;font-size:12px;letter-spacing:2px;padding:10px 18px;border-left:2px solid #efd8b4;background:#271c2b80;backdrop-filter:blur(8px)}#cast{position:absolute;left:8%;right:8%;bottom:204px;display:flex;align-items:end;justify-content:center;gap:24px;pointer-events:none}.portrait{position:relative;width:min(30%,280px);filter:brightness(.76) saturate(.75);transform:translateY(8px) scale(.96);transition:filter .35s,transform .35s;animation:enter-person .5s ease both}.portrait.speaking{filter:none;transform:translateY(0) scale(1.03);z-index:2}.portrait-art{width:100%;aspect-ratio:1;background-image:url('assets/art/romance-expressions.webp');background-size:300% 400%;border-radius:100px 100px 16px 16px;box-shadow:0 10px 35px #21172455;border:2px solid #fff5}.portrait.speaking .portrait-art{border-color:var(--person-color);box-shadow:0 0 0 4px #fff2,0 12px 50px #25122c88}.portrait>span{display:block;text-align:center;color:#fff7ed;font-size:11px;letter-spacing:3px;margin-top:10px;text-shadow:0 2px 8px #000}#cast[data-count='1'] .portrait{width:310px;max-width:48%}#opening-title{position:absolute;inset:120px 30px auto;text-align:center;color:white;text-shadow:0 4px 24px #231022}#opening-title small{display:block;font-size:11px;letter-spacing:7px;margin-bottom:24px}#opening-title span{font:32px/1.8 'Yu Mincho',serif;letter-spacing:5px}.speech{position:absolute;bottom:24px;left:5%;right:5%;padding:20px 28px 13px;background:#fffaf4f5;border:1px solid #ffe5ed;border-radius:16px;box-shadow:0 8px 25px #24112735;outline:none;min-height:156px;cursor:pointer}.speech.character:before{content:'';position:absolute;top:-12px;left:15%;width:22px;height:22px;background:#fffaf4;transform:rotate(45deg);border-top:1px solid #ffe5ed;border-left:1px solid #ffe5ed}.speech.you{left:12%;right:3%;background:#f8e9f1f7;border-color:#e3b6cb}.speech.you:before{content:'';position:absolute;right:35px;top:-11px;width:20px;height:20px;transform:rotate(45deg);background:#f8e9f1}.speech.narrator{background:#201c31e6;color:#fff9f0;border-color:#ffffff30;backdrop-filter:blur(10px)}.speech.narrator #speaker{color:#e9c9b8}.speech-heading{display:flex;align-items:center;gap:12px;min-height:22px}#speaker{font-size:13px;font-weight:700;color:#654252;border-bottom:2px solid var(--speaker-color);padding-bottom:3px}.speech-heading small{font-size:10px;color:#9d7b87}#you-icon{width:26px;height:26px;object-fit:contain}#line{font-size:17px;line-height:1.9;letter-spacing:.5px;min-height:65px;margin:13px 0 4px;white-space:pre-wrap}.speech.narrator #line{font-family:'Yu Mincho',serif}.speech-footer{display:flex;justify-content:space-between;align-items:center;gap:10px}.speech-footer>span{font-size:10px;opacity:.6}#next{min-height:38px;background:none;border:0;font-size:12px;padding:5px 10px;color:inherit}.speech:focus-visible{outline:3px solid #dfb1c8;outline-offset:-5px}#choice-panel{padding:18px 22px 24px;background:#fff9f4;border:1px solid #ddc9d1;border-top:0;border-radius:0 0 14px 14px;animation:choices-in .25s ease}#choice-panel .choice-label{margin:0 0 12px}#choices{grid-template-columns:repeat(2,minmax(0,1fr))}#choices button{border-radius:9px;position:relative;padding-right:27px}#choices button:after{content:'›';position:absolute;right:12px;top:50%;transform:translateY(-50%);color:#aa7b8e}.reader-actions{margin-top:10px;align-items:center;flex-wrap:wrap;gap:8px}.reader-actions>div{display:flex;align-items:center;gap:18px}.reader-actions button{min-height:44px}.speed-label{font-size:11px}select{font:inherit;color:inherit;background:#fff9f4;border:1px solid #d9c9c4;border-radius:6px;padding:6px;min-height:36px}#relationships{margin-top:8px;border-top:1px solid #deccd2;padding:15px 0}#relationships summary{cursor:pointer;font-size:12px;color:#8a6878;min-height:32px}#relationships>p{font-size:11px;color:#8a6878}#affinities{margin:8px 0}#log-dialog{width:650px}#log-lines{display:grid;gap:14px}.log-line{margin:0;line-height:1.9;font-size:13px;border-bottom:1px solid #eadde1;padding-bottom:12px}.log-line b{display:block;font-size:11px;color:#98758a;margin-bottom:4px}#weather,#event-effect{position:absolute;inset:0;pointer-events:none;z-index:-1}.petals{background-image:radial-gradient(ellipse at center,#ffdbebbb 0 2px,transparent 4px),radial-gradient(ellipse at center,#ffebeeaa 0 3px,transparent 5px);background-size:137px 193px,257px 231px;animation:petals 16s linear infinite}.rain{background-image:repeating-linear-gradient(105deg,transparent 0 26px,#dce4ff33 27px,transparent 28px 51px);animation:rain .8s linear infinite;opacity:.6}.lanterns{background:radial-gradient(ellipse at 15% 20%,#ffc97633,transparent 35%),radial-gradient(ellipse at 80% 40%,#ffc97622,transparent 25%);animation:glow 4s ease-in-out infinite alternate}#event-effect.blackout{background:#070611;animation:blackout 2.6s ease-out both}#event-effect.gust{background:linear-gradient(115deg,transparent,#ffe7f088,transparent);animation:gust 1s ease-out both}#event-effect.bump{background:#ffd8a922;animation:glow .15s 2}.novel-stage:has(.blackout) #backdrop{filter:brightness(.6)}
@keyframes enter-person{from{opacity:0;translate:0 9px}to{opacity:1;translate:0 0}}@keyframes choices-in{from{opacity:0;translate:0 8px}to{opacity:1;translate:0 0}}@keyframes petals{to{background-position:160px 610px,-100px 610px}}@keyframes rain{to{background-position:-30px 120px}}@keyframes glow{to{opacity:.35}}@keyframes blackout{0%,25%{opacity:.98}100%{opacity:.25}}@keyframes gust{from{translate:-100% 0;opacity:1}to{translate:100% 0;opacity:0}}
@media(min-width:1100px){#reader{max-width:1120px;margin:auto}.novel-stage{height:650px}#cast{bottom:208px}.portrait{width:290px}}
@media(max-width:760px){.sound-bar{gap:8px;font-size:10px}.sound-bar label{gap:4px}.sound-bar input{width:56px}.sound-bar button{padding:5px 10px;font-size:11px}#track-name{max-width:115px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.novel-stage{height:560px;border-radius:12px}.location-label{top:14px;left:12px;font-size:10px;letter-spacing:1px;padding:8px 12px}#cast{left:3%;right:3%;bottom:245px;gap:6px}.portrait{width:33%;transform:translateY(5px) scale(.96)}.portrait-art{border-radius:60px 60px 9px 9px}.portrait>span{font-size:9px;letter-spacing:1px;margin-top:7px}#cast[data-count='1'] .portrait{width:230px;max-width:67%}#cast[data-count='2'] .portrait{width:44%}.speech{bottom:15px;left:4%;right:4%;padding:16px 18px 10px;min-height:204px}.speech.you{left:7%;right:3%}#line{font-size:15px;line-height:1.85;min-height:110px;margin:10px 0 3px}.speech-heading{gap:8px}#speaker{font-size:12px}.speech-footer>span{font-size:9px}#opening-title{top:105px}#opening-title span{font-size:27px;letter-spacing:3px}#choices{grid-template-columns:1fr}#choices button{font-size:13px;min-height:50px;padding:12px 26px 12px 14px}#choice-panel{padding:17px 15px}.reader-actions>div{gap:12px;flex-wrap:wrap}.reader-actions button{font-size:11px}.reader-actions{justify-content:space-between}.speed-label{font-size:10px}.cover-picture{height:310px}#album-count{display:none}}
@media(max-width:360px){.novel-stage{height:595px}.speech{min-height:240px}#cast{bottom:279px}#line{font-size:14px;min-height:142px}.speech-footer>span{font-size:8px}}
@media(max-height:500px) and (min-width:600px){main{padding-top:0}.novel-stage{height:400px}#cast{bottom:160px;left:14%;right:14%;gap:16px}.portrait,#cast[data-count='1'] .portrait{width:180px}.speech{bottom:12px;min-height:136px;left:5%;right:5%;padding:12px 22px 8px}#line{font-size:14px;min-height:48px;margin:5px 0}.location-label{top:10px}.portrait>span{font-size:9px}#opening-title{top:75px}#opening-title span{font-size:25px}.sound-bar{padding-bottom:8px}.chapter-bar{padding:8px 3px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}#event-effect.blackout{opacity:.2}}
/* Keep background perspective and portraits steady while dialogue changes. */
#backdrop{left:50%;right:auto;width:auto;height:100%;aspect-ratio:16/9;min-width:100%;transform:translateX(-50%)}.portrait{animation:none}.portrait.entering{animation:enter-person .5s ease both}
.speech.character:before{left:var(--tail,50%)}
/* Chapter doors, individual expression atlases, and the walkable classroom. */
.hero-face{display:inline-block;width:44px!important;height:44px!important;flex:none;border-radius:50%;background-repeat:no-repeat;background-size:300% 200%;box-shadow:0 0 0 2px #e4becf}.speech.you .speech-heading{min-height:44px}.speech.you{padding-top:13px}.cast-banner{display:flex;align-items:center;justify-content:center;gap:0;min-height:410px;background:linear-gradient(150deg,#ffe8ca99,#d6b8ce77),url('assets/art/romance-backgrounds.webp') left top/200% 300%;padding:35px 5px}.banner-face{width:33.333%;aspect-ratio:1;background-repeat:no-repeat;box-shadow:0 15px 40px #3a273433;border-radius:100px 100px 8px 8px}.banner-face:nth-child(1){transform:translateY(25px) rotate(-4deg)}.banner-face:nth-child(3){transform:translateY(25px) rotate(4deg)}.cover-picture .cast-banner{height:100%;min-height:600px}#ending>.cast-banner{max-width:none;padding:35px 12%;margin:0;min-height:350px}.chapter-transition{width:760px;max-width:calc(100vw - 30px);padding:64px 35px;text-align:center;background:radial-gradient(ellipse at 50% 0,#5d405b,#201d32 70%);color:#fff4ec;border:1px solid #c6a087;box-shadow:0 0 80px #b0898222}.chapter-transition[open]{animation:chapter-enter .7s ease both}.chapter-transition::backdrop{background:#181425ee;backdrop-filter:blur(14px)}.chapter-decoration{font-size:40px;color:#e8c6a4}.chapter-transition .eyebrow{color:#d6b4b6;letter-spacing:8px;margin:22px 0}.chapter-transition h1{font-size:40px;letter-spacing:5px;margin:14px 0 24px}.chapter-transition #chapter-time{font-size:12px;color:#d9bda6;letter-spacing:2px}.chapter-transition #chapter-description{font-size:14px;color:#e9d9e1;margin:22px 0 35px}.chapter-transition button{background:#a47787;border-color:#d0a9b7}#classroom-dialog{width:1140px;max-width:calc(100vw - 24px);max-height:95dvh;padding:24px;background:#fbf6ed}.room-header{display:flex;justify-content:space-between;gap:15px;align-items:center}.room-header h2{font-family:'Yu Mincho',serif;font-weight:500;font-size:25px;margin:6px 0}.room-header .eyebrow{margin:0}#room-intro{margin:12px 0 18px;font-size:12px}.room-layout{display:grid;grid-template-columns:minmax(0,1fr) 200px;gap:22px}#room-canvas{display:block;width:100%;height:auto;aspect-ratio:3/2;border:1px solid #c5ad89;border-radius:8px;touch-action:none;background:#dbc6a4}#room-canvas:focus-visible{outline:3px solid #b48b9d;outline-offset:3px}.room-guide h3{font-size:14px;margin:2px 0 12px}.room-guide p{font-size:12px;line-height:1.8}.room-guide small{font-size:10px;color:#846e71;line-height:1.8}#room-destinations{display:grid;gap:6px}#room-destinations button{font-size:12px;padding:8px 10px;min-height:42px;text-align:left}.room-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px}.dpad{display:grid;grid-template-columns:repeat(3,48px);grid-template-rows:repeat(2,44px);gap:4px;touch-action:none}.dpad button{padding:4px;min-height:44px;font-size:22px;touch-action:none;user-select:none}.dpad button:first-child{grid-column:2}.dpad button:nth-child(2){grid-column:1;grid-row:2}.dpad button:nth-child(3){grid-column:2;grid-row:2}.dpad button:nth-child(4){grid-column:3;grid-row:2}#room-interact{font-size:12px;min-height:52px}.room-talk-copy h2{font:26px 'Yu Mincho',serif}.room-talk-copy>p:not(.eyebrow){font-size:16px;line-height:2;min-height:96px}#room-talk-dialog{width:770px;max-width:calc(100vw - 24px);padding:30px}#room-talk-dialog[open]{display:grid;grid-template-columns:230px 1fr;gap:28px;align-items:center}#room-face{width:230px;aspect-ratio:1}.room-talk-copy .cover-buttons{margin:18px 0 0}.room-talk-copy button{font-size:12px}@keyframes chapter-enter{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:760px){.cover-picture .cast-banner{min-height:310px}.cast-banner{min-height:260px;padding:25px 8px}#ending>.cast-banner{min-height:230px;padding:25px 15px}.chapter-transition{padding:40px 23px}.chapter-transition h1{font-size:29px}.chapter-transition #chapter-description{font-size:13px}.chapter-transition .eyebrow{letter-spacing:5px}#classroom-dialog{padding:16px;max-height:96dvh}.room-header{align-items:start}.room-header h2{font-size:21px}.room-header button{font-size:11px;padding:8px}.room-layout{display:block}.room-guide{margin-top:18px}.room-guide>p:first-of-type{font-size:11px}#room-destinations{grid-template-columns:repeat(2,minmax(0,1fr))}#room-intro{font-size:11px}.room-controls{gap:8px}.dpad{grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px)}#room-interact{max-width:145px;font-size:11px;padding:10px}.room-guide small{display:none}#room-talk-dialog[open]{grid-template-columns:1fr;gap:16px;padding:22px}#room-face{width:min(230px,70%);margin:auto}.room-talk-copy h2{font-size:22px;margin:10px 0}.room-talk-copy>p:not(.eyebrow){font-size:14px;min-height:70px}.room-talk-copy .eyebrow{text-align:center}.room-talk-copy .cover-buttons{margin-top:14px}.room-talk-copy button{padding:10px 12px}.hero-face{width:36px!important;height:36px!important}.speech.you .speech-heading{min-height:36px}}
@media(max-height:500px) and (min-width:600px){.chapter-transition{padding:22px}.chapter-decoration{font-size:24px}.chapter-transition .eyebrow{margin:10px}.chapter-transition h1{font-size:29px;margin:8px}.chapter-transition #chapter-description{margin:15px}.room-layout{grid-template-columns:minmax(0,1fr) 180px;display:grid}#room-talk-dialog[open]{grid-template-columns:180px 1fr;gap:22px}#room-face{width:180px}.room-talk-copy>p:not(.eyebrow){font-size:14px}.hero-face{width:28px!important;height:28px!important}.speech.you .speech-heading{min-height:28px}}
/* Classroom toolbar remains legible on narrow phones. */
.room-header{flex-wrap:wrap}.room-header>div{flex:1;min-width:180px}#room-zoom{font-size:11px;padding:8px 12px;min-height:40px}.room-header #room-exit{order:3}#room-zoom{order:2}@media(max-width:760px){.room-header>div{flex-basis:100%}.room-header #room-exit{margin-left:auto}.room-header{gap:8px}#room-zoom{font-size:10px}.room-talk-copy .cover-buttons{flex-wrap:wrap}}
