.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: 1440px; margin: auto; padding: 12px 24px 64px; }
aside { display: flex; min-width: 0; flex-direction: column; gap: 12px; }
.panel { overflow: hidden; padding: 4px; border-radius: 16px; background: var(--panel); }
.panel h2 { display: flex; align-items: center; gap: 10px; height: 40px; margin: 0 0 4px; padding: 0 12px; border-radius: 12px; background: var(--card); font-size: 14px; font-weight: 500; }
.panel h2 [data-icon] { color: var(--accent); }
.panel output { margin-left: auto; color: var(--muted); font: 12px "DM Mono", ui-monospace, monospace; }
.swatches { display: grid; grid-template-columns: repeat(6, 26px); justify-content: space-between; gap: 12px 0; padding: 10px 10px 12px; }
.swatches button, .custom { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(128 128 128 / .3); cursor: pointer; transition: scale .3s var(--spring); }
.swatches button:hover, .custom:hover { scale: 1.15; }
.swatches [aria-pressed="true"], .custom.on { outline: 2px solid var(--ink); outline-offset: 2px; }
.swatches .clear { background: repeating-conic-gradient(#d4d4d8 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
.custom { position: relative; display: grid; place-items: center; border: 1.5px dashed var(--muted); box-shadow: none; }
.custom::after { content: "+"; color: var(--muted); font-size: 16px; line-height: 1; }
.custom.on { border: 0; }
.custom.on::after { content: none; }
.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.custom:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
#styles { display: flex; gap: 2px; }
#styles button { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 12px; color: var(--muted); text-align: left; transition: color .3s, background-color .3s; }
#styles button:hover { color: var(--ink); }
#styles svg { width: 22px; height: 22px; border-radius: 6px; }
#styles [aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgb(17 18 20 / .08); }
#status { margin: 0 0 12px; color: var(--muted); }
#status:empty { margin: 0; }
#grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
#grid .face { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 18px; background: var(--tile); animation: in .45s var(--soft) both; animation-delay: calc(var(--i) * 8ms); transition: background-color .3s, scale .3s var(--spring); }
#grid li:hover .face { background: var(--hover); }
#grid .face:active { scale: .97; }
#grid .face svg { display: block; width: 74%; height: 74%; transition: translate .3s var(--soft), rotate .3s var(--soft); }
#grid li:hover .face svg { translate: 0 -4px; rotate: -3deg; }
#grid:not(.plain) .face svg { border-radius: 50%; }
/* on a dark tile a transparent avatar gets a thin light edge on screen only, so black hair still shows */
:root[data-theme="dark"] #grid.plain .face svg { filter: drop-shadow(1px 0 0 #d5d9e1) drop-shadow(-1px 0 0 #d5d9e1) drop-shadow(0 1px 0 #d5d9e1) drop-shadow(0 -1px 0 #d5d9e1); }
#grid li { position: relative; }
.copy { position: absolute; top: 0; left: 50%; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 99px; background: var(--ink); color: var(--page); font-size: 13px; opacity: 0; pointer-events: none; translate: -50% -20%; scale: .86; transition: opacity .18s, translate .42s var(--spring), scale .42s var(--spring); }
.copy [data-icon] { width: 14px; height: 14px; }
#grid li:hover .copy, #grid li:has(:focus-visible) .copy { z-index: 1; opacity: 1; pointer-events: auto; translate: -50% -50%; scale: 1; }
@media (hover: none) { .copy { display: none; } }
#note { position: fixed; bottom: 24px; left: 50%; z-index: 4; margin: 0; padding: 10px 18px; border-radius: 99px; background: var(--ink); color: var(--page); translate: -50% 0; }
#note:empty { display: none; }
@keyframes in { from { opacity: 0; translate: 0 6px; scale: .98; } }
@media (min-width: 1024px) { .page { grid-template-columns: 264px minmax(0, 1fr); } aside { position: sticky; top: 84px; align-self: start; } #styles { flex-direction: column; } }
@media (max-width: 1023px) { .page { gap: 12px; padding: 12px 16px 64px; } .panel { padding: 0; background: none; } .panel h2 { display: none; } #styles { overflow-x: auto; gap: 8px; scrollbar-width: none; } #styles button { flex: none; border-radius: 99px; background: var(--tile); } .swatches { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; } .swatches > * { flex: none; } }
