/* Compact RPG screen: scenery and dialogue belong to the same cabinet. */
#game-shell{border:3px solid #e3eddb;border-radius:6px;background:#2e5c40;box-shadow:0 0 0 3px #1c3a28,0 0 0 5px #9fd0a3,0 18px 38px #1b362535}
#game-shell .game-hud{height:54px;background:#2e5c40;border-bottom:2px solid #b7d0a2;box-shadow:none;padding-inline:18px}
#game-shell .game-hud .street-sign{color:#fff1bd}
#game-shell .care-status{background:#376f4c;min-height:38px;padding-block:6px}
#game-shell .care-hearts i{width:19px;height:17px;background:#85a888;filter:drop-shadow(0 2px 0 #1c3a28)}
#game-shell .care-status[data-hearts="1"] i:nth-child(1),#game-shell .care-status[data-hearts="2"] i:nth-child(-n+2),#game-shell .care-status[data-hearts="3"] i{background:#f0152e;transform:translateY(-1px)}
#route-checkpoints{list-style:none;margin:0;padding:8px 20px;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:8px;background:#2e5c40;border-bottom:2px solid #b7d0a2}
#route-checkpoints li{position:relative;display:grid;place-items:center;min-width:0}
#route-checkpoints li::before{content:"";position:absolute;left:50%;top:50%;width:calc(100% + 12px);height:2px;background:#79a37c}
#route-checkpoints li:last-child::before{content:none}
#route-checkpoints span{position:relative;z-index:1;display:grid;place-items:center;width:23px;height:23px;border:1px solid #bdd3aa;background:#376f4c;border-radius:3px;font:11px monospace;color:#e3eddb}
#route-checkpoints li[data-state="done"] span{background:#e3eddb;border-color:#e3eddb;color:#2e5c40}
#route-checkpoints li[data-state="current"] span{border:2px solid #f4ce71;color:#fff1bd;box-shadow:0 0 0 2px #f4ce7120}
#game-viewport{position:relative;display:flex;flex-direction:column;height:auto;overflow:hidden;background:#2e5c40}
#street-stage>canvas#game{display:block;width:100%;height:390px;flex:none;image-rendering:pixelated;cursor:crosshair;touch-action:pan-y}
#game-objective{position:relative;inset:auto;order:-1;display:block;width:100%;max-width:none;margin:0;padding:10px 16px;border:0;border-bottom:2px solid #b7d0a2;border-radius:0;background:#ebf2e5;box-shadow:none;color:#2e5c40;pointer-events:none}
#game-objective>i{display:none}
#game-objective b{font:700 12px/1.5 monospace;display:block}
#game-objective span{font:11px/1.5 monospace;display:block;color:#446c53;margin-top:2px}
#game-viewport:has(#game-intro:not([hidden])) #game-objective,#game-viewport:has(#game-win:not([hidden])) #game-objective{display:none}
#dialogue-actions #act{grid-column:1/-1;display:block;clear:none;width:auto;max-width:100%;justify-self:end;margin:0;min-height:40px;padding:7px 5px 7px 22px;position:relative;border:0;border-radius:0;background:transparent;color:#2e5c40;box-shadow:none;font:700 13px/1.5 monospace;text-align:right}
#dialogue-actions #act::before{content:"";position:absolute;left:6px;top:50%;transform:translateY(-50%);border-left:8px solid currentColor;border-block:5px solid transparent}
#dialogue-actions #act:hover:not(:disabled){background:#ebf2e5;color:#2e5c40;border:0}
#dialogue-actions #act:focus-visible{outline:2px solid #468d61;outline-offset:2px}
#dialogue-actions #act:disabled{opacity:.45}
#game-bottom{display:flex;align-items:center;justify-content:flex-end;gap:0;min-height:0;padding:7px 12px;background:#376f4c;border-top:2px solid #b7d0a2}
#game-bottom #mission{display:none}
#game-bottom .game-controls{display:flex;justify-content:flex-end;width:100%;max-width:none;gap:0;margin:0}
#game-bottom #jump{display:none!important}
#game-bottom #walk{display:inline-flex!important;align-items:center;justify-content:center;width:auto;min-height:40px;font:12px/1.4 monospace;padding:8px 14px;background:#e3eddb;color:#2e5c40;border:2px solid #b7d0a2;border-radius:3px;box-shadow:none}
#game-shell:has(#dialogue-bubble:not([hidden])) #game-bottom,#game-shell:has(#game-intro:not([hidden])) #game-bottom,#game-shell:has(#game-win:not([hidden])) #game-bottom{display:none}
#game-shell .game-progress{height:4px;background:#2e5e40}
#game-shell .game-progress i{background:#f4ce71}
#game-viewport:has(#game-intro:not([hidden])){height:590px;display:block}
#game-viewport:has(#game-intro:not([hidden])) #street-stage>canvas#game{height:100%}
#game-viewport:has(#game-intro.transformed:not([hidden])){height:420px}
#game-viewport:has(#game-win:not([hidden])){min-height:430px}
#game-viewport .origin-card{max-width:800px;grid-template-columns:1fr 1.05fr;border-radius:4px;border-color:#2e5c40}
#game-viewport .origin-visual{background:#ebf2e5;align-content:center}
#game-viewport .origin-copy h3{font-size:25px;line-height:1.2}
#game-viewport .origin-copy p{font-size:13px;line-height:1.6}
#game-viewport .game-intro-card{max-width:min(520px,calc(100% - 34px));border-radius:3px;padding:26px 28px;background:#fff4de;border:3px solid #2e5c40;box-shadow:0 0 0 3px #e3eddb}
#game-viewport #hero-preview{display:block;width:100%;height:auto;max-height:none;object-fit:contain}
#win-title{font-size:31px;line-height:1.12}
#win-description{font-size:14px;line-height:1.7;margin:15px auto 20px}
#real-life{font-size:14px;min-height:48px}
@media(max-width:760px){
 #game-shell .game-hud{height:48px;padding-inline:10px}
 #game-shell .care-status{min-height:35px;font-size:11px}
 #game-shell .care-hearts i{width:17px;height:16px}
 #route-checkpoints{padding:7px 11px;gap:5px}
 #route-checkpoints span{width:21px;height:21px;font-size:10px}
 #street-stage>canvas#game{height:clamp(260px,75vw,330px)}
 #game-objective{padding:8px 12px}
 #game-objective b{font-size:11px}
 #game-objective span{font-size:10px;line-height:1.45}
 #dialogue-actions #act{font-size:12px;min-height:44px;padding-block:7px}
 #game-bottom{padding:6px 9px}
 #game-bottom #walk{width:100%;font-size:12px;min-height:44px}
 #game-viewport:has(#game-intro:not([hidden])){height:625px}
 #game-viewport:has(#game-intro.transformed:not([hidden])){height:410px}
 #game-viewport:has(#game-win:not([hidden])){min-height:420px}
 #game-viewport .origin-card{grid-template-columns:1fr;max-width:370px}
 #game-viewport .origin-copy h3{font-size:23px}
 #game-viewport .origin-copy p{font-size:12px}
 #game-viewport #hero-preview{height:146px;aspect-ratio:auto}
 #game-viewport .transformed #hero-preview{height:190px}
 #game-viewport .game-intro-card{padding:24px 19px}
 #win-title{font-size:27px}
 #win-description{font-size:13px}
}
@media(max-width:360px){
 #game-viewport .origin-copy h3{font-size:21px}
 #game-viewport #hero-preview{height:135px}
 #game-shell .game-hud .street-sign{font-size:8px}
}
@media(prefers-reduced-motion:reduce){#game-shell *{animation:none!important;transition:none!important}}
#game-bottom .game-controls{gap:8px;align-items:stretch}
#game-bottom #greet{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 14px;border:2px solid #c8dab8;border-radius:3px;background:#fff4de;color:#2e5c40;font:12px/1.4 monospace;box-shadow:none}
#game-bottom #greet[hidden]{display:none}
#dialogue-actions #act[hidden],#dialogue-actions #mayor-register[hidden]{display:none}
#dialogue-actions #mayor-register{grid-column:1/-1;justify-self:end;display:inline-flex;align-items:center;gap:10px;min-height:44px;padding:8px 5px;border:0;background:transparent;color:#2e5c40;font:700 13px/1.5 monospace;text-align:right;text-decoration:none}
#dialogue-actions #mayor-register::before{content:"";border-left:8px solid currentColor;border-block:5px solid transparent;flex:none}
#dialogue-actions #mayor-register:hover{background:#ebf2e5}
@media(max-width:760px){#game-bottom .game-controls{flex-wrap:wrap}#game-bottom #walk{flex:1 1 160px;width:auto}#game-bottom #greet{flex:1 1 110px;font-size:11px}#dialogue-actions #mayor-register{font-size:12px}}
/* Named characters, one start action and no manual pause state. */
#game-shell .game-hud{display:grid;grid-template-columns:1fr auto 1fr;gap:10px}
#game-shell .game-score{grid-column:1;justify-self:start}
#game-shell .game-hud .street-sign{grid-column:2;justify-self:center;max-width:none}
#game-viewport:has(#game-intro:not([hidden])){height:430px}
#game-viewport .avatar-choice{margin-block:16px}
#game-viewport .avatar-options button{font-weight:600;min-height:46px}
#game-viewport .origin-copy small{font-size:11px}
@media(max-width:760px){
 #game-viewport:has(#game-intro:not([hidden])){height:480px}
 #game-shell .game-hud{grid-template-columns:1fr auto 1fr;gap:8px}
 #game-shell .game-hud .street-sign{max-width:140px}
 #game-viewport .origin-copy{padding:16px 19px}
 #game-viewport .origin-copy small{display:block;line-height:1.5;margin-top:10px}
}


#street-stage { position:relative; width:100%; flex:none; background:#e3e8d9; }
#game-viewport:has(#game-intro:not([hidden])) #street-stage { height:100%; }
#game-shell:has(#mayor-prologue:not([hidden])) :is(#care-status,#route-checkpoints,#game-objective,#game-bottom,.game-progress,.game-score) { display:none; }
#game-shell:has(#mayor-prologue:not([hidden])) #route-open { grid-column:3; }
#street-stage:has(#mayor-prologue:not([hidden])) #game { cursor:default; }
#mayor-prologue { position:absolute; inset:0; pointer-events:none; }
#street-stage .street-speech {
  --tail:50%; position:absolute; z-index:2; inset:auto; transform:none;
  display:block; width:max-content; max-width:min(25rem,calc(100% - 16px));
  padding:9px 13px 10px; margin:0; box-sizing:border-box; color:#20372b;
  border:2px solid #21372a; border-radius:13px; background:#fffbee;
  box-shadow:0 3px 0 #1b322a25; text-align:left; pointer-events:none;
}
#street-stage .street-speech::after {
  content:""; position:absolute; inset:auto; left:var(--tail); bottom:-7px; width:10px; height:10px;
  background:inherit; border:0; border-right:2px solid #21372a; border-bottom:2px solid #21372a;
  transform:translateX(-50%) rotate(45deg); box-sizing:content-box;
}
#street-stage .street-speech b,#street-stage .dialogue-speaker {
  display:block; margin:0 0 2px; padding:0; background:transparent; color:#41624c;
  font:700 11px/1.3 Inter,Arial,sans-serif; letter-spacing:.025em;
}
#street-stage .street-speech p { margin:0; padding:0; font:600 15px/1.35 Inter,Arial,sans-serif; color:#172c21; }
#street-stage #dialogue-bubble.hero-speaking { background:#eaf2df; }
#opening-next { position:absolute; top:8px; right:8px; z-index:3; min-height:44px; pointer-events:auto; padding:6px 13px; border:1px solid #fff9; border-radius:6px; background:#203729ec; color:white; font:650 .82rem/1.2 Inter,Arial,sans-serif; cursor:pointer; }
#opening-next:hover { background:#365b43; }
#opening-next:focus-visible { outline:3px solid #f6d989; outline-offset:2px; }
#dialogue-actions { display:none; }
#game-viewport:has(#dialogue-bubble:not([hidden])) #dialogue-actions { display:flex; justify-content:flex-end; padding:4px 12px; background:#fff8e8; }
@media(max-width:760px){
 #street-stage .street-speech { padding:7px 11px 8px; }
 #street-stage .street-speech p { font-size:14px; }
}
