*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{--bg:#0f1117;--bg2:#181b25;--bg3:#1f2333;--surface:#252a3a;--border:#2e3448;--border-light:#3a4160;--text:#e8eaf0;--text-dim:#8b91a8;--text-muted:#5c6380;--accent:#FF6B35;--accent-hover:#ff8a5c;--accent-glow:rgba(255,107,53,.15);--blue:#4d9fff;--green:#34d399;--red:#f87171;--yellow:#fbbf24;--purple:#a78bfa;--radius:10px;--radius-sm:6px;--shadow:0 4px 24px rgba(0,0,0,.3);--font:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;--transition:.2s ease}
html{scroll-behavior:smooth}
body{font-family:var(--font);background:var(--bg);color:var(--text);line-height:1.6;min-height:100vh}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}
a{color:var(--accent);text-decoration:none;transition:color var(--transition)}
a:hover{color:var(--accent-hover)}
.btn{display:inline-flex;align-items:center;gap:6px;padding:10px 20px;border-radius:var(--radius-sm);border:1px solid transparent;font-size:.9rem;font-weight:600;cursor:pointer;transition:all var(--transition);font-family:inherit}
.btn-primary{background:var(--accent);color:#fff}
.btn-primary:hover{background:var(--accent-hover);color:#fff}
.btn-ghost{background:transparent;border-color:var(--border-light);color:var(--text)}
.btn-ghost:hover{border-color:var(--accent);color:var(--accent)}
.btn-danger{border-color:var(--red);color:var(--red);background:transparent}
.btn-danger:hover{background:rgba(248,113,113,.1)}
.btn-sm{padding:6px 14px;font-size:.82rem}
.site-header{border-bottom:1px solid var(--border);background:var(--bg2);position:sticky;top:0;z-index:100;backdrop-filter:blur(12px)}
.header-inner{max-width:1400px;margin:0 auto;padding:0 24px;display:flex;align-items:center;justify-content:space-between;height:56px}
.logo{display:flex;align-items:center;gap:10px;font-weight:700;font-size:1.05rem;color:var(--text)}
.logo span{background:linear-gradient(135deg,var(--accent),var(--yellow));-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}
.main-nav{display:flex;gap:8px}
.main-nav a{padding:6px 14px;border-radius:var(--radius-sm);color:var(--text-dim);font-size:.88rem;font-weight:500;transition:all var(--transition)}
.main-nav a:hover{color:var(--text);background:var(--bg3)}
.hero{max-width:1400px;margin:0 auto;padding:60px 24px 40px;display:grid;grid-template-columns:1fr auto;gap:40px;align-items:start}
.hero h1{font-size:clamp(1.8rem,4vw,2.8rem);line-height:1.2;font-weight:800;background:linear-gradient(135deg,#fff,var(--text-dim));-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}
.hero-sub{font-size:1.1rem;color:var(--text-dim);margin-top:16px;max-width:560px}
.hero-actions{display:flex;gap:12px;margin-top:28px;flex-wrap:wrap}
.hero-stat{display:flex;flex-direction:column;gap:12px}
.stat-card{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);padding:16px 24px;text-align:center;min-width:120px}
.stat-card strong{display:block;font-size:1.6rem;color:var(--accent);font-weight:800}
.stat-card span{font-size:.78rem;color:var(--text-muted)}
.planner-section{max-width:1400px;margin:0 auto;padding:0 24px 60px}
.planner-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:16px;margin-bottom:20px}
.planner-header h2{font-size:1.4rem;font-weight:700}
.planner-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.layout-name-input{background:var(--bg3);border:1px solid var(--border);color:var(--text);padding:6px 12px;border-radius:var(--radius-sm);font-size:.88rem;font-family:inherit;width:160px}
.layout-name-input:focus{outline:none;border-color:var(--accent)}
.planner-layout{display:grid;grid-template-columns:260px 1fr 240px;gap:16px;min-height:520px}
.figure-library{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);display:flex;flex-direction:column;overflow:hidden;max-height:600px}
.library-header{padding:14px;border-bottom:1px solid var(--border)}
.library-header h3{font-size:.95rem;font-weight:600;margin-bottom:10px}
.library-filters{display:flex;flex-direction:column;gap:8px}
.library-filters input,.library-filters select{background:var(--bg3);border:1px solid var(--border);color:var(--text);padding:6px 10px;border-radius:var(--radius-sm);font-size:.82rem;font-family:inherit;width:100%}
.library-filters input:focus,.library-filters select:focus{outline:none;border-color:var(--accent)}
.figure-list{flex:1;overflow-y:auto;padding:8px;display:flex;flex-direction:column;gap:4px}
.figure-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:var(--radius-sm);cursor:grab;transition:all var(--transition);border:1px solid transparent}
.figure-item:hover{background:var(--bg3);border-color:var(--border)}
.figure-item:active{cursor:grabbing}
.figure-emoji{font-size:1.3rem;flex-shrink:0}
.figure-meta{flex:1;min-width:0}
.figure-meta strong{display:block;font-size:.82rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.figure-meta span{font-size:.72rem;color:var(--text-muted)}
.rarity-badge{font-size:.65rem;padding:2px 6px;border-radius:4px;font-weight:600;text-transform:uppercase;flex-shrink:0}
.rarity-common{background:var(--surface);color:var(--text-dim)}
.rarity-chase{background:var(--accent-glow);color:var(--accent)}
.rarity-glow{background:rgba(77,159,255,.15);color:var(--blue)}
.rarity-metallic{background:rgba(251,191,36,.15);color:var(--yellow)}
.rarity-flocked{background:rgba(167,139,250,.15);color:var(--purple)}
.custom-figure{padding:10px 14px;border-top:1px solid var(--border)}
.custom-form{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.custom-form input,.custom-form select{background:var(--bg3);border:1px solid var(--border);color:var(--text);padding:6px 10px;border-radius:var(--radius-sm);font-size:.82rem;font-family:inherit;width:100%}
.hidden{display:none!important}
.shelf-area{display:flex;flex-direction:column;gap:12px}
.shelf-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);padding:12px 16px}
.shelf-presets select{background:var(--bg3);border:1px solid var(--border);color:var(--text);padding:6px 12px;border-radius:var(--radius-sm);font-size:.85rem;font-family:inherit}
.shelf-toggles{display:flex;gap:16px}
.toggle-label{display:flex;align-items:center;gap:6px;font-size:.82rem;color:var(--text-dim);cursor:pointer}
.toggle-label input{accent-color:var(--accent)}
.shelf-canvas-wrap{position:relative;background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;min-height:400px}
.shelf-canvas{display:grid;gap:2px;padding:16px;min-height:400px;position:relative}
.shelf-cell{background:var(--bg3);border:1px dashed var(--border);border-radius:var(--radius-sm);min-height:60px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all var(--transition);position:relative}
.shelf-cell:hover{border-color:var(--accent);background:var(--accent-glow)}
.shelf-cell.occupied{border-style:solid;border-color:var(--border-light);background:var(--surface)}
.shelf-cell .cell-emoji{font-size:1.4rem}
.shelf-cell .cell-label{font-size:.6rem;color:var(--text-dim);text-align:center;padding:2px 4px;word-break:break-word;line-height:1.2;position:absolute;bottom:2px;left:2px;right:2px;overflow:hidden;max-height:22px}
.shelf-cell .remove-btn{position:absolute;top:2px;right:2px;width:18px;height:18px;border-radius:50%;background:var(--red);color:#fff;border:none;font-size:.65rem;cursor:pointer;display:none;align-items:center;justify-content:center}
.shelf-cell.occupied:hover .remove-btn{display:flex}
.shelf-measurements{display:flex;justify-content:space-between;padding:8px 16px;font-size:.75rem;color:var(--text-muted)}
.shelf-info{display:flex;justify-content:space-between;align-items:center;font-size:.82rem;color:var(--text-dim)}
.details-panel{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);padding:16px;max-height:600px;overflow-y:auto}
.details-panel h3{font-size:.95rem;font-weight:600;margin-bottom:12px}
.selected-info{margin-bottom:16px;padding:12px;background:var(--bg3);border-radius:var(--radius-sm);min-height:60px}
.selected-info .empty-state{font-size:.82rem;color:var(--text-muted);font-style:italic}
.selected-info .sel-name{font-weight:600;font-size:.9rem}
.selected-info .sel-details{font-size:.78rem;color:var(--text-dim);margin-top:4px}
.tips-list details{margin-bottom:8px;border:1px solid var(--border);border-radius:var(--radius-sm);overflow:hidden}
.tips-list summary{padding:8px 12px;font-size:.82rem;font-weight:600;cursor:pointer;background:var(--bg3)}
.tips-list summary:hover{background:var(--surface)}
.tips-list ul{padding:8px 12px 12px 28px;font-size:.8rem;color:var(--text-dim)}
.tips-list li{margin-bottom:4px}
.gallery-section{max-width:1400px;margin:0 auto;padding:0 24px 60px}
.gallery-section h2{font-size:1.4rem;font-weight:700;margin-bottom:8px}
.section-sub{color:var(--text-dim);margin-bottom:24px;font-size:.95rem}
.gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:20px}
.gallery-card{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;transition:border-color var(--transition)}
.gallery-card:hover{border-color:var(--accent)}
.gallery-preview{height:140px;display:flex;align-items:center;justify-content:center;gap:4px;padding:16px}
.gallery-marvel{background:linear-gradient(135deg,#1a1525,#2a1040)}
.gallery-saga{background:linear-gradient(135deg,#0f1a2e,#1a3050)}
.gallery-chase{background:linear-gradient(135deg,#1a1208,#2a2010)}
.gallery-color{background:linear-gradient(135deg,#1a0f0f,#0f1a15)}
.gallery-preview .mini-fig{width:24px;height:32px;border-radius:4px 4px 2px 2px}
.gallery-card h3{padding:16px 16px 4px;font-size:.95rem;font-weight:600}
.gallery-card p{padding:0 16px 16px;font-size:.82rem;color:var(--text-dim)}
.guide-section{max-width:1400px;margin:0 auto;padding:0 24px 60px}
.guide-section h2{font-size:1.4rem;font-weight:700;margin-bottom:24px}
.guide-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:20px;margin-bottom:32px}
.guide-block{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);padding:20px}
.guide-block h3{font-size:.95rem;font-weight:600;margin-bottom:8px;color:var(--accent)}
.guide-block p{font-size:.88rem;color:var(--text-dim);line-height:1.7}
.guide-notes{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);padding:24px}
.guide-notes h3{font-size:1rem;font-weight:600;margin-bottom:12px}
.guide-notes p{font-size:.88rem;color:var(--text-dim);line-height:1.7;margin-bottom:12px}
.guide-notes p:last-child{margin-bottom:0}
.site-footer{border-top:1px solid var(--border);background:var(--bg2);margin-top:40px}
.footer-inner{max-width:1400px;margin:0 auto;padding:32px 24px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}
.footer-brand{display:flex;flex-direction:column;gap:4px}
.footer-logo{font-weight:700;font-size:.9rem}
.footer-version{font-size:.75rem;color:var(--text-muted)}
.footer-links{display:flex;gap:16px}
.footer-links a{font-size:.82rem;color:var(--text-dim)}
.footer-links a:hover{color:var(--text)}
.footer-note{font-size:.78rem;color:var(--text-muted);width:100%;text-align:center;margin-top:8px}
.toast{position:fixed;bottom:24px;right:24px;background:var(--surface);border:1px solid var(--border);color:var(--text);padding:12px 20px;border-radius:var(--radius);font-size:.88rem;box-shadow:var(--shadow);z-index:1000;transition:opacity .3s,transform .3s}
.toast.hidden{opacity:0;transform:translateY(10px);pointer-events:none}
@media(max-width:1100px){.planner-layout{grid-template-columns:220px 1fr}.details-panel{grid-column:1/-1;max-height:none}}
@media(max-width:800px){.planner-layout{grid-template-columns:1fr}.figure-library{max-height:300px}.hero{grid-template-columns:1px;text-align:center}.hero-sub{margin-left:auto;margin-right:auto}.hero-actions{justify-content:center}.hero-stat{flex-direction:row;justify-content:center;flex-wrap:wrap}.header-inner{padding:0 16px}.main-nav{display:none}}
@media print{.site-header,.site-footer,.figure-library,.details-panel,.planner-controls,.shelf-toolbar,.shelf-info,.hero,.gallery-section,.guide-section{display:none!important}.planner-section{padding:0}.shelf-canvas-wrap{border:none}.shelf-canvas{grid-template-columns:repeat(auto-fill,minmax(60px,1fr))!important}}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
