/* dc-hub-pinned-chrome.css — shared pinned bar under app header (admin breadcrumb + user hub topbar) */

:root {
  --dc-hub-pinned-bar-h: 40px;
  --dc-hub-pinned-bar-gap: 8px;
}

@media (orientation: landscape) and (max-height: 520px) {
  :root {
    --dc-hub-pinned-bar-h: 34px;
    --dc-hub-pinned-bar-gap: 6px;
  }
}

/* —— Fixed shell (position authority) —— */
.dc-hub-pinned-bar,
html body.admin-mode.admin-hub-page .admin-breadcrumb.admin-hub-breadcrumb,
html body.admin-mode.admin-hub-page .wrap > .admin-hub-breadcrumb,
html body.admin-mode.dashboard-hub-page .admin-breadcrumb.dashboard-breadcrumb,
html body.admin-mode.dashboard-hub-page .wrap > .dashboard-breadcrumb,
body.contests-public-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.contests-public-open > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.contests-public-open .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.contests-public-open .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome] {
  position: fixed !important;
  top: calc(var(--admin-header-height, 68px) + var(--dc-admin-vv-offset-top, 0px)) !important;
  left: max(12px, env(safe-area-inset-left, 0px)) !important;
  right: max(12px, env(safe-area-inset-right, 0px)) !important;
  width: auto !important;
  transform: none !important;
  z-index: 4995 !important;
  max-width: none !important;
  min-height: var(--dc-hub-pinned-bar-h, 40px) !important;
  margin: 0 !important;
  padding: 0 14px !important;
  box-sizing: border-box !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Admin breadcrumb: box on the bar itself */
html body.admin-mode.admin-hub-page .admin-breadcrumb.admin-hub-breadcrumb,
html body.admin-mode.admin-hub-page .wrap > .admin-hub-breadcrumb,
html body.admin-mode.dashboard-hub-page .admin-breadcrumb.dashboard-breadcrumb,
html body.admin-mode.dashboard-hub-page .wrap > .dashboard-breadcrumb {
  display: flex !important;
  align-items: center !important;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  background: rgba(12, 14, 20, 0.94) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 13px;
  pointer-events: auto;
}

/* User contests: single nav bar — mobile full bleed like admin (no wrapper) */
body.contests-public-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
body.contests-public-open .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome] {
  padding: 0 !important;
  pointer-events: auto !important;
}

/* Legacy wrapper markup (if cached): inner nav paints the box */
body.contests-public-open > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav),
body.contests-public-open .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav) {
  padding: 0 !important;
  background: transparent;
  pointer-events: none;
}

body.contests-public-open > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav) .cp-topbar,
body.contests-public-open .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome]:not(nav) .cp-topbar {
  pointer-events: auto;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  html body.admin-mode.admin-hub-page:not(.accounts-hub-page) .admin-breadcrumb.admin-hub-breadcrumb,
  html body.admin-mode.admin-hub-page:not(.accounts-hub-page) .wrap > .admin-hub-breadcrumb,
  html body.admin-mode.dashboard-hub-page .admin-breadcrumb.dashboard-breadcrumb,
  html body.admin-mode.dashboard-hub-page .wrap > .dashboard-breadcrumb,
  html body.user-chrome-outside-wrap.contests-public-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contests-public-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contests-public-open .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome] {
    left: 50% !important;
    right: auto !important;
    width: min(calc(100% - 24px), var(--cp-hub-max, 767px)) !important;
    max-width: min(calc(100% - 24px), var(--cp-hub-max, 767px)) !important;
    transform: translateX(-50%) !important;
  }
}

/* Phone landscape (~844×390): full bleed pinned bar */
@media (max-width: 899px) and (orientation: landscape) and (max-height: 520px) {
  html body.admin-mode.admin-hub-page:not(.accounts-hub-page) .admin-breadcrumb.admin-hub-breadcrumb,
  html body.admin-mode.admin-hub-page:not(.accounts-hub-page) .wrap > .admin-hub-breadcrumb,
  html body.admin-mode.dashboard-hub-page .admin-breadcrumb.dashboard-breadcrumb,
  html body.admin-mode.dashboard-hub-page .wrap > .dashboard-breadcrumb,
  html body.user-chrome-outside-wrap.contests-public-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contests-public-open > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contests-public-open > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contests-public-open .wrap > nav.cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome],
  body.contests-public-open .wrap > .cp-topbar-shell.dc-hub-pinned-bar[data-cp-hub-chrome] {
    left: max(12px, env(safe-area-inset-left, 0px)) !important;
    right: max(12px, env(safe-area-inset-right, 0px)) !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
  }
}
