.videoBox {
  background-color: black;
  width: 100%;
  height: 53vh;
  /* Fixed height instead of fit-content */
  display: flex;
  position: relative;
  overflow: hidden;
  /* Prevent content overflow */
}

.timer {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 20;
  color: white;

  /* padding: 0.5rem; */
  border-radius: 4px;
}

.playerInfo {
  z-index: 10;
  width: auto;
  position: absolute;
  left: 1rem;
  top: 1rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 1rem;


  border-radius: 8px;
}

.playerSection {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.playerName {
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
  text-transform: uppercase;
}

.playerCards {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

@keyframes flipIn {
  from {
    transform: perspective(600px) rotateY(90deg);
    opacity: 0;
  }

  to {
    transform: perspective(600px) rotateY(0deg);
    opacity: 1;
  }
}

.playerCards img {
  width: 3rem;
  height: 4rem;
  object-fit: contain;
  border-radius: 4px;
  background-color: white;
  animation: flipIn 0.5s ease-out both;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.videoframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.iframe {
  width: auto;
  height: 100%;
  aspect-ratio: 16/9;
  border: none;
  background-color: #1a1a1a;
}

/* Error state styling */
.videoframe::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  z-index: 2;
}

.errorMessage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  text-align: center;
  z-index: 3;
  font-size: 1.2rem;
}

/* @media (max-width: 1199px) {
  .videoBox {
    height: 40vh;
    min-height: 300px;
  }
} */

@media (max-width: 768px) {
  .videoBox {
    height: auto;
    width: 100%;
    aspect-ratio: 16/9;
    min-height: unset;
  }

  /* Reset iframe for mobile to full width */
  .iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
  }

  .playerInfo {
    width: auto;
    left: 5px;
    top: 5px;
    flex-direction: column;
    gap: 5px;
    padding: 5px;

  }

  .playerSection {
    gap: 2px;
  }

  .playerName {
    font-size: 0.7rem;
    margin-bottom: 2px;
  }

  .playerCards img {
    width: 1.8rem;
    height: 2.4rem;
  }

  .timer {
    bottom: 5px;
    right: 5px;
    padding: 0;
    transform: scale(0.7);
    transform-origin: bottom right;
  }
}

@media (max-width: 480px) {
  .videoBox {
    height: auto;
    width: 100%;
    aspect-ratio: 16/9;
    min-height: unset;
  }

  .playerInfo {
    left: 2px;
    top: 2px;
    padding: 3px;
  }

  .playerName {
    font-size: 0.6rem;
  }

  .playerCards {
    gap: 2px;
  }

  .playerCards img {
    width: 1.5rem;
    height: 2rem;
  }
}