/* build.css — "Build Your Inu" page. Shares header/nav/fonts/colors with styles.css */
.build-page { min-height: 100vh; }
.broom { position: relative; min-height: 100vh; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 420px at 30% -8%, rgba(150, 230, 205, .12), transparent 62%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .02) 0 2px, transparent 2px 46px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .016) 0 2px, transparent 2px 92px),
    linear-gradient(180deg, #0b1424 0%, #08101d 62%, #060a13 100%); }
.local-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 6px; font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; white-space: nowrap;
  color: #d9f5de; background: rgba(47, 191, 91, .12); border: 1px solid rgba(47, 191, 91, .5); }
.dot.ok { background: var(--in); box-shadow: 0 0 8px var(--in); }

.build { flex: 1; display: grid; grid-template-columns: minmax(340px, 560px) minmax(0, 1fr); gap: 30px; width: 100%; max-width: 1320px; margin: 0 auto; padding: 18px 24px 26px; align-items: start; }

/* ---------- preview ---------- */
.preview-col { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.frame { position: relative; width: 100%; max-width: min(560px, calc(100vh - 290px)); min-width: 300px; aspect-ratio: 1; padding: 14px; border-radius: 14px;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .07) 0 2px, transparent 2px 6px), linear-gradient(135deg, #5a3418, #8c5629 50%, #4e2c14);
  box-shadow: 0 0 0 3px #2b1709, 0 22px 50px rgba(0, 0, 0, .6), inset 0 0 28px rgba(0, 0, 0, .4); }
.frame::before { content: ""; position: absolute; inset: 9px; border-radius: 8px; border: 2px solid rgba(240, 207, 123, .6); pointer-events: none; z-index: 3; }
.pv { position: relative; width: 100%; height: 100%; border-radius: 4px; overflow: hidden; background: #070d1a; box-shadow: inset 0 0 0 2px #000; transition: border-radius .25s; }
.pv svg { display: block; width: 100%; height: 100%; }
.pv.pop { animation: pvpop .28s ease-out; }
@keyframes pvpop { 0% { transform: scale(.985); filter: brightness(1.25); } 100% { transform: none; filter: none; } }
.frame.circle .pv { border-radius: 50%; }
.circle-guide { position: absolute; inset: 14px; border-radius: 50%; pointer-events: none; z-index: 2; box-shadow: 0 0 0 999px rgba(5, 8, 14, .0); transition: .25s; }
.frame.circle .circle-guide { box-shadow: 0 0 0 3px rgba(216, 232, 46, .55); }
.pv-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: min(560px, calc(100vh - 290px)); min-width: 300px; font-size: 13px; letter-spacing: 1.4px; color: var(--muted); }
.pv-id { color: var(--brass-1); }
.crop { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.crop input { accent-color: var(--vest); width: 16px; height: 16px; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: min(560px, calc(100vh - 290px)); min-width: 300px; }
.btn { appearance: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; padding: 8px 10px; border-radius: 8px;
  font: 400 19px/1.05 var(--f-head); letter-spacing: 2px; color: var(--text); background: linear-gradient(180deg, #15233a, #0c1626); border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .5); transition: transform .08s, border-color .15s, background .15s; text-align: center; }
.btn small { font: 400 11px/1 var(--f-mono); letter-spacing: 1.2px; color: var(--muted); }
.btn:hover { border-color: var(--vest); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.btn:focus-visible { outline: 2px solid var(--vest); outline-offset: 2px; }
.btn.primary { grid-column: 1 / -1; flex-direction: row; gap: 10px; font-size: 24px; min-height: 54px; color: #101606; background: linear-gradient(180deg, #e6f55a, #c3d520); border-color: #8f9f10; }
.btn.primary .ico { font-size: 22px; }
.btn.ghost { grid-column: 1 / -1; background: transparent; }
.toast { min-height: 20px; max-width: min(560px, calc(100vh - 290px)); font-size: 13px; letter-spacing: 1px; color: var(--vest); opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }

/* ---------- paper form ---------- */
.paper { position: relative; padding: 18px 22px 16px; border-radius: 6px; color: var(--ink); font-family: var(--f-type);
  background: linear-gradient(180deg, #f6eed6, #ebdfbd); box-shadow: 0 18px 44px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(80, 60, 20, .25); }
.paper::before { content: ""; position: absolute; left: 50%; top: 9px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #0c1220; box-shadow: inset 0 2px 3px #000; }
.paper-head { padding: 12px 0 8px; text-align: center; border-bottom: 2px double rgba(36, 29, 16, .6); margin-bottom: 8px; }
.paper-head h2 { margin: 0; font: 400 34px/1 var(--f-head); letter-spacing: 4px; }
.paper-head p { margin: 4px 0 0; font-size: 12px; letter-spacing: 1.6px; opacity: .7; }
.g { padding: 6px 0 5px; border-bottom: 1px dashed rgba(36, 29, 16, .3); }
.g:last-child { border-bottom: 0; }
.g-label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; font: 400 18px/1 var(--f-head); letter-spacing: 2.4px; }
.g-label .no { font: 400 12px/1 var(--f-type); letter-spacing: 0; opacity: .5; }
.g-label small { font: 400 11px/1 var(--f-type); letter-spacing: .4px; opacity: .65; }
.g-label .cur { margin-left: auto; font: 400 12px/1 var(--f-type); letter-spacing: .5px; opacity: .7; }
.tabbar { display: flex; align-items: flex-end; gap: 10px; margin: 2px 0 10px; border-bottom: 3px solid #241d10; }
.tabs { display: flex; gap: 4px; flex: 1; min-width: 0; }
.tab { appearance: none; cursor: pointer; flex: 1; padding: 9px 6px 8px; font: 400 20px/1 var(--f-head); letter-spacing: 2.6px; color: #241d10; background: rgba(36, 29, 16, .10); border: 2px solid rgba(36, 29, 16, .5); border-bottom: 0; border-radius: 6px 6px 0 0; transition: background .12s; }
.tab:hover { background: rgba(36, 29, 16, .2); }
.tab[aria-selected="true"] { color: #f6eed6; background: #241d10; border-color: #241d10; }
.tab:focus-visible, .reset:focus-visible { outline: 3px solid #2a6fd1; outline-offset: 2px; }
.reset { appearance: none; cursor: pointer; margin-bottom: 6px; padding: 6px 10px; font: 400 12px/1 var(--f-type); letter-spacing: 1.4px; color: #241d10; background: transparent; border: 1.5px dashed rgba(36, 29, 16, .55); border-radius: 4px; }
.reset:hover { background: rgba(36, 29, 16, .12); }
.tpanel[hidden] { display: none; }
.tpanel { max-height: calc(100vh - 250px); overflow-y: auto; padding-right: 6px; scrollbar-width: thin; scrollbar-color: rgba(36, 29, 16, .55) transparent; }
.grp { margin: 7px 0 5px; font: 400 11px/1 var(--f-type); letter-spacing: 1.8px; text-transform: uppercase; color: rgba(36, 29, 16, .62); display: flex; align-items: center; gap: 8px; }
.grp::after { content: ""; flex: 1; height: 1px; background: rgba(36, 29, 16, .25); }
.grp:first-of-type { margin-top: 2px; }
.chips.swatches { gap: 6px; }
.chip:has(.sw):not(:has(span)) { padding: 0; width: 34px; justify-content: center; border-radius: 50%; }
.chip .sw { }
.chip.stock .sw { background: repeating-linear-gradient(45deg, #fff 0 4px, #cfc7b0 4px 8px); }
.chip:has(.sw):not(:has(span)) .sw { width: 22px; height: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; min-height: 34px; border-radius: 4px; font: 400 13.5px/1 var(--f-type); color: var(--ink);
  background: rgba(255, 255, 255, .35); border: 2px solid rgba(36, 29, 16, .55); transition: transform .08s, background .12s; }
.chip:hover { background: rgba(255, 255, 255, .7); }
.chip:active { transform: translateY(1px); }
.chip:focus-visible { outline: 3px solid #2a6fd1; outline-offset: 2px; }
.chip[aria-pressed="true"] { color: #f6eed6; background: #241d10; border-color: #241d10; box-shadow: 0 0 0 2px #f6eed6 inset; }
.chip .sw { width: 15px; height: 15px; border-radius: 50%; flex: none; border: 2px solid rgba(0, 0, 0, .55); }
.chip[aria-pressed="true"] .sw { border-color: #f6eed6; }
.name-row { display: flex; align-items: center; gap: 10px; }
.name-row input { flex: 1; max-width: 260px; padding: 9px 12px; font: 400 18px/1 var(--f-type); letter-spacing: 2px; text-transform: uppercase; color: var(--ink); background: rgba(255, 255, 255, .55); border: 2px solid rgba(36, 29, 16, .55); border-radius: 4px; }
.name-row input:focus { outline: 3px solid #2a6fd1; outline-offset: 1px; background: #fff; }
.name-row input.bad { animation: shakeX .35s; border-color: #cf3338; }
@keyframes shakeX { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.count { font-size: 12px; opacity: .65; }
.note { margin: 6px 0 0; font-size: 12px; opacity: .7; min-height: 14px; }
.note.warn { color: #b3262b; opacity: 1; }
.foot { padding: 14px 20px 22px; text-align: center; font-size: 12px; letter-spacing: .8px; color: var(--muted); opacity: .8; }

/* ---------- mobile ---------- */
@media (max-width: 880px) {
  .build { grid-template-columns: 1fr; gap: 18px; padding: 12px 12px 22px; }
  .preview-col { position: static; align-items: center; }
  .frame, .pv-meta, .actions, .toast { max-width: 520px; width: 100%; min-width: 0; }
  .frame { padding: 10px; }
  .frame::before { inset: 6px; }
  .circle-guide { inset: 10px; }
  .local-pill { display: none; }
  .btn { font-size: 17px; min-height: 46px; }
  .btn.primary { font-size: 22px; }
  .paper { padding: 16px 14px 12px; }
  .paper-head h2 { font-size: 30px; }
  .chip { padding: 8px 11px; font-size: 13px; }
  .tpanel { max-height: none; overflow: visible; padding-right: 0; }
  .tab { font-size: 17px; letter-spacing: 1.6px; }
}
@media (prefers-reduced-motion: reduce) { .pv.pop, .name-row input.bad { animation: none; } }

/* floating mini preview (mobile only, appears when the main preview is scrolled away) */
.mini { display: none; position: fixed; right: 12px; bottom: 12px; z-index: 50; width: 96px; padding: 5px 5px 0; border-radius: 10px; cursor: pointer; border: 0; text-align: center;
  background: linear-gradient(135deg, #5a3418, #8c5629 50%, #4e2c14); box-shadow: 0 0 0 2px #2b1709, 0 10px 24px rgba(0, 0, 0, .6); opacity: 0; transform: translateY(14px); pointer-events: none; transition: .2s; }
.mini span { display: block; width: 100%; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: #070d1a; }
.mini span svg { display: block; width: 100%; height: 100%; }
.mini em { display: block; padding: 3px 0 4px; font: 400 10px/1 var(--f-mono); font-style: normal; letter-spacing: 1.4px; color: var(--brass-1); text-transform: uppercase; }
@media (max-width: 880px) { .mini { display: block; } .mini.show { opacity: 1; transform: none; pointer-events: auto; } }
