/* Layout only. Colours, fonts, borders, shadows and copy come from the site's
   existing theme and PHP pages. This sheet is inert outside mobile layout mode. */
html.scorpion-mobile body { min-width: 0; }
/* Hide only the scrollbar chrome; keep native scrolling and overflow intact. */
html.scorpion-mobile,
html.scorpion-mobile * { scrollbar-width: none; -ms-overflow-style: none; }
html.scorpion-mobile::-webkit-scrollbar,
html.scorpion-mobile *::-webkit-scrollbar { display: none; width: 0; height: 0; }
html.scorpion-mobile .app.container {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 12px !important;
}
html.scorpion-mobile-embedded body { margin: 0 !important; padding: 0 !important; }
html.scorpion-mobile-embedded body > nav,
html.scorpion-mobile-embedded body > .nav-container,
html.scorpion-mobile-embedded .learning-header,
html.scorpion-mobile-embedded .learning-main-nav,
html.scorpion-mobile-embedded .learning-sub-nav,
html.scorpion-mobile-embedded .learning-sidebar,
html.scorpion-mobile-embedded .bp-rail,
html.scorpion-mobile-embedded .bp-topbar,
html.scorpion-mobile-embedded body > footer,
html.scorpion-mobile-embedded .footer-ads { display: none !important; }
html.scorpion-mobile .app .row { margin-left: -8px; margin-right: -8px; }
html.scorpion-mobile .app .row > [class*="col-"] { min-width: 0; padding-left: 8px; padding-right: 8px; }
html.scorpion-mobile .app > .row { margin-left: -8px; margin-right: -8px; }
html.scorpion-mobile .app > .row > [class*="col-"] { padding-left: 8px !important; padding-right: 8px !important; }
html.scorpion-mobile .app > .row > [class*="col-"],
html.scorpion-mobile .inventory-container > .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
html.scorpion-mobile .inventory-container > .row { margin-left: -8px; margin-right: -8px; }
html.scorpion-mobile .inventory-container > .row > [class*="col-"] { padding-left: 8px !important; padding-right: 8px !important; }
html.scorpion-mobile .inventory-container > .row > .divider-right { border-right: 0; }
html.scorpion-mobile .app > .row > .divider-right { border-right: 0; }
html.scorpion-mobile[data-scorpion-page="home"] .friends-container { clear: both; padding-top: 8px; }
/* Home: the padded blocks and the My Feed title/status row line up with the page edge, stacked */
html.scorpion-mobile[data-scorpion-page="home"] .app > .row > [class*="col-"] > .p-3 { padding-left: 0 !important; padding-right: 0 !important; }
html.scorpion-mobile[data-scorpion-page="home"] .app > .row > [class*="col-"] > .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
/* Game and item pages cap their column at 58rem; fill the width like the other pages */
html.scorpion-mobile .app > .row > .col { max-width: 100% !important; min-width: 0; }
html.scorpion-mobile .app img.img-fluid,
html.scorpion-mobile .app video,
html.scorpion-mobile .app iframe { max-width: 100%; }
html.scorpion-mobile .app .card-body,
html.scorpion-mobile .app .text-break { overflow-wrap: anywhere; }
html.scorpion-mobile .SystemAlert { box-sizing: border-box; width: 100%; max-width: 100%; }
html.scorpion-mobile[data-scorpion-page="home"] .thumbnail-span { max-width: 128px; }
html.scorpion-mobile[data-scorpion-page="home"] .friends-container > .items { flex-wrap: nowrap; overflow-x: auto; margin: 0; }
html.scorpion-mobile[data-scorpion-page="home"] .friends-container .friend-card { flex: 0 0 180px; margin: 0 8px 0 0; }
html.scorpion-mobile[data-scorpion-page="home"] .recently-played-container > .items { margin-left: 0 !important; }
html.scorpion-mobile[data-scorpion-page="profile"] .thumbnail-span { max-width: 220px; }

/* Existing tabs remain tabs; long sets scroll instead of crushing labels or
   taking a whole screen above the content. This includes account/inventory. */
