/* 🧱 LEGO collection (v3.6): Sets · Minifigures · Passport.
   The Sully's Vault interface around it stays black; the passport itself is a physical red booklet with paper pages. */

/* ---------------------------------------------------------------- LEGO section tabs */
.lego-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.lego-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 700; }
.lego-tabs a:hover { text-decoration: none; background: var(--surface-2); }
.lego-tabs a.active { border-color: #7a2a2f; background: linear-gradient(180deg, #2a0f12, #160709); }
.lego-sub { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; }
.lego-sub a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: .88rem; font-weight: 600; }
.lego-sub a:hover { text-decoration: none; color: var(--text); }
.lego-sub a.active { color: #fff; background: var(--accent-soft); border-color: #3b2f6b; }

/* ---------------------------------------------------------------- minifigures */
.fig-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; margin: 10px 0 4px; }
.fig-meta div { min-width: 0; }
.fig-meta .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.fig-meta .v { font-weight: 600; overflow-wrap: anywhere; }
.fig-views { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.fig-views figure { margin: 0; width: 120px; }
.fig-views .ph { width: 120px; height: 120px; background: #fff; border-radius: 10px; display: grid; place-items: center; overflow: hidden; }
.fig-views .ph img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fig-views .ph.none { background: var(--surface-2); color: var(--muted); font-size: .78rem; text-align: center; padding: 8px; }
.fig-views figcaption { font-size: .75rem; color: var(--muted); margin-top: 4px; text-align: center; }
.part-list { display: grid; gap: 6px; }
.part-row { display: grid; grid-template-columns: 120px 44px 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.part-row:last-child { border-bottom: 0; }
.part-row .slot { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.part-row .pimg { width: 44px; height: 44px; background: #fff; border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.part-row .pimg img { max-width: 100%; max-height: 100%; }
.set-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.set-chip { display: flex; gap: 8px; align-items: center; padding: 6px 10px 6px 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); max-width: 100%; }
.set-chip img { width: 44px; height: 34px; object-fit: contain; background: #fff; border-radius: 6px; }
.copy-list { display: grid; gap: 10px; }
.copy { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.copy .cph { width: 72px; height: 72px; border-radius: 10px; background: #fff; overflow: hidden; display: grid; place-items: center; color: #888; font-size: .7rem; }
.copy .cph img { width: 100%; height: 100%; object-fit: cover; }
.copy .ctitle { font-weight: 700; }
.copy .cbits { font-size: .84rem; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.copy .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .copy { grid-template-columns: 56px 1fr; } .copy .cph { width: 56px; height: 56px; } .copy .acts { grid-column: 1 / -1; justify-content: flex-start; } .part-row { grid-template-columns: 90px 40px 1fr; } }
.acc-check { display: grid; gap: 6px; margin-top: 6px; }
.acc-check label { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 0; }
.deal-card .disc { font-size: 1.4rem; font-weight: 800; color: var(--gain); }
.honest { border-left: 3px solid #7a2a2f; padding: 10px 14px; background: #120708; border-radius: 0 10px 10px 0; color: #e6d7d8; font-size: .9rem; }

/* ---------------------------------------------------------------- 📕 the passport booklet */
.pp-wrap { --pp-red: #8c1c21; --pp-red-dark: #5e0f13; --pp-paper: #f5f2ea; --pp-ink: #9ba1a8; --gold-1: #f3dd94; --gold-2: #c9a24a; --gold-3: #8e6b22; }
.pp-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
.pp-stats .kpi { padding: 10px 12px; }
.pp-stats .kpi .big { font-size: 1.25rem; }
@media (max-width: 700px) { .pp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pp-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 10px 0; }
.pp-toolbar .sep { width: 1px; height: 26px; background: var(--border); }
.pp-pageinfo { min-width: 120px; text-align: center; color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.pp-stage { position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  background: radial-gradient(ellipse at 50% 40%, #151515 0%, #050505 70%); border: 1px solid var(--border); border-radius: 16px;
  display: grid; place-items: center; cursor: default; }
.pp-zoom { transform-origin: 0 0; position: absolute; left: 0; top: 0; }
.pp-book { position: absolute; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3, .7, .25, 1); }
.pp-book.no-anim, .pp-book.no-anim .pp-leaf { transition: none !important; }
.pp-leaf { position: absolute; top: 0; height: 100%; transform-origin: 0 50%; transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.45, .05, .2, 1); }
.pp-leaf.turned { transform: rotateY(-180deg); }
.pp-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden;
  font-size: calc(var(--pw) / 26); }
.pp-face.back { transform: rotateY(180deg); }
.pp-face::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.pp-leaf.flipping .pp-face::after { animation: pp-shade .9s ease-in-out; }
.pp-face.front::after { background: linear-gradient(90deg, rgba(0,0,0,.35), rgba(0,0,0,0) 60%); }
.pp-face.back::after { background: linear-gradient(270deg, rgba(0,0,0,.35), rgba(0,0,0,0) 60%); }
@keyframes pp-shade { 0% { opacity: 0; } 45% { opacity: 1; } 100% { opacity: 0; } }

/* the red cover — leather grain, gold foil, rounded outer corners, a little thickness */
.pp-cover { background-color: var(--pp-red);
  background-image: radial-gradient(ellipse at 35% 25%, rgba(255,255,255,.10), rgba(255,255,255,0) 55%),
                    radial-gradient(ellipse at 70% 90%, rgba(0,0,0,.25), rgba(0,0,0,0) 60%), var(--pp-grain);
  border-radius: 0 4.2% 4.2% 0 / 0 3% 3% 0; box-shadow: inset 2px 0 0 rgba(0,0,0,.25), inset -1px 0 0 rgba(255,255,255,.06),
    2px 2px 0 #5a0d11, 3px 4px 0 #e9e3d6, 4px 6px 14px rgba(0,0,0,.55); }
.pp-cover.back-outside { border-radius: 4.2% 0 0 4.2% / 3% 0 0 3%; }
.pp-cover svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pp-cover .scan { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pp-inside-cover { background-color: #efe9dc; background-image: var(--pp-grain-paper); border-radius: 4.2% 0 0 4.2% / 3% 0 0 3%; }
.pp-inside-cover.right { border-radius: 0 4.2% 4.2% 0 / 0 3% 3% 0; }
.pp-inside-cover::before { content: ""; position: absolute; inset: 0; border: .45em solid var(--pp-red); border-radius: inherit; opacity: .92; }
.pp-paper { background-color: var(--pp-paper); background-image: var(--pp-grain-paper); }
/* the paper pages are a little smaller than the cover, like a real booklet */
.pp-face.pp-paper.right { inset: 1.3% 1.8% 1.3% 0; }
.pp-face.pp-paper.left { inset: 1.3% 0 1.3% 1.8%; }
.pp-paper.right { border-radius: 0 3.6% 3.6% 0 / 0 2.6% 2.6% 0; box-shadow: inset 12px 0 18px -14px rgba(0,0,0,.45); }
.pp-paper.left { border-radius: 3.6% 0 0 3.6% / 2.6% 0 0 2.6%; box-shadow: inset -12px 0 18px -14px rgba(0,0,0,.45); }
.pp-print { position: absolute; inset: 0; width: 100%; height: 100%; }
.pp-pno { position: absolute; bottom: 8.6%; font: 600 .62em/1 "Segoe UI", Arial, sans-serif; color: #8d939a; letter-spacing: .05em; }
.pp-paper.right .pp-pno { right: 9.5%; } .pp-paper.left .pp-pno { left: 16%; }
/* owner page: handwriting goes into the printed boxes */
.pp-hand { position: absolute; font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; color: #1d2a6b; white-space: nowrap;
  transform-origin: center; display: grid; place-items: center; pointer-events: none; }
.pp-photo { position: absolute; overflow: hidden; border-radius: 7%; }
.pp-photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.92) contrast(1.02); }
.pp-hint { position: absolute; left: 50%; bottom: 1.6%; transform: translateX(-50%); font: 600 .5em/1 Inter, sans-serif; color: #b2b6bb; letter-spacing: .04em; }

/* stamps: real artwork kept as is, inked onto the paper */
.pp-stamp { position: absolute; transform-origin: 50% 50%; cursor: pointer; touch-action: none; }
.pp-stamp img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; opacity: .9; pointer-events: none;
  filter: contrast(1.04) saturate(.95); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
/* v3.8.1: a placed stamp never shows a selection box; the outline below exists only while you are editing it */
.pp-stamp.draft { outline: none; }
.pp-stamp.editing { outline: 2px solid #7c5cff; outline-offset: 4px; cursor: move; }
.pp-stamp.flash { animation: pp-flash 1.6s ease-in-out 2; }
@keyframes pp-flash { 50% { outline: 3px solid #fbbf24; outline-offset: 6px; } }
.pp-h { position: absolute; width: 1.1em; height: 1.1em; border-radius: 50%; background: #7c5cff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.pp-h.rot { left: 50%; top: -2.2em; transform: translateX(-50%); cursor: grab; }
.pp-h.rot::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 1.1em; background: #7c5cff; transform: translateX(-50%); }
.pp-h.size { right: -.75em; bottom: -.75em; cursor: nwse-resize; border-radius: 3px; }
.pp-edit-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; padding: 10px; border: 1px solid #3b2f6b;
  background: var(--accent-soft); border-radius: 12px; margin-top: 10px; }
.pp-edit-bar input[type=range] { width: 140px; }
.pp-edit-bar label { margin: 0; font-size: .82rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }

/* stamp library / my stamps */
.stamp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stamp-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  text-align: left; color: var(--text); cursor: pointer; font: inherit; }
.stamp-card:hover { border-color: #3a3a3a; }
.stamp-card.sel { border-color: #7c5cff; box-shadow: 0 0 0 2px #7c5cff inset; }
.stamp-paper { aspect-ratio: 1; border-radius: 8px; background-color: #f5f2ea; background-image: var(--pp-grain-paper);
  display: grid; place-items: center; overflow: hidden; padding: 8%; }
.stamp-paper img { max-width: 100%; max-height: 100%; mix-blend-mode: multiply; opacity: .92; }
.stamp-card .nm { font-weight: 700; font-size: .9rem; }
.stamp-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.stamp-filters select { width: auto; min-width: 120px; flex: 1 1 120px; max-width: 220px; }
.stamp-editor { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 760px) { .stamp-editor { grid-template-columns: 1fr; } }
.stamp-canvas-box { position: relative; background: repeating-conic-gradient(#2a2a2a 0% 25%, #1c1c1c 0% 50%) 50% / 18px 18px; border-radius: 10px;
  overflow: hidden; touch-action: none; }
.stamp-canvas-box canvas { display: block; width: 100%; height: auto; }
.crop-rect { position: absolute; border: 2px dashed #fbbf24; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); pointer-events: none; }
.scan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.scan-grid figure { margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.scan-grid img { width: 100%; aspect-ratio: .72; object-fit: cover; display: block; background: #222; cursor: zoom-in; }
.scan-grid figcaption { padding: 8px 10px; font-size: .84rem; display: flex; justify-content: space-between; gap: 6px; align-items: center; }

/* 🟨 v3.7 real stamp catalog */
.catalog-status { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .84rem; color: var(--muted);
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); margin-bottom: 10px; }
.catalog-status strong { color: var(--text); }
.catalog-status .warn { color: var(--warn); } .catalog-status .bad { color: var(--bad); }
.catalog-status button { margin-left: auto; }
.stamp-card .stamp-paper .t { text-align: center; }
.no-photo { display: grid; place-items: center; text-align: center; gap: 4px; color: #6f6a60; font-size: .78rem; font-weight: 600; padding: 6px; }
.no-photo .ico { font-size: 1.6rem; opacity: .7; }
.no-photo.big { font-size: .95rem; max-width: 340px; }
.no-photo.big .t { color: #7d776c; font-weight: 500; }
.where-from { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface-2); }
.where-from .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.where-from .v { font-weight: 700; font-size: 1.02rem; margin: 2px 0; }

/* v3.8 — stamp photos from other websites: keep "information source" and "image source" apart */
.img-source { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.img-source .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .65; }
.img-source .v { margin-top: 2px; }
.img-source a { color: inherit; text-decoration: underline; }
.img-credit { font-size: 11px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catalog-status .good { color: var(--good, #3ecf8e); }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; overflow-wrap: anywhere; }
.mini-table td { padding: 6px 8px; border-top: 1px solid rgba(255,255,255,.07); vertical-align: top; }
#img-src .stamp-card input, #img-src .stamp-card select { font-size: 12px; padding: 4px 6px; }
