@font-face{font-family:GotchiPixel;src:url('../assets/gotchi-pixel.ttf?v=2') format('truetype');font-display:swap}

body{min-height:100vh;background:#000000;color:#fff}
.site-footer{border-top:1px solid var(--line)}
.builder-shell{max-width:1760px;margin:auto;padding:clamp(35px,4vw,70px) clamp(18px,4vw,70px) 44px;position:relative}
.builder-shell:before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background-image:url('../assets/grid.svg');background-size:32px 32px;opacity:.075}
.builder-intro{text-align:center;margin:0 auto clamp(28px,3vw,48px);max-width:780px}
.builder-intro h1{font:clamp(30px,4.6vw,65px)/1.2 GotchiPixel,monospace;letter-spacing:normal;margin:18px 0 16px}
.builder-intro h1 em{font-style:normal;background:#fff;color:#000;padding:0 .12em}
.builder-intro p{color:#aaa;font:11px/1.9 GotchiPixel,monospace;margin:0}

.builder-layout{display:grid;grid-template-columns:minmax(170px,.75fr) minmax(350px,1.55fr) minmax(170px,.75fr);gap:clamp(14px,2.4vw,38px);align-items:center}
.trait-column{display:grid;grid-template-rows:1fr 1fr;gap:clamp(12px,2vw,28px)}
.trait-picker{width:100%;aspect-ratio:1;background:#000000;color:#fff;border:1px solid #777;padding:clamp(12px,1.4vw,22px);display:flex;flex-direction:column;justify-content:space-between;text-align:left;transition:border-color .2s,transform .2s}
.trait-picker:hover,.trait-picker:focus-visible{border-color:#fff;transform:translateY(-3px)}
.picker-top,.picker-bottom{display:flex;justify-content:space-between;align-items:center;gap:8px;font:9px/1.4 GotchiPixel,monospace}
.picker-top>span:last-child{font-size:17px}
.picker-art{flex:1;min-height:0;display:grid;place-items:center;padding:7px}
.picker-art svg{width:100%;height:100%;max-height:180px;image-rendering:pixelated;shape-rendering:crispEdges}
.picker-bottom{align-items:end}
.picker-bottom strong{font:clamp(10px,1vw,14px)/1.35 GotchiPixel,monospace;text-transform:uppercase}
.picker-bottom small{font:7px/1.3 GotchiPixel,monospace;color:#888;text-align:right}

.portal-wrap{border:1px solid #fff;background:#000;box-shadow:12px 12px 0 -1px #000000,12px 12px 0 0 #777;min-width:0;display:flex;flex-direction:column}
.portal-topline,.portal-bottomline{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;font:9px/1.5 GotchiPixel,monospace}
.portal-topline{border-bottom:1px solid #444}
.portal-bottomline{border-top:1px solid #444;color:#aaa}
.portal-stage{aspect-ratio:1;width:100%;height:auto;min-height:0;background:#000;cursor:zoom-out}
.portal-stage[data-view="full"]{cursor:zoom-in}
.portal-stage svg{width:100%;height:100%;image-rendering:pixelated;shape-rendering:crispEdges}
.view-control{background:#fff;color:#000;border:0;border-top:1px solid #fff;width:100%;padding:16px 12px;font:10px GotchiPixel,monospace}
.view-control:hover,.view-control:focus-visible{background:#000;color:#fff}
.shadow-controls{display:grid;grid-template-columns:1fr 1fr 1fr;border-top:1px solid #444}
.shadow-controls button{background:#000;color:#fff;border:0;padding:15px 6px;font:9px GotchiPixel,monospace}
.shadow-controls button+button{border-left:1px solid #444}
.shadow-controls button:hover,.shadow-controls button:focus-visible,.shadow-controls button[aria-pressed="true"]{background:#fff;color:#000}
.export-controls{border-top:1px solid #444;padding:16px 20px}
.export-controls>span{display:block;color:#aaa;font:9px/1.5 GotchiPixel,monospace;white-space:nowrap}
.export-formats{display:flex;align-items:center;justify-content:flex-start;justify-content:safe center;gap:12px;overflow-x:auto;margin-top:12px;padding-bottom:4px;scrollbar-width:thin}
.export-format{display:flex;flex:none;align-items:center;gap:6px}
.export-format+.export-format{border-left:1px solid #444;padding-left:12px}
.export-format>span{color:#aaa;font:8px GotchiPixel,monospace;white-space:nowrap}
.export-controls button{background:#000;color:#fff;border:1px solid #777;padding:9px 8px;font:8px GotchiPixel,monospace;white-space:nowrap}
.export-controls button:hover,.export-controls button:focus-visible{background:#fff;color:#000;border-color:#fff}
.export-controls button:disabled{opacity:.45;cursor:wait}
.export-status{min-height:1.4em;text-align:right;color:#aaa;margin:0;padding:0 16px 12px;font:7px GotchiPixel,monospace}
.builder-footnote{display:flex;justify-content:space-between;gap:20px;color:#888;border-top:1px solid #333;margin:clamp(36px,4vw,64px) 0 0;padding:20px 0;font:8px/1.7 GotchiPixel,monospace}

.trait-dialog{width:min(960px,calc(100vw - 24px));max-height:min(86vh,980px);padding:0;background:#000000;color:#fff;border:1px solid #fff;box-shadow:10px 10px 0 #555;overflow:auto}
.trait-dialog::backdrop{background:rgba(0,0,0,.82);backdrop-filter:blur(8px)}
.dialog-head{display:flex;justify-content:space-between;align-items:start;gap:20px;padding:28px 30px 16px;border-bottom:1px solid #444}
.dialog-head h2{font:clamp(24px,3vw,36px)/1.2 GotchiPixel,monospace;margin:12px 0 0}
.dialog-close{width:44px;height:44px;background:#000;color:#fff;border:1px solid #777;font:30px/1 monospace}
.dialog-close:hover,.dialog-close:focus-visible{background:#fff;color:#000}
.search-label{display:block;margin:22px 30px 7px;color:#aaa;font:8px GotchiPixel,monospace}
#trait-search{display:block;width:calc(100% - 60px);margin:0 30px 25px;background:#000;color:#fff;border:1px solid #777;padding:14px 16px;border-radius:0;outline:none;font:11px GotchiPixel,monospace}
#trait-search:focus{border-color:#fff}
.trait-gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:0 30px 26px}
.trait-option{background:#000;color:#fff;border:1px solid #555;text-align:left;padding:10px;min-width:0}
.trait-option:hover,.trait-option:focus-visible,.trait-option[aria-pressed="true"]{border-color:#fff;box-shadow:inset 0 0 0 1px #fff}
.trait-option svg{display:block;width:100%;aspect-ratio:1;background:#000;image-rendering:pixelated;shape-rendering:crispEdges}
.trait-option strong,.trait-option small{display:block;font-family:GotchiPixel,monospace;line-height:1.4}
.trait-option strong{font-size:10px;text-transform:uppercase;margin:10px 0 4px;overflow-wrap:anywhere}
.trait-option small{font-size:8px;color:#888}
.empty-gallery{grid-column:1/-1;color:#aaa;padding:35px 0;font:10px GotchiPixel,monospace}
.dialog-foot{border-top:1px solid #444;padding:14px 30px;margin:0;color:#888;font:8px GotchiPixel,monospace}

@media(max-width:960px){.builder-layout{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:"portal portal" "left right"}.portal-wrap{grid-area:portal;max-width:650px;width:100%;justify-self:center}.left-traits{grid-area:left}.right-traits{grid-area:right}.trait-column{align-self:start}.trait-picker{aspect-ratio:1.12}}
@media(max-width:600px){.builder-intro .eyebrow{font-size:8px}.builder-intro h1{font-size:29px}.builder-layout{gap:14px}.trait-column{gap:14px}.trait-picker{aspect-ratio:1;padding:10px}.picker-top{font-size:7px}.picker-bottom{display:block}.picker-bottom strong{font-size:9px}.picker-bottom small{display:none}.portal-topline,.portal-bottomline{font-size:7px;padding:12px}.export-controls{padding:12px}.export-controls>span{font-size:7px}.export-formats{margin-top:10px}.builder-footnote{display:block;font-size:7px}.builder-footnote span{display:block;margin-top:6px}.dialog-head{padding:20px}.search-label{margin:18px 20px 7px}#trait-search{width:calc(100% - 40px);margin:0 20px 20px}.trait-gallery{grid-template-columns:repeat(2,minmax(0,1fr));padding:0 20px 20px}.dialog-foot{padding:14px 20px}}
@media(prefers-reduced-motion:reduce){.trait-picker{transition:none}}

body.light{background:#fff;color:#000000}
body.light .builder-shell:before{filter:invert(1)}
body.light .builder-intro p,body.light .portal-bottomline,body.light .export-controls>span,body.light .export-format>span,body.light .export-status,body.light .search-label{color:#666}
body.light .trait-picker,body.light .portal-wrap,body.light .shadow-controls button,body.light .export-controls button,body.light .trait-dialog,body.light .dialog-close,body.light #trait-search,body.light .trait-option{background:#fff;color:#000000;border-color:#777}
body.light .builder-intro h1 em,body.light .view-control{background:#000000;color:#fff}
body.light .portal-stage{background:#fff}
body.light .portal-topline,body.light .portal-bottomline,body.light .shadow-controls,body.light .shadow-controls button+button,body.light .export-controls,body.light .dialog-head,body.light .dialog-foot{border-color:#bbb}
body.light .export-format+.export-format{border-color:#bbb}
.picker-art .picker-light{display:none}
body.light .trait-picker[data-category="head"] .picker-dark,body.light .trait-picker[data-category="legs"] .picker-dark{display:none}
body.light .trait-picker[data-category="head"] .picker-light,body.light .trait-picker[data-category="legs"] .picker-light{display:block}
body.light .trait-option svg>rect:first-child{fill:#fff}
body.light .trait-picker:hover,body.light .trait-picker:focus-visible,body.light .trait-option:hover,body.light .trait-option:focus-visible,body.light .trait-option[aria-pressed="true"]{border-color:#000000}
body.light .trait-picker:hover,body.light .trait-picker:focus-visible{box-shadow:inset 0 0 0 1px #000000}
body.light .view-control:hover,body.light .view-control:focus-visible{background:#fff;color:#000000}
body.light .shadow-controls button:hover,body.light .shadow-controls button:focus-visible,body.light .shadow-controls button[aria-pressed="true"],body.light .export-controls button:hover,body.light .export-controls button:focus-visible,body.light .dialog-close:hover,body.light .dialog-close:focus-visible{background:#000000;color:#fff}
body.light .trait-dialog{box-shadow:10px 10px 0 #aaa}
body.light .trait-option svg{background:#fff}
body.light .trait-option .motion-frame>:is(.light-outer-frame,.light-removed-head-pixel){display:none}
body.light .trait-option .light-removed-expression-pixel{display:none}
body.light .builder-footnote{border-color:#bbb;color:#666}
body.light .portal-stage.frame-dark{background:#000}
body.light .portal-stage:not(.frame-dark) .motion-frame>:is(.light-outer-frame,.light-removed-head-pixel),.portal-stage.frame-light .motion-frame>:is(.light-outer-frame,.light-removed-head-pixel){display:none}
body.light .portal-stage:not(.frame-dark) .light-removed-expression-pixel,.portal-stage.frame-light .light-removed-expression-pixel{display:none}
.light-shinobi-inset{display:none}
body.light .portal-stage:not(.frame-dark) .motion-frame>.light-shinobi-inset,.portal-stage.frame-light .motion-frame>.light-shinobi-inset{display:block}
body.light .portal-stage:not(.frame-dark) .light-laser-root,.portal-stage.frame-light .light-laser-root{display:block}
body.light .portal-stage:not(.frame-dark) .light-laser-outgoing,.portal-stage.frame-light .light-laser-outgoing{fill:#000}
.light-double-beam{display:none}
.godlike-prism-frames.godlike-light{display:none}
body.light .trait-option .preview-prism-frames.godlike-light{display:block}
body.light .trait-option .preview-prism-frames.godlike-dark{display:none}
body.light .trait-option .light-laser-root{display:block}
body.light .trait-option .light-laser-outgoing{fill:#000}
body.light .portal-stage:not(.frame-dark) .godlike-prism-frames.godlike-light,.portal-stage.frame-light .godlike-prism-frames.godlike-light{display:block}
body.light .portal-stage:not(.frame-dark) .godlike-prism-frames.godlike-dark,.portal-stage.frame-light .godlike-prism-frames.godlike-dark{display:none}
body.light .portal-stage:not(.frame-dark) .light-double-beam,.portal-stage.frame-light .light-double-beam,body.light .trait-option .light-double-beam{display:block}
body.light .portal-stage:not(.frame-dark) .light-double-laser :is(.light-laser-outgoing,.light-double-source-pixel),.portal-stage.frame-light .light-double-laser :is(.light-laser-outgoing,.light-double-source-pixel),body.light .trait-option .light-double-laser :is(.light-laser-outgoing,.light-double-source-pixel){display:none}

.builder-culture-picker{position:relative;display:inline-block}.builder-culture-picker select[hidden]{display:none}.builder-culture-menu{position:absolute;top:100%;left:0;z-index:60;min-width:100%;border:1px solid var(--line);background:var(--ink);color:var(--paper)}.builder-culture-menu[hidden]{display:none}.builder-culture-menu button{display:block;width:100%;padding:16px;text-align:left;border:0;border-radius:0;color:inherit;background:none;font:10px/1.5 GotchiPixel,monospace;white-space:nowrap;cursor:pointer}.builder-culture-menu button+button{border-top:1px solid var(--line)}.builder-culture-menu button:hover,.builder-culture-menu button:focus-visible{background:var(--paper);color:var(--ink)}.builder-culture-menu button[aria-selected="true"]::before{content:'■ ';font-size:9px}
.builder-metadata .trait-list>div{background:var(--ink)}
