/* モンスター工房 */
:root { --ink: #3b2a3a; --sub: #8a7a8a; --line: #f0dccc; --pink: #ff6a9a; --pink2: #ffd0e0; --panel: #fffdf9; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif; color: var(--ink); background: linear-gradient(160deg, #fff4e6, #e8f4ff) fixed; font-size: 14px; }
button, .btn, select, input { font: inherit; color: inherit; }
button, .btn { cursor: pointer; border: 2px solid #e6c9b8; background: #fff; border-radius: 10px; padding: 4px 10px; text-decoration: none; }
button:hover, .btn:hover { border-color: var(--pink); }
button.on { background: #ffe8f0; border-color: var(--pink); box-shadow: 0 0 0 2px var(--pink2); }
header { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #fff; border-bottom: 3px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
header h1 { margin: 0; font-size: 20px; color: var(--pink); } .sub { color: var(--sub); } .spacer { flex: 1; }
.tog { display: inline-flex; align-items: center; gap: 4px; }
.wrap { display: flex; gap: 12px; padding: 12px; align-items: flex-start; }
.list { width: 230px; flex-shrink: 0; max-height: calc(100vh - 80px); overflow-y: auto; background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 8px; position: sticky; top: 64px; }
.list h4 { margin: 8px 0 4px; font-size: 13px; color: #c0507a; }
.list button { display: flex; align-items: center; gap: 6px; width: 100%; padding: 2px 6px; margin: 2px 0; text-align: left; font-size: 13px; }
.list button canvas { width: 40px; height: 40px; image-rendering: pixelated; flex-shrink: 0; }
.list button .t { font-size: 10px; color: var(--sub); } .list button .saved { color: var(--pink); margin-left: auto; }
main { flex: 1; min-width: 0; }
.stage { display: flex; gap: 14px; flex-wrap: wrap; background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 12px; }
.big canvas { width: 384px; height: 384px; image-rendering: pixelated; border-radius: 10px; border: 2px solid var(--line); display: block; max-width: 100%; }
.side { flex: 1; min-width: 260px; } .side h2 { margin: 0 0 4px; }
.note { color: var(--sub); margin: 0 0 8px; }
.sizes { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 8px; } .sizes div { text-align: center; } .sizes canvas { image-rendering: pixelated; display: block; border: 1px dashed var(--line); } .sizes small { color: var(--sub); }
.bgs, .acts { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 6px 0; }
.big-btn { background: linear-gradient(#ff8ab0, #ff5a8a); color: #fff; border: none; font-weight: bold; padding: 8px 16px; }
.msg { color: #2a9a3a; font-weight: bold; min-height: 1.2em; }
.editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; margin-top: 12px; }
.editor section { background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.editor h3 { margin: 0 0 8px; font-size: 15px; } .editor h3 small { font-weight: normal; color: var(--sub); font-size: 12px; }
.row { display: flex; align-items: center; gap: 6px; margin: 6px 0; flex-wrap: wrap; } .row > b { width: 64px; font-size: 13px; }
.opts { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.opts button { font-size: 12px; padding: 3px 8px; }
.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.colors label { display: flex; align-items: center; gap: 4px; font-size: 13px; } .colors input[type=color] { width: 40px; height: 28px; border: none; background: none; padding: 0; }
.sub-item { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; background: #fff7f0; border-radius: 10px; padding: 4px 6px; margin: 4px 0; font-size: 13px; }
.sub-item b { min-width: 96px; } .sub-item input[type=color] { width: 28px; height: 24px; border: none; padding: 0; background: none; }
.sub-item button { padding: 1px 7px; font-size: 12px; } .sub-item .pos { color: var(--sub); font-size: 11px; min-width: 52px; text-align: center; }
.refs { position: fixed; left: 0; right: 0; bottom: 0; height: 46vh; background: #fffdf9; border-top: 3px solid var(--pink2); z-index: 10; display: none; flex-direction: column; box-shadow: 0 -6px 20px rgba(120,80,100,.2); }
.refs.open { display: flex; }
.refs-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 2px solid var(--line); } .refs-head small { color: var(--sub); }
.refs-body { flex: 1; overflow: auto; padding: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.refs-body figure { margin: 0; text-align: center; font-size: 11px; color: var(--sub); }
.refs-body img { image-rendering: pixelated; border: 2px solid var(--line); border-radius: 8px; cursor: zoom-in; background: #fff; }
.refs-body .empty { color: var(--sub); padding: 20px; }
@media (max-width: 900px) { .wrap { flex-direction: column; } .list { width: 100%; max-height: 220px; position: static; } .big canvas { width: 256px; height: 256px; } }
/* AI絵 */
.ai { background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-top: 12px; }
.ai h3 { margin: 0 0 8px; font-size: 15px; } .ai h3 small { font-weight: normal; color: var(--sub); font-size: 12px; }
.ai textarea { width: 100%; box-sizing: border-box; font: 12px/1.5 monospace; border: 2px solid var(--line); border-radius: 10px; padding: 6px 8px; resize: vertical; }
.ai .row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.ai-cands { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ai-cands figure { margin: 0; width: 170px; text-align: center; border: 3px solid var(--line); border-radius: 12px; padding: 4px; background: repeating-conic-gradient(#f2ecf4 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.ai-cands figure.on { border-color: var(--pink2); box-shadow: 0 0 0 3px rgba(255,120,170,.25); }
.ai-cands img { width: 160px; height: 160px; object-fit: contain; cursor: zoom-in; }
.ai-cands figcaption { display: flex; justify-content: center; gap: 6px; font-size: 12px; } .ai-cands figcaption button { padding: 1px 8px; font-size: 12px; }
.ai-cands .empty { color: var(--sub); padding: 8px; }
