/* Video wrapper */
.loading-spinner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    z-index: 50;
}
  .video-card-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    border-radius: 1rem;
  }

  /* Loading overlay */
  #loadingOverlay {
    position: absolute;
    inset: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
  }
  
  #loadingOverlay .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: #309f6a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  
  #loadingOverlay .loading-text {
    margin-top: 16px;
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }

  /* Shaka container MUST fill wrapper */
  #shakaContainer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  /* Video MUST NOT be flex */
  #videoPlayer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
  }

  /* Offline message */
  #offlineMessage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  #offlineMessage img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  /* Ensure Shaka UI stretches correctly */
  .video-card-wrap .shaka-video-container,
  .video-card-wrap .shaka-player-container {
    width: 100% !important;
    height: 100% !important;
  }

  /* Viewer badge */
  .viewer-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 11px;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    background: rgba(0,0,0,0.6);
    color: white;
  }
  .viewer-badge i {
    color: var(--dart-green, #309f6a);
    font-size: 12px;
  }

  /* YouTube corner logo */
  .yt-corner-logo {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 50;
    padding: 6px;
    border-radius: 8px;
    pointer-events: none;
    user-select: none;
    display: flex;
    background: rgba(0,0,0,0.4);
  }
  .yt-corner-logo img {
    height: 20px;
    width: auto;
    display: block;
  }

  /* Locked state styles */
  .locked-bg-container {
    position: absolute;
    inset: 0;
    background-color: #050505;
    overflow: hidden;
  }
  .locked-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .4;
    filter: blur(12px);
    transform: scale(1.1);
  }
  .locked-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    filter: blur(20px);
    transform: scale(1.1);
    pointer-events: none;
  }
  .locked-overlay-content {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.2);
    padding: 10px;
  }
  .locked-card {
    width: 100%;
    max-width: 340px;
    max-height: 100%;
    border-radius: 20px;
    background: rgba(20,20,20,.6);
    backdrop-filter: blur(20px);
    padding: 20px 24px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden; /* Prevent spillover */
  }
  .lock-icon-circle {
    margin: 0 auto 10px auto;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
  .locked-card h4 {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: .02em;
    margin-top: 0;
  }
  .locked-card p {
    font-size: 13px;
    color: rgba(255,255,255,.6);
    margin-bottom: 16px;
    line-height: 1.4;
  }
  .btn-locked-login {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: var(--dart-green,#309f6a);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 10px;
    border-radius: 10px;
    transition: all .2s;
    text-decoration: none;
    border: none;
    box-shadow: 0 4px 12px rgba(48,159,106,.3);
    flex-shrink: 0;
  }
  .btn-locked-login:hover {
    background: #258558;
    transform: translateY(-1px);
    color: #fff;
    box-shadow: 0 6px 16px rgba(48,159,106,.4);
  }
  .btn-locked-register {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,.5);
    margin-top: 12px;
    text-decoration: none;
    transition: color .2s;
    flex-shrink: 0;
  }
  .btn-locked-register:hover {
    color: #fff;
    text-decoration: underline;
  }

  /* Responsive Adjustments for Small Screens / Mobile Embeds */
  @media (max-width: 576px), (max-height: 320px) {
    .locked-card {
      padding: 12px 16px;
      max-width: 280px;
      border-radius: 16px;
    }
    .lock-icon-circle {
      width: 28px;
      height: 28px;
      margin-bottom: 6px;
    }
    .lock-icon-circle i {
      font-size: 11px !important;
    }
    .locked-card h4 {
      font-size: 15px;
      margin-bottom: 2px;
    }
    .locked-card p {
      font-size: 11px;
      margin-bottom: 10px;
      line-height: 1.25;
    }
    .btn-locked-login {
      padding: 8px;
      font-size: 13px;
      border-radius: 8px;
    }
    .btn-locked-register {
      margin-top: 8px;
      font-size: 11px;
    }
  }

  /* Compact locked card inside the 16:9 video player container */
  .video-card-wrap .locked-overlay-content {
    padding: 8px;
  }
  .video-card-wrap .locked-card {
    padding: 14px 18px;
    gap: 0;
  }
  .video-card-wrap .lock-icon-circle {
    width: 30px;
    height: 30px;
    margin-bottom: 6px;
  }
  .video-card-wrap .lock-icon-circle i {
    font-size: 12px !important;
  }
  .video-card-wrap .locked-card h4 {
    font-size: 16px;
    margin-bottom: 2px;
  }
  .video-card-wrap .locked-card p {
    font-size: 12px;
    margin-bottom: 10px;
  }
  .video-card-wrap .btn-locked-login {
    padding: 8px;
    font-size: 13px;
  }
  .video-card-wrap .btn-locked-register {
    margin-top: 8px;
    font-size: 11px;
  }

  @media (max-width: 576px) {
    .video-card-wrap .locked-card {
      padding: 10px 14px;
      max-width: 260px;
    }
    .video-card-wrap .lock-icon-circle {
      width: 26px;
      height: 26px;
      margin-bottom: 4px;
    }
    .video-card-wrap .locked-card h4 {
      font-size: 14px;
    }
    .video-card-wrap .locked-card p {
      font-size: 11px;
      margin-bottom: 8px;
      line-height: 1.2;
    }
    .video-card-wrap .btn-locked-login {
      padding: 7px;
      font-size: 12px;
    }
    .video-card-wrap .btn-locked-register {
      margin-top: 6px;
      font-size: 10px;
    }
  }

  /* YouTube container */
  #youtubeContainer {
    position: absolute;
    inset: 0;
    z-index: 15;
  }
  
  /* Hide the time/duration for live streams - shows just "Live" */
  .shaka-current-time {
    display: none !important;
  }
  
  /* Hide Shaka's broken cast button */
  .shaka-cast-button {
    display: none !important;
  }
  
  /* Custom cast button styling */
  .custom-cast-button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity 0.2s;
  }
  .custom-cast-button:hover {
    opacity: 1;
  }
  .custom-cast-button svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
  }