/* KEBRICK — Minifigure Studio */
.minifigure-profile-card { overflow: hidden; }
.minifig-workbench-heading,
.owned-minifigs-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }
.minifig-workbench-heading h3,
.owned-minifigs-heading h3 { margin:7px 0 6px; color:var(--text); font:700 clamp(23px,3vw,31px) "Space Grotesk",sans-serif; }
.minifig-workbench-heading h3 span,
.owned-minifigs-heading h3 span { color:var(--yellow-deep); }
.minifig-workbench-heading p,
.owned-minifigs-heading p { max-width:620px; color:var(--muted); font-size:12px; line-height:1.65; }
.minifig-studio-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.mini-action-button { border:1px solid var(--line); border-radius:11px; padding:11px 14px; color:var(--text); background:var(--surface-2); font-size:11px; font-weight:800; transition:.2s ease; }
.mini-action-button:hover { transform:translateY(-2px); border-color:var(--yellow-deep); box-shadow:0 8px 22px rgba(255,196,0,.16); }
.mini-download-button { color:#171717; border-color:#ffd43b; background:linear-gradient(135deg,#ffe36b,#ffc400); }
.minifig-studio-layout { display:grid; grid-template-columns:minmax(250px, .82fr) minmax(0,1.5fr); gap:20px; margin-top:22px; align-items:stretch; }
.minifig-stage-wrap { min-width:0; }
.minifig-stage { position:relative; min-height:390px; display:flex; flex-direction:column; align-items:center; justify-content:center; overflow:hidden; isolation:isolate; padding:24px 16px 15px; border:1px solid rgba(255,212,59,.34); border-radius:20px; background:radial-gradient(circle at 50% 42%,rgba(255,255,255,.22),transparent 48%),linear-gradient(145deg,#171a2a,#26213b 58%,#151823); box-shadow:inset 0 0 45px rgba(0,0,0,.16),0 14px 35px rgba(30,30,50,.12); transition:background .25s ease; }
.minifig-stage::before,.minifig-stage::after { content:""; position:absolute; z-index:-1; width:190px; height:190px; border-radius:50%; filter:blur(42px); opacity:.45; pointer-events:none; }
.minifig-stage::before { left:-80px; top:-70px; background:#ffcf36; }
.minifig-stage::after { right:-85px; bottom:-65px; background:#9c5bff; }
.minifig-stage[data-background="cyber"] { background:radial-gradient(circle at 50% 45%,#37305b,#151729 70%); }
.minifig-stage[data-background="lofi"] { background:linear-gradient(150deg,#f6d7a6,#9dbb9a 52%,#596f69); }
.minifig-stage[data-background="space"] { background:radial-gradient(circle at 25% 25%,#5363a4 0 2px,transparent 3px),radial-gradient(circle at 72% 38%,#fff 0 1px,transparent 2px),linear-gradient(145deg,#10142e,#292054 60%,#11172a); background-size:70px 70px,95px 95px,auto; }
.minifig-stage[data-background="gaming"] { background:linear-gradient(135deg,#1b1641,#42236e 50%,#121d3b); }
.minifig-stage[data-background="beach"] { background:linear-gradient(180deg,#75c8ed 0 48%,#f4d48c 49% 100%); }
.minifig-stage[data-background="fantasy"] { background:radial-gradient(circle at 50% 15%,#8e75c4,#2a2546 66%,#171a2b); }
.minifig-stage[data-background="street"] { background:linear-gradient(150deg,#343e58,#171d2b 65%,#5b3d68); }
.mini-stage-spark { position:absolute; color:#ffe47b; text-shadow:0 0 15px #ffd43b; animation:miniSparkFloat 3.2s ease-in-out infinite; }
.mini-spark-a { top:18%; left:17%; font-size:27px; }
.mini-spark-b { top:34%; right:16%; font-size:21px; animation-delay:-1.2s; }
.customizer-figure { position:relative; z-index:1; width:min(190px,65%); height:300px; display:flex; align-items:center; justify-content:center; filter:drop-shadow(0 16px 12px rgba(0,0,0,.3)); animation:miniFigureFloat 3.5s ease-in-out infinite; }
.customizer-figure svg { display:block; width:100%; height:100%; overflow:visible; }
.mini-nameplate { position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; gap:4px; margin-top:1px; color:#fff; text-align:center; }
.mini-nameplate strong { max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:800 12px "Space Grotesk",sans-serif; letter-spacing:.15em; text-shadow:0 0 12px rgba(255,212,59,.45); }
.mini-nameplate span { color:rgba(255,255,255,.55); font-size:8px; font-weight:800; letter-spacing:.2em; }
.mini-title-field { display:block; margin-top:13px; color:var(--muted); font-size:9px; font-weight:900; letter-spacing:.12em; }
.mini-title-field input { display:block; width:100%; margin-top:7px; padding:11px 12px; border:1px solid var(--line); border-radius:10px; outline:0; color:var(--text); background:var(--surface); font-size:12px; letter-spacing:normal; }
.mini-title-field input:focus { border-color:var(--yellow-deep); box-shadow:0 0 0 3px rgba(255,212,59,.15); }
.minifig-editor { min-width:0; padding:15px; border:1px solid var(--line); border-radius:18px; background:var(--surface-2); }
.mini-category-tabs { display:flex; gap:7px; overflow-x:auto; padding:0 0 11px; scrollbar-width:thin; }
.mini-category-tabs button { flex:0 0 auto; padding:9px 11px; border:1px solid var(--line); border-radius:10px; color:var(--muted); background:var(--surface); font-size:10px; font-weight:800; white-space:nowrap; transition:.18s ease; }
.mini-category-tabs button:hover { color:var(--text); border-color:rgba(255,196,0,.7); }
.mini-category-tabs button.active { color:#191919; border-color:#ffd43b; background:#ffd43b; box-shadow:0 5px 15px rgba(255,212,59,.2); }
.mini-option-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(100px,1fr)); gap:9px; max-height:330px; overflow:auto; padding:3px 3px 7px 0; scrollbar-color:rgba(160,160,160,.45) transparent; }
.mini-option-card { position:relative; min-height:108px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; padding:10px 7px; border:1px solid var(--line); border-radius:13px; color:var(--text); background:var(--surface); text-align:center; transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.mini-option-card:hover:not(:disabled) { transform:translateY(-3px); border-color:rgba(255,196,0,.8); box-shadow:0 8px 18px rgba(30,30,40,.08); }
.mini-option-card.selected { border:2px solid #e9b900; background:linear-gradient(145deg,rgba(255,212,59,.2),var(--surface)); box-shadow:0 0 0 3px rgba(255,212,59,.1),0 8px 18px rgba(255,196,0,.1); }
.mini-option-card:disabled { cursor:not-allowed; opacity:.52; filter:grayscale(.55); }
.mini-option-art { width:51px; height:48px; display:grid; place-items:center; border-radius:12px; background:var(--surface-2); }
.mini-option-emoji { font-size:28px; line-height:1; filter:drop-shadow(0 3px 3px rgba(0,0,0,.1)); }
.mini-option-label { max-width:100%; color:var(--text); font-size:10px; font-weight:800; line-height:1.25; }
.mini-option-card small { color:var(--muted); font-size:8px; }
.mini-option-lock { color:#a47c00; font-size:8px; font-weight:900; }
.mini-skin-swatch { width:33px; height:33px; border:3px solid rgba(0,0,0,.12); border-radius:50%; background:var(--swatch); box-shadow:inset -4px -4px 7px rgba(0,0,0,.12),0 2px 5px rgba(0,0,0,.12); }
.mini-hair-swatch { width:37px; height:34px; display:block; border-radius:20px 20px 7px 7px; background:linear-gradient(145deg,#58402f,#211c21); position:relative; }
.mini-hair-swatch::before { content:""; position:absolute; left:7px; right:7px; top:-5px; height:15px; border-radius:14px 14px 4px 4px; background:inherit; }
.mini-hair-long::after,.mini-hair-braids::after { content:""; position:absolute; top:16px; left:1px; width:8px; height:20px; border-radius:0 0 8px 8px; background:inherit; box-shadow:27px 0 0 currentColor; }
.mini-hair-curly { border-radius:50%; background:radial-gradient(circle at 20% 40%,#61442d 0 8px,transparent 9px),radial-gradient(circle at 45% 15%,#61442d 0 9px,transparent 10px),radial-gradient(circle at 70% 30%,#61442d 0 9px,transparent 10px),radial-gradient(circle at 85% 62%,#61442d 0 8px,transparent 9px); }
.mini-hair-messy { clip-path:polygon(0 40%,12% 0,30% 25%,48% 0,62% 25%,84% 2%,100% 43%,92% 100%,8% 100%); }
.mini-hair-mohawk { width:16px; border-radius:8px 8px 3px 3px; }
.mini-hair-bald { background:transparent; border:2px dashed var(--muted); border-radius:50%; }
.mini-outfit-swatch { width:36px; height:37px; display:grid; place-items:center; border-radius:11px 11px 7px 7px; border:2px solid rgba(0,0,0,.16); color:#fff; background:var(--swatch); font-size:19px; text-shadow:0 1px 2px #0005; }
.mini-legs-swatch,.mini-hat-swatch { font-size:26px; filter:drop-shadow(0 3px 3px rgba(0,0,0,.12)); }
.mini-hair-colors { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 10px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.mini-hair-colors > span { color:var(--muted); font-size:9px; font-weight:900; letter-spacing:.1em; }
.mini-hair-colors > div { display:flex; gap:8px; flex-wrap:wrap; }
.mini-hair-color { width:22px; height:22px; border:2px solid var(--surface); border-radius:50%; outline:1px solid var(--line); background:var(--hair-color); }
.mini-hair-color.selected { outline:3px solid #e6b400; transform:scale(1.12); }
.mini-editor-hint { margin:10px 2px 0; color:var(--muted); font-size:9px; }
.minifig-rewards { margin-top:22px; padding-top:17px; border-top:1px solid var(--line); }
.rewards-title { display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--text); font-size:12px; }
.rewards-title span { color:var(--muted); font-size:10px; }
.reward-track { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.reward-chip { padding:8px 11px; border:1px solid var(--line); border-radius:10px; color:var(--muted); background:var(--surface-2); font-size:10px; }
.reward-chip.unlocked { color:#8a6500; border-color:rgba(255,196,0,.75); background:rgba(255,212,59,.2); box-shadow:0 0 15px rgba(255,212,59,.12); }
.owned-minifigs-section { margin-top:26px; padding-top:23px; border-top:1px solid var(--line); }
.owned-minifigs-heading { align-items:center; margin-bottom:16px; }
.owned-minifig-count { flex:0 0 auto; padding:9px 12px; border:1px solid rgba(255,196,0,.5); border-radius:999px; color:#876500; background:rgba(255,212,59,.16); font-size:9px; font-weight:900; letter-spacing:.1em; }
.owned-minifig-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(145px,1fr)); gap:12px; }
.owned-minifig-card { min-width:0; display:flex; flex-direction:column; align-items:center; gap:8px; padding:12px 10px; border:1px solid var(--line); border-radius:15px; color:var(--text); background:var(--surface); text-align:center; transition:.2s ease; }
.owned-minifig-card:hover,.owned-minifig-card.selected { transform:translateY(-3px); border-color:#e6b900; box-shadow:0 9px 24px rgba(30,30,40,.09); }
.owned-minifig-image { width:100%; height:125px; display:grid; place-items:center; overflow:hidden; border-radius:10px; background:linear-gradient(145deg,var(--surface-2),rgba(255,212,59,.13)); }
.owned-minifig-image img { max-width:100%; width:100%; height:100%; object-fit:contain; }
.owned-minifig-fallback { font-size:42px; }
.owned-minifig-card strong { max-width:100%; overflow:hidden; color:var(--text); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.owned-minifig-card small { color:var(--muted); font-size:8px; font-weight:800; letter-spacing:.08em; }
.owned-minifig-card em { color:#987300; font-size:8px; font-style:normal; font-weight:900; }
.owned-minifigs-loading,.owned-minifigs-empty { grid-column:1/-1; min-height:150px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px; padding:22px; border:1px dashed var(--line); border-radius:15px; color:var(--muted); text-align:center; }
.owned-minifigs-empty > span { font-size:32px; }
.owned-minifigs-empty strong { color:var(--text); font-size:13px; }
.owned-minifigs-empty p,.owned-minifigs-loading p { max-width:420px; font-size:10px; line-height:1.6; }
.mini-loading-orbit { width:28px; height:28px; border:3px solid rgba(255,196,0,.18); border-top-color:#e8b400; border-radius:50%; animation:miniSpin .8s linear infinite; }
.customizer-note { margin:12px 0 0; color:var(--muted); font-size:10px; line-height:1.5; }
.hero-minifigure { width:120px; height:210px; }
.hero-minifigure > svg { display:block; width:100%; height:100%; overflow:visible; }
.hero-minifigure .mini-held-item { animation:miniHandWave 2.6s ease-in-out infinite; transform-origin:140px 160px; }
@keyframes miniFigureFloat { 0%,100% { transform:translateY(0) rotate(-1deg); } 50% { transform:translateY(-7px) rotate(1deg); } }
@keyframes miniSparkFloat { 0%,100% { transform:translateY(0) rotate(0); opacity:.65; } 50% { transform:translateY(-13px) rotate(25deg); opacity:1; } }
@keyframes miniHandWave { 0%,100% { transform:rotate(0); } 50% { transform:rotate(-10deg); } }
@keyframes miniSpin { to { transform:rotate(360deg); } }
body.dark-mode .minifig-editor { background:rgba(255,255,255,.035); }
body.dark-mode .mini-option-card,
body.dark-mode .mini-hair-colors,
body.dark-mode .owned-minifig-card,
body.dark-mode .mini-title-field input { color:var(--text); background:var(--surface); }
body.dark-mode .mini-option-art { background:var(--surface-2); }
body.dark-mode .owned-minifig-count { color:#ffe07a; }
@media(max-width:900px) {
  .minifig-studio-layout { grid-template-columns:1fr; }
  .minifig-stage { min-height:350px; }
  .customizer-figure { height:270px; }
}
@media(max-width:600px) {
  .minifig-workbench-heading,.owned-minifigs-heading { flex-direction:column; }
  .minifig-studio-actions { justify-content:flex-start; }
  .minifig-editor { padding:10px; }
  .mini-option-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
  .mini-option-card { min-height:98px; padding:8px 4px; }
  .mini-option-label { font-size:9px; }
  .owned-minifig-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .minifig-stage { min-height:330px; }
}


/* Classic LEGO minifigure proportions */
.customizer-figure svg { overflow: visible; }
.hero-minifigure > svg { overflow: visible; }
.mini-held-item { filter: drop-shadow(0 2px 2px rgba(0,0,0,.22)); }

/* Illustrated accessory picker and better-fitting hair pieces */
.mini-item-art { width:54px; height:54px; display:grid; place-items:center; }
.mini-item-art svg { width:100%; height:100%; display:block; overflow:visible; filter:drop-shadow(0 3px 3px rgba(0,0,0,.16)); }
.mini-held-item { overflow:visible; filter:drop-shadow(0 2px 2px rgba(0,0,0,.24)); transform-origin:205px 220px; animation:miniHandWave 2.8s ease-in-out infinite; }
.mini-option-card:has(.mini-item-art) .mini-option-art { width:64px; height:62px; background:linear-gradient(145deg,var(--surface-2),rgba(255,212,59,.12)); }
.mini-option-card:has(.mini-item-art) { min-height:120px; }
.mini-option-symbol { width:30px; height:30px; display:block; border:3px solid #d7ad20; border-radius:9px 9px 12px 12px; background:linear-gradient(145deg,#ffe98b,#e5b62d); box-shadow:inset -4px -4px 0 rgba(0,0,0,.08); }
.mini-face-art { position:relative; width:42px; height:42px; display:block; border:2px solid #bd8d16; border-radius:13px 13px 15px 15px; background:#ffd83d; box-shadow:inset -4px -4px 0 rgba(0,0,0,.08); }
.mini-face-art:before,.mini-face-art:after { content:""; position:absolute; top:12px; width:4px; height:6px; border-radius:50%; background:#252936; }
.mini-face-art:before { left:10px; }.mini-face-art:after { right:10px; }
.mini-face-art i { position:absolute; left:12px; bottom:8px; width:15px; height:8px; border-bottom:2px solid #8e4931; border-radius:0 0 15px 15px; }
.mini-face-angry i { transform:rotate(180deg); }.mini-face-shocked i { left:17px; bottom:7px; width:7px; height:9px; border:2px solid #8e4931; border-radius:50%; }
.mini-face-sleepy:before,.mini-face-sleepy:after { height:2px; top:15px; border-radius:3px; }.mini-face-glasses { background:linear-gradient(90deg,transparent 48%,#252936 48% 53%,transparent 53%),#ffd83d; }
.mini-face-glasses i { border:2px solid #252936; width:30px; height:13px; left:4px; bottom:12px; border-radius:6px; }
.mini-hat-swatch { position:relative; width:48px; height:43px; display:block; }
.mini-hat-swatch:before { content:""; position:absolute; left:8px; right:8px; top:11px; height:24px; border-radius:16px 16px 7px 7px; background:linear-gradient(145deg,#ffd84a,#d99a19); border:2px solid #8c6814; }
.mini-hat-swatch:after { content:""; position:absolute; left:3px; right:3px; bottom:5px; height:7px; border-radius:50%; background:#e9b62c; border:2px solid #8c6814; }
.mini-hat-none:before { background:transparent; border:2px dashed var(--muted); }.mini-hat-none:after { display:none; }
.mini-hat-headphones:before { background:transparent; border:4px solid #343b4c; border-bottom-color:transparent; border-radius:22px 22px 0 0; top:2px; height:32px; }
.mini-hat-headphones:after { left:2px; right:auto; bottom:4px; width:8px; height:15px; border-radius:5px; background:#bd5bea; box-shadow:34px 0 #4acbe8; }
.mini-hat-wizard:before { top:0; left:11px; right:11px; height:32px; clip-path:polygon(50% 0,100% 100%,0 100%); border-radius:0; }.mini-hat-wizard:after { bottom:3px; }
.mini-hat-crown:before { top:5px; clip-path:polygon(0 25%,25% 55%,50% 0,75% 55%,100% 25%,95% 100%,5% 100%); border-radius:3px; }
.mini-hat-space:before { top:3px; height:34px; border-radius:17px; background:rgba(105,203,235,.35); border:3px solid #8bdcf1; }
.mini-bg-art { width:52px; height:43px; display:block; border-radius:9px; border:2px solid rgba(0,0,0,.15); background:linear-gradient(160deg,#17284c,#b34f9e 60%,#ffca57); }
.mini-bg-lofi { background:linear-gradient(160deg,#93d8ee,#f5d78c 60%,#77a86c); }.mini-bg-space { background:radial-gradient(circle at 70% 25%,#fff 0 2px,transparent 3px),linear-gradient(145deg,#080d2b,#43318d,#10162e); }.mini-bg-beach { background:linear-gradient(#6ccbe8 0 55%,#f5d47d 56%); }
.mini-legs-swatch { width:48px; height:44px; display:grid; place-items:center; }
.mini-leg-preview { position:relative; display:block; width:29px; height:38px; border-left:5px solid #344d72; border-right:5px solid #344d72; background:linear-gradient(90deg,transparent 46%,#26364d 46% 54%,transparent 54%); }
.mini-leg-robot { border-color:#879ba9; background:repeating-linear-gradient(0deg,transparent 0 8px,#43d6ed 9px 11px); }.mini-leg-mermaid { width:28px; height:36px; border:0; border-radius:5px 5px 16px 16px; background:linear-gradient(#34b6b5,#197a91); clip-path:polygon(0 0,100% 0,80% 75%,100% 100%,50% 85%,0 100%,20% 75%); }
.mini-hair-swatch { transform:scale(1.12); transform-origin:center bottom; }
