:root{font-family:system-ui,-apple-system,'Noto Sans JP',sans-serif;color:#e9e7df;background:#121a21}*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at 50% -15%,#314654,#121a21 65%);min-height:100vh}.shell{max-width:690px;margin:auto;padding:28px 16px 45px}header{text-align:center;margin-bottom:24px}header h1{font-size:clamp(24px,6vw,38px);margin:4px 0}.eyebrow,.step{letter-spacing:.15em;color:#afc8bd;font-size:12px}header p,.hint,footer{color:#acb8ba;font-size:13px}.panel{border:1px solid #58636b;background:#202c34e8;padding:24px;border-radius:18px;box-shadow:0 16px 32px #0004}.panel[hidden],[hidden]{display:none!important}nav,.actions{display:flex;gap:10px;margin:18px 0}button{border:1px solid #697783;background:#34444f;color:white;border-radius:10px;padding:12px 15px;cursor:pointer;font:inherit}button:hover{filter:brightness(1.15)}button.active,button.primary{background:#27795f;border-color:#43a282}button:disabled{opacity:.5;cursor:not-allowed}nav button,.actions button{flex:1}label{display:block;font-weight:650;margin:17px 0 9px}input:not([type=range]):not([type=file]),select{display:block;width:100%;background:#121d25;border:1px solid #697783;color:#fff;border-radius:9px;padding:12px;margin-top:7px;font:inherit}input[type=file]{display:block;margin-top:10px;width:100%;font-size:13px}input[type=range]{width:100%;accent-color:#41ab86;margin:16px 0 5px}.fieldset{margin:20px 0;padding:14px;background:#17232b;border-radius:12px}.between{display:flex;justify-content:space-between}.axisTop{text-align:center;color:#c5d3d3;font-size:13px;margin:10px}.personality{display:flex;align-items:center;gap:5px}.axisSide{font-size:11px;writing-mode:vertical-rl;line-height:1.2;color:#c5d3d3}.personGrid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;flex:1;max-width:430px;margin:auto}.personGrid button{aspect-ratio:1;padding:0;border-radius:5px;background:#46575e;min-width:0}.personGrid button.center{background:#647077}.personGrid button.selected{background:#3dad84;border:2px solid #d6ffe1}.hero{display:flex;align-items:center;gap:16px;padding:10px 0}.portrait{height:84px;width:84px;flex-shrink:0;border-radius:12px;object-fit:cover;background:#47545e;display:grid;place-items:center;font-size:40px}.stats,.results{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:16px 0}.stat{background:#16232b;border-radius:10px;padding:13px 8px;text-align:center}.stat small{display:block;color:#aabcc0;font-size:11px}.stat b{display:block;font-size:22px;margin:3px}h3{margin-top:24px}#message{color:#ffd69b;text-align:center;min-height:18px}.dungeon{display:grid;gap:2px;max-width:520px;margin:14px auto;background:#0d141b;padding:5px;border-radius:9px}.tile{aspect-ratio:1;display:grid;place-items:center;font-size:clamp(9px,2vw,20px);border-radius:2px;position:relative}.wall{background:#52606a;border:1px solid #64717b}.floor{background:#29373f}.visited{background:#2b725b}.boss{background:#9d474c}.startTile{background:#1a8464}.last{outline:2px solid #fce38d;outline-offset:-2px;z-index:1}.legend{font-size:12px;color:#bfceca;text-align:center}.code{font-size:22px;font-weight:800;letter-spacing:.07em;overflow-wrap:anywhere}footer{text-align:center;margin:22px} @media(max-width:420px){.panel{padding:15px}.stats,.results{gap:5px}.stat b{font-size:18px}}

/* v0.1.1: portrait crop overlay and short adventure log */
.cropBackdrop{position:fixed;inset:0;background:#000b;z-index:50;display:flex;align-items:center;justify-content:center;padding:16px;overflow:auto}.cropPanel{background:#22303a;border:1px solid #79858a;border-radius:16px;padding:18px;width:min(100%,420px);max-height:96vh;overflow:auto;box-shadow:0 20px 70px #000a}.cropPanel h2{margin:0 0 8px;font-size:21px}#cropCanvas{display:block;width:min(100%,320px);height:auto;aspect-ratio:1;margin:14px auto;background:#171e25;touch-action:none;cursor:grab;border:2px solid #d0e9dc;border-radius:5px}#cropCanvas:active{cursor:grabbing}.cropPanel .actions{margin-bottom:0}.eventLog{margin:12px 0 18px;padding-left:1.45em;line-height:1.65}.eventLog li{margin:7px 0;font-size:14px;overflow-wrap:anywhere}.iconPreview{display:block;width:72px;height:72px;object-fit:cover;border-radius:10px;margin:8px 0}