/* ── cards.css — bottom sheet cards inside #cards wrapper ───────────────
   Used by: #user-card, #settings-card only.
   ctx-menu has its own standalone css (ctx-menu.css).

   #cards is position:fixed inset:0 z-index:50 — it is the stacking context.
   Children (#user-card, #settings-card) are position:absolute inside it.

   JS open:  remove .hidden → rAF → add .is-open
   JS close: remove .is-open → transitionend → add .hidden
────────────────────────────────────────────────────────────────────────── */

#cards {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

/* ── Card base — absolute inside #cards ─────────────────────── */
#cards .kofi-card {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
#cards .kofi-card.hidden  { display: none; }
#cards .kofi-card.is-open { pointer-events: all; }

/* ── Backdrop ────────────────────────────────────────────────── */
.kofi-card-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
}
#cards .kofi-card.is-open .kofi-card-backdrop { opacity: 1; }

/* ── Sheet ───────────────────────────────────────────────────── */
.kofi-card-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border: 1px solid var(--border-md);
  border-bottom: none;
  min-height: 38vh;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0 calc(1.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
#cards .kofi-card.is-open .kofi-card-sheet { transform: translateY(0); }

/* ── Drag handle pill ────────────────────────────────────────── */
.kofi-card-sheet::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  background: var(--border-md);
  border-radius: 2px;
  margin: 0.65rem auto 0.5rem;
  flex-shrink: 0;
}

/* ── Attach card tiles ───────────────────────────────────────── */
#attach-card-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 0.5rem 0 0.25rem;
}

#attach-card-tiles label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.1rem 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: var(--text-sm);
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
}
#attach-card-tiles label:hover,
#attach-card-tiles label:active { background: var(--surface3); }
