/* Kartu Peti Banner Editor. GUI ala Minecraft lewat token --mc-* (sama
 * dengan slotGridMinecraft.css). Chromium 88: tanpa nesting/:has/dvh. */
.bnr-chest .kit-card__body { display: flex; flex-direction: column; gap: 12px; }
.bnr-chest .kit-seg { flex-wrap: wrap; }
.bnr-chest__tools { display: flex; flex-wrap: wrap; gap: 8px; }
.bnr-chest__tools .btn { flex: 1 1 150px; }
.bnr-chest__summary { margin: 0; font-size: 13px; color: var(--text-secondary); }
.bnr-chest__danger { color: var(--wb-danger); }

/* ── Panel peti + slot ──────────────────────────────────────────────── */
.bnr-chest__grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 2px;
  padding: 8px;
  background: var(--mc-gui-panel);
  border: 2px solid var(--mc-gui-edge);
  border-radius: 6px;
  box-shadow: inset 2px 2px 0 var(--mc-gui-light), inset -2px -2px 0 var(--mc-gui-shade);
}
/* Tekan lama di HP: tanpa seleksi teks / menu gambar bawaan. */
.bnr-chest__grid {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.bnr-chest__slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  aspect-ratio: 1 / 1;
  background: var(--mc-slot);
  border: 0;
  border-radius: 0;
  box-shadow: inset 2px 2px 0 var(--mc-slot-dark), inset -2px -2px 0 var(--mc-gui-light);
  cursor: pointer;
}
/* aspect-ratio belum ada di Chromium 88 → tinggi cadangan. */
@supports not (aspect-ratio: 1 / 1) {
  .bnr-chest__slot { height: 36px; }
}
.bnr-chest__slot[hidden] { display: none; }
.bnr-chest__slot:hover { background: var(--mc-slot-hover); }
.bnr-chest__slot:focus-visible { outline: 2px solid var(--mc-gui-light); outline-offset: -4px; }
.bnr-chest__slot.is-selected { box-shadow: inset 0 0 0 2px var(--accent), inset 2px 2px 0 var(--mc-slot-dark); }
.bnr-chest__grid.is-moving .bnr-chest__slot.is-target { outline: 1px dashed var(--mc-gui-light); outline-offset: -3px; }
.bnr-chest__slot.is-lifted .bnr-chest__icon { opacity: 0.35; }
.bnr-chest__slot.is-drop { background: var(--mc-slot-hover); box-shadow: inset 0 0 0 2px var(--mc-gui-light); }
body.is-chest-dragging,
body.is-chest-dragging * { cursor: grabbing !important; }

/* Hantu seret: titik tengah = pointer (translate dari chestDrag.js). */
.bnr-chest-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  margin: -24px 0 0 -24px;
  pointer-events: none;
  will-change: transform;
}
.bnr-chest-ghost__box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--mc-slot);
  border: 2px solid var(--accent);
  box-shadow: 0 10px 24px var(--wb-shadow);
  transform: rotate(-4deg);
}
.bnr-chest-ghost--touch .bnr-chest-ghost__box { width: 60px; height: 60px; margin: -6px 0 0 -6px; }
.bnr-chest-ghost__box .bnr-chest__img { height: 86%; }

.bnr-chest__icon { display: flex; align-items: center; justify-content: center; width: 88%; height: 88%; pointer-events: none; }
.bnr-chest__img { max-width: 100%; max-height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.bnr-chest__swatch { display: block; width: 45%; height: 90%; border: 1px solid var(--mc-slot-dark); }
.bnr-chest__icon--shield .bnr-chest__swatch { width: 60%; height: 80%; }
.bnr-chest__count {
  position: absolute;
  right: 3px;
  bottom: 1px;
  z-index: 2;
  font-family: "Monocraft", var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--stack-count);
  text-shadow: 1px 1px 0 var(--mc-gui-shade);
  pointer-events: none;
}

/* ── Panel slot terpilih ────────────────────────────────────────────── */
.bnr-chest__panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--wb-rule);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
}
.bnr-chest__panel[hidden] { display: none; }
.bnr-chest__panel-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.bnr-chest__qtyrow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.bnr-chest__qtylabel { font-size: 12px; color: var(--text-muted); margin-right: 4px; }
.bnr-chest__step { min-width: 40px; }
.bnr-chest__qty { width: 72px; text-align: center; }
.bnr-chest__hint { margin: 0; font-size: 12px; color: var(--text-muted); }
.bnr-chest__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bnr-chest__actions .btn { flex: 1 1 130px; }
.bnr-chest__actions .btn.is-active { border-color: var(--accent); color: var(--accent); }

/* Layar sempit: Pratinjau 1 … Edisi 5, Peti 6, Ekspor 7 (terakhir). */
@media (max-width: 999px) {
  .bnr-chest { order: 6; }
}
