:root{--tree-ink:#11130f;--tree-paper:#f5f4ee;--tree-lime:#c8ff36;--tree-line:#34382f;--tree-muted:#9ca392;--tree-panel:#191c17}
*{box-sizing:border-box;letter-spacing:0}
html,body{height:100%;margin:0;overflow:hidden;background:var(--tree-ink);font-family:"Noto Sans JP","Yu Gothic UI",Meiryo,sans-serif}
button,input{font:inherit}
.tree-app{height:100%;display:flex;flex-direction:column;background:var(--tree-ink);color:#fff}
.tree-header{height:64px;flex:none;display:flex;align-items:center;border-bottom:1px solid #ffffff1c;background:#11130ff5;z-index:20;padding:0 max(16px,calc((100vw - 1440px)/2))}
.tree-brand{display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none;margin-right:auto}.tree-brand img{width:36px;height:36px;object-fit:cover;border:1px solid var(--tree-lime)}.tree-brand span{line-height:1}.tree-brand b{display:block;font-size:14px}.tree-brand small{display:block;margin-top:6px;color:var(--tree-lime);font-size:8px;font-weight:800;letter-spacing:2px}
.tree-header nav{height:100%;display:flex}.tree-header nav a{display:flex;align-items:center;color:#bfc5b9;text-decoration:none;font-size:12px;font-weight:800;border-left:1px solid #ffffff18;padding:0 18px}.tree-header nav a:last-child{border-right:1px solid #ffffff18}.tree-header nav a:hover,.tree-header nav a.active{background:var(--tree-lime);color:#11130f}
.mobile-menu{display:none;width:40px;height:40px;border:1px solid #ffffff33;background:transparent;color:#fff;font-size:20px}
.tree-main{flex:1;min-height:0;display:flex}.tree-workspace{position:relative;flex:1;min-width:0;display:flex}.tree-stage{position:relative;flex:1;min-width:0;overflow:hidden;touch-action:none;cursor:grab;background-color:#141711;background-image:linear-gradient(#ffffff07 1px,transparent 1px),linear-gradient(90deg,#ffffff07 1px,transparent 1px),radial-gradient(circle at 50% 50%,#263020 0,transparent 58%);background-size:32px 32px,32px 32px,100% 100%}.tree-stage.dragging{cursor:grabbing}.tree-stage:focus-visible{outline:2px solid var(--tree-lime);outline-offset:-2px}
#tree-svg{width:100%;height:100%;display:block;user-select:none}.tree-camera{transform-origin:0 0}.edge{fill:none;stroke:#68705f;stroke-width:2;stroke-dasharray:7 7;vector-effect:non-scaling-stroke}.edge.family-edge{stroke-width:3;stroke-dasharray:none}.edge.dim{opacity:.12}.edge.owned{stroke:var(--tree-lime);stroke-dasharray:none}.family-hub circle{fill:#11130f;stroke-width:5}.family-hub text{fill:#fff;text-anchor:middle;font-size:19px;font-weight:900;paint-order:stroke;stroke:#11130f;stroke-width:4px}.root-node rect{fill:var(--tree-lime);stroke:#fff;stroke-width:3}.root-node text{fill:#11130f;text-anchor:middle;font-size:18px;font-weight:900}
.dice-node{cursor:pointer;outline:none}.dice-node .node-frame{fill:#20251d;stroke:#8a9180;stroke-width:3;transition:.18s}.dice-node .node-image-frame{fill:#11130f}.dice-node image{pointer-events:none}.dice-node .node-label{fill:#fff;font-size:14px;font-weight:900;text-anchor:middle;paint-order:stroke;stroke:#11130f;stroke-width:4px;pointer-events:none}.dice-node .node-status{fill:#aeb5a7;font-size:9px;font-weight:700;text-anchor:middle;pointer-events:none}.dice-node:hover .node-frame,.dice-node:focus-visible .node-frame,.dice-node.selected .node-frame{stroke:#fff;stroke-width:5}.dice-node.selected .node-frame{filter:drop-shadow(0 0 8px #c8ff3673)}.dice-node.owned .node-frame{fill:#243013;stroke:var(--tree-lime);stroke-width:5}.dice-node.owned:after{content:""}.dice-node.dim{opacity:.13}.dice-node.hit .node-frame{stroke:#ffdf58;stroke-width:6}.owned-check{fill:var(--tree-lime);stroke:#11130f;stroke-width:2}.owned-check-text{fill:#11130f;font-size:12px;font-weight:1000;text-anchor:middle;pointer-events:none}
.tree-toolbar{position:absolute;top:12px;left:12px;right:12px;z-index:8;display:flex;align-items:flex-start;gap:8px;pointer-events:none}.tree-toolbar>*{pointer-events:auto}.tree-search-wrap{position:relative;width:min(330px,42vw)}.tree-search-wrap>span{position:absolute;left:12px;top:5px;color:#11130f;font-size:26px;transform:rotate(-20deg);z-index:2}.tree-search-wrap input{width:100%;height:42px;border:1px solid #11130f;background:#fbfaf6;color:#11130f;padding:0 38px;font-size:13px;font-weight:700;outline:none;box-shadow:3px 3px 0 var(--tree-lime)}.tree-search-wrap input:focus{box-shadow:5px 5px 0 var(--tree-lime)}.search-results{position:absolute;top:49px;left:0;width:100%;max-height:260px;overflow:auto;background:#fbfaf6;color:#11130f;border:1px solid #11130f;box-shadow:4px 4px 0 #11130f}.search-results button{display:flex;width:100%;align-items:center;justify-content:space-between;border:0;border-bottom:1px solid #dedcd3;background:#fbfaf6;padding:9px 11px;text-align:left;font-size:12px;font-weight:800;cursor:pointer}.search-results button:hover{background:var(--tree-lime)}.search-results small{color:#697064}
.family-filters{display:flex;gap:4px;flex-wrap:wrap}.family-filters button{height:36px;padding:0 12px;border:1px solid #ffffff3b;background:#11130fe6;color:#d7dbd2;font-size:11px;font-weight:900;cursor:pointer}.family-filters button.active{border-color:var(--family);background:var(--family);color:#11130f}.icon-control{width:36px;height:36px;border:1px solid #ffffff3b;background:#11130fe6;color:#fff;font-weight:900;cursor:pointer}
.tree-legend{position:absolute;left:12px;bottom:12px;display:flex;gap:14px;padding:7px 10px;background:#11130fe6;border:1px solid #ffffff24;color:#c3c8bd;font-size:9px;font-weight:800}.tree-legend span{display:flex;align-items:center;gap:5px}.tree-legend i{width:11px;height:11px;display:block;border:2px solid #899080}.tree-legend .legend-owned{background:#243013;border-color:var(--tree-lime)}.tree-legend .legend-unknown{height:0;border:0;border-top:2px dashed #899080;width:16px}
.zoom-controls{position:absolute;right:12px;bottom:12px;display:flex;flex-direction:column;gap:4px}.zoom-controls button{width:44px;height:38px;border:1px solid #ffffff35;background:#11130feb;color:#fff;font-weight:900;cursor:pointer}.zoom-controls button:hover{border-color:var(--tree-lime);color:var(--tree-lime)}.zoom-controls button:last-child{font-size:10px}
.tree-detail{position:relative;width:380px;flex:none;border-left:1px solid #ffffff20;background:#f5f4ee;color:#11130f;overflow:hidden}.detail-content{height:100%;overflow-y:auto;padding:22px 20px 40px}.detail-close{position:absolute;right:10px;top:10px;z-index:3;width:34px;height:34px;border:1px solid #11130f;background:#fbfaf6;color:#11130f;font-size:20px;cursor:pointer}.detail-empty{min-height:100%;display:grid;align-content:center;text-align:center;padding:24px}.empty-mark{width:74px;height:74px;display:grid;place-items:center;margin:0 auto 18px;background:#11130f;color:var(--tree-lime);font-weight:1000}.detail-empty h1{font-size:23px;margin:0 0 8px}.detail-empty p{margin:0;color:#687064;font-size:12px;line-height:1.8}
.detail-head{display:flex;gap:14px;align-items:flex-start;padding:36px 0 18px;border-bottom:2px solid #11130f}.detail-head img,.detail-fallback{width:72px;height:72px;flex:none;object-fit:cover;border:2px solid #11130f;background:#dfe3d9}.detail-fallback{display:grid;place-items:center;font-size:28px;font-weight:900}.detail-head h1{font-size:22px;line-height:1.35;margin:5px 0 7px}.family-chip{display:inline-block;background:var(--family);padding:3px 8px;font-size:10px;font-weight:900}.detail-tags{display:flex;gap:4px;flex-wrap:wrap}.detail-tags span{border:1px solid #b9bdb2;background:#fff;padding:2px 6px;font-size:9px;font-weight:700}.detail-section{padding:17px 0;border-bottom:1px solid #cacdc4}.detail-section h2{margin:0 0 8px;font-size:11px;letter-spacing:1.2px;color:#697064}.detail-section p{margin:0;font-size:13px;line-height:1.75}.detail-stats{display:grid;grid-template-columns:1fr 1fr;border-left:1px solid #c8cbc2;border-top:1px solid #c8cbc2}.detail-stats div{padding:8px 9px;border-right:1px solid #c8cbc2;border-bottom:1px solid #c8cbc2;background:#fff}.detail-stats dt{font-size:9px;color:#757c71}.detail-stats dd{margin:2px 0 0;font-size:15px;font-weight:900}.ability-list{margin:0;padding:0;list-style:none;display:grid;gap:6px}.ability-list li{background:#fff;border-left:3px solid #11130f;padding:8px 10px;font-size:11px;line-height:1.6}.unknown-note{color:#8a6b00;background:#fff4bd;border:1px solid #d2b53f;padding:9px 10px!important}.detail-actions{display:flex;gap:7px;padding-top:18px}.detail-actions button,.detail-actions a{flex:1;min-height:42px;display:grid;place-items:center;border:1px solid #11130f;background:#fff;color:#11130f;text-decoration:none;font-size:11px;font-weight:900;cursor:pointer}.detail-actions .owned-button.active{background:var(--tree-lime)}.detail-actions a{background:#11130f;color:#fff}
.tree-statusbar{height:34px;flex:none;display:flex;align-items:center;gap:20px;padding:0 14px;border-top:1px solid #ffffff1c;background:#11130f;color:#aeb5a7;font-size:10px}.tree-statusbar b{color:var(--tree-lime)}.tree-statusbar .caution{margin-left:auto;color:#f5d86f}
.help-dialog{width:min(440px,calc(100vw - 28px));border:1px solid var(--tree-lime);background:#1b1f18;color:#fff;padding:22px;box-shadow:10px 10px 0 #000}.help-dialog::backdrop{background:#000a}.help-dialog>button{position:absolute;right:10px;top:10px;width:32px;height:32px;border:1px solid #ffffff40;background:transparent;color:#fff;font-size:20px}.help-dialog h2{margin:0 0 18px;font-size:19px}.help-dialog dl{margin:0;display:grid;gap:7px}.help-dialog dl div{display:grid;grid-template-columns:90px 1fr;border:1px solid #ffffff20;padding:8px 10px}.help-dialog dt{color:var(--tree-lime);font-weight:900;font-size:12px}.help-dialog dd{margin:0;color:#c8cec3;font-size:12px}
@media(max-width:1000px){.tree-detail{width:330px}.tree-header nav a{padding:0 12px}.family-filters button{padding:0 9px}}
@media(max-width:780px){.tree-header{height:58px;padding:0 12px}.tree-header nav{display:none;position:absolute;top:58px;left:0;right:0;height:auto;background:#11130f;border-top:1px solid #ffffff25;grid-template-columns:repeat(2,1fr);padding:8px}.tree-header nav.open{display:grid}.tree-header nav a{height:45px;border:1px solid #ffffff18!important}.mobile-menu{display:block}.tree-brand b{font-size:12px}.tree-brand small{font-size:7px}.tree-main{position:relative}.tree-detail{position:absolute;left:0;right:0;bottom:0;width:auto;height:min(62%,540px);transform:translateY(calc(100% - 52px));transition:transform .22s ease;border-left:0;border-top:2px solid var(--tree-lime);z-index:12}.tree-detail.open{transform:translateY(0)}.tree-detail:before{content:"ダイス詳細";display:block;height:50px;padding:17px 20px;background:#f5f4ee;font-size:11px;font-weight:900}.detail-content{height:calc(100% - 50px);padding-top:0}.detail-head{padding-top:8px}.detail-close{top:8px}.tree-toolbar{top:8px;left:8px;right:8px;display:grid;grid-template-columns:1fr 36px}.tree-search-wrap{width:auto}.family-filters{grid-column:1/3;overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px}.family-filters button{flex:none}.tree-legend{display:none}.zoom-controls{bottom:10px;right:8px}.tree-statusbar{gap:14px}.tree-statusbar .caution{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.search-results{max-height:190px}}
@media(max-width:480px){.tree-brand img{width:32px;height:32px}.tree-search-wrap input{font-size:11px}.family-filters button{height:32px}.tree-toolbar{gap:6px}.tree-statusbar{font-size:9px;padding:0 9px}.tree-statusbar span:first-child{display:none}.detail-stats{grid-template-columns:1fr 1fr}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
