.rpg-window{position:relative;background:#10182b;border:2px solid #edf0df;border-radius:7px;box-shadow:inset 0 0 0 2px #263349,0 4px 0 #080d16;color:#f5f0dc}.window-label{position:absolute;top:-12px;left:14px;background:#10182b;padding:0 8px;font-size:12px;letter-spacing:.1em;color:#f6eccd}#screen{aspect-ratio:3/2}#minimap{position:absolute;right:12px;top:12px;width:120px;height:80px;border:2px solid #eddcaf;image-rendering:pixelated;box-shadow:0 3px 12px #0008;cursor:pointer}.command-bar{padding:20px 14px 6px;gap:16px;align-items:center}.field-commands{display:grid;grid-template-columns:repeat(4,1fr);gap:4px 9px;flex:1;padding:15px 10px 10px}.field-commands button,.battle-commands button{font-size:15px;border:0;background:transparent;padding:6px 7px;min-height:36px;text-align:left;letter-spacing:.08em}.field-commands button:before,.battle-commands button:before{content:"▶";font-size:10px;color:#f6d584;margin-right:7px;opacity:0}.field-commands button:hover:before,.field-commands button:focus-visible:before,.battle-commands button:hover:before,.battle-commands button:focus-visible:before{opacity:1}.field-commands button:hover,.battle-commands button:hover{background:#2a3956;color:#ffe2a0}.direction-pad{grid-template-columns:repeat(3,36px);grid-template-rows:repeat(2,35px);margin-left:0}.direction-pad button{min-height:35px;font-size:16px}#full-map{width:100%;height:auto;image-rendering:pixelated;border:1px solid #859873;cursor:crosshair}.strength-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}.strength-grid strong{display:block;color:#fff0c7}
#battle-window{width:min(840px,calc(100vw - 24px));max-width:840px;padding:22px;background:#0c1423;border:3px solid #eceddb;box-shadow:inset 0 0 0 3px #2d3e57,0 30px 100px #000a;max-height:calc(100dvh - 24px);overflow:auto}#battle-window::backdrop{background:#050b16d1;backdrop-filter:blur(5px)}#battle-overlay{position:static;inset:auto;background:none;display:block;padding:0}#battle-overlay[hidden]{display:none}.battle-top{display:grid;grid-template-columns:220px 1fr;gap:18px;margin:8px 0 16px}.battle-vitals{display:grid;gap:3px;padding:14px 18px;font-size:14px}.battle-target{padding:14px 18px;font-size:14px}.battle-name{font-size:18px;color:#f5deb1;line-height:1.6;margin:0 0 4px}.battle-stage{height:280px;position:relative;overflow:hidden;border:1px solid #455644;border-radius:4px;margin:8px 0 22px;background:#18271e}#battle-background{position:absolute;inset:0;width:100%;height:100%;image-rendering:pixelated}.combatant{position:absolute;transform-origin:center bottom;text-align:center}.combatant.enemy{left:calc(50% - 100px);top:12px;width:200px;height:220px}.battle-enemy{width:200px;height:200px;image-rendering:pixelated;margin:0;animation:enemy-idle 1.8s steps(2,end) infinite}.combatant.hero{right:40px;bottom:22px;width:88px;height:95px}.combatant.hero canvas{width:88px;height:88px;image-rendering:pixelated}.combatant.cat{right:132px;bottom:22px;width:64px}.combatant.cat canvas{width:64px;height:64px;image-rendering:pixelated}.combatant-label{display:block;font-size:11px;color:#ede4c0;background:#10251faa}.battle-bottom{display:grid;grid-template-columns:210px minmax(0,1fr);gap:18px}.battle-command-window{padding:15px 10px 10px}.battle-commands{display:grid;grid-template-columns:1fr;gap:0;width:100%;max-width:none}.battle-commands button:last-child{grid-column:auto}.battle-message{padding:18px;text-align:left;margin:0;font-size:15px;line-height:1.9;min-height:190px;color:#fff6de}.defeated .battle-enemy{opacity:.18;animation:none}.damage-popup{position:absolute;left:50%;top:8%;z-index:6;white-space:nowrap;font:bold 34px Georgia,serif;color:#ffe9bc;text-shadow:3px 3px #0c111e,-1px -1px #9b3931;animation:damage-float .85s ease-out forwards;pointer-events:none}.damage-popup.healing{color:#9dffd1;text-shadow:2px 2px #143b29}.attacking{animation:hero-attack .26s ease-in-out}.enemy-attack{animation:enemy-lunge .23s ease-in-out}.damaged{animation:hit-shake .45s steps(5,end)}.casting{filter:drop-shadow(0 0 12px #9df4ff);animation:cast-pulse .22s ease-in-out}.guarding{filter:drop-shadow(0 0 10px #a7c4ff)}.healing-motion{filter:drop-shadow(0 0 15px #99f5ae)}.escaping{animation:run-away .35s ease-in-out}.falling{animation:enemy-fall .4s ease-out}.sword-hit{position:absolute;inset:20% 12%;background:linear-gradient(125deg,transparent 45%,#fff5b7 48%,#fff 51%,transparent 54%);animation:slash-flash .25s ease-out}.magic-hit{position:absolute;inset:5%;background:radial-gradient(circle,#fff 2%,#bafff4 10%,#83dbff66 35%,transparent 60%);animation:cast-pulse .45s ease-out}.magic-orb{position:absolute;width:28px;height:28px;right:10%;top:75%;border-radius:50%;background:#f2fff5;box-shadow:0 0 14px 7px #9cf9ff,0 0 45px #adffcb;animation:orb-fly .38s ease-in forwards}#battle-effects{position:absolute;inset:0;pointer-events:none}
@keyframes enemy-idle{50%{transform:translateY(-4px)}}@keyframes damage-float{0%{opacity:0;transform:translate(-50%,12px) scale(.7)}20%{opacity:1;transform:translate(-50%,-12px) scale(1.2)}70%{opacity:1}100%{opacity:0;transform:translate(-50%,-42px)}}@keyframes hero-attack{50%{transform:translate(-45px,-24px) rotate(-7deg)}}@keyframes enemy-lunge{50%{transform:translate(20px,22px) scale(1.06)}}@keyframes hit-shake{0%,40%,80%{transform:translateX(-7px);filter:brightness(2)}20%,60%,100%{transform:translateX(7px);filter:brightness(.6)}}@keyframes cast-pulse{50%{transform:scale(1.12);opacity:.7}}@keyframes run-away{100%{transform:translateX(90px);opacity:0}}@keyframes enemy-fall{100%{opacity:0;transform:translateY(12px)}}@keyframes slash-flash{0%{opacity:0;transform:scale(.5)}50%{opacity:1}100%{opacity:0;transform:scale(1.3)}}@keyframes orb-fly{100%{right:48%;top:27%;transform:scale(1.5)}}
@media(max-width:760px){#screen{aspect-ratio:1}#minimap{width:90px;height:60px;right:8px;top:8px}.command-bar{display:flex;padding:20px 10px 7px;gap:10px;align-items:center;flex-wrap:nowrap}.field-commands{grid-template-columns:repeat(2,minmax(0,1fr));padding:13px 7px 7px;gap:0}.field-commands button{font-size:14px;padding:4px 2px;min-height:34px}.direction-pad{display:grid;grid-template-columns:repeat(3,30px);grid-template-rows:repeat(2,34px);grid-column:auto;grid-row:auto;align-self:center}.direction-pad button{min-height:34px;padding:0}.command-bar #bag-button,.command-bar #book-button{grid-column:auto;grid-row:auto}.screen-wrap.is-battle{min-height:0}#battle-window{padding:17px 12px 12px;width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.battle-top{grid-template-columns:105px minmax(0,1fr);gap:10px;margin-bottom:12px}.battle-vitals,.battle-target{font-size:11px;padding:12px 9px}.battle-name{font-size:13px;line-height:1.5}.window-label{font-size:10px;left:8px;top:-10px}.battle-stage{height:230px;margin:6px 0 18px}.combatant.enemy{left:calc(50% - 76px);width:152px;top:2px;height:169px}.battle-enemy{width:152px;height:152px}.combatant.hero{right:12px;bottom:15px;width:64px;height:72px}.combatant.hero canvas{width:64px;height:64px}.combatant.cat{right:76px;bottom:14px;width:48px}.combatant.cat canvas{width:48px;height:48px}.combatant-label{font-size:9px}.battle-bottom{grid-template-columns:117px minmax(0,1fr);gap:10px}.battle-command-window{padding:13px 6px 6px}.battle-commands button{font-size:13px;min-height:33px;padding:5px 1px;letter-spacing:0}.battle-commands button:before{margin-right:3px;font-size:9px}.battle-message{font-size:12px;min-height:184px;padding:13px 10px;line-height:1.8}.damage-popup{font-size:28px}}
@media(max-height:600px){.battle-stage{height:180px}.battle-enemy{width:132px;height:132px}.combatant.enemy{width:132px;left:calc(50% - 66px)}.battle-message{min-height:150px}.battle-commands button{min-height:28px}}
@media(prefers-reduced-motion:reduce){.combatant,.battle-enemy,.damage-popup,.magic-orb,.sword-hit,.magic-hit{animation:none!important}.damage-popup{opacity:1;transform:translateX(-50%)}.magic-orb{right:48%;top:27%}}
.map-legend{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:12px}.map-legend .map-destination{display:flex;align-items:center;gap:8px;min-height:42px;padding:7px 9px;text-align:left;background:#101c2c;border:1px solid #59677a;color:#f4ead4;font-size:12px}.map-destination canvas{flex:0 0 24px;width:24px;height:24px;image-rendering:pixelated}.map-legend .map-destination:hover,.map-legend .map-destination:focus-visible{border-color:#f2d38f;background:#283a50}.map-destination span{overflow-wrap:anywhere}.map-legend-note{margin-bottom:0}@media(max-width:760px){.map-legend{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.map-legend .map-destination{font-size:11px;padding:7px 6px;gap:6px}.map-destination canvas{flex-basis:22px;width:22px;height:22px}}

.adventure-guide{display:flex;align-items:center;gap:14px;margin:0 12px 10px;padding:12px 14px;background:#202c3b;border:1px solid #506078;border-radius:5px}.adventure-guide>div{flex:1;min-width:0}.adventure-guide p{font-size:13px;line-height:1.6;margin:4px 0 0}.guide-button{min-height:44px;max-width:260px;background:#e9cc8c;color:#222c38;border-color:#e9cc8c;font-size:13px;font-weight:700;white-space:normal}.guide-button:hover{background:#f5dfaf}.quick-vitals{display:none}.touch-controls{display:none}.adventure-progress li{margin:10px 0}.adventure-progress strong{color:#d9c997}.low-hp{color:#ffae9d!important}
@media(max-width:760px){.masthead{padding:10px 12px}.masthead nav button{min-height:40px;padding:6px 10px}main{padding-top:12px}.title-row{margin-bottom:12px}h1{font-size:23px;line-height:1.3;margin:4px 0}.title-row .mobile-break{display:none}.intro{font-size:11px}.chapter-label{display:none}.adventure-guide{margin:0 6px 7px;padding:10px;display:block}.adventure-guide p{font-size:13px;margin:4px 0 7px}.guide-button{width:100%;max-width:none;min-height:44px;font-size:14px;padding:8px}.quick-vitals{display:flex;justify-content:space-around;gap:6px;padding:5px 8px 8px;font-size:13px;color:#efe4c6}.map-header{padding:8px 10px;gap:4px}.map-header>span:first-child{gap:5px;font-size:11px}.area-type{margin-left:2px;font-size:10px;padding:2px 5px}.command-bar{display:flex;flex-wrap:wrap;gap:12px;padding:17px 10px 8px}.field-commands{flex:1 0 100%;grid-template-columns:repeat(4,minmax(0,1fr));padding:13px 4px 4px}.field-commands button{font-size:12px;min-height:44px;padding:3px 1px;letter-spacing:0;white-space:nowrap}.field-commands button:before{margin-right:2px;font-size:7px}.direction-pad{width:100%;display:grid;grid-template-columns:repeat(4,minmax(44px,1fr));grid-template-rows:44px;gap:8px}.direction-pad button{min-height:44px;font-size:24px;grid-column:auto!important;grid-row:auto!important;touch-action:none}.direction-pad [data-dir=left]{order:1}.direction-pad [data-dir=up]{order:2}.direction-pad [data-dir=down]{order:3}.direction-pad [data-dir=right]{order:4}.touch-controls{display:block;font-size:11px;line-height:1.7}.desktop-controls{display:none}.control-note{margin:0 10px 12px}.map-legend .map-destination{min-height:44px}.choices button{min-height:44px}.battle-commands button{min-height:44px}.battle-message{min-height:220px}.battle-stage{height:205px}.journal{grid-template-columns:1fr 1fr}#quick-vitals b{font-size:14px}.message-box{font-size:12px}dialog p{font-size:14px}dialog .subtle{font-size:12px}}

@media(max-width:760px){.title-row .eyebrow,.title-row .intro{display:none}.title-row{margin-bottom:8px}h1{font-size:20px;letter-spacing:0;line-height:1.35}.adventure-guide{display:flex;gap:8px;padding:8px 10px}.adventure-guide>div{flex:1}.adventure-guide p{font-size:12px;line-height:1.45;margin:3px 0}.guide-button{width:110px;flex:0 0 110px;max-width:110px;font-size:13px;padding:7px}.quick-vitals{padding-top:2px;padding-bottom:6px}.map-header{padding-top:7px;padding-bottom:7px}}

@media(max-width:760px) and (max-height:740px){#screen{aspect-ratio:auto}.adventure-guide p{font-size:12px}}


/* 方位は地図の外側。店の記号とキャラを覆わず、すべての地図で上を北にする。 */
.map-with-directions{display:grid;grid-template-columns:32px minmax(0,1fr) 32px;grid-template-rows:32px auto 32px;align-items:center;justify-items:center;min-width:0;color:#f2d38f}
.main-map-directions{margin:0 6px}
.map-with-directions>.screen-wrap,.map-with-directions>#full-map{grid-column:2;grid-row:2;width:100%;min-width:0;margin:0}
.map-direction{display:flex;align-items:center;justify-content:center;gap:4px;pointer-events:none;font-size:15px;font-weight:700;line-height:1.1}
.map-direction.north{grid-column:2;grid-row:1}
.map-direction.south{grid-column:2;grid-row:3}
.map-direction.west{grid-column:1;grid-row:2;flex-direction:column;gap:5px}
.map-direction.east{grid-column:3;grid-row:2;flex-direction:column;gap:5px}
ruby{ruby-align:center}rt{font-family:var(--font);font-size:.6em;font-weight:400;letter-spacing:0;line-height:1.1;color:#eee1c4}
.map-direction rt{font-size:9px}
.map-legend .map-destination{padding-top:12px;padding-bottom:9px}
.map-legend .map-destination span{line-height:2}
#location{line-height:1.8}#area-type{line-height:1.7}
.full-map-directions{margin:12px 0 0}
@media(max-width:760px){.map-with-directions{grid-template-columns:29px minmax(0,1fr) 29px;grid-template-rows:29px auto 29px}.main-map-directions{margin:0 3px}.map-direction{font-size:14px}.map-direction rt{font-size:9px}#location rt,#area-type rt{font-size:9px}.map-header{min-height:44px}#minimap{width:76px;height:51px;right:5px;top:5px}.map-caption{padding:5px;font-size:8px;letter-spacing:0}.map-caption span:last-child{display:none}.map-legend .map-destination{font-size:12px;line-height:2.1}dialog h2 ruby{line-height:1.9}}
