/* Clubstream Transmit: player and live wrapper.
   Brand: gold #F6BC5E, maroon #1F0713 / #210713, slate #2c2f3f. */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

/* ---------- Live wrapper (from the Livestream Player snippets) ---------- */
.cst-live {
  position: relative;
  font-family: 'Montserrat', sans-serif;
  background: #000;
  /* break out of the content column, keep 16:9 inside the viewport */
  width: 95vw;
  max-width: calc(85vh * (16 / 9));
  left: 50%;
  transform: translateX(-50%);
  margin: 10px 0;
  z-index: 1000;
}

.cst-surface { position: relative; width: 100%; }
.cst-surface.is-blurred { pointer-events: none; }
.cst-surface.is-blurred .cst-stage { filter: blur(8px); opacity: 0.6; }

.cst-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.cst-stage-audio { background: radial-gradient(circle at center, #2c2f3f 0%, #000 100%); }

.cst-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.cst-placeholder img { max-width: 60%; max-height: 60%; object-fit: contain; }

.cst-toggle { position: absolute; top: 10px; right: 10px; z-index: 40; }
.cst-toggle-btn {
  display: inline-block; background: rgba(31, 7, 19, 0.85); color: #F6BC5E; border: 1px solid #F6BC5E;
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-decoration: none; padding: 6px 12px;
  border-radius: 999px; transition: background 0.2s ease, color 0.2s ease;
}
.cst-toggle-btn:hover, .cst-toggle-btn:focus { background: #F6BC5E; color: #1F0713; }

/* Pinned to the top so it never covers the controls it tells people to use */
.cst-status-bar {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  background: #F6BC5E; color: #1F0713; padding: 10px 20px; border-radius: 4px;
  font-size: 14px; font-weight: 700; z-index: 55; pointer-events: none;
  max-width: calc(100% - 40px); box-sizing: border-box; text-align: center; line-height: 1.35;
}
.cst-status-headline, .cst-status-detail { display: block; }
.cst-status-headline + .cst-status-detail { margin-top: 4px; font-size: 13px; font-weight: 600; opacity: 0.85; }

.cst-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.8); z-index: 70; }
.cst-modal {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 90%; max-width: 500px; background: #210713; border-radius: 6px; z-index: 80; overflow: hidden;
}
.cst-modal h3 { background: #F6BC5E; margin: 0; padding: 15px; text-align: center; color: #1F0713; font-weight: 700; }
.cst-modal p { padding: 25px; color: #fff; font-size: 16px; line-height: 1.5; text-align: center; margin: 0; }
.cst-actions { background: #2c2f3f; padding: 5px; text-align: center; }
.cst-actions a {
  display: inline-block; margin: 5px; padding: 12px 20px; font-weight: 700; border-radius: 4px;
  text-decoration: none; background: #F6BC5E; color: #1F0713;
}
.cst-actions a.cst-listen-audio { background: #444; color: #fff; border: 1px solid #555; }
.cst-ppv-unavailable { display: inline-block; margin: 5px; padding: 12px 20px; font-weight: 700; color: #fff; font-size: 14px; }

#cst-theatre-dimmer {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); opacity: 0;
  pointer-events: none; transition: opacity 0.4s ease; z-index: 900;
}
body.cst-theatre-dim #cst-theatre-dimmer { opacity: 1; }

@media (max-width: 600px) {
  .cst-status-bar { padding: 8px 14px; font-size: 13px; }
}

/* ---------- Player ---------- */
.cst-player { position: absolute; inset: 0; background: #000; overflow: hidden; }
.cst-vod .cst-player { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.cst-mode-audio { background: transparent; }

.cst-video-container { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; }
.cst-player video {
  position: absolute !important; inset: 0; width: 100% !important; height: 100% !important;
  object-fit: contain; background: #000; display: block;
}

/* Audio-only: the <video> element plays the sound but is never shown */
.cst-mode-audio video { opacity: 0 !important; background: transparent !important; }
.cst-mode-audio .shaka-video-container { background: transparent !important; }
.cst-mode-audio video:picture-in-picture,
.cst-mode-audio video:fullscreen,
.cst-mode-audio video:-webkit-full-screen { filter: brightness(0) contrast(0) !important; background: #000 !important; }
.cst-mode-audio .shaka-control-panel,
.cst-mode-audio .shaka-controls-container { opacity: 1 !important; visibility: visible !important; }
.cst-mode-audio .shaka-pip-button,
.cst-mode-audio .shaka-fullscreen-button { display: none !important; }

.cst-audio-screen {
  position: absolute; inset: 0; z-index: 5; pointer-events: none; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: 'Montserrat', sans-serif;
}
.cst-audio-icon { font-size: 50px; margin-bottom: 15px; }
.cst-audio-title { color: #F6BC5E; font-size: 22px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px; }
.cst-audio-desc { font-size: 15px; color: #ccc; }

.cst-loading {
  position: absolute; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.85); transition: opacity 0.3s ease;
}
.cst-loading img { max-width: 60%; max-height: 60%; object-fit: contain; }
.cst-ready .cst-loading { opacity: 0; pointer-events: none; }

.cst-error {
  position: absolute; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.85); color: #fff; padding: 1rem; text-align: center; font-size: 16px;
  font-family: 'Montserrat', sans-serif;
}

/* Protected VOD still being prepared (or failed): a 16:9 panel in the player's place */
.cst-coming-soon {
    position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
    display: flex; align-items: center; justify-content: center; text-align: center;
    background: radial-gradient(circle at center, #3a1024 0%, #12040b 100%);
    color: #fff; font-family: 'Montserrat', sans-serif;
}
.cst-coming-soon-bg {
    position: absolute; inset: -24px; background-size: cover; background-position: center;
    filter: blur(14px) brightness(0.35); transform: scale(1.05);
}
.cst-coming-soon-body { position: relative; padding: 24px; max-width: 520px; }
.cst-coming-soon-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px;
    border: 2px solid #F6BC5E; border-radius: 50%; color: #F6BC5E; background: rgba(0, 0, 0, 0.35);
    animation: cst-soon-pulse 2.4s ease-in-out infinite;
}
.cst-coming-soon.is-failed .cst-coming-soon-icon { animation: none; }
.cst-coming-soon-title { margin: 18px 0 8px; color: #F6BC5E; font-size: 22px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.cst-coming-soon-text { margin: 0; color: #ddd; font-size: 15px; line-height: 1.5; }
@keyframes cst-soon-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(246, 188, 94, 0.45); } 50% { box-shadow: 0 0 0 12px rgba(246, 188, 94, 0); } }
@media (prefers-reduced-motion: reduce) { .cst-coming-soon-icon { animation: none; } }
@media (max-width: 600px) {
    .cst-coming-soon-icon { width: 48px; height: 48px; }
    .cst-coming-soon-icon svg { width: 22px; height: 22px; }
    .cst-coming-soon-title { margin-top: 12px; font-size: 17px; letter-spacing: 1.5px; }
    .cst-coming-soon-text { font-size: 13px; }
}

.cst-vod-gate { padding: 2rem; text-align: center; background: #210713; color: #fff; font-family: 'Montserrat', sans-serif; }
.cst-vod-gate a { color: #F6BC5E; }

/* Shaka controls */
.cst-player .shaka-control-panel { background: linear-gradient(transparent, rgba(0, 0, 0, 0.8)) !important; }
.cst-player .shaka-overflow-menu, .cst-player .shaka-overflow-menu *,
.cst-player .shaka-settings-menu, .cst-player .shaka-settings-menu * { color: #fff !important; }
.cst-player .shaka-message-container { display: none !important; } /* we show our own errors */

.shaka-video-container:fullscreen video, .shaka-video-container:-webkit-full-screen video { object-fit: contain !important; }
video:picture-in-picture { object-fit: contain !important; }

@media (hover: none) and (pointer: coarse) {
  .cst-player .shaka-control-panel { opacity: 1 !important; visibility: visible !important; }
}

/* TV browsers: fit the viewport and make the focused button obvious */
.csl-tv .cst-live { max-width: calc(95vh * (16 / 9)); }
.csl-tv .cst-player .shaka-controls-button-panel button:focus,
.csl-tv .cst-player .shaka-controls-button-panel button:focus-visible { outline: 3px solid #fff !important; outline-offset: 2px; }

/* VOD deterrents: account watermark and capture blanking */
.cst-wm {
  position: absolute; z-index: 150; top: 10px; right: 12px; pointer-events: none; user-select: none; white-space: nowrap;
  font: 500 clamp(10px, 1.1vw, 13px)/1.2 system-ui, sans-serif; color: rgba(255, 255, 255, 0.18); text-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
}
.cst-blank {
  position: absolute; inset: 0; z-index: 100001; display: none; align-items: center; justify-content: center; flex-direction: column;
  gap: 14px; background: #000; color: #fff; text-align: center; padding: 16px; font: 16px/1.4 'Montserrat', sans-serif;
}
.cst-player.is-blanked .cst-blank { display: flex; }
.cst-player.is-blanked video { visibility: hidden; }
.cst-blank button { font: inherit; padding: 10px 22px; border: 0; border-radius: 4px; background: #F6BC5E; color: #1F0713; cursor: pointer; font-weight: 700; }

/* VOD preview limit for non-subscribers */
.cst-preview-popup {
  display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 100002;
  width: 90%; max-width: 500px; background: #210713; border-radius: 6px; overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); font-family: 'Montserrat', sans-serif;
}
.cst-player.is-preview-ended .cst-preview-popup { display: block; }
.cst-player.is-preview-ended video { filter: blur(8px); }
.cst-player.is-preview-ended .shaka-controls-container { pointer-events: none; }
.cst-preview-header { background: #F6BC5E; padding: 12px 20px; font-size: 20px; color: #1F0713; text-align: center; font-weight: 700; }
.cst-preview-body { padding: 20px; font-size: 16px; color: #fff; line-height: 1.4; }
.cst-preview-footer { background: #2c2f3f; padding: 15px; display: flex; gap: 10px; justify-content: center; }
.cst-preview-footer a, .cst-preview-footer button {
  flex: 1; background: #F6BC5E; color: #1F0713; text-decoration: none; font: 700 16px 'Montserrat', sans-serif;
  border: none; border-radius: 4px; padding: 10px; cursor: pointer; text-align: center;
}
@media (max-width: 480px) {
  .cst-preview-footer { flex-direction: column; }
}

/* UK embargo (geolock) overlay */
.cst-geo-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); display: flex; align-items: center; justify-content: center; z-index: 10001; }
.cst-geo-popup { background: #210713; width: 90%; max-width: 560px; border-radius: 8px; overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55); font-family: 'Montserrat', sans-serif; }
.cst-geo-header { background: #F6BC5E; padding: 14px 18px; font-size: 20px; font-weight: 700; color: #1F0713; text-align: center; }
.cst-geo-body { padding: 22px; font-size: 16px; color: #fff; line-height: 1.6; text-align: center; }
.cst-geo-footer { background: #2c2f3f; padding: 14px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cst-geo-btn { background: #F6BC5E; color: #1F0713 !important; font-size: 16px; font-weight: 700; text-decoration: none; border-radius: 4px; padding: 10px 22px; display: inline-block; }
.cst-geo-btn.cst-geo-secondary { background: #e8a83f; }
