/* ── Flip cards ─────────────────────────────────────────────────── */
.flip-card { perspective: 1000px; cursor: pointer; height: 420px; }
.flip-card-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform .45s cubic-bezier(.4,0,.2,1);
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back {
  position: absolute; inset: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  border-radius: 12px; overflow: hidden;
}
.flip-card-back { transform: rotateY(180deg); background: #0f0f0f; border: 1px solid rgba(255,255,255,0.1); font-size: 20px; }
.flip-card.sel .flip-card-front { box-shadow: 0 0 0 2px #78d200; }
.flip-card.flipped .flip-card-front { pointer-events: none; }

/* ── Card front ─────────────────────────────────────────────────── */
.flip-card-front { font-size: 20px; }
.cf-header { display: flex; align-items: center; gap: 10px; padding: 18px 18px 4px; }
.cf-emoji { font-size: 2em; flex-shrink: 0; line-height: 1; }
.cf-title { font-size: 1.7em; line-height: 1.1; margin: 0; }
.cf-meta { font-size: 0.82em; color: #52525b; padding: 0 18px 6px; }
.cf-tags { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 18px 8px; }
.cf-tags .tag { font-size: 0.78em; }
.cf-desc { font-size: 0.88em; color: #71717a; line-height: 1.55; padding: 0 18px 10px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.cf-cta { padding: 9px 18px; border-top: 1px solid rgba(255,255,255,0.07); margin-top: auto; }
.cf-cta-label { font-size: 0.82em; font-weight: 600; color: #52525b; letter-spacing: .04em; text-transform: uppercase; }
.toggle-sel {
  width: 100%; padding: 9px; border: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  cursor: pointer; font-size: 0.88em; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; transition: all .15s;
  background: rgba(255,255,255,0.03); color: #52525b;
}
.toggle-sel.sel { background: rgba(120,210,0,0.12); color: #78d200; }

/* ── Card back ──────────────────────────────────────────────────── */
.cb-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cb-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.7em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80%; }
.flip-close {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,0.06); color: #71717a;
  border: none; cursor: pointer; font-size: 0.75em;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cb-tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 8px; }
.back-tab-btn {
  font-size: 0.65em; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 5px; border: none; cursor: pointer;
  background: transparent; color: #52525b; transition: all .15s;
}
.back-tab-btn.active { background: rgba(255,255,255,0.08); color: #fff; }
.back-tab-panel { flex: 1; overflow-y: auto; margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.back-list-item { display: flex; gap: 8px; align-items: flex-start; font-size: 0.82em; color: #a1a1aa; }
.cb-tip-bar { padding-top: 7px; border-top: 1px solid rgba(255,255,255,0.06); margin-top: 7px; flex-shrink: 0; }
.cb-tip { font-size: 0.82em; color: #a1a1aa; font-style: italic; line-height: 1.5; }

/* ── Filter UI ──────────────────────────────────────────────────── */
.filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  cursor: pointer; transition: all .15s;
}
.filter-clear-btn {
  display: inline-flex; align-items: center;
  padding: 7px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.08); color: #52525b;
  background: transparent; cursor: pointer; transition: color .15s;
}
.filter-clear-btn:hover { color: #fff; }
.filter-panel {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 14px; border-radius: 12px;
  background: #0f0f0f; border: 1px solid rgba(255,255,255,0.07); margin-bottom: 8px;
}
.filter-option-btn {
  display: inline-flex; align-items: center;
  padding: 5px 13px; border-radius: 99px;
  font-size: 12px; font-weight: 600; border: 1px solid;
  cursor: pointer; transition: all .15s;
}
.filter-option-btn.not-sel { background: transparent; color: #a1a1aa; border-color: rgba(255,255,255,0.1); }
.filter-count-badge { border-radius: 99px; padding: 1px 7px; font-size: 10px; font-weight: 700; margin-left: 2px; color: #000; }

/* ── Pagination ─────────────────────────────────────────────────── */
#pagination-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 28px; padding-bottom: 12px; }
.pag-btn { min-width: 36px; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; border: 1px solid; transition: all .15s; background: transparent; border-color: rgba(255,255,255,0.1); color: #a1a1aa; cursor: pointer; }
.pag-btn:hover:not(.pag-disabled):not(.pag-active) { border-color: rgba(255,255,255,0.2); color: #fff; }
.pag-btn.pag-active { background: #f700ff; border-color: #f700ff; color: #fff; cursor: default; }
.pag-btn.pag-disabled { border-color: rgba(255,255,255,0.05); color: #3f3f46; cursor: default; }

/* ── Selection bar ──────────────────────────────────────────────── */
#selection-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; transform: translateY(100%); transition: transform .25s cubic-bezier(.4,0,.2,1); }
.sel-bar-inner { background: rgba(15, 15, 15, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid rgba(255,255,255,0.1); padding: 12px 24px 20px; }
.sel-bar-content { max-width: 72rem; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sel-bar-info { display: flex; align-items: center; gap: 12px; }
#sel-count-label { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 15px; color: #f700ff; }
.sel-sub-label { color: #52525b; font-size: 12px; display: block; margin-top: 1px; }
.sel-bar-actions { display: flex; gap: 8px; }

/* ── Delivered banner heartbeat ─────────────────────────────────── */
@keyframes beat-twice {
  0%   { transform: scale(1); }
  18%  { transform: scale(1.045); }
  36%  { transform: scale(1); }
  54%  { transform: scale(1.045); }
  72%  { transform: scale(1); }
  100% { transform: scale(1); }
}
.banner-beat { animation: beat-twice 0.75s ease-in-out 1 forwards; }
