/* Soccersim dedicated phone and tablet interface R47.
   Loaded after site.css so desktop styles remain untouched. */

.mobile-nav-backdrop,
.mobile-bottom-nav { display: none; }

@media (max-width: 1024px) {
  html { overflow-x: hidden; }
  body.device-mobile {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
    background-attachment: scroll, scroll;
  }
  body.device-mobile.mobile-nav-open { overflow: hidden; }

  body.device-mobile .topbar {
    position: sticky;
    top: 0;
    z-index: 110;
  }
  body.device-mobile .topbar-inner {
    width: 100%;
    height: 56px;
    padding: 0 9px;
    gap: 7px;
  }
  body.device-mobile .brand {
    min-width: 0;
    gap: 6px;
  }
  body.device-mobile .brand-ball {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    font-size: 20px;
  }
  body.device-mobile .brand > span:last-child {
    max-width: 100px;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
  }
  body.device-mobile .mobile-nav-toggle {
    display: inline-flex;
    order: 3;
    width: 38px;
    height: 38px;
    margin-left: 0;
    flex: 0 0 38px;
  }
  body.device-mobile.game-mode .topbar .mobile-nav-toggle { display: none; }

  body.device-mobile .account-area,
  body.device-mobile .lobby-account-area {
    min-width: 0;
    margin-left: auto;
    gap: 5px;
  }
  body.device-mobile .account-area > .nav-counter-icon:first-child,
  body.device-mobile .lobby-account-area > .nav-counter-icon:first-child,
  body.device-mobile .account-area > a[href*="/Social/Online"] {
    display: none !important;
  }
  body.device-mobile .account-area .nav-counter-icon,
  body.device-mobile .lobby-account-area .nav-counter-icon,
  body.device-mobile .game-user-menu > summary,
  body.device-mobile .lobby-user-menu > summary {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 9px;
  }
  body.device-mobile .game-user-name,
  body.device-mobile .lobby-user-name,
  body.device-mobile .online-label { display: none !important; }

  body.device-mobile .main-nav,
  body.device-mobile .lobby-main-nav {
    display: none;
    position: fixed;
    z-index: 130;
    inset: 56px 0 calc(66px + env(safe-area-inset-bottom)) 0;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: none;
    padding: 12px 10px 22px;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg, #f7fafc 0%, #eaf2f7 100%);
    box-shadow: 0 20px 50px rgba(17, 43, 61, .24);
    -webkit-overflow-scrolling: touch;
  }
  body.device-mobile.lobby-mode .lobby-main-nav {
    bottom: 0;
  }
  body.device-mobile.mobile-nav-open .main-nav,
  body.device-mobile.mobile-nav-open .lobby-main-nav { display: flex; }

  body.device-mobile .mobile-nav-backdrop {
    display: none;
    position: fixed;
    z-index: 120;
    inset: 56px 0 0;
    width: 100%;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(10, 27, 39, .48);
    backdrop-filter: blur(2px);
  }
  body.device-mobile.mobile-nav-open .mobile-nav-backdrop { display: block; }

  body.device-mobile .main-nav > a,
  body.device-mobile .lobby-main-nav > a,
  body.device-mobile .main-nav > details > summary,
  body.device-mobile .lobby-main-nav > details > summary {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border: 1px solid #d7e3ec;
    border-radius: 10px;
    background: #fff;
    color: #173b53;
    font-size: 13px;
    font-weight: 850;
    box-shadow: 0 2px 7px rgba(23, 59, 83, .05);
  }
  body.device-mobile .main-nav > details,
  body.device-mobile .lobby-main-nav > details { width: 100%; }
  body.device-mobile .main-nav > details > summary::after,
  body.device-mobile .lobby-main-nav > details > summary::after {
    content: "+";
    color: #347fba;
    font-size: 18px;
    line-height: 1;
  }
  body.device-mobile .main-nav > details[open] > summary::after,
  body.device-mobile .lobby-main-nav > details[open] > summary::after { content: "−"; }
  body.device-mobile .main-nav .nav-menu,
  body.device-mobile .lobby-main-nav .nav-menu {
    position: static;
    display: grid;
    width: 100%;
    min-width: 0;
    margin: 5px 0 0;
    overflow: hidden;
    border: 1px solid #d7e3ec;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
  }
  body.device-mobile .main-nav .nav-menu a,
  body.device-mobile .lobby-main-nav .nav-menu a,
  body.device-mobile .main-nav .nav-menu button,
  body.device-mobile .lobby-main-nav .nav-menu button {
    min-height: 44px;
    padding: 11px 13px;
    border-bottom: 1px solid #edf1f4;
    color: #27495f;
    font-size: 12px;
  }

  body.device-mobile.game-mode .mobile-bottom-nav {
    display: grid;
    position: fixed;
    z-index: 140;
    left: 0;
    right: 0;
    bottom: 0;
    grid-template-columns: repeat(4, 1fr);
    min-height: calc(62px + env(safe-area-inset-bottom));
    padding: 5px 5px env(safe-area-inset-bottom);
    border-top: 1px solid #cbd9e3;
    background: rgba(250, 252, 253, .97);
    box-shadow: 0 -8px 24px rgba(21, 51, 70, .13);
    backdrop-filter: blur(12px);
  }
  body.device-mobile .mobile-bottom-nav a,
  body.device-mobile .mobile-bottom-nav button {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1px;
    padding: 4px 2px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #35566b;
    font-size: 11px;
    font-weight: 750;
  }
  body.device-mobile .mobile-bottom-nav a:active,
  body.device-mobile .mobile-bottom-nav button:active,
  body.device-mobile.mobile-nav-open .mobile-bottom-nav button {
    background: #e7f2f9;
    color: #2373aa;
  }
  body.device-mobile .mobile-bottom-icon {
    font-size: 20px;
    line-height: 1.1;
  }
  body.device-mobile .mobile-bottom-nav small {
    color: inherit;
    font-size: 9px;
  }
  body.device-mobile .mobile-bottom-nav b {
    position: absolute;
    top: 3px;
    left: calc(50% + 8px);
    min-width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border-radius: 999px;
    background: #d33d39;
    color: #fff;
    font-size: 8px;
  }

  body.device-mobile .ticker {
    position: sticky;
    top: 56px;
    z-index: 100;
    height: 34px;
  }
  body.device-mobile .ticker-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    width: 100%;
    height: 34px;
    padding: 0 9px;
    gap: 7px;
    overflow: hidden;
  }
  body.device-mobile .ticker-inner > strong {
    max-width: 110px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.device-mobile .ticker-inner > span:nth-of-type(1) { display: none !important; }
  body.device-mobile .ticker-inner > span:nth-of-type(2) {
    display: block !important;
    overflow: hidden;
    color: #d8e0e7;
    font-size: 9px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.device-mobile .ticker-countdown {
    display: inline-flex !important;
    min-width: 0;
    margin-left: 0;
    gap: 4px;
  }
  body.device-mobile .ticker-countdown small { display: none; }
  body.device-mobile .ticker-countdown .countdown-value { font-size: 10px; }

  body.device-mobile .shell,
  body.device-mobile .page-shell,
  body.device-mobile .wide-page-shell,
  body.device-mobile .club-management-page-shell {
    width: calc(100% - 12px);
    max-width: none;
    margin-inline: 6px;
  }
  body.device-mobile .page-shell {
    min-height: calc(100vh - 160px);
    padding: 10px 0 18px;
  }
  body.device-mobile .panel,
  body.device-mobile .auth-page,
  body.device-mobile .server-card,
  body.device-mobile .league-card {
    max-width: 100%;
    border-radius: 8px;
  }
  body.device-mobile .panel-header {
    min-height: 42px;
    padding: 9px 11px;
    align-items: flex-start;
  }
  body.device-mobile .panel-header h2 { font-size: 14px; }
  body.device-mobile .panel-header > span,
  body.device-mobile .panel-header > a { font-size: 10px; }
  body.device-mobile .panel-body { padding: 12px; }
  body.device-mobile h1 { font-size: 24px; line-height: 1.18; }
  body.device-mobile h2 { font-size: 16px; }

  body.device-mobile .dashboard-grid,
  body.device-mobile .team-info-grid,
  body.device-mobile .league-layout,
  body.device-mobile .goal-league-layout,
  body.device-mobile .regions-grid,
  body.device-mobile .navigation-card-grid,
  body.device-mobile .country-list-grid,
  body.device-mobile .settings-grid,
  body.device-mobile .hall-grid,
  body.device-mobile .newspaper-grid,
  body.device-mobile .finance-grid,
  body.device-mobile .finance-overview-body,
  body.device-mobile .manager-profile-grid,
  body.device-mobile .national-team-layout,
  body.device-mobile .international-cup-layout,
  body.device-mobile .domestic-cup-layout,
  body.device-mobile .club-management-grid,
  body.device-mobile .board-summary,
  body.device-mobile .admin-stat-grid,
  body.device-mobile .admin-server-row,
  body.device-mobile .server-updates-grid,
  body.device-mobile .archive-grid,
  body.device-mobile .youth-profile-layout,
  body.device-mobile .match-report-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body.device-mobile .club-card-grid,
  body.device-mobile .form-grid,
  body.device-mobile .morale-grid,
  body.device-mobile .metric-grid,
  body.device-mobile .nav-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  body.device-mobile .team-page-header,
  body.device-mobile .league-titlebar,
  body.device-mobile .mail-toolbar,
  body.device-mobile .cup-title,
  body.device-mobile .club-management-hero,
  body.device-mobile .club-management-identity {
    align-items: flex-start;
    flex-direction: column;
  }

  body.device-mobile .entity-tabs,
  body.device-mobile .section-tabs,
  body.device-mobile .history-mode-tabs,
  body.device-mobile .league-competition-tabs,
  body.device-mobile .ranking-sort-tabs {
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  body.device-mobile .entity-tabs::-webkit-scrollbar,
  body.device-mobile .section-tabs::-webkit-scrollbar,
  body.device-mobile .history-mode-tabs::-webkit-scrollbar,
  body.device-mobile .league-competition-tabs::-webkit-scrollbar,
  body.device-mobile .ranking-sort-tabs::-webkit-scrollbar { display: none; }
  body.device-mobile .entity-tabs > *,
  body.device-mobile .section-tabs > *,
  body.device-mobile .history-mode-tabs > *,
  body.device-mobile .league-competition-tabs > *,
  body.device-mobile .ranking-sort-tabs > * {
    flex: 0 0 auto;
    min-height: 40px;
    white-space: nowrap;
  }

  body.device-mobile .table-scroll,
  body.device-mobile .transfer-table-wrap,
  body.device-mobile .cup-bracket {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  body.device-mobile .data-table { font-size: 10.5px; }
  body.device-mobile .data-table th,
  body.device-mobile .data-table td { padding: 7px 5px; }

  /* Squad tables become player cards instead of desktop-width tables. */
  body.device-mobile .goal-player-table {
    display: block;
    width: 100%;
    min-width: 0 !important;
    border-collapse: separate;
  }
  body.device-mobile .goal-player-table thead { display: none; }
  body.device-mobile .goal-player-table tbody {
    display: grid;
    width: 100%;
    gap: 7px;
    padding: 7px;
  }
  body.device-mobile .goal-player-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "player player player"
      "position age stamina"
      "value value action";
    gap: 5px 8px;
    padding: 10px;
    border: 1px solid #dce5ec;
    border-left: 4px solid #86b5d3;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(24, 54, 73, .05);
  }
  body.device-mobile .goal-player-table tr.lined-player { border-left-color: #2f8cc1; background: #f4faff; }
  body.device-mobile .goal-player-table td {
    display: none;
    min-width: 0 !important;
    padding: 0;
    border: 0;
    white-space: normal;
    text-align: left !important;
  }
  body.device-mobile .goal-player-table td:nth-child(1) {
    grid-area: player;
    display: flex;
    min-height: 32px;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 12px;
    font-weight: 800;
  }
  body.device-mobile .goal-player-table td:nth-child(2) { grid-area: position; display: block; }
  body.device-mobile .goal-player-table td:nth-child(4) { grid-area: age; display: block; }
  body.device-mobile .goal-player-table td:nth-child(13) { grid-area: stamina; display: block; }
  body.device-mobile .goal-player-table td:nth-child(15) { grid-area: value; display: block; color: #1c5f8c; font-weight: 800; }
  body.device-mobile .goal-player-table td:nth-child(16) { grid-area: action; display: block; justify-self: end; }
  body.device-mobile .goal-player-table td:nth-child(2)::before { content: "Pos: "; color: #75838d; font-size: 9px; }
  body.device-mobile .goal-player-table td:nth-child(4)::before { content: "Age: "; color: #75838d; font-size: 9px; }
  body.device-mobile .goal-player-table td:nth-child(13)::before { content: "Sta: "; color: #75838d; font-size: 9px; }
  body.device-mobile .goal-player-table td:nth-child(15)::before { content: "Value: "; color: #75838d; font-size: 9px; font-weight: 600; }
  body.device-mobile .goal-player-table .flag-small { width: 20px; height: 14px; }
  body.device-mobile .goal-player-table .player-icons { display: inline-flex; flex-wrap: wrap; }

  /* Transfer market becomes readable offer cards. */
  body.device-mobile .transfer-market-table {
    display: block;
    width: 100%;
    min-width: 0 !important;
    table-layout: auto;
  }
  body.device-mobile .transfer-market-table colgroup,
  body.device-mobile .transfer-market-table thead { display: none; }
  body.device-mobile .transfer-market-table tbody {
    display: grid;
    width: 100%;
    gap: 8px;
    padding: 8px;
  }
  body.device-mobile .transfer-market-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "player player action"
      "position age price";
    gap: 7px 9px;
    padding: 11px;
    border: 1px solid #dce5ec;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(24, 54, 73, .06);
  }
  body.device-mobile .transfer-market-table td {
    position: static !important;
    display: none;
    min-width: 0 !important;
    width: auto !important;
    padding: 0;
    border: 0;
    box-shadow: none !important;
    white-space: normal;
    background: transparent !important;
  }
  body.device-mobile .transfer-market-table td:nth-child(1) {
    grid-area: player;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 800;
  }
  body.device-mobile .transfer-market-table td:nth-child(3) { grid-area: position; display: block; }
  body.device-mobile .transfer-market-table td:nth-child(5) { grid-area: age; display: block; }
  body.device-mobile .transfer-market-table td:nth-child(15) { grid-area: price; display: block; justify-self: end; font-weight: 850; }
  body.device-mobile .transfer-market-table td:nth-child(16) { grid-area: action; display: block; justify-self: end; }
  body.device-mobile .transfer-market-table td:nth-child(3)::before { content: "Pos: "; color: #75838d; font-size: 9px; }
  body.device-mobile .transfer-market-table td:nth-child(5)::before { content: "Age: "; color: #75838d; font-size: 9px; }
  body.device-mobile .transfer-market-table td:nth-child(15)::before { content: "Fee: "; color: #75838d; font-size: 9px; font-weight: 600; }
  body.device-mobile .transfer-market-table .market-offer-action,
  body.device-mobile .transfer-market-table .button { min-height: 35px; padding: 6px 9px; font-size: 10px; }
  body.device-mobile .transfer-market-table .empty-cell { display: block; grid-column: 1 / -1; }

  /* League table retains the important columns and fits the screen. */
  body.device-mobile .goal-standings-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 9.5px;
  }
  body.device-mobile .goal-standings-table th:nth-child(6),
  body.device-mobile .goal-standings-table td:nth-child(6),
  body.device-mobile .goal-standings-table th:nth-child(7),
  body.device-mobile .goal-standings-table td:nth-child(7),
  body.device-mobile .goal-standings-table th:nth-child(8),
  body.device-mobile .goal-standings-table td:nth-child(8),
  body.device-mobile .goal-standings-table th:nth-child(9),
  body.device-mobile .goal-standings-table td:nth-child(9) { display: none; }
  body.device-mobile .goal-standings-table th:nth-child(1),
  body.device-mobile .goal-standings-table td:nth-child(1) { width: 18px; padding-inline: 1px; }
  body.device-mobile .goal-standings-table th:nth-child(2),
  body.device-mobile .goal-standings-table td:nth-child(2) { width: 27px; }
  body.device-mobile .goal-standings-table th:nth-child(3),
  body.device-mobile .goal-standings-table td:nth-child(3) { width: auto; }
  body.device-mobile .goal-standings-table th:nth-child(4),
  body.device-mobile .goal-standings-table td:nth-child(4),
  body.device-mobile .goal-standings-table th:nth-child(5),
  body.device-mobile .goal-standings-table td:nth-child(5),
  body.device-mobile .goal-standings-table th:nth-child(10),
  body.device-mobile .goal-standings-table td:nth-child(10) { width: 28px; }
  body.device-mobile .goal-standings-table .team-link {
    min-width: 0;
    gap: 3px;
  }
  body.device-mobile .goal-standings-table .team-link > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.device-mobile .goal-standings-table .manager-icon-badge,
  body.device-mobile .goal-standings-table .club-badge { display: none; }

  body.device-mobile .formation-workspace,
  body.device-mobile .formation-reference-layout {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "pitch" "squad" "tactics" !important;
    gap: 10px;
  }
  body.device-mobile .formation-reference-layout { --formation-panel-height: auto; }
  body.device-mobile .formation-pitch-card,
  body.device-mobile .pitch-column { width: 100%; min-width: 0; }
  body.device-mobile .formation-reference-layout .pitch,
  body.device-mobile .pitch {
    width: min(100%, 390px);
    max-width: 100%;
    max-height: none;
    margin-inline: auto;
    touch-action: manipulation;
  }
  body.device-mobile .formation-reference-layout .pitch-player { width: 68px; }
  body.device-mobile .formation-reference-layout .pitch-player b { font-size: 8px; }
  body.device-mobile .formation-roster {
    height: auto;
    max-height: none;
  }
  body.device-mobile .formation-player-groups,
  body.device-mobile .squad-column {
    max-height: 460px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.device-mobile .formation-side-tactics,
  body.device-mobile .tactics-column { height: auto; max-height: none; }
  body.device-mobile .formation-side-tactics .formation-tactics-save-form { grid-template-columns: 1fr !important; }

  body.device-mobile .mail-layout {
    display: grid;
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body.device-mobile .mail-list {
    max-height: 230px;
    overflow-y: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  body.device-mobile .mail-reader { min-width: 0; padding: 15px; }
  body.device-mobile .mail-reader-head h2 { font-size: 20px; }
  body.device-mobile .mail-body { overflow-wrap: anywhere; }

  body.device-mobile input,
  body.device-mobile select,
  body.device-mobile textarea {
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    font-size: 16px;
  }
  body.device-mobile button,
  body.device-mobile .button {
    min-height: 40px;
    touch-action: manipulation;
  }
  body.device-mobile form:not(.inline-form),
  body.device-mobile .form-stack { min-width: 0; }
  body.device-mobile .register-name-grid,
  body.device-mobile .form-grid,
  body.device-mobile .goalfc-settings-form { grid-template-columns: minmax(0, 1fr) !important; }

  body.device-mobile .footer { margin-bottom: 0; }
  body.device-mobile .footer-inner {
    padding: 14px 4px 18px;
    align-items: center;
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 560px) {
  body.device-mobile .auth-page,
  body.device-mobile .premium-login-page,
  body.device-mobile .beta-register-page,
  body.device-mobile .beta-pending-page {
    display: flex;
    width: 100%;
    margin: 6px 0 12px;
    flex-direction: column;
    border-radius: 8px;
  }
  body.device-mobile .auth-card,
  body.device-mobile .premium-login-page .auth-card,
  body.device-mobile .beta-register-card,
  body.device-mobile .beta-pending-card {
    order: 1;
    width: 100%;
    padding: 22px 16px;
  }
  body.device-mobile .auth-hero,
  body.device-mobile .premium-login-hero,
  body.device-mobile .beta-register-hero,
  body.device-mobile .beta-pending-hero {
    order: 2;
    min-height: 0;
    padding: 28px 18px;
  }
  body.device-mobile .auth-hero h1 { font-size: 31px; }
  body.device-mobile .premium-feature-grid,
  body.device-mobile .beta-registration-steps { margin-top: 20px; }
  body.device-mobile .premium-feature-grid > div small,
  body.device-mobile .beta-registration-steps small { display: none; }

  body.device-mobile .club-card-grid,
  body.device-mobile .form-grid,
  body.device-mobile .morale-grid,
  body.device-mobile .metric-grid,
  body.device-mobile .nav-metric-grid,
  body.device-mobile .manager-profile-stats,
  body.device-mobile .club-management-hero-metrics {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body.device-mobile .goal-player-table tr {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "player player"
      "position age"
      "stamina value"
      "action action";
  }
  body.device-mobile .goal-player-table td:nth-child(16) { justify-self: stretch; }
  body.device-mobile .goal-player-table td:nth-child(16) .button { width: 100%; }
  body.device-mobile .transfer-market-table tr {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "player player"
      "position age"
      "price action";
  }
  body.device-mobile .transfer-market-table td:nth-child(16) .button { width: 100%; }
  body.device-mobile .manager-cover {
    padding: 20px 15px;
    align-items: flex-start;
    flex-direction: column;
  }
  body.device-mobile .manager-cover h1 { font-size: 24px; }
}

/* Dimension lobby mobile rebuild R48 */
.mobile-lobby-account-links { display: none; }

@media (max-width: 1024px) {
  body.device-mobile.lobby-mode .mobile-nav-toggle {
    margin-left: auto;
  }
  body.device-mobile.lobby-mode .lobby-account-area {
    display: none !important;
  }
  body.device-mobile .mobile-lobby-account-links {
    display: grid;
    gap: 8px;
  }
  body.device-mobile .mobile-lobby-account-links > a,
  body.device-mobile .mobile-lobby-account-links form button {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    padding: 11px 14px;
    border: 1px solid #d7e3ec;
    border-radius: 10px;
    background: #fff;
    color: #173b53;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
  }
  body.device-mobile .mobile-lobby-account-links form {
    margin: 0;
  }
  body.device-mobile .mobile-lobby-account-links form button {
    color: #9a3230;
  }

  html.dimension-room-root,
  body.dimension-room-mode {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  body.device-mobile.dimension-room-mode {
    display: block !important;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  body.device-mobile.dimension-room-mode .topbar {
    position: sticky;
    top: 0;
  }
  body.device-mobile.dimension-room-mode .lobby-section-strip {
    position: sticky;
    top: 56px;
    z-index: 105;
    min-height: 30px;
    padding: 0 12px;
    font-size: 10px;
  }
  body.device-mobile.dimension-room-mode .page-shell {
    width: calc(100% - 16px);
    height: auto !important;
    min-height: 0 !important;
    margin: 10px 8px 18px;
    padding: 0;
    overflow: visible !important;
  }
  body.device-mobile.dimension-room-mode .server-login-page {
    display: grid;
    height: auto !important;
    min-height: 0 !important;
    grid-template-rows: none !important;
    gap: 12px;
  }
  body.device-mobile.dimension-room-mode .server-dimension-panel,
  body.device-mobile.dimension-room-mode .server-updates-panel {
    min-width: 0;
    min-height: 0 !important;
    overflow: hidden;
  }
  body.device-mobile.dimension-room-mode .server-dimension-panel .panel-header,
  body.device-mobile.dimension-room-mode .server-updates-panel .panel-header {
    min-height: 52px;
    padding: 13px 15px;
    align-items: center;
    background: linear-gradient(180deg, #fff, #f6f8fa);
  }
  body.device-mobile.dimension-room-mode .server-dimension-panel .panel-header h2,
  body.device-mobile.dimension-room-mode .server-updates-panel .panel-header h2 {
    font-size: 18px;
  }

  body.device-mobile.dimension-room-mode .server-dimension-table-wrap {
    overflow: visible !important;
    padding: 10px;
  }
  body.device-mobile.dimension-room-mode .server-dimension-table,
  body.device-mobile.dimension-room-mode .server-dimension-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }
  body.device-mobile.dimension-room-mode .server-dimension-table thead {
    display: none;
  }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody tr {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "name name name"
      "description description description"
      "tick tick tick"
      "ticks season turn"
      "action action action";
    gap: 0;
    overflow: hidden;
    border: 1px solid #d9e3ea;
    border-left: 5px solid #2b9b55;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(23, 51, 69, .08);
  }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody tr.is-offline {
    border-left-color: #8d96a0;
  }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody tr.is-simulating {
    border-left-color: #e18a22;
    background: #fffaf1;
  }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td {
    display: block;
    min-width: 0;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid #e8edf1;
    background: transparent;
    white-space: normal;
  }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(1) {
    grid-area: name;
    padding-top: 15px;
  }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(2) {
    grid-area: description;
  }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(3) {
    grid-area: tick;
  }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(4) { grid-area: ticks; }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(5) { grid-area: season; }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(6) { grid-area: turn; }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(7) {
    grid-area: action;
    border-bottom: 0;
  }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(4),
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(5),
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(6) {
    min-height: 68px;
    padding: 10px 8px;
    border-right: 1px solid #e8edf1;
    text-align: center;
  }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(6) {
    border-right: 0;
  }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(4)::before,
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(5)::before,
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(6)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: #76848e;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
  }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(4) strong,
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(5) strong,
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td:nth-child(6) strong {
    color: #203746;
    font-size: 14px;
  }
  body.device-mobile.dimension-room-mode .dimension-server-name {
    min-width: 0;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
  }
  body.device-mobile.dimension-room-mode .dimension-server-ball {
    width: 42px;
    height: 42px;
    font-size: 21px;
  }
  body.device-mobile.dimension-room-mode .dimension-server-name strong {
    color: #1e2d38;
    font-size: 17px;
    overflow-wrap: anywhere;
  }
  body.device-mobile.dimension-room-mode .dimension-server-name small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
  }
  body.device-mobile.dimension-room-mode .dimension-description,
  body.device-mobile.dimension-room-mode .community-dimension-description {
    width: 100%;
    min-width: 0;
  }
  body.device-mobile.dimension-room-mode .community-dimension-description strong {
    color: #263844;
    font-size: 16px;
  }
  body.device-mobile.dimension-room-mode .community-dimension-copy {
    margin-top: 4px;
    color: #566772;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
  body.device-mobile.dimension-room-mode .community-dimension-description small {
    max-width: none;
    margin-top: 7px;
    color: #778590;
    font-size: 11px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
  body.device-mobile.dimension-room-mode .dimension-tick,
  body.device-mobile.dimension-room-mode .dimension-progress-state {
    width: 100%;
    min-width: 0;
    padding: 2px 0;
  }
  body.device-mobile.dimension-room-mode .dimension-tick strong {
    color: #1f5e86;
    font-size: 22px;
  }
  body.device-mobile.dimension-room-mode .dimension-tick small {
    display: block;
    margin-top: 2px;
    font-size: 10px;
  }
  body.device-mobile.dimension-room-mode .dimension-progress-track {
    width: 100%;
  }
  body.device-mobile.dimension-room-mode .dimension-action-cell form,
  body.device-mobile.dimension-room-mode .dimension-action-cell .button {
    width: 100%;
    margin: 0;
  }
  body.device-mobile.dimension-room-mode .dimension-action-cell .button {
    min-height: 48px;
    border-radius: 9px;
    font-size: 13px;
  }
  body.device-mobile.dimension-room-mode .dimension-help-list {
    margin: 0 10px 12px;
    padding: 12px 14px 12px 30px;
    border: 1px solid #dce6ed;
    border-radius: 9px;
    background: #f6f9fb;
    color: #4e606c;
    font-size: 11px;
    line-height: 1.5;
  }
  body.device-mobile.dimension-room-mode .dimension-help-list li + li {
    margin-top: 6px;
  }

  body.device-mobile.dimension-room-mode .server-updates-panel {
    display: block !important;
  }
  body.device-mobile.dimension-room-mode .server-updates-panel .forum-heading-actions {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  body.device-mobile.dimension-room-mode .server-updates-panel .forum-heading-actions > div:first-child {
    min-width: 0;
  }
  body.device-mobile.dimension-room-mode .server-updates-panel .forum-heading-actions > div:first-child span {
    display: block;
    margin-top: 3px;
    color: #77848e;
    font-size: 10px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  body.device-mobile.dimension-room-mode .news-header-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  body.device-mobile.dimension-room-mode .news-header-actions .button {
    width: 100%;
    min-height: 42px;
    margin: 0;
  }
  body.device-mobile.dimension-room-mode .server-updates-grid {
    display: grid !important;
    width: 100%;
    min-height: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px;
    padding: 10px;
    overflow: visible !important;
  }
  body.device-mobile.dimension-room-mode .server-update-card {
    display: block;
    width: 100%;
    min-height: 0 !important;
    height: auto !important;
    padding: 15px;
    overflow: hidden;
    border-radius: 9px;
    box-shadow: 0 3px 11px rgba(23, 51, 69, .06);
  }
  body.device-mobile.dimension-room-mode .server-update-card h3 {
    margin: 12px 0 8px;
    font-size: 20px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  body.device-mobile.dimension-room-mode .server-update-card p {
    display: block !important;
    margin: 0;
    overflow: visible !important;
    color: #465661;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-line;
    overflow-wrap: anywhere;
    -webkit-line-clamp: unset !important;
  }
  body.device-mobile.dimension-room-mode .admin-news-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  body.device-mobile.dimension-room-mode .admin-news-actions form,
  body.device-mobile.dimension-room-mode .admin-news-actions .button {
    width: 100%;
  }
  body.device-mobile.dimension-room-mode .footer {
    display: block;
    margin: 0;
  }
  body.device-mobile.dimension-room-mode .footer-inner {
    padding: 14px 6px calc(18px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 430px) {
  body.device-mobile.dimension-room-mode .page-shell {
    width: calc(100% - 12px);
    margin-inline: 6px;
  }
  body.device-mobile.dimension-room-mode .server-dimension-table-wrap,
  body.device-mobile.dimension-room-mode .server-updates-grid {
    padding: 7px;
  }
  body.device-mobile.dimension-room-mode .server-dimension-table tbody td {
    padding-inline: 12px;
  }
  body.device-mobile.dimension-room-mode .news-header-actions {
    grid-template-columns: minmax(0, 1fr);
  }
  body.device-mobile.dimension-room-mode .admin-news-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}



/* Mobile navigation visibility, account actions and useful quick bar R49 */
.mobile-menu-heading,
.mobile-game-account-links { display: none; }

@media (max-width: 1024px) {
  body.device-mobile .topbar {
    z-index: 160 !important;
  }
  body.device-mobile .main-nav,
  body.device-mobile .lobby-main-nav {
    z-index: 175 !important;
    background: #f4f8fb !important;
    filter: none !important;
    backdrop-filter: none !important;
  }
  body.device-mobile .mobile-nav-backdrop {
    z-index: 140 !important;
    background: rgba(10, 27, 39, .52) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  body.device-mobile .mobile-bottom-nav {
    z-index: 180 !important;
  }
  body.device-mobile .mobile-menu-heading {
    position: sticky;
    top: -12px;
    z-index: 3;
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -12px -10px 6px;
    padding: 13px 14px;
    border-bottom: 1px solid #cfdde7;
    background: linear-gradient(135deg, #173f5a, #347fba);
    color: #fff;
    box-shadow: 0 4px 14px rgba(22, 55, 77, .15);
  }
  body.device-mobile .mobile-menu-heading > div {
    display: grid;
    min-width: 0;
    gap: 1px;
  }
  body.device-mobile .mobile-menu-heading span {
    color: rgba(255,255,255,.68);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .13em;
  }
  body.device-mobile .mobile-menu-heading strong {
    color: #fff;
    font-size: 18px;
    line-height: 1.15;
  }
  body.device-mobile .mobile-menu-heading small {
    overflow: hidden;
    color: rgba(255,255,255,.78);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.device-mobile .mobile-menu-close {
    display: grid;
    width: 42px;
    height: 42px;
    min-height: 42px;
    flex: 0 0 42px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 11px;
    background: rgba(255,255,255,.13);
    color: #fff;
    font-size: 27px;
    font-weight: 300;
    line-height: 1;
  }
  body.device-mobile .main-nav > details > summary,
  body.device-mobile .main-nav > a,
  body.device-mobile .lobby-main-nav > details > summary,
  body.device-mobile .lobby-main-nav > a {
    filter: none !important;
    opacity: 1 !important;
  }
  body.device-mobile .mobile-game-account-links {
    display: grid;
    gap: 7px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid #cfdde7;
  }
  body.device-mobile .mobile-account-heading {
    padding: 0 4px 2px;
    color: #687b89;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
  }
  body.device-mobile .mobile-game-account-links > a,
  body.device-mobile .mobile-game-account-links form button {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    padding: 10px 13px;
    border: 1px solid #d7e3ec;
    border-radius: 10px;
    background: #fff;
    color: #173b53;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
  }
  body.device-mobile .mobile-game-account-links form {
    margin: 0;
  }
  body.device-mobile .mobile-game-account-links form button {
    color: #9a3230;
  }
  body.device-mobile .game-user-menu,
  body.device-mobile .lobby-user-menu {
    display: none !important;
  }
  body.device-mobile .account-area #mailLink {
    display: inline-flex !important;
  }
}


/* Compact mobile navigation, touch formation and visible manager ranks R50 */
.mobile-formation-touch-help { display: none; }

@media (max-width: 1024px) {
  body.device-mobile .main-nav > details,
  body.device-mobile .lobby-main-nav > details,
  body.device-mobile .main-nav > .nav-dropdown,
  body.device-mobile .lobby-main-nav > .nav-dropdown {
    display: block;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    align-self: auto !important;
  }
  body.device-mobile .main-nav > details > summary,
  body.device-mobile .lobby-main-nav > details > summary,
  body.device-mobile .main-nav > .nav-dropdown > summary,
  body.device-mobile .lobby-main-nav > .nav-dropdown > summary {
    width: 100%;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    padding: 0 14px !important;
    justify-content: space-between !important;
    border-bottom: 1px solid #d7e3ec !important;
    line-height: 1.2;
  }
  body.device-mobile .main-nav > details[open],
  body.device-mobile .lobby-main-nav > details[open] {
    height: auto !important;
  }
  body.device-mobile .main-nav .nav-menu,
  body.device-mobile .lobby-main-nav .nav-menu {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 5px 0 0 !important;
  }
  body.device-mobile .main-nav,
  body.device-mobile .lobby-main-nav {
    gap: 7px !important;
  }

  body.device-mobile .mobile-formation-touch-help {
    display: grid;
    gap: 3px;
    margin: 8px 9px 4px;
    padding: 10px 11px;
    border: 1px solid #a9cde4;
    border-radius: 8px;
    background: linear-gradient(135deg, #f4faff, #eaf5fb);
    color: #315a72;
    font-size: 10px;
    line-height: 1.45;
  }
  body.device-mobile .mobile-formation-touch-help strong {
    color: #174f73;
    font-size: 11px;
  }
  body.device-mobile .formation-roster-help { display: none; }
  body.device-mobile .formation-player-groups,
  body.device-mobile .squad-column {
    max-height: none !important;
    overflow: visible !important;
  }
  body.device-mobile .formation-reference-layout .pool-player {
    min-height: 48px;
    padding: 7px 8px;
    border-radius: 8px;
    touch-action: manipulation;
  }
  body.device-mobile .formation-reference-layout .pool-player-name b { font-size: 12px; }
  body.device-mobile .formation-reference-layout .pool-player-meta small { font-size: 10px; }
  body.device-mobile .formation-reference-layout .pitch-player {
    width: 62px;
    touch-action: manipulation;
  }
  body.device-mobile .formation-reference-layout .formation-placeholder {
    width: 58px;
    min-height: 44px;
    touch-action: manipulation;
  }
  body.device-mobile .pitch-player-remove {
    width: 22px;
    height: 22px;
    top: -8px;
    right: 5px;
    opacity: 1;
    font-size: 15px;
  }
  body.device-mobile .formation-pitch-heading {
    position: sticky;
    top: 94px;
    z-index: 4;
    margin: -2px -2px 8px;
    padding: 8px 4px;
    background: rgba(255,255,255,.96);
  }
  body.device-mobile .formation-save-dock {
    position: sticky;
    bottom: calc(66px + env(safe-area-inset-bottom));
    z-index: 10;
    padding: 9px;
    border-top: 1px solid #d7e3ec;
    background: rgba(255,255,255,.96);
    box-shadow: 0 -8px 20px rgba(20,54,75,.10);
  }
  body.device-mobile .manager-rank-label {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    padding: 2px 7px;
    border: 1px solid #bdd6e7;
    border-radius: 999px;
    background: #eef7fc;
    color: #246f9f;
    font-size: 10px;
    font-weight: 850;
    white-space: nowrap;
  }
}


/* Mobile formation target-first controls and stable club ticker R51 */
.mobile-formation-role-jump { display: none; }

@media (max-width: 1024px) {
  body.device-mobile .mobile-formation-role-jump {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 0 7px 9px;
    padding: 8px;
    border: 1px solid #c9dce8;
    border-radius: 9px;
    background: #f5f9fc;
  }
  body.device-mobile .mobile-formation-role-jump > span {
    grid-column: 1 / -1;
    color: #647b8a;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  body.device-mobile .mobile-formation-role-jump button {
    display: grid;
    min-width: 0;
    min-height: 45px;
    place-items: center;
    gap: 1px;
    padding: 5px 3px;
    border: 1px solid #bcd4e3;
    border-radius: 8px;
    background: #fff;
    color: #245d80;
    box-shadow: 0 2px 6px rgba(29, 75, 104, .05);
  }
  body.device-mobile .mobile-formation-role-jump button:active {
    border-color: #347fba;
    background: #eaf5fb;
  }
  body.device-mobile .mobile-formation-role-jump b {
    font-size: 15px;
    line-height: 1;
  }
  body.device-mobile .mobile-formation-role-jump small {
    overflow: hidden;
    max-width: 100%;
    color: #718593;
    font-size: 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.device-mobile .formation-pitch-card,
  body.device-mobile [data-roster-group] {
    scroll-margin-top: 104px;
  }
  body.device-mobile .formation-placeholder.mobile-slot-selected,
  body.device-mobile .pitch-player.mobile-slot-selected {
    z-index: 18;
    filter: drop-shadow(0 0 8px rgba(255, 194, 39, .95));
  }
  body.device-mobile .formation-placeholder.mobile-slot-selected > span,
  body.device-mobile .pitch-player.mobile-slot-selected .player-shirt {
    outline: 4px solid #ffc62e;
    outline-offset: 3px;
  }
  body.device-mobile .pitch.mobile-slot-picking {
    box-shadow: inset 0 0 0 4px rgba(255, 198, 46, .32);
  }
  body.device-mobile .position-group.mobile-roster-target {
    margin: 7px 5px;
    padding: 10px 7px 8px;
    border: 2px solid #347fba;
    border-radius: 10px;
    background: #f1f8fd;
    box-shadow: 0 8px 20px rgba(52, 127, 186, .12);
  }
  body.device-mobile .position-group.mobile-roster-target h3 {
    color: #1f6e9f;
    font-size: 11px;
  }
  body.device-mobile .position-group.mobile-roster-target .pool-player {
    border-color: #c7ddea;
  }
  body.device-mobile.club-management-mode .ticker {
    position: sticky !important;
    top: 56px !important;
    margin: 0 !important;
  }
  body.device-mobile.club-management-mode .club-management-page-shell {
    padding-top: 10px;
  }
}
