/* Tampilan hasil scan (mobile-first). */
.viewer { display: grid; gap: 14px; min-width: 0; }

.v-head {
  display: grid; gap: 10px; padding: 14px; border-radius: 18px; border: 1px solid var(--line-2);
  background: radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 60%), var(--surface);
}
.v-id { display: flex; gap: 12px; align-items: center; min-width: 0; }
.v-head .avatar {
  width: 44px; height: 44px; border-radius: 13px; flex: none; display: grid; place-items: center; font: 700 19px var(--display);
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; box-shadow: 0 10px 26px -12px var(--glow);
}
.nick { font-size: 19px; word-break: break-word; margin-bottom: 6px; }
/* HP: info (ID, collector, rank, tanggal) satu baris yang bisa digeser, supaya koleksi skin cepat terlihat. */
.v-head .pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.v-head .pills::-webkit-scrollbar { display: none; }
.v-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.v-actions .verSel { flex: 1 1 180px; }
.v-extra { display: contents; }
.pill.collector { border-color: color-mix(in srgb, var(--c) 50%, transparent); color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }

.v-summary { display: grid; gap: 12px; }

/* tile ringkasan: geser horizontal di HP */
.tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(108px, 1fr); gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tiles::-webkit-scrollbar { display: none; }
.tile { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--c, var(--accent)); }
.tile b { display: block; font: 700 21px var(--display); font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 12px; white-space: nowrap; }

.v-tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); position: sticky; top: var(--header-h); z-index: 15;
  background: var(--bg); margin: 0 -16px; padding: 0 12px;
}
.v-tabs button {
  flex: 1; background: none; border: 0; padding: 13px 10px; color: var(--muted); font: 600 15px var(--display); cursor: pointer; position: relative;
}
.v-tabs button.on { color: var(--text); }
.v-tabs button.on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent-2), #38d6ff); }

/* ---------- koleksi ---------- */
.toolbar { display: grid; gap: 10px; margin-top: 4px; }
.frow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-sm {
  display: flex; align-items: center; gap: 8px; flex: 1 1 200px; padding: 0 12px; border-radius: 12px; min-height: 44px;
  background: var(--field); border: 1px solid var(--line-2); color: var(--dim);
}
.search-sm svg { width: 18px; height: 18px; flex: none; }
.search-sm:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-sm input { background: none; border: 0; outline: none; padding: 8px 0; width: 100%; font-size: 16px; color: var(--text); min-width: 0; }
.filterBtn { min-height: 44px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; cursor: pointer; min-height: 36px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600;
}
.chip i { font-style: normal; color: var(--dim); font-size: 11px; }
.chip .d { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); }
.chip.on { color: var(--text); background: var(--accent-soft); border-color: var(--accent); }
.chip.on i { color: var(--accent-text); }

/* panel filter = bottom sheet di HP */
.filters {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface); border-radius: 22px 22px 0 0;
  border: 1px solid var(--line-2); box-shadow: 0 -20px 50px rgba(0,0,0,.35); transform: translateY(105%); transition: transform .25s ease;
  display: grid; grid-template-rows: auto 1fr auto; max-height: 80dvh;
}
.sheet-open .filters { transform: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px; }
.sheet-head b { font: 700 17px var(--display); }
.sheet-body { overflow: auto; padding: 8px 16px; display: grid; gap: 14px; align-content: start; }
.sheet-body .frow select { flex: 1 1 140px; }
.sheet-body .chips { flex-wrap: wrap; overflow: visible; }
.sheet-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }
.sheet-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(2,5,12,.5); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }

