/*!
 * BappaCards — the deck, the board, and the card in hand.
 * https://bappatutions.in
 */

.bc-wrap { display: grid; gap: clamp(0.5rem, 2vw, 1rem); }

/* Two rows of five. The board says where things go before anyone explains it. */
.bc-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(0.35rem, 1.4vw, 0.7rem);
}

.bc-slot {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  border: 3px dashed rgb(122 74 56 / 0.4);
  background: rgb(255 255 255 / 0.45);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

/* The numeral printed faintly in its own place: the guide is the board itself,
   not an instruction a child would have to be able to read. */
.bc-slot__ghost {
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 800;
  color: rgb(122 74 56 / 0.28);
}

.bc-slot.is-over {
  border-color: #158F41;
  background: rgb(21 143 65 / 0.16);
  transform: scale(1.06);
}

.bc-slot.is-filled {
  border: 3px solid #5A3A22;
  background: var(--card, #FFC93C);
  box-shadow: 0 4px 0 rgb(0 0 0 / 0.18);
  animation: bc-land 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.5);
}
.bc-slot__num {
  font-size: clamp(1.5rem, 5.5vw, 2.4rem);
  font-weight: 800;
  color: #2B2118;
}

@keyframes bc-land {
  0%   { transform: scale(1.25); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* ── the deck ─────────────────────────────────────────────────────────────── */
.bc-deck {
  position: relative;
  min-height: clamp(96px, 22vw, 150px);
  display: grid;
  place-items: center;
}
/* The pile the next card comes off. */
.bc-deck::before {
  content: '';
  position: absolute;
  width: clamp(66px, 17vw, 104px);
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  background: repeating-linear-gradient(45deg, #8A5A2B 0 8px, #7A4A22 8px 16px);
  border: 3px solid #5A3A22;
  box-shadow: 3px 3px 0 rgb(0 0 0 / 0.2), 6px 6px 0 rgb(0 0 0 / 0.12);
}

.bc-card {
  position: relative;
  width: clamp(66px, 17vw, 104px);
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  border: 3px solid #5A3A22;
  background: var(--card, #FFC93C);
  box-shadow: 0 5px 0 rgb(0 0 0 / 0.22);
  display: grid;
  place-items: center;
  font: inherit;
  cursor: grab;
  /* The finger drags the card; the page must not move underneath it. */
  touch-action: none;
  transform: rotateY(90deg);
  transition: transform 0.26s ease;
}
.bc-card.is-up { transform: rotateY(0deg); }
.bc-card span {
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  font-weight: 800;
  color: #2B2118;
}

/* Held: lifted out of the layout and following the finger. */
.bc-card.is-held {
  position: fixed;
  z-index: 60;
  cursor: grabbing;
  transition: none;
  transform: scale(1.1) rotate(-4deg);
  box-shadow: 0 14px 22px rgb(0 0 0 / 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .bc-card, .bc-slot { transition: none; }
  .bc-slot.is-filled { animation: none; }
  .bc-card { transform: none; }
}
