/* Card element (Cardmeister <playing-card> web component) */
.card {
  position: absolute;
  width: var(--card-width);
  height: var(--card-height);
  border-radius: 8px;
  cursor: grab;
  transition: transform 200ms ease-out, box-shadow 150ms ease;
  will-change: transform;
  z-index: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  touch-action: none;
}

.card img {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-2px);
  z-index: 2;
}

.card.dragging {
  cursor: grabbing;
  opacity: 0.85;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1001;
  transition: none;
}

.card.drag-source {
  opacity: 0.3;
}

.card.no-transition {
  transition: none;
}

/* Tableau card stacking */
.tableau-column .card {
  left: 0;
}

/* Waste pile fanning */
#waste-zone .card {
  position: absolute;
  top: 0;
}

/* Auto-play animation */
.card.auto-playing {
  transition: transform 250ms ease-in-out;
  z-index: 100;
}

/* Non-interactive cards */
.card.locked {
  cursor: default;
}

.card.locked:hover {
  transform: none;
}

/* Stock card count badge */
.stock-count {
  position: absolute;
  bottom: -8px;
  right: -8px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  z-index: 5;
}

/* Card picked by tap, click or keyboard, waiting for a destination */
.card.selected {
  outline: 3px solid rgba(120, 200, 255, 0.95);
  outline-offset: -1px;
  box-shadow: 0 0 12px rgba(120, 200, 255, 0.6);
}

/* Keyboard focus */
.card:focus-visible,
.zone:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}
