/* Batch opening results: an order's cards on the counter, the way the end of
   a pack looks (css/opening.css). The cards lie on a playmat; beside it the
   till prints one long receipt for the whole order (.receipt lives in
   css/opening.css). The rows, the pickers and the buttons stay plain. The
   layer sits under the pack opening and the card inspector (both z-index 40)
   so those open above it. */

.batch-open {
  /* On the laminate the quietest greys fall under 4.5:1; quiet text is ink-2 here. */
  --muted: var(--ink-2);
  --faint: var(--ink-2);
  --hair: rgb(var(--hl) / 0.16);
  position: fixed;
  inset: 0;
  z-index: 38;
  display: flex;
  background:
    radial-gradient(ellipse 900px 640px at 42% 36%, rgb(255 224 178 / 0.14), rgb(255 224 178 / 0) 70%),
    radial-gradient(ellipse 130% 110% at 46% 40%, transparent 55%, rgba(0, 0, 0, 0.32)),
    url("../../assets/textures/laminate.png"),
    var(--counter);
  color: var(--ink);
}
.bo-frame {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}
.bo-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: max(8px, env(safe-area-inset-top)) var(--gutter) 8px;
}
.bo-bar-title { color: var(--ink-2); font-size: 15px; font-weight: 600; }
.bo-bar .ghost { border-color: rgb(var(--hl) / 0.38); }
.bo-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  outline: none;
}
.bo-body {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 8px var(--gutter) 48px;
}
.bo-loading { margin: 0; padding: 48px var(--gutter); color: var(--ink-2); }
.bo-foot {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px var(--gutter) max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-2);
  background: var(--wall-dark);
}
.bo-foot .solid { flex: 1 1 100%; }
.bo-foot .ghost { flex: 1 1 0; }

.bo-watch {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 4px;
  color: var(--ink-2);
  font-size: 14px;
}
.bo-watch p { margin: 0; }
.bo-watch b { color: var(--ink); }
.bo-watch .link-btn { flex: none; white-space: nowrap; }

/* ---- Headline -------------------------------------------------------------- */
.bo-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 700;
  font-variation-settings: "opsz" 48;
  letter-spacing: -0.02em;
  line-height: 1.05;
  outline: none;
}
.bo-lede { max-width: 60ch; margin: 8px 0 0; color: var(--ink-2); }

/* ---- The table: the mat (and what else was in the order), the receipt -----
   One column on a phone, in this order: the mat, the receipt, the rest. */
.bo-table { display: flex; flex-direction: column; gap: 26px; margin-top: 22px; }
.bo-main { display: contents; }
.bo-main > .bo-mat { order: 1; }
.bo-side { order: 2; }
.bo-main > :not(.bo-mat) { order: 3; }
.bo-side .receipt { width: 100%; max-width: 340px; margin: 0 auto 8px; }

/* The playmat: charcoal neoprene with a stitched edge (as in the opening). */
.bo-mat {
  position: relative;
  min-width: 0;
  padding: 6px 16px 22px;
  border-radius: 14px;
  background: url("../../assets/textures/neoprene.png"), var(--mat);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 3px 4px rgba(0, 0, 0, 0.35),
    0 18px 40px rgba(0, 0, 0, 0.3);
}
.bo-mat::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(220, 220, 214, 0.22);
  border-radius: 10px;
  pointer-events: none;
}
.bo-mat > .bo-section:first-child { margin-top: 18px; }

.bo-section { margin-top: 36px; }
.bo-section h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.bo-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.bo-section-head .link-btn { min-height: 44px; display: inline-flex; align-items: center; margin: -8px 0; }
.bo-quiet { margin: 10px 0 0; color: var(--ink-2); font-size: 14px; }
.bo-money { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bo-order { margin-top: 10px; }
.bo-missing { margin-top: 18px; }

/* ---- Card tiles ------------------------------------------------------------ */
.bo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 10px;
  margin-top: 16px;
}
.bo-tile { position: relative; min-width: 0; }
/* A holder keeps the card's shape while its face is unmounted (windowed), and
   carries the card's contact shadow on the mat, never the .tcg itself. */
.bo-face {
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;
  padding: 0;
  border: 0;
  border-radius: 4.5% / 3.2%;
  background: transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}
.bo-face:empty { background: rgb(255 255 255 / 0.05); box-shadow: none; }
.bo-face:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.bo-name {
  display: flex;
  gap: 6px;
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}
.bo-name span { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-name small { flex: none; color: var(--ink-2); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.bo-sub { display: flex; justify-content: space-between; gap: 6px; margin: 2px 0 0; color: var(--ink-2); font-size: 12px; }
.bo-sub > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-where { margin: 1px 0 0; overflow: hidden; color: var(--ink-2); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Per-product list: rows between hairlines, on the counter -------------- */
.bo-list { list-style: none; margin: 8px 0 0; padding: 0; border-bottom: 1px solid var(--hair); }
.bo-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 2px 14px;
  padding: 16px 0;
  border-top: 1px solid var(--hair);
}
.bo-row-face .bo-face { width: 64px; }
.bo-row-main { min-width: 0; }
.bo-row-main h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.bo-row-main h3 small { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.bo-row-meta, .bo-row-best { margin: 2px 0 0; color: var(--ink-2); font-size: 13px; }
.bo-row-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 4px; }
.bo-row-actions .link-btn,
.bo-bar .link-btn,
.bo-watch .link-btn { min-height: 44px; display: inline-flex; align-items: center; }

/* ---- Pull grid view -------------------------------------------------------- */
.bo-modes {
  display: flex;
  gap: 24px;
  margin: 20px 0 0;
  border-bottom: 1px solid var(--hair);
  overflow-x: auto;
  scrollbar-width: none;
}
.bo-modes::-webkit-scrollbar { display: none; }
.bo-modes button {
  position: relative;
  flex: none;
  min-height: 44px;
  padding: 8px 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.bo-modes button:hover,
.bo-modes button.on { color: var(--ink); }
.bo-modes button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); }
.bo-modes small { margin-left: 4px; color: var(--ink-2); font-size: 12px; font-weight: 500; }
.bo-modes + .bo-mat { margin-top: 18px; }
.bo-more { height: 1px; }

/* Sleeves and coins use the strip the opening spread uses; its own heading is replaced by ours. */
.bo-gear .spread-gear { max-width: none; margin: 12px 0 0; }
.bo-gear .spread-gear > h3 { display: none; }

@media (min-width: 560px) {
  .bo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 14px; }
  .bo-foot .solid { flex: 0 0 auto; }
  .bo-foot .ghost { flex: 0 0 auto; }
}
@media (min-width: 760px) {
  .bo-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .bo-row { grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; }
  .bo-row-actions { grid-column: 3; flex-direction: column; align-items: flex-end; margin-top: 0; }
  .bo-section h2 { font-size: 24px; }
  .bo-mat { padding: 8px 28px 28px; border-radius: 18px; }
  .bo-mat::after { border-radius: 14px; }
}
@media (min-width: 900px) {
  .bo-foot { justify-content: flex-end; }
  .bo-watch { justify-content: flex-start; }
}
/* Wide: the mat and what came with the order on the left, the receipt beside it. */
@media (min-width: 1080px) {
  .bo-table { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; align-items: start; }
  .bo-main { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
  .bo-side .receipt { max-width: none; margin: 0 0 8px; }
  .bo-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
