@font-face{font-family:SplatoonK;src:url('assets/SplatoonK.ttf') format('truetype');font-display:swap}
*{box-sizing:border-box}body{margin:0;background:var(--color-paper);color:var(--color-ink);font-family:var(--font-body)}button,input,select{font:inherit;color:inherit}button{cursor:pointer;background:var(--color-surface);border:1px solid var(--color-rule);min-height:42px;padding:8px 12px}button:hover{background:var(--color-shelf)}button:disabled{opacity:.5;cursor:default}:focus-visible{outline:3px solid var(--color-focus);outline-offset:2px}main{max-width:1200px;margin:auto;padding:24px}.heading,.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}h1{margin:0;font-size:28px}h2{font-size:18px;margin:0 0 16px}.dialog-heading h2{margin:0}.hint,footer{font-size:12px;color:var(--color-muted);line-height:1.7}#status{font-size:13px}#status:empty{display:none}#preview{width:100%;height:auto;display:block;border:1px solid var(--color-rule);background:#f8f9f4;margin:20px 0}#editor{display:grid;grid-template-columns:1fr 1fr;gap:32px}#editor[hidden]{display:none}section{min-width:0}input,select{background:var(--color-surface);border:1px solid var(--color-rule);padding:10px;min-width:0}.field{display:flex;flex-direction:column;gap:6px;font-size:12px;min-width:0;margin-bottom:14px}.field button{text-align:left;overflow-wrap:anywhere}.titles{display:grid;grid-template-columns:1fr 1fr;gap:12px}.plate-parts{display:grid;grid-template-columns:1fr 1fr;gap:18px}#banner{padding:0;line-height:0}#banner img{display:block;width:100%;height:auto}fieldset{border:0;margin:0;padding:0;min-width:0}legend{font-size:12px;padding:0;margin-bottom:6px}.badges{display:flex;gap:6px}.badges button{width:60px;height:60px;padding:4px;background:#eceee6}.badges img{width:100%;height:100%;object-fit:contain}.weapons{display:grid;grid-template-columns:1fr 42px 1fr;gap:10px;align-items:center}.weapons .field{margin:0}.weapons .field button{display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;min-height:148px;font-size:13px;gap:6px}.weapons img{width:80px;height:80px;object-fit:contain}#swap{padding:0;font-size:20px}footer{border-top:1px solid var(--color-rule);padding-top:14px;margin-top:24px}summary{cursor:pointer}a{color:inherit}dialog{width:min(760px,calc(100% - 24px));max-height:90dvh;padding:20px;border:1px solid var(--color-rule);background:var(--color-paper);color:inherit}dialog::backdrop{background:#0008}.search-tools{display:flex;gap:8px;margin-top:16px}.search-tools input{flex:1;width:100%}.search-tools select{max-width:42%}.picker-actions{display:flex;justify-content:space-between;align-items:center;margin:12px 0;font-size:12px}#results{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;overflow:auto;max-height:55dvh}#results button{font-size:12px;min-width:0;display:flex;align-items:center;flex-direction:column;gap:6px;text-align:center}#results img{width:68px;height:68px;object-fit:contain}#results.banner img{width:100%;height:auto}#results.banner button{padding:4px}#results.adjective,#results.subject{grid-template-columns:repeat(2,minmax(0,1fr))}#results.adjective button,#results.subject button{justify-content:center}#results button[aria-pressed=true]{border:2px solid var(--color-ink);background:var(--color-shelf)}#export-image{display:block;width:100%;height:auto;margin-top:20px}#download{display:block;padding:12px;margin-top:14px;text-align:center;background:var(--color-ink);color:var(--color-paper);font-weight:700;text-decoration:none}
@media(max-width:700px){main{padding:16px 12px}h1{font-size:24px}#editor{grid-template-columns:1fr;gap:22px}#preview{margin:12px 0 20px}.plate-parts{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}.badges{gap:4px}.badges button{width:calc((100% - 8px)/3);height:auto;aspect-ratio:1;padding:2px}dialog{padding:14px}#results{grid-template-columns:repeat(2,minmax(0,1fr))}.weapons .field button{min-height:128px}.weapons img{height:65px}.search-tools select{max-width:40%}}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#editor{grid-template-columns:120px minmax(0,1.3fr) minmax(0,1fr);gap:24px;align-items:start}#nickname,#adjective,#subject{font-family:SplatoonK,var(--font-body);font-size:20px}#nickname{min-height:48px}#adjective,#subject{min-height:48px}#export,#close-picker,#close-export,#clear,#crop-cancel,#crop-apply{font-size:24px;min-width:44px}.photo-section{display:flex;flex-direction:column;gap:8px}#photo-add{width:120px;height:120px;padding:0;display:grid;place-items:center}#photo-add img{width:100%;height:100%;object-fit:cover}.photo-actions{display:flex;gap:8px}.photo-actions button{flex:1;font-size:22px}.weapons .field button{min-height:120px}.weapons .field:first-child img{width:100px;height:100px}.weapons .field:last-child img{width:65px;height:65px}.weapons{grid-template-columns:minmax(0,1.3fr) 36px minmax(0,1fr)}#results.badge,#results.weapon{grid-template-columns:repeat(6,minmax(0,1fr))}#results button{padding:6px}#results.adjective button,#results.subject button{font-family:SplatoonK,var(--font-body);font-size:18px}#crop-dialog{max-width:440px}#crop-canvas{display:block;width:min(100%,320px);height:auto;margin:18px auto 0;touch-action:none;cursor:grab;background:#eee}#crop-canvas:active{cursor:grabbing}.crop-control{display:flex;align-items:center;gap:12px;font-size:12px;margin-block:8px}.crop-control input{width:100%}#crop-apply{width:100%;margin-top:12px}#crop-dialog .hint{text-align:center}#photo-status:empty{display:none}
@media(max-width:700px){#editor{grid-template-columns:76px minmax(0,1fr);gap:16px}#photo-add{width:76px;height:76px}.photo-actions{gap:4px}.photo-actions button{padding:2px;min-width:34px}#editor>section:last-child{grid-column:1/-1}.weapons{max-width:350px}.titles{gap:6px}#adjective,#subject{font-size:16px;padding:6px}.plate-parts{grid-template-columns:1fr}.badges button{max-width:50px}.field{margin-bottom:10px}#results.badge,#results.weapon{grid-template-columns:repeat(4,minmax(0,1fr))}#results img{width:56px;height:56px}}


#banner{max-width:260px}#nickname{text-align:center;font-size:26px}

body{background:#fff}main,dialog{--profile-accent:#657d2b;--color-paper:#fff;--color-surface:#fff;--color-shelf:#fff;--color-ink:#292929;--color-muted:#595959;--color-rule:#ddd;--color-focus:var(--profile-accent)}#preview,.badges button{background:#fff}main button:hover,dialog button:hover{border-color:var(--profile-accent)}.heading-tools{display:flex;align-items:center;gap:14px}.accent-control{display:flex;align-items:center;gap:8px;font-size:12px}#accent{width:44px;height:40px;padding:3px;cursor:pointer;background:#fff;border:1px solid #ddd}#results button[aria-pressed=true]{background:#fff;border-color:var(--profile-accent)}

#accent{display:grid;place-items:center;padding:5px}#accent-swatch{display:block;width:28px;height:28px;border:1px solid #ddd}#color-picker{max-width:400px}#color-options{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:18px}#color-options button{padding:5px;min-height:48px;background:#fff}#color-options span{display:block;background:var(--swatch);height:32px}#color-options button[aria-pressed=true]{outline:2px solid #292929;outline-offset:1px}#share{font-size:24px;min-width:44px}

/* Ink-sticker workbench: white surfaces with a single selectable ink color. */
main{max-width:1160px;padding-top:30px}.heading{padding:0 4px 16px;position:relative}.heading:after{content:"";position:absolute;bottom:0;left:4px;width:90px;height:5px;background:var(--profile-accent);transform:skewX(-24deg)}h1{font-family:SplatoonK,var(--font-body);font-size:30px;letter-spacing:-1px}.heading-tools{gap:8px}.heading-tools button{height:46px;min-width:46px;border:2px solid #292929;border-radius:8px;box-shadow:2px 3px 0 #292929;transition:transform .12s,box-shadow .12s}.heading-tools button:hover{transform:translateY(-2px)}.heading-tools button:active{transform:translate(2px,3px);box-shadow:none}#accent{width:46px;height:46px;border:2px solid #292929}#accent-swatch{border:0;border-radius:3px;width:28px;height:28px}#export{background:var(--profile-accent);color:#fff;text-shadow:0 1px 2px #0008}#preview{margin:24px 0;border:0;outline:1px solid #ededed;box-shadow:0 12px 32px #00000009}#editor{padding:24px;background:#fff;border-top:3px solid #292929;border-bottom:1px solid #e8e8e8;gap:24px}#editor button,#editor input{border-color:#dedede;border-radius:6px}#editor button:hover{border-color:var(--profile-accent);background:color-mix(in srgb,var(--profile-accent) 5%,white)}#nickname{border-width:0 0 2px;border-radius:0!important;border-bottom-color:var(--profile-accent)!important;background:#fff}#adjective,#subject{text-align:center;font-size:18px}#photo-add{border:2px dashed #ccc!important;border-radius:10px!important;overflow:hidden}#photo-add:hover{border-color:var(--profile-accent)!important}.photo-actions button{min-height:36px}.weapons{grid-template-columns:1fr 32px 1fr;gap:8px}.weapons .field button{min-height:150px;background:radial-gradient(ellipse at center,color-mix(in srgb,var(--profile-accent) 8%,white),white 72%)}.weapons .field:first-child img,.weapons .field:last-child img{width:100px;height:100px}#swap{border:0!important}.badges button{border-style:dashed!important}#banner{border:0!important;border-radius:3px!important;overflow:hidden}dialog{border:2px solid #292929;border-radius:12px;box-shadow:6px 6px 0 #29292933}.dialog-heading{padding-bottom:12px;border-bottom:3px solid #292929}.dialog-heading h2{font-family:SplatoonK,var(--font-body)}.dialog-heading button{border:0;border-radius:6px;font-size:24px}#results button{border-radius:6px}#results button[aria-pressed=true]{box-shadow:inset 0 0 0 1px var(--profile-accent)}#color-options button{border-radius:6px}#color-options span{border-radius:3px}#download{border-radius:6px}footer{border:0;margin-top:12px;padding:8px 4px}dialog::backdrop{background:#17171b99;backdrop-filter:blur(3px)}
@media(max-width:700px){main{padding:18px 12px}h1{font-size:24px}.heading-tools{gap:7px}.heading-tools button,#accent{min-width:40px;width:40px;height:40px}.heading{padding-bottom:14px}#editor{padding:18px 0;gap:14px}.weapons{max-width:none}.weapons .field button{min-height:116px}.weapons .field:first-child img,.weapons .field:last-child img{width:88px;height:88px}#adjective,#subject{font-size:16px}#preview{margin:20px 0}dialog{border-radius:8px}}

#photo-add{height:auto;aspect-ratio:14/5}#crop-dialog{max-width:620px}#crop-canvas{width:100%;aspect-ratio:14/5}

.background-tools{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:0 0 20px;font-size:13px}.background-tools select{max-width:100%;border-radius:6px}.background-tools button{border-radius:6px}.background-tools [hidden]{display:none}

/* Keep the selector stable while searches change the result count. */
#picker{height:min(720px,90dvh);max-height:90dvh;overflow:hidden}
#picker[open]{display:flex;flex-direction:column}
#picker>.dialog-heading,#picker>.search-tools,#picker>.picker-actions{flex-shrink:0}
#picker #results{flex:1;min-height:0;max-height:none;align-content:start;overflow:auto;scrollbar-gutter:stable}

#background-opacity-control{display:flex;align-items:center;gap:8px}#background-opacity-control[hidden]{display:none}#background-opacity{width:130px;padding:0;accent-color:var(--profile-accent)}#background-opacity-value{min-width:4ch;font-variant-numeric:tabular-nums}

/* Let thumbnails shrink with their grid cells, including narrow dialogs. */
#results.badge button,#results.weapon button{min-width:0;overflow:hidden}
#results.badge img,#results.weapon img{display:block;width:68px;max-width:100%;height:auto;aspect-ratio:1;object-fit:contain;flex-shrink:1}
@media(max-width:700px){#results.badge img,#results.weapon img{width:56px}}
#results.badge,#results.weapon{grid-auto-rows:84px}
#results.badge button,#results.weapon button{height:84px;justify-content:center}
#results.badge img,#results.weapon img{height:68px;max-height:100%;min-height:0}
@media(max-width:700px){#results.badge,#results.weapon{grid-auto-rows:72px}#results.badge button,#results.weapon button{height:72px}#results.badge img,#results.weapon img{height:56px}}