html.scorpion-mobile .app .nav-tabs {
    flex-direction: row !important;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-left: 0 !important;
    -webkit-overflow-scrolling: touch;
}
html.scorpion-mobile .app .nav-tabs > .nav-item { flex: 0 0 auto; }
html.scorpion-mobile .app .nav-tabs .nav-link { display: flex; align-items: center; min-height: 44px; white-space: nowrap; }
html.scorpion-mobile .app .btn,
html.scorpion-mobile .app select.form-control,
html.scorpion-mobile .app input.form-control:not(.page) { min-height: 44px; }
html.scorpion-mobile .app .btn { display: inline-flex; align-items: center; justify-content: center; }
html.scorpion-mobile .app .btn-block { display: flex; }
html.scorpion-mobile .app .input-group { min-width: 0; }
html.scorpion-mobile .app .input-group > .form-control { min-width: 0; }
html.scorpion-mobile .app .pagination { flex-wrap: wrap; row-gap: 8px; }
html.scorpion-mobile .app .pagination .page { flex: 0 0 auto; }
html.scorpion-mobile .mobile-table,
html.scorpion-mobile .table-responsive { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
html.scorpion-mobile .mobile-table > .table { min-width: 540px; }
/* Users search: keep the same result fields, arranged as a compact vertical
   list. Preserve the column headings for assistive technology. */
html.scorpion-mobile .mobile-table > .user-search-results { display: block; min-width: 0; width: 100%; }
html.scorpion-mobile .user-search-results thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
html.scorpion-mobile .user-search-results tbody { display: block; }
html.scorpion-mobile .user-search-results tbody tr {
    display: grid;
    grid-template-columns: 87px minmax(0, 1fr);
}
html.scorpion-mobile .user-search-results td { min-width: 0; overflow-wrap: anywhere; }
html.scorpion-mobile .user-search-results td:nth-child(1) { grid-column: 1; grid-row: 1 / 3; }
html.scorpion-mobile .user-search-results td:nth-child(2) { grid-column: 2; grid-row: 1; padding-bottom: 0; }
html.scorpion-mobile .user-search-results td:nth-child(2) > a { display: inline-flex; align-items: center; min-height: 32px; max-width: 100%; }
html.scorpion-mobile .user-search-results td:nth-child(4) { grid-column: 2; grid-row: 2; padding-top: 0; border-top: 0; }
html.scorpion-mobile .user-search-results td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; padding-top: 0; border-top: 0; }
html.scorpion-mobile .user-search-results td:nth-child(3):empty { display: none; }
/* This page uses light-icon classes, but the shared site bundle ships Free. */
html.scorpion-mobile[data-scorpion-page="browse"] .pagination .fal { font-family: "Font Awesome 5 Free"; font-weight: 900; }
html.scorpion-mobile .modal-dialog { max-width: calc(100% - 16px); margin: 8px auto; }
html.scorpion-mobile .modal-content { max-height: calc(100dvh - 16px); overflow-y: auto; }
html.scorpion-mobile .modal-footer > div { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* Games: keep the same cards and See All control. Every card in a genre can be
   reached with a swipe; the full results retain their normal wrapping grid. */
html.scorpion-mobile .genre-strip {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
html.scorpion-mobile .places-container .items.row { margin-left: 0; margin-right: 0; }
html.scorpion-mobile .genre-strip .item:nth-child(n) {
    display: block;
    flex: 0 0 164px;
    max-width: 164px;
    scroll-snap-align: start;
}
html.scorpion-mobile .items .item .details-wrapper .card.details {
    display: block !important;
    position: static;
    margin-top: 0;
}
html.scorpion-mobile .genre-row > .d-flex,
html.scorpion-mobile .genre-page > .d-flex { gap: 8px; }
html.scorpion-mobile .genre-row h4,
html.scorpion-mobile .genre-page h4 { min-width: 0; overflow-wrap: anywhere; }
html.scorpion-mobile .genre-row .see-all,
html.scorpion-mobile .genre-page .browse-back { flex-shrink: 0; }

/* Catalog controls wrap into two rows rather than squeezing the text field. */
html.scorpion-mobile .CatalogSearchBar { flex-wrap: wrap; gap: 0; }
html.scorpion-mobile .CatalogSearchBar > .keywordTextbox { flex: 1 1 100%; width: 100%; }
html.scorpion-mobile .CatalogSearchBar > .input-group-append { width: 100%; margin-left: 0; }
html.scorpion-mobile .CatalogSearchBar .categoriesForKeyword { flex: 1 1 0; min-width: 0; }
html.scorpion-mobile .mobile-filters { margin-bottom: 12px; }
html.scorpion-mobile .mobile-filters > summary { min-height: 44px; cursor: pointer; }
html.scorpion-mobile .mobile-filters > summary h3 { display: inline; margin: 0; }
html.scorpion-mobile .mobile-filters .filters { padding: 8px 0; }
html.scorpion-mobile .mobile-category > summary { list-style: none; cursor: pointer; }
html.scorpion-mobile .mobile-category > summary::-webkit-details-marker { display: none; }
html.scorpion-mobile .mobile-category:not([open]) > .dropdown-menu { display: none !important; }
html.scorpion-mobile .filters a { display: inline-flex; align-items: center; min-height: 36px; }

@media (max-width: 767.98px) {
    /* All primary sidebars become sections, without altering nested card grids. */
    html.scorpion-mobile .app > .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
    html.scorpion-mobile .app > .row > .divider-right { border-right: 0; }
    html.scorpion-mobile .app .nav-tabs.flex-column { margin-bottom: 12px; }
    html.scorpion-mobile .app .nav-tabs.flex-column .nav-link { border-right-width: 1px; }
    html.scorpion-mobile .app .CatalogSearchBar { margin-top: 4px; }
    html.scorpion-mobile[data-scorpion-page="game"] .place-rating { flex-wrap: wrap; row-gap: 8px; }
    html.scorpion-mobile[data-scorpion-page="game"] .mobile-game-info { display: flex; flex-direction: column; }
    html.scorpion-mobile[data-scorpion-page="game"] .mobile-game-info > .VisitButton { order: -1; max-width: 100% !important; }
    html.scorpion-mobile[data-scorpion-page="game"] .mobile-game-info > .VisitButton:first-of-type { margin-top: 12px !important; }
    html.scorpion-mobile[data-scorpion-page="game"] .app .row .col-sm-8,
    html.scorpion-mobile[data-scorpion-page="game"] .app .row .mobile-game-info { flex: 0 0 100%; max-width: 100%; }
    html.scorpion-mobile[data-scorpion-page="character"] .app .avatar,
    html.scorpion-mobile[data-scorpion-page="character"] .app .headshot { max-width: 220px; }
    html.scorpion-mobile .app .form-group.row > [class*="col-sm-"] { flex: 0 0 100%; max-width: 100%; }
}
