
/* Every other rule below sets an explicit "display" on some of these same
 * elements (button/menu/panel chrome, shown/hidden by JS via classes) — a
 * class selector's "display" always beats the UA stylesheet's [hidden]
 * rule on specificity, so without this !important override, a native
 * hidden attribute (the no-JS/pre-boot state for the error panel, PiP
 * button, play/pause + mute/unmute icon pairs) renders VISIBLE instead of
 * hidden. This one rule is the single source of truth for "hidden wins". */
.bf-player [hidden] { display: none !important; }
.bf-player { margin: 0; position: relative; background: #000; border-radius: var(--radius); overflow: hidden; }
.bf-player-stage { position: relative; aspect-ratio: 16 / 9; background: #000; }
.bf-player-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.bf-player-video::-webkit-media-controls { display: none !important; }
.bf-player.is-ready .bf-player-video { pointer-events: none; }

.bf-player-facade { position: absolute; inset: 0; }
.bf-player-poster, .bf-player-facade img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bf-player-facade-btn { position: absolute; inset: 0; width: 100%; height: 100%; background: rgba(0,0,0,.18); border: 0; display: grid; place-items: center; cursor: pointer; }
.bf-player-facade-glyph { width: 64px; height: 64px; border-radius: 999px; background: color-mix(in srgb, #000 45%, transparent); border: 1px solid rgba(255,255,255,.5); display: grid; place-items: center; color: #fff; font-size: 20px; padding-left: 4px; backdrop-filter: blur(4px); transition: transform .15s ease, background .15s ease; }
.bf-player-facade-btn:hover .bf-player-facade-glyph, .bf-player-facade-btn:focus-visible .bf-player-facade-glyph { transform: scale(1.06); background: color-mix(in srgb, var(--bf-accent, var(--brand)) 55%, #000 45%); }
.bf-player-facade.is-loading .bf-player-facade-glyph { opacity: .55; }
.bf-player-facade iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.bf-player-center-play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .2s ease; }
.bf-player.show-center-play .bf-player-center-play { opacity: 1; }
.bf-player-center-play span { width: 68px; height: 68px; border-radius: 999px; background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.45); display: grid; place-items: center; color: #fff; }
.bf-player-center-play span::before { content: "\25B6"; font-size: 22px; margin-left: 4px; }
.bf-player.is-playing .bf-player-center-play span::before { content: "\275A\275A"; margin-left: 0; font-size: 18px; }

.bf-player-buffering { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .15s ease .3s; }
.bf-player.is-buffering .bf-player-buffering { opacity: 1; }
.bf-player-buffering span { width: 40px; height: 40px; border-radius: 999px; border: 3px solid rgba(255,255,255,.25); border-top-color: var(--bf-accent, var(--brand)); animation: bf-spin .8s linear infinite; }
@keyframes bf-spin { to { transform: rotate(360deg); } }

.bf-player-error { position: absolute; inset: 0; display: grid; place-items: center; gap: 12px; background: rgba(0,0,0,.86); color: #fff; text-align: center; padding: 20px; }
.bf-player-error p { font-family: var(--font-body); opacity: .85; margin: 0; }
.bf-player-retry { font-family: var(--font-body); background: var(--bf-accent, var(--brand)); color: #000; border: 0; border-radius: var(--radius); padding: 9px 20px; font-weight: 600; cursor: pointer; }

.bf-player-chrome { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 14px 10px; background: linear-gradient(transparent, rgba(0,0,0,.82) 60%); opacity: 0; transform: translateY(4px); transition: opacity .2s ease, transform .2s ease; }
.bf-player.show-chrome .bf-player-chrome, .bf-player:not(.is-playing) .bf-player-chrome, .bf-player.is-scrubbing .bf-player-chrome { opacity: 1; transform: translateY(0); }

.bf-player-scrubber { position: relative; height: 18px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.bf-player-scrubber-track { position: relative; width: 100%; height: 4px; background: rgba(255,255,255,.25); border-radius: 999px; }
.bf-player-scrubber-buffered, .bf-player-scrubber-played { position: absolute; top: 0; left: 0; height: 100%; border-radius: 999px; }
.bf-player-scrubber-buffered { background: rgba(255,255,255,.42); width: 0%; }
.bf-player-scrubber-played { background: var(--bf-accent, var(--brand)); width: 0%; }
.bf-player-scrubber.is-loading .bf-player-scrubber-played { animation: bf-shimmer 1.1s ease-in-out infinite; }
@keyframes bf-shimmer { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.bf-player-scrubber-thumb { position: absolute; top: 50%; left: 0%; width: 12px; height: 12px; transform: translate(-50%,-50%); background: #fff; border-radius: 3px; box-shadow: 0 0 0 2px var(--bf-accent, var(--brand)); opacity: 0; transition: opacity .15s ease; }
.bf-player-scrubber:hover .bf-player-scrubber-thumb, .bf-player-scrubber:focus-visible .bf-player-scrubber-thumb, .bf-player.is-scrubbing .bf-player-scrubber-thumb { opacity: 1; }
.bf-player-scrubber-tooltip { position: absolute; bottom: 16px; transform: translateX(-50%); background: rgba(0,0,0,.85); color: #fff; font-size: 11px; font-family: var(--font-body); padding: 3px 7px; border-radius: 4px; pointer-events: none; }

.bf-player-bar { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.bf-player-btn { background: none; border: 0; color: #fff; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; border-radius: 6px; font-size: 15px; flex: 0 0 auto; }
.bf-player-btn:hover, .bf-player-btn:focus-visible { background: rgba(255,255,255,.14); }
.bf-player-btn[aria-pressed="true"], .bf-player-speed-opt.is-active, .bf-player-quality-opt.is-active { color: var(--bf-accent, var(--brand)); }
.bf-player-play .bf-icon-play, .bf-player-play .bf-icon-pause { display: block; }
.bf-player.is-playing .bf-player-play .bf-icon-play { display: none; }
.bf-player:not(.is-playing) .bf-player-play .bf-icon-pause { display: none; }
.bf-player-mute .bf-icon-vol, .bf-player-mute .bf-icon-muted { display: block; font-size: 13px; }
.bf-player.is-muted .bf-player-mute .bf-icon-vol { display: none; }
.bf-player:not(.is-muted) .bf-player-mute .bf-icon-muted { display: none; }
.bf-player-volume { display: flex; align-items: center; gap: 4px; }
.bf-player-volume-slider { width: 64px; accent-color: var(--bf-accent, var(--brand)); }
.bf-player-time { color: #fff; font-family: var(--font-body); font-variant-numeric: tabular-nums; font-size: 12px; opacity: .92; white-space: nowrap; }
.bf-player-spacer { flex: 1; }
.bf-player-settings-wrap { position: relative; }
.bf-player-settings-menu { position: absolute; bottom: 42px; right: 0; background: rgba(20,20,24,.96); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); padding: 10px; min-width: 150px; }
.bf-player-settings-group + .bf-player-settings-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.12); }
.bf-player-settings-label { display: block; color: rgba(255,255,255,.55); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-family: var(--font-body); margin-bottom: 6px; }
.bf-player-speed-options, .bf-player-quality-options { display: flex; flex-wrap: wrap; gap: 4px; }
.bf-player-speed-opt, .bf-player-quality-opt { background: none; border: 1px solid rgba(255,255,255,.18); color: #fff; font-family: var(--font-body); font-size: 12px; padding: 4px 8px; border-radius: 5px; cursor: pointer; }
.bf-player-speed-opt.is-active, .bf-player-quality-opt.is-active { border-color: var(--bf-accent, var(--brand)); }

.bf-player-noscript { position: absolute; inset: 0; display: grid; }
.bf-player-noscript img { width: 100%; height: 100%; object-fit: cover; grid-area: 1 / 1; }
.bf-player-noscript a { grid-area: 1 / 1; align-self: end; justify-self: start; margin: 16px; background: var(--bf-accent, var(--brand)); color: #000; font-family: var(--font-body); font-weight: 600; padding: 10px 16px; border-radius: var(--radius); text-decoration: none; }

@media (hover: none) { .bf-player-volume { display: none; } }
@media (max-width: 480px) {
  .bf-player-time { font-size: 11px; }
  .bf-player-current, .bf-player-duration { font-variant-numeric: tabular-nums; }
  .bf-player-settings-label + .bf-player-speed-options { max-width: 140px; }
}
.bf-player-scrubber-thumb, .bf-player-btn, .bf-player-facade-btn { min-height: 0; }
@media (pointer: coarse) {
  .bf-player-scrubber { height: 30px; }
  .bf-player-btn { width: 44px; height: 44px; }
}

/* Netflix-style up-next overlay (P2 attaches this markup on 'ended') */
.bf-player-upnext { position: absolute; inset: 0; background: rgba(6,6,8,.92); display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.bf-player-upnext.is-visible { opacity: 1; pointer-events: auto; }
.bf-player-upnext-card { display: flex; gap: 18px; align-items: center; max-width: 420px; }
.bf-player-upnext-thumb { position: relative; width: 140px; aspect-ratio: 16/9; border-radius: calc(var(--radius) * .8); overflow: hidden; flex: 0 0 auto; background: #111; }
.bf-player-upnext-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bf-player-upnext-ring { position: absolute; inset: 0; display: grid; place-items: center; }
.bf-player-upnext-ring svg { width: 36px; height: 36px; transform: rotate(-90deg); }
.bf-player-upnext-ring circle { fill: none; stroke-width: 3; }
.bf-player-upnext-ring .bf-ring-bg { stroke: rgba(255,255,255,.25); }
.bf-player-upnext-ring .bf-ring-fg { stroke: var(--bf-accent, var(--brand)); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.bf-player-upnext-body { color: #fff; font-family: var(--font-body); min-width: 0; }
.bf-player-upnext-eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.bf-player-upnext-title { font-family: var(--font-display); font-size: 1.3rem; margin: 6px 0 4px; line-height: 1.15; }
.bf-player-upnext-meta { font-size: 12px; color: rgba(255,255,255,.55); margin-bottom: 12px; }
.bf-player-upnext-actions { display: flex; gap: 10px; }
.bf-player-upnext-actions button { font-family: var(--font-body); font-weight: 600; font-size: 13px; border-radius: var(--radius); padding: 8px 16px; cursor: pointer; border: 1px solid rgba(255,255,255,.3); }
.bf-player-upnext-play { background: var(--bf-accent, var(--brand)); color: #000; border-color: transparent; }
.bf-player-upnext-cancel { background: none; color: #fff; }
.bf-player-upnext-static-count { font-family: var(--font-body); font-size: 12px; color: rgba(255,255,255,.7); }
@media (prefers-reduced-motion: reduce) { .bf-player-upnext-ring { display: none; } }
@media (max-width: 520px) { .bf-player-upnext-card { flex-direction: column; text-align: center; } .bf-player-upnext-thumb { width: 100%; max-width: 220px; } }
