*{box-sizing:border-box}
body{margin:0;background:#fcf9fc;color:#2a2328;font:14px -apple-system,BlinkMacSystemFont,"Hiragino Sans","Noto Sans JP",sans-serif}
button,select{font:inherit;color:inherit}
button{border:0;border-radius:8px;background:#f3f4f6;min-height:44px;padding:8px 12px;touch-action:manipulation}
button:disabled{opacity:.5}
button:focus-visible,select:focus-visible{outline:3px solid #b74471;outline-offset:2px}
[hidden]{display:none!important}
main{max-width:440px;margin:auto;padding:4px 8px calc(8px + env(safe-area-inset-bottom));}
.partner{display:flex;gap:8px;align-items:center;background:#fff;min-height:84px}
.partner>div{min-width:0;flex:1}
.partner>button{position:relative;flex:none;width:80px;height:84px;padding:0;background:#f3f4f6}
.partner img{width:80px;height:80px;object-fit:contain}
.partner small{position:absolute;right:0;bottom:0;background:#eef0f3;border-radius:4px;font-size:10px;padding:1px 4px}
.partner p{margin:4px 0;font-size:13px;line-height:1.5}
.partner strong{font-size:12px;color:#6e626a}
.toolbar{display:flex;align-items:center;gap:4px;margin:4px 0}
.toolbar label{display:flex;align-items:center;gap:4px;min-width:0;flex:1;font-size:11px}
.toolbar select{width:0;min-width:0;flex:1;max-width:142px;min-height:44px;background:white;border:1px solid #ddd;border-radius:8px;font-size:12px}
.toolbar button{font-size:12px;padding:6px 8px}
.field{display:grid;grid-template-areas:"hud" "objective" "map";min-width:0;position:relative;background:#edf2e9;border:1px solid #d5decf;border-radius:12px;padding:8px}
.hud{grid-area:hud;display:flex;justify-content:space-between;font-size:12px;padding:0 2px 7px}
.hud strong{color:#734657}
.board{grid-area:map;align-self:start;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
.tile{min-height:44px;height:clamp(44px,calc((100svh - 340px)/6),64px);position:relative;padding:0;background:#dce7cd;border:1px solid #c3d1b5;font-size:26px;border-radius:8px}
.tile small{display:block;position:absolute;bottom:1px;right:2px;font-size:11px;line-height:14px;background:#fff;border-radius:3px;padding:0 2px}
.tile.fog{background:#cdd4ce;color:#69756c;font-size:20px}
.tile.water{background:#c7e3ea;border-color:#a0c8d4}
.tile.reachable{outline:2px solid #5c8066;outline-offset:-2px}
.tile.current{background:#fff5d8;border:2px solid #bf8c44}
.tile.obstacle{background:#e2d9cb}
.panel{grid-area:map;align-self:center;z-index:1;min-width:0;margin:4px;border:1px solid #ddd;border-radius:12px;background:#fffffff5;padding:16px;text-align:center;box-shadow:0 3px 16px #28312819}
.panel h2{font-size:18px;margin:0 0 8px}
.panel p{font-size:13px;line-height:1.65}
.panel button{display:block;width:100%;margin-top:8px}
.primary{background:#d95b88;color:white;font-weight:700}
.actions{display:flex;gap:6px;margin-top:6px}
.actions button{flex:1;min-width:0;font-size:13px}
#tool[aria-pressed=true]{background:#eef0f3;outline:2px solid #6b7862}
.notice{min-height:38px;margin:7px 0 0;font-size:12px;line-height:1.5}
.save-note{font-size:11px;color:#6e626a;margin:4px 0}
dialog{width:calc(100% - 24px);max-width:420px;max-height:85svh;overflow-y:auto;overscroll-behavior:contain;border:1px solid #ddd;border-radius:12px;padding:16px;color:#2a2328}
dialog::backdrop{background:#241b2455}
.dialog-head{display:flex;justify-content:space-between;align-items:center}
.dialog-head h2{font-size:18px}
.dialog-head button{font-size:22px}
.cast-options{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.cast-options img{width:100%;height:100px;object-fit:contain}
.cast-options button{padding:4px;font-size:12px}
.cast-options button[aria-pressed=true]{outline:2px solid #d95b88}
.record{border-top:1px solid #eee;padding:12px 0}
.record p{margin:4px 0;font-size:13px}
#dialog-body{line-height:1.7}
#dialog-body ul{padding-left:20px}

.objective{grid-area:objective;font-size:12px;font-weight:600;line-height:1.5;margin:0 0 6px}
.tile-icon{position:absolute;inset:2px 0 14px;display:grid;place-items:center;line-height:1;pointer-events:none}
.tile small{pointer-events:none}
.tile:disabled{opacity:1}
.tile.reachable{border-style:dashed}
.tile.current{border-style:solid}
.tile.recent{box-shadow:inset 0 0 0 3px #5c8066}
.hud{font-variant-numeric:tabular-nums}
