/* Flip card container */
.flip-card {
  background-color: transparent;
  width: 250px;  
  height: 300px; 
  perspective: 1000px;
  margin: 10px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  border-radius: 10px;
}

/* Inner flip effect */
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border-radius: 10px;
}

/* Flip on hover */
.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

/* Front and back stacking */
.flip-card-front, .flip-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

/* Front */
.flip-card-front {
  background-color: #fff;
}

.flip-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Front footer: Name + Jersey centered at bottom */
.player-front-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: rgba(0, 123, 255, 0.85);
  color: #fff;
  padding: 2px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Arial Black', sans-serif;
  font-size: 0.9em;
  font-weight: bold;
  text-align: center;
  z-index: 2;
}

.player-name {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-jersey {
  margin: 0;
  font-size: 0.8em;
  opacity: 0.9;
}

/* Back */
.flip-card-back {
  background-color: #007BFF;
  color: #ffffff;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 5px;
  line-height: 1.2;
  font-family: 'Arial', sans-serif;
  font-size: 0.85em;
  text-align: center;
  border-radius: 10px;
  box-sizing: border-box;
}

.flip-card-back p {
  margin: 2px 0;
}

.player-data {
  color: #FFD700;
  font-weight: bold;
}

.flip-card-back a {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 10px;
  background-color: rgba(255,255,255,0.2);
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
  transition: background-color 0.3s;
}

.flip-card-back a:hover {
  background-color: rgba(255,255,255,0.4);
}

/* Responsive grid for multiple cards */
.player-card-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
