/* Original handheld RPG art and windows. Runtime terrain is the bitmap atlas. */
:root{color-scheme:dark;--night:#11141a;--panel:#1b222b;--ink:#f6f4e8;--muted:#acb3b9;--edge:#68707a;--gold:#eedba6;--green:#b6d9a8;--blue:#a2ced7}
body{background:#11141a}
.topbar,main,footer{max-width:848px}
.topbar{padding:20px 24px 12px}
.brand{font-size:17px}
main{padding-top:12px}
h1,h2,h3,.eyebrow,.journey-hud,.dialogue-box,.condition-option,.profile-panel,.map-controls,.map-bottom{font-family:var(--pixel)}
.panel{border:3px double #b0b3b7;box-shadow:none;background:#1b222b}
.primary,.secondary{border:2px solid #d5d3c9;border-radius:0;box-shadow:2px 2px 0 #000;padding:10px 20px;min-height:46px;font:17px var(--pixel)}
.primary{color:#161b22;background:#eedba6;border-color:#eedba6}
.primary:hover{background:#fff0bd}
.secondary{background:#272f38;color:#f6f4e8}
.secondary:hover{border-color:#f6f4e8;background:#333e49}
button:disabled{opacity:.5}
.privacy-promise{margin-top:16px;color:var(--green);font:14px/1.8 "Yu Gothic",Meiryo,sans-serif}
.intro-heading{padding:16px 0 26px}
.intro-heading h1{font-size:clamp(32px,5vw,46px);line-height:1.45}
.intro-heading p{max-width:650px;font-size:14px}
.intro-heading .eyebrow{font:12px var(--pixel)}
.intro-method{margin-top:18px}
.world,.town-map{background-image:url('assets/towns-v2.png');background-size:200% 200%;background-position:left top;background-repeat:no-repeat;image-rendering:pixelated}
.world{height:auto;aspect-ratio:20/12;border:4px solid #080b0e}
.world[data-chapter="1"],.era-1{background-position:right top}
.world[data-chapter="2"],.era-2{background-position:left bottom}
.world[data-chapter="3"],.era-3{background-position:right bottom}
.sprite{width:96px;aspect-ratio:1;background-image:none!important;image-rendering:pixelated}
.landing-dialogue{gap:20px}
.landing-dialogue .sprite{width:92px}
.journey-map{grid-template-columns:repeat(4,1fr)}
.chapter-stop{background:#1b222b}
.profile-panel h1{font-size:29px}
.profile-fields{display:grid;grid-template-columns:1fr 2fr;gap:24px;margin-top:28px}
.profile-fields label{font-size:16px}
.profile-fields input{display:block;width:100%;background:#101820;border:2px solid var(--edge);color:var(--ink);padding:12px 14px;margin-top:8px;border-radius:0;min-height:48px}
.profile-fields small{display:block;margin-top:6px;font:12px/1.7 "Yu Gothic",Meiryo,sans-serif}
.avatar-field{margin:28px 0 0;padding:18px;border:1px solid var(--edge)}
.avatar-field legend{padding:0 8px}
.avatar-options{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}
.avatar-option{position:relative;cursor:pointer;text-align:center;border:2px solid transparent;padding:8px 2px;font-size:11px}
.avatar-option:has(input:checked){border-color:var(--gold);background:#33414c}
.avatar-option input{position:absolute;left:5px;top:5px;accent-color:var(--gold)}
.avatar-option .sprite{width:100%;max-width:92px;margin:auto}
.error-text{color:#ffc5af;margin-top:12px}
.journey-hud{display:flex;justify-content:space-between;gap:16px;padding:11px 16px;border:3px double #d5d3c9;background:#11161c;max-width:768px;margin:auto}
.journey-hud strong{font-size:21px;display:inline-block;margin-right:18px;color:var(--gold)}
.journey-hud span{font-size:13px;overflow-wrap:anywhere}
.journey-hud>div:first-child{min-width:0}
.journey-hud small{font-size:11px}
.hud-quests{font-size:17px;text-align:right;white-space:nowrap}
.hud-quests span{color:var(--muted);margin-right:8px;font-size:11px}
.map-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px auto 8px;max-width:768px}
.map-heading h1{font-size:18px}
.map-heading>span{font-size:10px;text-align:right}
.town-map{position:relative;aspect-ratio:20/12;overflow:hidden;isolation:isolate;border:4px solid #080b0e;max-width:768px;margin:auto}
.map-npc,.map-player{position:absolute;left:calc((var(--x) - .5)*5%);top:calc((var(--y) - 1)*100%/12);width:10%;aspect-ratio:1;z-index:3;padding:0;border:0;background:transparent;min-height:0;image-rendering:pixelated}
.map-player{z-index:4;pointer-events:none;transition:left .1s linear,top .1s linear}
.map-npc .sprite,.map-player .sprite{width:100%;height:100%}
.map-npc:hover .sprite{filter:brightness(1.2)}
.map-npc:focus-visible{outline-offset:-4px}
.map-player.walking .sprite{animation:walking-step .2s steps(2) infinite}
.quest-marker{position:absolute;left:42%;top:-3%;font:bold clamp(11px,2.3vw,19px)/1 var(--pixel);color:#fff2ad;text-shadow:1px 1px #080b0e,-1px 1px #080b0e,1px -1px #080b0e,-1px -1px #080b0e}
.quest-done .quest-marker{color:#d5ffb8}
.map-object{position:absolute;top:54%;width:10%;aspect-ratio:1;padding:0;z-index:2;min-height:44px;min-width:44px;border:0;background-color:transparent;background-image:url('assets/props-v2.png');background-size:200% 200%;background-repeat:no-repeat;image-rendering:pixelated}
.map-object span{display:none}
.notice-board{left:0;background-position:left top}
.memory-chest{right:0;background-position:right top}
.memory-chest.opened{background-position:left bottom}
.map-controls{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:14px auto 0;max-width:768px}
.dpad{position:relative;display:grid;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(3,44px);gap:0;touch-action:none;flex-shrink:0}
.dpad::before{content:"";grid-area:2/2;background:#3a414a;border-block:1px solid #59616b;z-index:0}
.dpad button{position:relative;z-index:1;padding:0;font:17px var(--pixel);color:#c3c8ce;background:#3a414a;border:1px solid #59616b;min-height:44px;touch-action:manipulation;box-shadow:2px 2px 0 #05080c}
.dpad button:hover,.dpad button:active{background:#535d69;color:#fff}
.dpad [data-move="up"]{grid-area:1/2;border-radius:4px 4px 0 0}
.dpad [data-move="left"]{grid-area:2/1;border-radius:4px 0 0 4px}
.dpad [data-move="down"]{grid-area:3/2;border-radius:0 0 4px 4px}
.dpad [data-move="right"]{grid-area:2/3;border-radius:0 4px 4px 0}
.keyboard-tip{font-size:11px}
.talk-button{display:flex;align-items:center;gap:10px;border:0;background:transparent;padding:4px;box-shadow:none;color:var(--ink);font-size:12px}
.talk-button:hover{background:transparent}
.action-key{display:grid;place-items:center;width:54px;height:54px;border-radius:50%;background:#98545b;border:2px solid #d59899;color:#fff2e7;font:23px var(--pixel);box-shadow:3px 4px 0 #080b10}
.talk-button:hover .action-key,.talk-button:active .action-key{background:#b26770}
.speed-controls{display:flex;gap:0;align-items:center}
.speed-controls button{padding:6px 10px;background:#222c36;border:1px solid #697581;font:12px var(--pixel);min-height:38px}
.speed-controls button[aria-pressed="true"]{background:#d3caaa;border-color:#d3caaa;color:#192029}
.map-status{max-width:768px;margin:4px auto 0;min-height:20px;font:11px var(--pixel);color:#aab4bf}
.map-bottom{max-width:768px;display:flex;justify-content:space-between;align-items:center;gap:16px;margin:16px auto 0}
.map-bottom .primary{font-size:15px}
.dialogue-box{margin-top:14px;background:#eeeedd;color:#1b2227;border:6px double #11181e;box-shadow:0 0 0 2px #ececdb;padding:16px 20px}
.speaker-row{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.speaker-row .sprite{width:52px}
.speaker-row h2{font-size:18px}
.speaker-row .eyebrow{margin:0 0 3px;color:#4f6867;font-size:11px}
.dialogue-close{margin-left:auto;align-self:flex-start;padding:0 9px;background:transparent;color:#39484d;border:1px solid #7d8988;font-size:21px;min-height:36px}
.dialogue-text{min-height:3em;font:18px/1.85 var(--pixel)}
.dialogue-box .small{color:#5a6968}
.dialogue-box .primary{background:#29383b;color:#f2f0df;border-color:#29383b;font-size:15px}
.dialogue-box .primary:hover{background:#445958}
.dialogue-box .scene-actions{margin-top:14px}
.dialogue-box .choices{grid-template-columns:1fr;gap:0;margin-top:14px;border-block:1px solid #b4bdae}
.dialogue-box .choice{background:transparent;border:0;border-bottom:1px solid #b4bdae;color:#263337;box-shadow:none;min-height:70px;padding:12px 10px;gap:10px}
.dialogue-box .choice:last-child{border-bottom:0}
.dialogue-box .choice:hover,.dialogue-box .choice[aria-pressed="true"]{background:#d4ded0}
.dialogue-box .choice-number{font:17px var(--pixel);color:#546b67;flex:0 0 20px}
.dialogue-box .choice-text{font:15px/1.65 var(--pixel)}
.dialogue-box .choice small{color:#64756e;font:11px/1.6 "Yu Gothic",Meiryo,sans-serif}
.collected-role{margin-top:18px;padding-top:14px;border-top:1px solid #afbcae}
.collected-role .eyebrow{color:#506a65}
.collected-role h3{font:20px var(--pixel)}
.collected-role p{font-size:14px;margin-top:9px}
#dialogue-slot:empty{display:none}
#dialogue-slot:has(.dialogue-box)+.map-bottom{margin-top:18px}
#dialogue-slot>.source-drawer{margin-top:14px}
.life-ending{margin:10px 0 30px;border-color:var(--gold)}
.life-ending h2{font-size:26px}
.life-ending p{margin-top:12px}
.evidence-grid{grid-template-columns:repeat(2,1fr)}
.condition-option:has(input:checked){background:#33414c}
.condition-option{font-size:14px}
.result-intro .sprite{width:140px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@keyframes walking-step{from{transform:translateY(0)}to{transform:translateY(-2px)}}
@media(min-width:761px){.dpad{display:none}.map-controls{justify-content:flex-start}.speed-controls{margin-left:auto}}
@media(max-width:760px){
 .topbar{padding:16px 14px 10px}.brand{font-size:15px}.local-label{font-size:10px}
 main{padding:8px 14px 32px}footer{padding:20px 14px}
 .intro-heading{padding-top:8px}.intro-heading p{font-size:13px}
 .panel{padding:18px}.landing-dialogue{gap:8px}.landing-dialogue .sprite{width:65px}
 .journey-map{grid-template-columns:1fr 1fr}.chapter-stop{display:block;padding:10px 12px}.chapter-stop strong{font-size:18px}.chapter-stop span{font-size:11px}.chapter-stop small{font-size:9px}
 .profile-fields{grid-template-columns:1fr;gap:20px}
 .avatar-options{grid-template-columns:repeat(3,1fr)}.avatar-field{padding:10px}.avatar-option .sprite{max-width:82px}
 .journey-hud{padding:8px 10px;gap:10px}.journey-hud strong{font-size:17px;margin-right:7px}.journey-hud span{font-size:10px}.hud-quests{font-size:15px}.hud-quests span{display:block;margin:0;font-size:9px}
 .map-heading{margin-top:10px;gap:8px}.map-heading h1{font-size:15px}.map-heading>span{font-size:8px;max-width:125px}
 .town-map{border-width:3px}
 .map-controls{display:grid;grid-template-columns:132px 1fr;grid-template-rows:40px 80px;gap:6px 14px;margin-top:14px}
 .dpad{grid-column:1;grid-row:1/3}
 .keyboard-tip{display:none}.speed-controls{grid-column:2;grid-row:1;justify-self:end}
 .talk-button{grid-column:2;grid-row:2;justify-self:end;gap:9px}.action-key{width:58px;height:58px}
 .speed-controls button{min-height:38px;padding:6px 9px;font-size:11px}
 .map-status{font-size:10px}.map-bottom{margin-top:12px;gap:10px}.map-bottom .primary{padding:10px 13px;font-size:13px}
 .dialogue-box{padding:12px 14px;border-width:5px;margin-top:14px}
 .speaker-row .sprite{width:46px}.speaker-row h2{font-size:17px}
 .dialogue-text{font-size:16px;line-height:1.8}.dialogue-box .choice-text{font-size:14px}.dialogue-box .choice{min-height:72px;padding:11px 4px}
 .speaker-row .eyebrow{font-size:10px}.dialogue-close{min-height:38px}
 .life-ending h2{font-size:23px}.evidence-grid{grid-template-columns:1fr}
 .notice-board,.memory-chest{border-width:2px}
}
@media(prefers-reduced-motion:reduce){.map-player{transition:none}.map-player.walking .sprite{animation:none}}

