:root{--text-scale:1}.words{font-size:calc(17px * var(--text-scale));max-height:27dvh;overflow-y:auto;overscroll-behavior:contain}.dialogue:has(#choices:not(:empty)) .words{font-size:calc(12px * var(--text-scale))}#choices button{font-size:calc(14px * var(--text-scale))}.replay p,.text-preview{font-size:calc(15px * var(--text-scale))}.replay b{font-size:calc(12px * var(--text-scale))}.end-message{font-size:calc(14px * var(--text-scale))!important}.dialogue{max-height:65dvh;overflow:visible}#choices{max-height:36dvh;overflow-y:auto}.text-preview{padding:12px;background:#eeefdf;border-radius:8px}.display-settings{border-bottom:1px solid var(--line);padding-bottom:14px}#rotate-hint{position:fixed;top:12px;left:4%;right:4%;z-index:110;display:flex;align-items:center;gap:10px;padding:12px;background:#fff8e6;box-shadow:0 4px 30px #0004;border-radius:10px;font-size:12px}#rotate-hint button{margin-left:auto;padding:8px}.small-buttons{flex-wrap:wrap}html:fullscreen{background:var(--paper)}
@media(max-width:800px){.words{font-size:calc(15px * var(--text-scale))}#choices button{font-size:calc(13px * var(--text-scale))}}
@media(orientation:landscape) and (max-height:540px){
 body{padding:0}.game{height:100dvh;min-height:0}.game-top{top:0;padding:3px max(12px,env(safe-area-inset-right)) 3px max(12px,env(safe-area-inset-left));height:42px;flex-wrap:nowrap;gap:8px}.game-top .mini-brand{font-size:12px;white-space:nowrap}.chapter{order:0;width:auto;font-size:10px;padding:5px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-button{padding:5px 12px;min-height:34px}.day-card{display:none}.actor{inset:40px 40% 42px 0}.game .scene-bg.cg{inset:40px 0 42px;background-size:contain;background-position:left center;background-repeat:no-repeat}.game:has(.scene-bg.cg)::before{content:'';position:absolute;inset:0;background:var(--scene-image) center/cover;filter:blur(22px) brightness(.45)}.game.hide-interface .scene-bg.cg{inset:0;background-position:center}.game .dialogue{left:auto;right:max(14px,env(safe-area-inset-right));bottom:49px;width:44%;min-height:0;max-height:calc(100dvh - 115px);padding:25px 18px 32px}.speaker{top:-16px;left:14px;min-width:90px;font-size:12px;padding:7px 15px}.words{font-size:calc(14px * var(--text-scale));line-height:1.65;min-height:0;max-height:calc(100dvh - 178px)}.dialogue:has(#choices:not(:empty)){padding:22px 12px 12px}.dialogue:has(#choices:not(:empty)) .words{font-size:calc(11px * var(--text-scale));max-height:45px;margin-bottom:7px}#choices{max-height:calc(100dvh - 190px);gap:6px}#choices button{font-size:calc(12px * var(--text-scale));padding:8px;min-height:40px}#choices span{margin-right:8px}.game-bottom{left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));bottom:env(safe-area-inset-bottom);height:42px;flex-direction:row;justify-content:flex-end;gap:5px}.game-bottom>span{display:none}.game-bottom>div{flex-wrap:nowrap;gap:2px}.game-bottom button{font-size:10px;padding:8px 9px;min-height:34px;margin:0}.next{right:10px;bottom:5px}.restore-ui{bottom:12px;right:12px}
 .title-screen{height:100dvh;min-height:360px}.brand{padding:10px 4%;font-size:10px}.edition{font-size:8px}.title-art{background-size:cover;background-position:65% center}.title-wash{background:linear-gradient(90deg,#fcfaf2f7 0%,#fcfaf2e8 35%,#fcfaf230 68%,transparent)}.title-copy{margin:0 0 0 5%;width:55%;max-width:470px}.title-copy h1{font-size:36px;line-height:1.15;margin:8px 0}.title-copy h1 br{display:none}.title-copy .eyebrow{margin:5px 0;font-size:9px}.subtitle{font-size:10px;margin:10px 0}.title-buttons{width:300px;max-width:100%;gap:4px}.title-buttons>button{padding:7px 16px;font-size:12px}.small-buttons button{font-size:10px;padding:7px}.title-note{margin:7px 0;font-size:9px}.title-footer{bottom:5px;font-size:9px}.title-footer>span{max-width:none}.title-footer button{padding:5px}
 .map-screen{padding:8px max(15px,env(safe-area-inset-right))}.map-intro{margin:8px 0}.map-intro h2{font-size:21px;margin:5px}.map-intro p{margin:5px}.cast-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.cast-card{padding:10px;border-radius:40px 40px 10px 10px}.portrait{height:125px;margin:5px 0}.cast-copy h3{font-size:17px}.card-label{font-size:9px;margin:0}.cast-copy p{display:none}.cast-copy>span{font-size:10px}.bond-dots{margin-top:8px;gap:5px}.social-entry{padding:10px}.map-footer{margin:5px auto;font-size:10px}
 dialog{max-height:94dvh;width:94vw}.modal-head{padding:8px 16px}.modal-head h2{font-size:17px}.modal-body{padding:12px 18px}.social-portraits{height:120px}.end-screen{padding:12px}.end-paper{padding:20px 28px;border-radius:35px;max-width:700px}.end-flower{font-size:25px;margin:5px}.end-paper h2{margin:8px}.end-message{margin:12px 0}.end-note{margin:8px}
 #ending-film .film-art{inset:0}#ending-film .film-shade{background:linear-gradient(90deg,#071b1920 0%,#071b1940 45%,#071b19ef 72%,#071b19f5)}#ending-film .film-heading{top:4%;left:4%}#ending-film .film-heading span{font-size:17px}#ending-film .film-credits{top:14%;bottom:17%;right:3%;width:36%}#ending-film .film-caption{top:auto;bottom:22%;left:4%;right:auto;max-width:55%;font-size:15px;text-align:left}#ending-film .film-controls{bottom:3%}#ending-film .film-roll dd{font-size:17px}
}
/* Keep the complete four-person illustration separate from title controls. */
.title-screen{display:grid;grid-template-columns:minmax(300px,36%) minmax(0,1fr);grid-template-rows:auto 1fr auto;gap:0 2%;padding:0 3%;background:radial-gradient(ellipse at 75% 45%,#e7edd9,#fcfaf2 70%)}
.title-wash{display:none}.title-screen .brand{grid-column:1/-1;padding:24px 1.5%}
.title-screen .title-art{position:relative;inset:auto;grid-column:2;grid-row:2;align-self:center;width:100%;aspect-ratio:16/9;background-position:center;background-size:contain;background-color:transparent;border-radius:18px;box-shadow:0 18px 55px #405b4225;overflow:hidden}
.title-screen .title-copy{grid-column:1;grid-row:2;align-self:center;margin:0;padding:16px 5%;width:100%;max-width:none}
.title-screen .title-copy h1{font-size:clamp(44px,5.2vw,78px)}
.title-screen .title-buttons{width:100%;max-width:320px}.title-screen .small-buttons{flex-wrap:wrap;justify-content:flex-start;gap:3px}
.title-screen .title-note{line-height:1.8}.title-screen .title-footer{position:static;grid-column:1/-1;padding:20px 1.5%;gap:14px}
@media(max-width:800px) and (orientation:portrait){
 .title-screen{height:auto;min-height:100svh;grid-template-columns:1fr;grid-template-rows:auto auto 1fr auto;padding:0 5%;gap:0}
 .title-screen .brand{padding:15px 0}.title-screen .title-art{grid-column:1;grid-row:2;border-radius:12px}
 .title-screen .title-copy{grid-column:1;grid-row:3;padding:18px 3% 8px}.title-screen .title-copy h1{font-size:42px;margin:8px 0}
 .title-screen .subtitle{margin:12px 0 18px}.title-screen .title-buttons{max-width:none}.title-screen .title-footer{grid-row:4;padding:14px 3%}
}
@media(orientation:landscape) and (max-height:540px){
 .title-screen{height:100dvh;min-height:360px;grid-template-columns:minmax(260px,40%) minmax(0,1fr);padding:0 2%;gap:0 2%}
 .title-screen .brand{padding:8px 1%}.title-screen .title-copy{padding:0 2%}.title-screen .title-copy h1{font-size:32px;margin:6px 0}.title-screen .title-art{border-radius:10px}
 .title-screen .subtitle{margin:7px 0}.title-screen .title-note{font-size:8px;margin:5px 0}.title-screen .title-footer{padding:4px 1%;font-size:8px}
}
.name-setting{padding:4px 0 18px;border-bottom:1px solid var(--line);margin-bottom:16px}
#traveler-name{display:block;width:100%;margin:8px 0;padding:12px 14px;border:1px solid var(--line);border-radius:8px;background:#fffdf8;color:var(--ink);font-size:18px}
.name-suggestions,.name-actions{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}.name-suggestions button{padding:8px 15px}#traveler-name-error{color:#9e473e;min-height:1.5em}

.name-suggestions button{text-align:left;min-width:125px;flex:1 1 40%}.name-suggestions small{display:block;font-size:10px;line-height:1.6;margin-top:4px;color:var(--muted)}#nickname-story .replay{margin-top:12px;padding:0 16px;background:#f2f4e9;border-radius:12px}

.game-bottom #auto-button[aria-pressed="true"]{background:#fff2c9;color:#314c37;box-shadow:0 0 0 1px #efcf84}.game-bottom [data-action="log"]{background:#fff9e8;color:#34543e;font-weight:700}.conversation-log{padding-bottom:12px}
.name-suggestions button[aria-pressed="true"]{background:#e3ead6;border-color:#617e51;box-shadow:inset 0 0 0 1px #617e51}#traveler-name-selection{font-size:18px;font-weight:700;color:#4b6947}
