/* 3D sticker gallery (/media/3d-stickers) and Sticker Pack Builder (/media/sticker-pack-builder). */
.stk-page { display: grid; gap: 1.25rem; padding-bottom: 3rem; }
.stk-page h2 { margin: 0 0 .75rem; font-size: 1.2rem; }

/* Cast + toolbar */
.stk-cast { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; padding: 1rem 1.25rem; }
.stk-cast-item { display: grid; gap: .15rem; flex: 1 1 14rem; }
.stk-cast-name { font-weight: 700; font-size: 1.05rem; }
.stk-cast-cta { flex: 0 0 auto; }
.stk-toolbar { display: grid; gap: .75rem; }
.stk-search input {
  width: 100%; min-height: 46px; padding: .7rem 1rem; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface-solid); color: var(--text); font: inherit;
}
.stk-search input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.stk-chips { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.stk-chips-sm .stk-chip { min-height: 36px; padding: .35rem .8rem; font-size: .88rem; }
.stk-chip {
  flex: 0 0 auto; min-height: 44px; padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.stk-chip[aria-pressed="true"] { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; border-color: transparent; }
.stk-chip:focus-visible, .stk-fav:focus-visible, .stk-mini-btn:focus-visible, .stk-card-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.stk-count { margin: 0; }

/* Grid + cards */
.stk-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (max-width: 360px) { .stk-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; } }
.stk-card {
  display: grid; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.stk-card[hidden] { display: none; }
.stk-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stk-card-link { display: grid; justify-items: center; gap: .35rem; padding: .75rem .5rem .25rem; color: inherit; text-decoration: none; }
.stk-card-media {
  display: block; width: 100%; aspect-ratio: 1; border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .08), transparent 70%);
}
.stk-card-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.stk-card-name { font-size: .88rem; font-weight: 600; text-align: center; line-height: 1.25; min-height: 2.2em; }
/* P16B premium (Tulo/Tuli): lock badge, small preview, honest locked notice */
.stk-lock { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: linear-gradient(135deg, #ffcf4a, #ff8a1f); color: #3a1d00; }
.stk-lock svg { width: .8rem; height: .8rem; fill: currentColor; }
.stk-preview-small { width: 160px; height: 160px; object-fit: contain; margin: 80px auto; display: block; }
.stk-premium-list { margin: .5rem 0 .75rem 1.1rem; display: grid; gap: .35rem; }
.stk-card-actions { display: flex; gap: .35rem; justify-content: center; align-items: center; padding: .25rem .5rem .6rem; flex-wrap: wrap; }
.stk-mini-btn {
  display: inline-flex; align-items: center; min-height: 32px; padding: .2rem .6rem; border-radius: 999px;
  border: 1px solid var(--border); font-size: .78rem; font-weight: 600; color: var(--text); text-decoration: none;
}
.stk-fav {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-width: 36px; min-height: 36px;
  border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer;
}
.stk-fav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.stk-fav[aria-pressed="true"] { color: #ff3d6e; }
.stk-fav[aria-pressed="true"] svg { fill: currentColor; }
.stk-fav-lg { padding: .5rem 1rem; min-height: 44px; }
.stk-empty { text-align: center; padding: 1.5rem; }

/* Detail */
.stk-detail { display: grid; gap: 1rem; justify-items: center; padding: 1.25rem; }
.stk-stage {
  width: min(100%, 360px); aspect-ratio: 1; display: grid; place-items: center; border-radius: 22px;
  border: 1px solid var(--border);
}
.stk-stage img { width: 88%; height: auto; display: block; }
.stk-stage[data-bg="checker"] { background: repeating-conic-gradient(#d9dde3 0% 25%, #ffffff 0% 50%) 50% / 24px 24px; }
.stk-stage[data-bg="light"] { background: #ffffff; }
.stk-stage[data-bg="dark"] { background: #10141b; }
.stk-bg-switch { display: flex; gap: .4rem; }
.stk-bg-switch button {
  min-height: 40px; padding: .35rem .85rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.stk-bg-switch button[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); }
.stk-facts { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; justify-content: center; }
.stk-facts li { padding: .35rem .75rem; border-radius: 999px; background: var(--surface-solid); border: 1px solid var(--border); font-size: .88rem; }
.stk-detail-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.stk-share { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; align-items: center; }
.stk-share-label { font-weight: 700; font-size: .92rem; width: 100%; text-align: center; }
.stk-share .btn-ghost { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; }
.stk-share .btn-ghost[hidden] { display: none; }
.stk-share svg { width: 18px; height: 18px; fill: currentColor; flex: 0 0 auto; }
.stk-share-wa svg { color: #25d366; }
.stk-share-status { width: 100%; text-align: center; margin: 0; min-height: 1.2em; }
.stk-dl-list { list-style: none; padding: 0; margin: 0 0 .75rem; display: grid; gap: .6rem; }
.stk-dl-list li {
  display: flex; gap: .75rem; align-items: center; justify-content: space-between; padding: .75rem;
  border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border);
}
.stk-dl-list li > div { display: grid; gap: .15rem; }
.stk-dl-btn { flex: 0 0 auto; white-space: nowrap; }
.stk-kb { opacity: .8; font-weight: 500; font-size: .85em; }
@media (max-width: 480px) { .stk-dl-list li { flex-direction: column; align-items: stretch; } .stk-dl-btn { text-align: center; justify-content: center; } }
.stk-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.stk-tag { padding: .2rem .6rem; border-radius: 999px; background: var(--surface-solid); border: 1px solid var(--border); font-size: .8rem; }
.stk-table-wrap { overflow-x: auto; }
.stk-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.stk-table th, .stk-table td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }

/* Builder */
.spb-modebar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.spb-mode {
  min-height: 44px; padding: .45rem 1.1rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
}
.spb-mode[aria-pressed="true"] { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; border-color: transparent; }
.spb[data-mode="quick"] .spb-pro-only { display: none; }
.spb-layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .spb-layout { grid-template-columns: 1fr; } }
.spb-pick, .spb-pack { display: grid; gap: .75rem; padding: 1.1rem; min-width: 0; }
.spb-pack { position: sticky; top: 76px; }
@media (max-width: 900px) { .spb-pack { position: static; } }
.spb-h2 { margin-top: .5rem !important; }
.spb-results { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); max-height: 560px; overflow-y: auto; }
.spb-tile {
  position: relative; width: 100%; display: grid; justify-items: center; gap: .25rem; padding: .5rem .35rem; border-radius: 14px;
  border: 2px solid transparent; background: var(--surface-solid); color: var(--text); font: inherit; cursor: pointer;
}
.spb-tile img { width: 64px; height: 64px; object-fit: contain; }
.spb-tile-name { font-size: .72rem; line-height: 1.2; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.spb-tile-src { position: absolute; top: 4px; left: 4px; font-size: .62rem; font-weight: 700; padding: 0 .3rem; border-radius: 6px; background: var(--border); }
.spb-tile[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.spb-tile[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: .75rem; display: grid; place-items: center;
}
.spb-tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.spb-tile-broken img { visibility: hidden; }
.spb-state { padding: 1rem; text-align: center; color: var(--muted); }
.spb-state[hidden] { display: none; }
.spb-error { color: inherit; }
.spb-more { justify-self: center; }
.spb-field { display: grid; gap: .3rem; font-weight: 600; font-size: .92rem; }
.spb-field input[type="text"], .spb-field select {
  min-height: 44px; padding: .55rem .8rem; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-solid); color: var(--text); font: inherit;
}
.spb-field select:disabled { opacity: .55; }
.spb-bg-row { display: flex; gap: .5rem; align-items: center; }
.spb-bg-row input[type="color"] { width: 48px; height: 44px; border: 1px solid var(--border); border-radius: 10px; background: none; }
.spb-count { margin: 0; font-weight: 700; display: flex; gap: .5rem; align-items: center; }
.btn-link { background: none; border: 0; color: var(--link); font: inherit; cursor: pointer; text-decoration: underline; padding: .25rem; min-height: 32px; }
.spb-chosen { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; max-height: 360px; overflow-y: auto; }
.spb-item {
  display: grid; grid-template-columns: 1.6rem 48px minmax(0, 1fr) auto auto auto; gap: .4rem; align-items: center;
  padding: .3rem .4rem; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--border); cursor: grab;
}
.spb-item.dragging { opacity: .5; }
.spb-item img { width: 48px; height: 48px; object-fit: contain; }
.spb-item-n { font-weight: 700; color: var(--muted); text-align: center; font-size: .85rem; }
.spb-item-name { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spb-icon {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 1rem; cursor: pointer;
}
.spb-icon:disabled { opacity: .35; cursor: default; }
.spb-rm:hover { color: #ff3d6e; }
@media (max-width: 360px) { .spb-item { grid-template-columns: 40px minmax(0, 1fr) auto auto auto; } .spb-item-n { display: none; } .spb-item img { width: 40px; height: 40px; } }
.spb-presets { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.spb-preset {
  position: relative; display: grid; gap: .2rem; padding: .7rem .8rem; border-radius: 14px; border: 2px solid var(--border);
  background: var(--surface-solid); cursor: pointer;
}
.spb-preset input { position: absolute; opacity: 0; pointer-events: none; }
.spb-preset:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.spb-preset:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.spb-preset-name { font-weight: 700; font-size: .92rem; }
.spb-preset-desc { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.spb-pro { border: 1px solid var(--border); border-radius: 14px; padding: .75rem; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.spb-pro legend { font-weight: 700; padding: 0 .3rem; }
.spb-pro .muted-sm { grid-column: 1 / -1; margin: 0; }
.spb-warn { margin: 0; padding: .6rem .8rem; border-radius: 12px; background: rgba(255, 159, 67, .14); border: 1px solid rgba(255, 159, 67, .4); }
.spb-make { min-height: 50px; font-size: 1.05rem; }
.spb-make:disabled { opacity: .5; cursor: not-allowed; }
.spb-run { display: grid; gap: .75rem; padding: 1.1rem; }
.spb-progress { height: 12px; border-radius: 999px; background: var(--surface-solid); border: 1px solid var(--border); overflow: hidden; }
.spb-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand2)); transition: width .3s ease; }
.spb-run-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.spb-out { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.spb-row {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .5rem;
  border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border);
}
.spb-row-media { width: 96px; height: 96px; border-radius: 10px; background: repeating-conic-gradient(#d9dde3 0% 25%, #fff 0% 50%) 50% / 16px 16px; display: grid; place-items: center; overflow: hidden; }
.spb-row-media img, .spb-row-media video { width: 96px; height: 96px; object-fit: contain; }
.spb-row-info { display: grid; gap: .15rem; min-width: 0; font-size: .88rem; }
.spb-facts { color: var(--muted); }
.spb-ok { color: var(--ok); font-weight: 700; }
.spb-bad { color: #ff5a5a; }
.spb-row-failed { border-color: rgba(255, 90, 90, .5); }
@media (max-width: 480px) {
  .spb-row { grid-template-columns: 72px minmax(0, 1fr); }
  .spb-row-media, .spb-row-media img, .spb-row-media video { width: 72px; height: 72px; }
  .spb-dl { grid-column: 1 / -1; text-align: center; justify-content: center; }
}
.spb-noscript { padding: 1rem; }

@media (prefers-reduced-motion: reduce) {
  .stk-card, .spb-progress span { transition: none; }
  .stk-card:hover { transform: none; }
}
