/* Shared search: brand outline, compact rows, and the site's white card surfaces. */
#searchArea { --search-area-pad-x: 0px; --search-area-pad-y: 0px; padding: 0; min-height: 52px; border: 2px solid #e1e7ef; border-radius: 16px; background: #fff; }
#searchArea.focused, #searchArea:focus-within { border-color: var(--brand-blue); }
#searchArea.dropdown-open, #searchArea.questions-open { border-radius: 16px 16px 0 0; }
#searchArea form { position: static; min-height: 48px; gap: 4px; padding: 0 8px; box-sizing: border-box; }
#searchArea .search-input-wrap { position: static; }
#searchInput { box-sizing: border-box; min-height: 48px; padding: 10px 12px; font-family: var(--font-sans); font-size: 16px; background: transparent; color: #192b43; line-height: 1.4; }
#searchInput::placeholder { color: #64748b; font-size: 14px; }
#searchArea .search-btn::before { content: none; display: none; }
#searchArea .search-btn { flex: 0 0 36px; width: 36px; height: 36px; margin: 0; box-shadow: none; }
.search-back { display: none; }
#searchArea #liveSearchResults, #searchArea > .search-bar-questions {
  position: absolute; top: 100%; left: -2px; right: -2px; width: auto; box-sizing: border-box;
  margin: 0; padding: 6px; border: 2px solid var(--brand-blue); border-top: 1px solid #e1e7ef;
  border-radius: 0 0 16px 16px; background: #fff; max-height: min(540px, 70dvh); overflow-y: auto;
  box-shadow: 0 14px 28px -18px #192b4355 !important; overscroll-behavior: contain;
}
#searchArea > .search-bar-questions { display: block; }
#searchArea .search-bar-questions > li { width: 100%; }
#searchArea #liveSearchResults .search-card, #searchArea .search-bar-question {
  box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px;
  margin: 0; padding: 10px 12px; border: 0; border-radius: 9px; background: #fff; color: #192b43;
  font-family: var(--font-sans); font-size: 14px; line-height: 1.4; font-weight: 500; text-decoration: none;
  text-align: left; white-space: normal; transform: none; cursor: pointer;
}
#searchArea #liveSearchResults .search-entity-card { min-height: 72px; padding: 8px 12px 8px 9px; border-left: 3px solid var(--card-edge, var(--search-team-accent, #192b43)); margin: 3px 0; }
#searchArea #liveSearchResults .search-card:hover, #searchArea #liveSearchResults .search-card.selected,
#searchArea .search-bar-question:hover, #searchArea .search-bar-question:focus-visible { background: #eff4f9; transform: none; }
#searchArea :is(button, a):focus-visible { outline: 2px solid var(--brand-blue) !important; outline-offset: -2px; }
.search-entity-image { flex: 0 0 46px; height: 52px; display: flex; justify-content: center; align-items: flex-end; overflow: hidden; border-radius: 8px; background: #edf2f8; }
.search-entity-image img { display: block; max-width: 100%; width: 46px; height: 52px; object-fit: contain; object-position: bottom; }
.search-entity-image.is-team { align-items: center; }
.search-entity-image.is-team img { width: 34px; height: 34px; object-position: center; }
.search-entity-copy { display: grid; gap: 4px; min-width: 0; flex: 1; }
.search-entity-name { font-size: 15px; font-weight: 700; color: #192b43; line-height: 1.3; }
.search-entity-detail { font-size: 12px; color: #62738b; line-height: 1.4; overflow-wrap: anywhere; }
.search-result-chevron { color: #64748b; font-size: 22px; font-weight: 400; }
.search-result-icon { display: flex; flex: 0 0 24px; color: #64748b; }
.search-result-text { min-width: 0; overflow-wrap: anywhere; }
.search-prediction-card .search-result-text { flex: 1; }
.search-prediction-card .search-result-text strong { font-weight: 700; }
#searchArea .search-bar-question::before { content: ''; display: block; flex: 0 0 20px; height: 20px; background: #64748b; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='m16 16 5 5' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E") center / contain no-repeat; }
#searchArea .search-loading, #searchArea .search-error { padding: 14px; color: #64748b; font-size: 13px; }
.mobile-page-games { display: none; }
.mobile-menu-ball { display: block; flex: 0 0 60px; width: 60px; height: 60px; max-width: none; object-fit: contain; transform: translateY(-4px); }

@media (max-width: 820px) {
  .top-bar, .top-bar.is-mobile-scrolled {
    display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: center;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px; min-height: 64px; height: auto;
    background: var(--mobile-banner-color, #fff); backdrop-filter: none; -webkit-backdrop-filter: none;
    border-radius: 0; box-shadow: none; transition: none; position: sticky; top: 0;
  }
  .top-bar::before, .top-bar::after { display: none; }
  .top-bar .left-top { height: 44px; }
  .top-bar .mobile-menu-button { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; transform: none; }
  .top-bar .search-form { grid-column: 2; width: 100%; max-width: none; height: 44px; transform: none; z-index: auto; }
  #searchArea { min-height: 44px; height: 44px; border: 1px solid #e1e7ef; border-radius: 16px; background: #fff; }
  #searchArea form { min-height: 42px; height: 42px; padding: 0 4px; align-items: center; }
  #searchInput { min-height: 42px; height: 42px; color: #192b43; padding: 8px 6px 8px 10px; }
  #searchInput::placeholder { font-size: 13px; color: #64748b; }
  #searchArea .search-input-wrap { height: 42px; }
  #searchArea .search-btn { position: relative; flex: 0 0 36px; height: 36px; width: 36px; color: #fff; background: var(--brand-blue); transform: none; transition: none; }
  #desktopGamesSlot { display: none; }
  .sidebar-layout #mobileMenu { width: 100%; max-width: none; height: var(--mobile-menu-vh, 100dvh); border-radius: 0; border: 0; padding: 20px 16px max(24px, env(safe-area-inset-bottom)); box-sizing: border-box; }
  #mobileMenu .mobile-menu-close { top: 14px; right: 16px; width: 44px; height: 44px; }
  .mobile-page-games { display: block; min-width: 0; padding: 16px; border: 1px solid #e1e7ef; border-radius: 16px; background: #fff; }
  .mobile-games-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
  .mobile-games-heading h2 { margin: 0; color: #192b43; font-size: 18px; font-weight: 700; }
  .mobile-games-heading a { display: inline-flex; align-items: center; min-height: 32px; gap: 6px; font-size: 13px; color: #526176; text-decoration: none; }
  .mobile-games-heading a:hover { color: #192b43; }
  #mobileGamesSlot .scorecards-container { --carousel-mobile-slots: 1; }
  #mobileGamesSlot .games-carousel { margin: 0; width: 100%; }

  /* Keep the sticky search and the first identity/answer banner on one surface. */
  body.mobile-banner-page .top-bar {
    width: auto !important; margin-top: 0 !important; margin-bottom: 0 !important;
    margin-left: calc(-1 * var(--container-padding-x)) !important;
    margin-right: calc(-1 * var(--container-padding-x)) !important;
  }
  body.mobile-banner-page .sidebar-layout { margin-top: 0; }
  body.mobile-banner-page #mainContent .mobile-banner-wrapper { margin-top: 0 !important; padding-top: 0 !important; padding-inline: 0 !important; width: 100%; max-width: none; }
  body.mobile-banner-page #mainContent .content-area .mobile-joined-banner {
    width: calc(100% + 2 * var(--container-padding-x)) !important; max-width: none !important;
    margin-left: calc(-1 * var(--container-padding-x)) !important;
    margin-right: calc(-1 * var(--container-padding-x)) !important;
    margin-top: 0 !important; border-radius: 0 !important; border: 0; box-shadow: none !important;
  }
  body.mobile-banner-page .mobile-joined-banner > [data-testid="banner-bg"] { display: none; }
  body.mobile-search-open { overflow: hidden; }
  body.mobile-search-open .top-bar { z-index: 18000; }
  body.mobile-search-open .left-top { visibility: hidden; }
  body.mobile-search-open #searchArea {
    position: fixed; inset: 0; width: 100%; height: var(--mobile-menu-vh, 100dvh); min-height: 0;
    display: block; border: 0; border-radius: 0; padding: 0; background: #fff; overflow: hidden;
  }
  body.mobile-search-open #searchArea form { height: 64px; min-height: 64px; padding: 8px 12px; border-bottom: 1px solid #e1e7ef; gap: 4px; }
  body.mobile-search-open #searchArea .search-back { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 44px; padding: 0; border: 0; border-radius: 8px; color: #192b43; background: transparent; }
  body.mobile-search-open #searchInput { color: #192b43; padding-left: 4px; }
  body.mobile-search-open #searchInput::placeholder { color: #64748b; }
  body.mobile-search-open #searchArea .search-btn { color: #192b43; background: transparent; }
  body.mobile-search-open .search-icon-arrow { border-color: #192b43; }
  body.mobile-search-open .search-icon-arrow::before { background: #192b43; }
  body.mobile-search-open .search-icon-arrow::after { border-color: #192b43; }
  body.mobile-search-open .search-icon-clear { color: #192b43; }
  body.mobile-search-open #searchArea #liveSearchResults,
  body.mobile-search-open #searchArea > .search-bar-questions {
    top: 64px; left: 0; right: 0; bottom: 0; max-height: none; border: 0; border-radius: 0;
    padding: 8px 12px max(20px, env(safe-area-inset-bottom)); box-shadow: none !important;
  }
  body.mobile-search-open #searchArea .search-bar-question { min-height: 56px; }
  body.mobile-search-open #searchOverlay { display: none; }
}
