:root{font-family:'Yu Gothic','Meiryo',sans-serif;font-size:16px;--panel:#14251fed;--gold:#b99d60}body{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);font-size:16px}button,select{min-width:44px;min-height:48px;font-size:16px}button{touch-action:manipulation}small{font-size:14px}footer{min-width:0}footer button{flex-shrink:0;font-size:16px;min-height:44px}footer .context{font-size:14px}body.fighting{grid-template-rows:0 minmax(0,1fr) 48px}.mobile-battle{grid-template-rows:44px minmax(0,1fr) 50px}.battle-head{display:flex;align-items:center;gap:6px;padding:0 6px;background:linear-gradient(#263c32,#15271f);border-bottom:1px solid #988151;min-width:0}.battle-head button{min-height:44px;padding:3px 12px}.instruction{flex:1;min-width:0;overflow:auto;white-space:nowrap;font-size:14px}.timeline{grid-row:3;gap:4px;background:#11221d;padding:2px 5px;border-top:1px solid #a58a54}.timeline button{height:46px;min-height:44px;min-width:116px;font-size:14px;border-radius:3px}.timeline .portrait{width:38px;height:38px}.timeline small{font-size:14px;line-height:1.15;max-width:100px;overflow:hidden;text-overflow:ellipsis}.field{background:radial-gradient(ellipse at 50% 30%,#405344,#172b23)}.map>svg{margin:0}.tools{top:4px;left:auto;right:4px;max-width:calc(100% - 8px);flex-wrap:wrap;max-height:140px;padding:4px;background:#162b24f5;border:1px solid var(--gold);z-index:10}.tools button{font-size:14px;min-height:44px;padding:5px 9px}.tools input{min-height:44px;width:130px}.actor-compact{position:absolute;top:3px;left:8px;font-size:14px;background:#10291de8;border-left:2px solid var(--gold);padding:4px 7px;pointer-events:none;max-width:70%;white-space:nowrap;overflow:hidden}.combat-person{position:absolute;bottom:0;width:19%;max-width:230px;z-index:3;pointer-events:none}.combat-person.actor{left:0}.combat-person.target{right:0}.combat-person .portrait.large{display:block;border:0;background:transparent;width:100%;height:min(25dvh,140px);max-height:none;object-fit:contain;filter:drop-shadow(1px 2px 2px #08140d)}.person-readout{background:linear-gradient(90deg,#0e201df5,#1b3028ed);border-block:1px solid var(--gold);padding:4px 7px;font-size:14px;line-height:1.25;overflow-wrap:anywhere}.person-readout strong{font-size:16px;display:block}.person-readout small{font-size:14px;line-height:1.2}.commands{right:auto;top:35px;width:208px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:5px;max-height:calc(100% - 38px);background:var(--panel);border:1px solid var(--gold);border-radius:4px;box-shadow:0 3px 10px #08170d77}.commands button{font-size:16px;min-height:44px;text-align:center;padding:4px}.commands.skill-list{left:6px;top:34px;bottom:5px;width:43%;display:flex;flex-direction:column}.skill-list button{text-align:left;min-height:48px}.battle-detail.skill-detail{left:auto;right:5px;top:34px;bottom:5px;width:54%;font-size:16px;padding:10px;background:#1a3029f5;color:#ede4c8}.battle-detail p{font-size:16px;margin:8px 0}.target-detail{right:4px;top:34px;max-width:40%;max-height:65%;font-size:14px;padding:4px 8px;background:#183026ed;color:#f1e5c4;border:1px solid var(--gold);z-index:5}.target-detail summary{min-height:44px;display:flex;align-items:center}.target-detail[open]{max-width:60%;width:400px}.target-detail p{font-size:16px}.prediction{position:absolute;bottom:0;left:20%;right:20%;display:block;max-height:58px;height:auto;overflow:auto;padding:3px 8px;background:#11261ef5;color:#f3e5c4;border:1px solid var(--gold);font-size:14px;z-index:4}.prediction strong{font-size:16px}.prediction p{font-size:14px}.prediction summary{min-height:44px;display:flex;align-items:center}.prediction:has(details[open]){max-height:80%;}.chain-summary{line-height:1.4}.terrain-readout{position:absolute;right:8px;bottom:4px;background:#152b23ee;border:1px solid var(--gold);padding:7px;font-size:16px;pointer-events:none}.face-controls{position:absolute;bottom:auto;transform:translate(-50%,-50%);width:138px;height:138px;background:transparent;border:0;padding:0;display:grid;grid-template-columns:repeat(3,46px);grid-template-rows:repeat(3,46px);gap:0;pointer-events:none}.face-controls button{min-width:44px;min-height:44px;width:44px;height:44px;padding:0;pointer-events:auto;font-size:24px;background:#1d392dee}.face-controls button.selected{background:#a0874e}.face-controls [data-direction=N]{grid-column:2;grid-row:1}.face-controls [data-direction=E]{grid-column:3;grid-row:2}.face-controls [data-direction=S]{grid-column:2;grid-row:3}.face-controls [data-direction=W]{grid-column:1;grid-row:2}.battle-objective,.hint{display:none}.mobile-battle[data-mode=actor] .actor-compact{display:none}.mobile-battle[data-mode=animation] .map{pointer-events:none}.portrait.large{object-fit:contain}.profile p,.list button,.detail,.roster button,.chips button{font-size:16px}.profile small{font-size:14px}.chips button{min-height:44px}.scene-portraits .portrait{max-height:none}.scene-label{font-size:14px}#dialogButtons{flex-wrap:wrap}#dialogButtons button{min-height:44px}header{min-width:0}header strong{font-size:16px}header nav{gap:3px}header button{min-height:44px;font-size:14px}.profile{min-width:0}.profile p{white-space:normal}.candidate{min-width:0}.detail{overflow-wrap:anywhere}.home .facilities{max-height:70%;gap:8px}.home button{min-height:48px;font-size:16px}
@media(max-height:500px){.layout{grid-template-rows:88px minmax(0,1fr)}.profile{overflow:auto}.profile p{font-size:14px}.profile h2{font-size:16px}.roster button{font-size:14px}.list button,.detail{font-size:16px}.detail h3{font-size:18px}.home h1{font-size:26px;margin:4px 0}.home p{margin:5px 0}.scene-portraits{height:80%;padding:0 6%}.speech p{font-size:18px}.speech{max-height:48%;overflow:auto;min-height:90px}.scene-label{font-size:14px}.result p{margin:8px 0}}
@media(max-width:720px){header strong{display:none}header nav{justify-content:space-between;width:100%}.timeline button{min-width:100px}.timeline .portrait{width:32px;height:38px}.timeline small{font-size:14px;max-width:66px}.combat-person{width:20%}.person-readout{padding:3px 4px}.person-readout strong{font-size:14px}.person-readout small{font-size:14px}.commands{width:184px}.prediction{left:21%;right:21%;font-size:14px}.prediction strong{font-size:14px}.layout{grid-template-columns:128px minmax(0,1fr)}footer .context{max-width:none}footer button{padding:4px 8px}.battle-head button{font-size:14px;padding:3px 8px}.instruction{font-size:14px}.roster .portrait{width:36px;height:40px}.candidate{grid-template-columns:minmax(120px,.8fr) minmax(180px,1.2fr)}}
.timeline{overflow-y:hidden;scrollbar-width:none}.timeline::-webkit-scrollbar{display:none}
.combat-person .portrait.large{height:min(36dvh,170px)}.commands button{overflow-wrap:anywhere}
