/* Shared Vapor page shell fixes. The app body is a column so short pages
   keep the footer at the viewport edge and long pages scroll naturally. */
html,
body.steam-page-root {
  min-height: 100%;
}

body.steam-page-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.steam-page-root > .steam-global-header,
body.steam-page-root > .steam-subnav-bar,
body.steam-page-root > footer {
  flex: 0 0 auto;
}

body.steam-page-root > main.page-container {
  flex: 1 0 auto;
  width: 940px;
  max-width: calc(100% - 40px);
  margin: 28px auto 24px !important;
}

body.steam-page-root > footer {
  width: 100%;
  margin-top: auto !important;
}

body.steam-page-root > footer .footer-inner {
  width: 940px;
  max-width: calc(100% - 40px) !important;
  padding: 20px 0 !important;
  flex-wrap: wrap;
}

body.steam-page-root > footer .footer-inner > * {
  min-width: 0;
}

/* Original Vapor dropdowns use the existing compact global navigation. */
body.steam-page-root .main-nav-item.has-menu { position: relative; }
body.steam-page-root .main-nav-dropdown {
  display: none;
  position: absolute;
  z-index: 1000;
  top: 100%;
  left: 0;
  min-width: 190px;
  padding: 5px 0;
  background: #171a21;
  border: 1px solid #080b0f;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .55);
}
body.steam-page-root .main-nav-item.has-menu:hover .main-nav-dropdown,
body.steam-page-root .main-nav-item.has-menu:focus-within .main-nav-dropdown { display: block; }
body.steam-page-root .main-nav-dropdown a {
  display: block;
  padding: 8px 14px;
  color: #c6d4df;
  white-space: nowrap;
  font-size: 12px;
}
body.steam-page-root .main-nav-dropdown a:hover { background: #2a475e; color: #fff; text-decoration: none; }
body.steam-page-root .main-nav-user-link { display: inline-flex; align-items: center; }
body.steam-page-root .main-nav-user-link .main-nav-avatar { display: none; }

/* Compact account controls aligned like the reference client header. */
body.steam-page-root .header-user-area {
  top: 6px;
  right: 0;
  display: flex !important;
  align-items: flex-start;
  height: 62px;
  line-height: normal;
  z-index: 20;
}
body.steam-page-root .header-user-area > * { margin-left: 6px !important; }
body.steam-page-root .header-user-area .btn-install-steam { order: 0; }
body.steam-page-root .header-user-area .vapor-notification-link {
  position: relative;
  display: flex;
  width: 34px;
  height: 24px;
  align-items: center;
  justify-content: center;
  background: #303b49;
  color: #d6dadd;
}
body.steam-page-root .vapor-notification-link svg { width: 14px; height: 14px; fill: currentColor; }
body.steam-page-root .vapor-notification-link span {
  position: absolute;
  top: -6px;
  right: -6px;
  padding: 1px 4px;
  border-radius: 8px;
  background: #d94141;
  color: #fff;
  font-size: 9px;
  line-height: 13px;
}
body.steam-page-root .header-user-area .vapor-header-account {
  display: flex;
  align-items: center;
  padding-left: 3px;
  color: #c6d4df;
  text-align: right;
}
body.steam-page-root .vapor-header-account-text { display: flex; flex-direction: column; align-items: flex-end; }
body.steam-page-root .vapor-header-account-text strong { max-width: 150px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: normal; }
body.steam-page-root .vapor-header-account-text small { color: #a4d007; font-size: 10px; line-height: 13px; }
body.steam-page-root .vapor-header-avatar { width: 36px; height: 36px; margin-left: 8px !important; border: 1px solid #66c0f4; object-fit: cover; }

/* Keep the search control and its icon on the same vertical baseline. */
body.steam-page-root .subnav-search {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  flex: none;
  width: 210px;
  height: 27px;
  margin: 0 !important;
  overflow: visible;
}
body.steam-page-root .subnav-search input {
  float: none;
  flex: 1 1 auto;
  width: auto;
  height: 25px;
}
body.steam-page-root .subnav-search button {
  float: none;
  flex: 0 0 29px;
  width: 29px;
  height: 25px;
  line-height: 25px;
  align-self: center;
}
body.steam-page-root .vapor-search-suggestions {
  display: none;
  position: absolute;
  z-index: 1100;
  top: calc(100% + 2px);
  left: -1px;
  right: -1px;
  background: #171a21;
  border: 1px solid #080b0f;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .55);
}
body.steam-page-root .vapor-search-result { display: flex; align-items: center; min-height: 52px; padding: 5px 8px; color: #c6d4df; }
body.steam-page-root .vapor-search-result:hover,
body.steam-page-root .vapor-search-all:hover { background: #2a475e; color: #fff; text-decoration: none; }
body.steam-page-root .vapor-search-result img { width: 80px; height: 38px; margin-right: 9px; object-fit: cover; background: #0e141b; }
body.steam-page-root .vapor-search-all { display: block; padding: 8px; border-top: 1px solid #26394b; }
body.steam-page-root .steam-feed-avatar { display: block; width: 40px; height: 40px; flex: 0 0 40px; margin-right: 12px; }

/* Avoid a forced 980px horizontal canvas on tablet and narrow desktop widths. */
@media screen and (max-width: 980px) {
  html,
  body.steam-page-root {
    min-width: 0 !important;
  }

  body.steam-page-root .header-content,
  body.steam-page-root .subnav-inner {
    width: auto;
    max-width: 940px;
    margin-left: 20px;
    margin-right: 20px;
  }

  body.steam-page-root > main.page-container {
    width: auto;
    max-width: none;
    margin-left: 20px !important;
    margin-right: 20px !important;
  }

  body.steam-page-root > footer .footer-inner {
    width: auto;
    max-width: none !important;
    margin-left: 20px;
    margin-right: 20px;
  }
}

@media screen and (max-width: 760px) {
  body.steam-page-root > main.page-container {
    margin: 18px 10px 20px !important;
  }

  body.steam-page-root > footer .footer-inner {
    display: block;
    margin-left: 10px;
    margin-right: 10px;
    padding: 16px 0 !important;
  }

  body.steam-page-root > footer .footer-inner > * + * {
    margin-top: 12px;
  }

  body.steam-page-root .header-content,
  body.steam-page-root .subnav-inner {
    margin-left: 10px;
    margin-right: 10px;
  }

  body.steam-page-root main table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
}

/* Keep the web shell responsive when rendered inside the desktop client. */
html.in-steam-client body.steam-page-root > main.page-container,
body.in-steam-client > main.page-container {
  width: auto;
  max-width: 1200px;
  margin: 10px auto 24px !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}
