/* ============================================================================
   DECK BOX (deckbox.js) — faces in design px; the views scale the whole net / box.
   Navy panel + gold inset frame = the style of the reference dieline (Starter Pack).
   ============================================================================ */
.db-face {
  position: absolute; left: 50%; top: 50%; box-sizing: border-box; overflow: hidden;
  background-size: cover; background-position: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.db-net .db-face { left: auto; top: auto; outline: 1.5px solid #070f1d; }
.db-net { position: relative; }

/* the navy panel (default back, sides, top, bottom) */
.db-panel { background-color: #16305a; background-image: radial-gradient(ellipse at 50% 38%, #24477f 0%, #183566 45%, #0f2346 100%); }
.db-panel.has-img { background-color: #0f2346; }
.db-frame {
  position: absolute; inset: 9px; border-radius: 7px; pointer-events: none;
  border: 3px solid #e9b949;
  box-shadow: inset 0 0 0 1.5px #7a5410, 0 0 0 1.5px #7a5410, inset 0 0 18px rgba(0, 0, 0, 0.35);
}
.db-side .db-frame { inset: 7px 8px; }
.db-cap .db-frame { inset: 8px; }

.db-logo { display: block; max-width: 100%; height: auto; filter: drop-shadow(0 3px 0 rgba(3, 8, 20, 0.55)); user-select: none; }

/* ---- cover: optional title / image over the art ---- */
.db-cover-scrim { position: absolute; left: 0; right: 0; height: 36%; pointer-events: none; }
.db-cover-scrim.is-top { top: 0; background: linear-gradient(180deg, rgba(6, 12, 28, 0.78), rgba(6, 12, 28, 0)); }
.db-cover-scrim.is-bottom { bottom: 0; background: linear-gradient(0deg, rgba(6, 12, 28, 0.82), rgba(6, 12, 28, 0)); }
.db-cover-title {
  position: absolute; left: 14px; right: 14px; text-align: center; white-space: nowrap; overflow: hidden;
  font-family: "Bowlby One", "Lilita One", system-ui, sans-serif; line-height: 1.05; letter-spacing: 0.02em;
  color: #f5c14a; -webkit-text-stroke: 3px #0a1428; paint-order: stroke fill;
  text-shadow: 0 4px 0 #0a1428, 0 8px 14px rgba(0, 0, 0, 0.6);
}
.db-cover-title.is-top { top: 18px; }
.db-cover-title.is-bottom { bottom: 20px; }
.db-cover-img { position: absolute; left: 50%; transform: translateX(-50%); height: auto; max-height: 42%; object-fit: contain;
  filter: drop-shadow(0 4px 0 rgba(3, 8, 20, 0.55)) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45)); }
.db-cover-img.is-top { top: 14px; }
.db-cover-img.is-bottom { bottom: 16px; }

/* ---- back ---- */
.db-back-in {
  position: absolute; inset: 20px 22px 22px; display: flex; flex-direction: column; align-items: center;
}
.dbx-back .db-logo { width: 68%; margin-top: 2px; }
.db-deckname {
  margin: 10px 0 12px; width: 100%; white-space: nowrap; overflow: hidden;
  font-family: "Bowlby One", "Lilita One", system-ui, sans-serif; line-height: 1.05; letter-spacing: 0.02em;
  color: #fff3d0; text-align: center;
  -webkit-text-stroke: 2px #0a1428; paint-order: stroke fill;
  text-shadow: 0 3px 0 #0a1428, 0 6px 10px rgba(0, 0, 0, 0.55);
}
.db-list {
  list-style: none; margin: 0; padding: 10px 12px; width: 100%; box-sizing: border-box;
  counter-reset: db; flex: 1 1 auto; min-height: 0;
  background: rgba(5, 12, 28, 0.55); border: 1.5px solid rgba(233, 185, 73, 0.55); border-radius: 8px;
  /* 10 rows share the frame's height, so the list fills it whatever the name above takes */
  display: grid; grid-template-rows: repeat(10, minmax(0, 1fr)); grid-auto-flow: column; gap: 0 12px;
  font-family: "Lilita One", "Space Grotesk", system-ui, sans-serif; font-size: 15px; line-height: 1.2; color: #e8eefb;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}
.db-list.two-col { grid-template-columns: 1fr 1fr; }
.db-list li { counter-increment: db; display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.db-list li::before { content: counter(db); flex: none; width: 18px; text-align: right; color: #e9b949; font-size: 12px; }
.db-list li span { overflow: hidden; text-overflow: ellipsis; }
.db-list li b { color: #e9b949; font-weight: 400; }

/* ---- spines (content rotated to read bottom → top) ---- */
.db-spine {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-90deg);
  display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 26px; box-sizing: border-box;
}
.db-logo-sm { width: 150px; max-height: 96px; object-fit: contain; flex: none; }
.db-spine-name {
  font-family: "Bowlby One", "Lilita One", system-ui, sans-serif; line-height: 1; letter-spacing: 0.03em;
  color: #f5c14a; white-space: nowrap; overflow: hidden; min-width: 0; flex: 0 1 auto;
  -webkit-text-stroke: 2px #0a1428; paint-order: stroke fill; text-shadow: 0 3px 0 #0a1428;
}
/* dbx-count / dbx-back: NOT db-*, styles.css (the game) already has .db-count (the deck builder's
   pill counter) and .db-back — loaded together, they drew a pill on the count spine */
.dbx-count { display: flex; align-items: baseline; gap: 10px; }
.dbx-count b {
  font-family: "Bowlby One", system-ui, sans-serif; font-weight: 400; font-size: 58px; line-height: 1; color: #f5c14a;
  -webkit-text-stroke: 2.5px #0a1428; paint-order: stroke fill; text-shadow: 0 4px 0 #0a1428;
}
.dbx-count span {
  font-family: "Bowlby One", system-ui, sans-serif; font-size: 26px; letter-spacing: 0.08em; color: #fff3d0;
  -webkit-text-stroke: 1.5px #0a1428; paint-order: stroke fill; text-shadow: 0 3px 0 #0a1428;
}

/* ---- top / bottom ---- */
.db-cap { display: grid; place-items: center; }
.db-logo-cap { width: 62%; max-height: 78%; object-fit: contain; position: relative; }

/* ---- 3D ---- */
.db-box { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }
.db-box .db-face { outline: 1px solid rgba(7, 15, 29, 0.9); }
.db-shade { position: absolute; inset: 0; background: #000; pointer-events: none; }
.db-gloss {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.07) 100%);
}

/* ---- FILL ANIMATION (DeckBox.fillBox) ---- */
.db-fx-host { position: relative; overflow: hidden; }
.db-fx-scene { position: absolute; inset: 0; perspective: 1500px; perspective-origin: 50% 30%;
  /* the box is a picture, not a control: with the pointer on, the cards INSIDE it won the hit
     test and hovering them repainted a card back through the closed box */
  pointer-events: none; }
.db-fx-fit { position: absolute; left: 50%; top: 66%; width: 0; height: 0; transform-style: preserve-3d; }
.db-fx-cam, .db-fx-bump, .db-fx-hinge, .db-fx-lid { position: absolute; left: 0; top: 0; transform-style: preserve-3d; }
.db-fx-cam .db-face { outline: 1px solid rgba(7, 15, 29, 0.9); }
.db-fx-lid { transform-origin: 50% 0; }
.db-fx-lid > * { position: absolute; left: 0; top: 0; margin: 0; }
.db-fx-lid-out { transform: none; }
.db-fx-lid > .db-fx-lid-in { left: 0; top: 0; transform: rotateY(180deg); }   /* beats .db-fx-inner's centring */
/* inside of the box: DARK — only a little light reaches it through the slot, so the walls
   fade from dim navy at the rim to near black at the bottom */
.db-fx-inner {
  position: absolute; left: 50%; top: 50%; box-sizing: border-box;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: linear-gradient(180deg, #14264a 0%, #070f20 30%, #03070f 100%);
}
.db-fx-inner.is-floor { background: #020409; }
.db-fx-inner.db-fx-lid-in { background: linear-gradient(0deg, #2a4a80, #14284d); border: 3px solid #0a1428; }
/* the dark well at the slot (deepest in the middle, softer at the walls) */
.db-fx-shadow {
  position: absolute; left: 50%; top: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(1, 3, 8, 0.62) 0%, rgba(2, 5, 12, 0.5) 45%, rgba(3, 7, 16, 0.25) 100%);
  /* NO mix-blend-mode here: inside a preserve-3d scene it FLATTENS the whole box (Chrome) */
}
/* a card = a slab: two faces (the back) + its edges; the pile of slabs gives the deck volume */
.db-fx-card { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-style: preserve-3d; }
.db-fx-slab { position: absolute; left: 0; top: 0; box-sizing: border-box; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
/* no background: the card's own frame IS the outline (it has rounded, transparent corners) */
.db-fx-slab.is-face { overflow: hidden; background: transparent; }
/* a face showing a REAL card (mountFace): the card fills the width, centred */
.db-fx-slab.is-face.has-front { display: flex; align-items: center; justify-content: center; }
.db-fx-slab.is-face.has-front > * { width: 100%; flex: none; }
.db-fx-slab.is-face.has-front .card { width: 100%; }
.db-fx-slab img { width: 100%; height: 100%; display: block; object-fit: fill; }
/* card edges: pale card stock, a little darker toward each face so every card reads on its own */
/* a silhouette layer of the card's thickness (mountFace with `sil`): the frame png's alpha as the
   mask, stretched over the board rect — the face shows the frame on exactly that rect */
.db-fx-sil { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center; }
.db-fx-slab.is-edge.is-top { background: linear-gradient(180deg, #b9b09a 0%, #f3eee1 35%, #f3eee1 65%, #9d947f 100%); }
.db-fx-slab.is-edge.is-side { background: linear-gradient(90deg, #a79e88 0%, #e6e0d0 40%, #e6e0d0 60%, #8f8671 100%); }
.db-fx-sweep {
  position: absolute; top: -10%; bottom: -10%; left: 0; width: 38%; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
  mix-blend-mode: overlay;
}
.db-fx-sparks { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.db-spark {
  position: absolute; display: block;
  background: radial-gradient(circle, #fff 0%, #fff6d0 35%, #f5c14a 70%);
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
  filter: drop-shadow(0 0 4px rgba(255, 214, 110, 0.9));
}