.grid-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 10px; color: var(--muted); font-size: 13.5px; gap: 10px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.more-sentinel { grid-column: 1 / -1; height: 1px; }
.skin {
  position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; cursor: pointer; background: #0a0f1c;
  border: 1px solid var(--line); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.skin img { width: 100%; height: 100%; object-fit: cover; display: block; }
.skin .ph {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 8px 8px 40%;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 55%, #0a0f1c), color-mix(in srgb, var(--c) 12%, #0a0f1c));
}
.skin .ph span {
  font: 700 clamp(13px, 4vw, 18px) var(--display); color: rgba(255,255,255,.28); text-transform: uppercase; text-align: center;
  letter-spacing: .04em; word-break: break-word; line-height: 1.1;
}
.skin.miss .ph { filter: grayscale(1) brightness(.6); }
.skin .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), transparent 30%, transparent 48%, rgba(2,5,12,.95)); }
.skin .rb {
  position: absolute; top: 6px; left: 6px; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; padding: 2px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--c) 85%, #000); color: #fff;
}
.skin .info { position: absolute; left: 8px; right: 8px; bottom: 7px; color: #fff; }
.skin .info .s { font-weight: 700; font-size: 12px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.skin .info .h { color: #aab5d0; font-size: 10.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skin .line { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c); box-shadow: 0 0 12px var(--c); }
.skin .ck {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55);
  background: rgba(0,0,0,.35); display: grid; place-items: center; font-size: 12px; font-weight: 800; color: transparent; transition: all .15s;
}
.skin .star {
  position: absolute; top: 33px; right: 3px; width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0;
  background: rgba(0,0,0,.5); color: rgba(255,255,255,.7); cursor: pointer; font-size: 15px; opacity: 0; transition: opacity .15s;
}
.pickHint { margin: -4px 0 10px; }
.skin.sel .star, .skin .star.on { opacity: 1; }
.skin .star.on { color: #ffd166; background: rgba(0,0,0,.7); }
.skin.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.skin.sel .ck { background: var(--accent); border-color: var(--accent); color: #fff; }
.skin.miss img { filter: grayscale(1) brightness(.45); }
.skin.miss .shade { background: linear-gradient(180deg, rgba(120,10,25,.25), rgba(40,0,8,.55) 50%, rgba(10,0,4,.95)); }
.skin.miss .lock { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: #ff6b78; font-size: 9px; font-weight: 800; letter-spacing: .14em; white-space: nowrap; }
.skin.miss .lock div { width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 5px; display: grid; place-items: center; border: 1.5px solid rgba(255,90,104,.6); background: rgba(255,90,104,.12); }
.grid .none { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 16px; border: 1px dashed var(--line-2); border-radius: 16px; }
@media (hover: hover) {
  .skin:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 60%, transparent); box-shadow: 0 14px 30px -14px var(--c); }
  .skin:hover .star { opacity: 1; }
}

/* ---------- poster ---------- */
.poster-wrap { display: grid; gap: 14px; }
.poster-side { display: grid; gap: 10px; min-width: 0; }
.poster-stage {
  display: grid; place-items: center; padding: 12px; border-radius: 18px; border: 1px solid var(--line);
  background: repeating-conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%) 0 0 / 22px 22px; min-height: 240px; touch-action: pan-y;
}
.poster { display: block; width: auto; max-width: 100%; max-height: 62dvh; border-radius: 8px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.8), 0 0 0 1px var(--line-2); }
.poster-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 8px); z-index: 12;
  background: var(--surface-glass); backdrop-filter: blur(12px); border: 1px solid var(--line-2); border-radius: 16px; padding: 8px 8px 8px 14px;
}
.slideInfo { color: var(--muted); font-size: 13px; flex: 1 1 140px; }
.slideInfo b { color: var(--text); }
.poster-actions { display: flex; gap: 8px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; }
.thumb {
  flex: none; position: relative; border: 2px solid transparent; border-radius: 10px; padding: 0; background: none; cursor: pointer; opacity: .65;
}
.thumb.on { opacity: 1; border-color: var(--accent); }
.thumb img { display: block; height: 84px; width: auto; border-radius: 8px; }
.thumb span { position: absolute; left: 5px; bottom: 5px; font-size: 11px; font-weight: 800; background: rgba(0,0,0,.75); color: #fff; border-radius: 6px; padding: 1px 6px; }

.poster-controls { display: grid; gap: 10px; }
.acc { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.acc summary {
  list-style: none; cursor: pointer; padding: 14px 16px; font: 600 15px var(--display); display: flex; justify-content: space-between; align-items: center;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "›"; font-size: 22px; color: var(--dim); transform: rotate(90deg); transition: transform .2s; line-height: 1; }
.acc[open] summary::after { transform: rotate(-90deg); }
.acc-body { display: grid; gap: 12px; padding: 0 16px 16px; }
.acc .f { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pRatio button, .pLayout button { font-size: 12.5px; padding: 8px 6px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button {
  width: 40px; height: 40px; border-radius: 12px; border: 2px solid transparent; cursor: pointer;
  background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.swatches button.on { border-color: var(--text); box-shadow: 0 0 14px var(--a); }
.more-opts { display: grid; gap: 12px; }
.more-opts.off { opacity: .4; pointer-events: none; }

/* ---------- statistik ---------- */
.battle { display: grid; gap: 14px; margin-top: 4px; }
.battle .seg { width: max-content; max-width: 100%; }
.mgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.metric { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.metric b { display: block; font: 700 21px var(--display); font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); font-size: 12px; }
.metric.hl { background: linear-gradient(160deg, var(--accent-soft), var(--surface)); border-color: var(--accent-line); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.htable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.htable th { text-align: left; color: var(--dim); font-weight: 600; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.htable td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.htable .wr { display: flex; align-items: center; gap: 8px; }
.htable .wr .b { flex: 1; min-width: 40px; max-width: 140px; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.htable .wr .b i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #38d6ff); border-radius: 6px; }
.role { font-size: 11px; color: var(--muted); }

/* ---------- bar pilihan ---------- */
.selbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); z-index: 30;
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 16px;
  background: var(--surface-glass); border: 1px solid var(--accent-line); backdrop-filter: blur(16px); box-shadow: var(--shadow); font-size: 14px;
}
.selbar > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selbar b { color: var(--accent-text); font-family: var(--display); font-size: 16px; }
.selbar i { font-style: normal; color: var(--muted); font-size: 12.5px; }

/* Mode lihat saja (link untuk pembeli): tanpa poster & tanpa memilih skin. */
.viewer.ro .v-tabs [data-t="poster"], .viewer.ro .autoPick, .viewer.ro .pickHint, .viewer.ro .selbar, .viewer.ro .selToggle, .viewer.ro .toolbar .view,
.viewer.ro .skin .ck, .viewer.ro .skin .star { display: none !important; }
.viewer.ro .skin { cursor: default; }

/* ---------- layar lebar ---------- */
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
  .mgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .skin .info .s { font-size: 13px; }
}
@media (min-width: 900px) {
  .v-head { grid-template-columns: 1fr auto; align-items: center; padding: 20px; }
  .v-head .avatar { width: 60px; height: 60px; font-size: 26px; }
  .nick { font-size: 26px; }
  .v-head .pills { flex-wrap: wrap; overflow: visible; }
  .tiles { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); overflow: visible; }
  .v-tabs { margin: 0; padding: 0; }
  .v-tabs button { flex: none; padding: 13px 22px; }
  .filterBtn { display: none; }
  .filters { position: static; transform: none; box-shadow: none; border: 0; background: none; display: block; max-height: none; border-radius: 0; }
  .sheet-head, .sheet-foot, .sheet-backdrop { display: none; }
  .sheet-body { padding: 0; overflow: visible; gap: 10px; }
  .sheet-body .frow select { flex: 0 1 auto; }
  .sheet-body .chips { flex-wrap: nowrap; overflow-x: auto; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .poster-wrap { grid-template-columns: 340px minmax(0, 1fr); align-items: start; }
  .poster-controls { order: -1; }
  .poster-side { position: sticky; top: calc(var(--header-h) + 60px); }
  .poster { max-height: 70vh; }
  .poster-bar { position: static; }
  .thumb img { height: 110px; }
  .selbar { left: 50%; right: auto; transform: translateX(-50%); bottom: 22px; }
}
