/* Home + Daily Challenges mobile polish — 2026-11-16.
   Scoped to the public mobile Workbench and V5 DC content. Production,
   desktop, and the unreleased tools are deliberately untouched. */
@media (max-width:860px) {
  /* Only the ACTIVE page is highlighted. Keeping Home as a big elevated
     button on every route made it look selected while browsing Challenges. */
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation
  .gtt-mobile-tab[data-gtt-mobile-group="home"]:not(.is-current) {
    transform:none!important;
    height:55px!important;
    min-height:55px!important;
    border-color:transparent!important;
    background:transparent!important;
    box-shadow:none!important;
    color:#adc9e1!important;
    font-weight:650!important;
  }
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation
  .gtt-mobile-tab.is-current {
    color:#f3faff!important;
    background:linear-gradient(155deg,rgba(116,195,255,.26),rgba(40,103,165,.34))!important;
    box-shadow:inset 0 1px rgba(255,255,255,.22)!important;
  }
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation
  .gtt-mobile-tab[data-gtt-mobile-group="home"].is-current {
    background:linear-gradient(155deg,rgba(122,194,247,.37),rgba(40,102,167,.51))!important;
    border-color:rgba(177,234,255,.7)!important;
    box-shadow:inset 0 1px rgba(255,255,255,.26),0 7px 21px rgba(3,21,45,.28)!important;
  }
  /* Full "Daily Challenges" fits three real public buttons. Five-button
     testers receive the shorter "Challenges" without losing the aria label. */
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation .gtt-mobile-tab-label {
    display:block!important;
    max-width:100%;
    font-size:clamp(9px,2.7vw,11px)!important;
    line-height:1.18!important;
    letter-spacing:-.15px!important;
    font-weight:750!important;
    text-overflow:clip!important;
  }
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation
  .gtt-mobile-tab[data-gtt-mobile-group="daily"] .gtt-mobile-tab-label {
    letter-spacing:-.25px!important;
  }
  /* The rail remains swipeable; buttons align to a clean leading edge and
     the active one can be fully visible instead of showing clipped text. */
  body[data-theme="glass"] #content .dc-mobile-sections-track {
    scroll-padding-inline:0!important;
    scroll-snap-type:x proximity!important;
  }
  body[data-theme="glass"] #content .dc-mobile-sections-track>.dc-mobile-section {
    scroll-snap-align:start!important;
  }
  body[data-theme="glass"] #content .dc-mobile-sections.dc-can-scroll-back::before {
    content:'‹';
    position:absolute;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    top:5px;bottom:5px;left:4px;
    width:25px;
    padding-left:4px;
    border-radius:9px 0 0 9px;
    color:#d4efff;
    font-size:23px;
    line-height:1;
    background:linear-gradient(270deg,transparent,rgba(10,32,64,.96) 58%);
    pointer-events:none;
    z-index:1;
  }
  /* Eliminate the large blank band between the sticky DC navigation and
     page heading, while preserving natural title and subtitle wrapping. */
  body[data-theme="glass"] #content .dc-mobile-sections + .page-head {
    margin:2px 0 14px!important;
    padding:0!important;
    min-height:0!important;
    align-items:flex-start!important;
  }
  body[data-theme="glass"] #content .dc-mobile-sections + .page-head h1 {
    line-height:1.16!important;
    overflow-wrap:break-word;
  }
  /* Prevent long labels and toolbar counts from driving page overflow. */
  body[data-current-view="challenges"] #content :is(
    .v5-main-panel,.v5-toolbar,.v5-challenge-section,.v5-challenge-card
  ) {
    box-sizing:border-box!important;
    min-width:0!important;
    max-width:100%!important;
  }
  body[data-current-view="challenges"] #content .v5-toolbar .v5-search {
    min-width:0!important;
  }
  body[data-current-view="challenges"] #content .v5-challenge-card :is(
    strong,p,.card-count
  ) {
    max-width:100%!important;
    overflow-wrap:break-word;
  }
  body[data-current-view="home"] #content .h162-root {
    min-width:0!important;
    max-width:100%!important;
  }
  /* Reserve room for safe-area bottom tab navigation even on the final
     Home or Daily Challenge card, including after filtering and scrolling. */
  html[data-gtt-design-mode="workbench"] body[data-theme]:is(
    [data-current-view="home"],[data-current-view="overview"],
    [data-current-view="calendar"],[data-current-view="challenges"],
    [data-current-view="rankings"],[data-current-view="records"],
    [data-current-view="history"],[data-current-view="playerprofiles"]
  ) .main-area>#content.content {
    padding-bottom:calc(var(--gtt-mobile-bottom,65px) + 22px)!important;
  }
}
@media(max-width:355px) {
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation .gtt-mobile-tab-label {
    font-size:9px!important;
  }
}

/* 16 Nov mobile repair: V5 base at <=550px uses flex-direction:column,
   while dc-mobile-responsive gave .page-head>div flex-basis:205px. That
   205px is a HEIGHT in a column, producing the huge gap under DC tabs and
   pushing the action button far from the title. Reset the flex basis. */
@media (max-width:860px) {
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content > .dc-mobile-sections + header.page-head {
    display:flex!important;
    flex-direction:column!important;
    flex-wrap:nowrap!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    align-content:normal!important;
    gap:9px!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:10px 0 12px!important;
    padding:0!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content > .dc-mobile-sections + header.page-head > div {
    flex:0 0 auto!important;
    align-self:stretch!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content > .dc-mobile-sections + header.page-head > .heading-link {
    flex:0 0 auto!important;
    align-self:flex-start!important;
    margin:0!important;
    min-height:40px!important;
  }
  /* Only the page matching the route may ever have an active treatment.
     This wins even if an older tab script left Home's is-current class. */
  html[data-gtt-design-mode="workbench"] body:not([data-current-view="home"])
  #gtt-mobile-navigation .gtt-mobile-tab[data-gtt-mobile-group="home"] {
    transform:none!important;
    height:55px!important;
    min-height:55px!important;
    border:0!important;
    border-radius:10px!important;
    background:transparent!important;
    box-shadow:none!important;
    color:#adc9e1!important;
    font-weight:650!important;
  }
  html[data-gtt-design-mode="workbench"] body:not([data-current-view="home"])
  #gtt-mobile-navigation .gtt-mobile-tab[data-gtt-mobile-group="home"] .gtt-mobile-tab-icon {
    width:29px!important;height:27px!important;flex-basis:27px!important;
  }
  html[data-gtt-design-mode="workbench"] body:not([data-current-view="home"])
  #gtt-mobile-navigation .gtt-mobile-tab[data-gtt-mobile-group="home"] .gtt-mobile-tab-icon img {
    width:27px!important;height:27px!important;max-width:27px!important;max-height:27px!important;
  }
}

/* 16 Nov phone page picker and account panel repair.
   The real supplied artwork replaces the old unicode magnifier for the two
   shared site search triggers (phone top bar + desktop floating search). */
html[data-gtt-design-mode="workbench"] #wb2-shell .wb2-search-art {
  display:block!important;
  width:24px!important;
  height:25px!important;
  max-width:24px!important;
  max-height:25px!important;
  min-width:24px!important;
  flex:0 0 24px!important;
  object-fit:contain!important;
  image-rendering:pixelated;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
@media (max-width:860px),
       (pointer:coarse) and (orientation:landscape) and (max-height:600px) and (max-width:1100px) {
  /* Daily is now opened from the primary bottom tab. Hide the redundant
     horizontal page rail instead of wasting a row and clipping "Rankings". */
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content > .dc-mobile-sections {
    display:none!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme="glass"]
  #content > .dc-mobile-sections + header.page-head {
    margin-top:2px!important;
  }
  /* Center the same search BUTTON used on desktop. The old "Overview" label
     duplicated the page heading and pushed search/account off narrow phones. */
  html[data-gtt-design-mode="workbench"] #wb2-shell .gtt-mobile-page-title {
    display:none!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme] #wb2-shell
  .wb2-bar .wb2-actions {
    margin-left:auto!important;
    position:static!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme] #wb2-shell
  .wb2-bar .wb2-actions > .wb2-mobile-search {
    display:inline-flex!important;
    position:absolute!important;
    box-sizing:border-box!important;
    top:calc(env(safe-area-inset-top,0px) + 8px)!important;
    left:50%!important;
    right:auto!important;
    transform:translateX(-50%)!important;
    z-index:2!important;
    flex:0 0 auto!important;
    width:clamp(112px,42vw,166px)!important;
    min-width:112px!important;
    max-width:166px!important;
    height:40px!important;
    min-height:40px!important;
    margin:0!important;
    padding:0 11px!important;
    gap:9px!important;
    border:1px solid rgba(170,215,255,.43)!important;
    border-radius:12px!important;
    color:#eaf7ff!important;
    background:linear-gradient(145deg,rgba(92,151,217,.26),rgba(20,49,90,.69))!important;
    box-shadow:0 5px 20px rgba(2,11,29,.15),inset 0 1px rgba(238,248,255,.15)!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme] #wb2-shell
  .wb2-bar .wb2-actions > .wb2-mobile-search .wb2-search-label {
    display:inline!important;
    color:#eaf7ff!important;
    font:700 12px/1.1 Inter,system-ui,sans-serif!important;
  }
  /* The old account CSS explicitly used right:-47px, making the whole menu
     stick out of the viewport. Anchor the menu to viewport-right instead. */
  html[data-gtt-design-mode="workbench"] body[data-theme] #wb2-shell
  #gtt-accounts > .gtt-accounts-panel {
    position:fixed!important;
    top:calc(var(--gtt-mobile-top,56px) + 7px)!important;
    right:max(10px,env(safe-area-inset-right,0px))!important;
    left:auto!important;
    bottom:auto!important;
    box-sizing:border-box!important;
    width:min(350px,calc(100vw - 20px))!important;
    min-width:0!important;
    max-width:calc(100vw - 20px)!important;
    max-height:calc(100dvh - var(--gtt-mobile-top,56px) - 20px)!important;
    padding:16px!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    overflow-wrap:break-word;
    -webkit-overflow-scrolling:touch;
  }
  html[data-gtt-design-mode="workbench"] #gtt-accounts
  :is(.gtt-auth-discord,.gtt-auth-google,.gtt-account-menu-links button,
      .gtt-account-menu-links a) {
    box-sizing:border-box!important;
    max-width:100%!important;
  }
  /* Dedicated Daily page picker: a small, accessible bottom popover.
     More keeps its full-height search/category drawer unchanged. */
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation.is-daily-picker
  .gtt-mobile-sheet {
    inset:auto max(10px,env(safe-area-inset-right,0px))
      calc(var(--gtt-mobile-bottom,65px) + 10px)
      max(10px,env(safe-area-inset-left,0px))!important;
    width:auto!important;
    height:auto!important;
    min-height:0!important;
    max-width:560px!important;
    max-height:calc(100dvh - var(--gtt-mobile-top,56px) - var(--gtt-mobile-bottom,65px) - 22px)!important;
    margin:0 auto!important;
    border-radius:18px!important;
  }
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation.is-daily-picker
  :is(.gtt-mobile-menu-search,.gtt-mobile-jump-head,.gtt-mobile-jumps) {
    display:none!important;
  }
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation.is-daily-picker
  .gtt-mobile-sheet-heading {
    padding:14px 14px 9px!important;
  }
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation.is-daily-picker
  .gtt-mobile-sheet h2 {
    font-size:18px!important;
  }
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation
  .gtt-mobile-sheet-list.gtt-mobile-daily-grid {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    padding:4px 12px 14px!important;
    overflow-y:auto!important;
    min-height:0!important;
  }
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation
  .gtt-mobile-daily-grid > .gtt-mobile-page-link {
    min-width:0!important;
    min-height:61px!important;
    height:auto!important;
    gap:8px!important;
    padding:10px 8px!important;
    border:1px solid rgba(160,211,251,.19)!important;
    border-radius:11px!important;
    background:rgba(104,165,227,.10)!important;
    color:#e8f5ff!important;
    font-size:12px!important;
    font-weight:750!important;
    line-height:1.22!important;
  }
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation
  .gtt-mobile-daily-grid > .gtt-mobile-page-link.is-selected {
    border-color:rgba(163,226,255,.72)!important;
    background:linear-gradient(130deg,rgba(116,190,249,.29),rgba(31,88,148,.34))!important;
    box-shadow:inset 0 1px rgba(250,254,255,.23)!important;
  }
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation
  .gtt-mobile-daily-grid > .gtt-mobile-page-link .gtt-mobile-page-name {
    overflow-wrap:break-word!important;
    text-align:left;
  }
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation
  .gtt-mobile-tab[data-gtt-mobile-group="daily"]{
    position:relative;
  }
  html[data-gtt-design-mode="workbench"] #gtt-mobile-navigation
  .gtt-mobile-tab[data-gtt-mobile-group="daily"]::after {
    content:'⌃';
    position:absolute;
    right:7px;
    top:5px;
    font:700 13px/1 Inter,system-ui,sans-serif;
    color:#a3d8f9;
    pointer-events:none;
  }
}
@media (max-width:320px) {
  html[data-gtt-design-mode="workbench"] body[data-theme] #wb2-shell
  .wb2-bar .wb2-actions > .wb2-mobile-search{
    gap:5px!important;
    padding:0 8px!important;
    width:112px!important;
  }
}


/* Mobile Search is one complete rectangular hit target, matching the desktop
   floating Search control. Earlier 44px action-button rules caused its icon
   to escape left while only the label had a small rounded background. */
@media (max-width:860px),
       (pointer:coarse) and (orientation:landscape) and (max-height:600px) and (max-width:1100px) {
  html[data-gtt-design-mode="workbench"] body[data-theme] #wb2-shell
  .wb2-bar .wb2-actions > button.wb2-mobile-search.wb2-action-search {
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    box-sizing:border-box!important;
    flex:0 0 clamp(132px,44vw,168px)!important;
    width:clamp(132px,44vw,168px)!important;
    min-width:132px!important;
    max-width:168px!important;
    height:40px!important;
    min-height:40px!important;
    padding:0 12px!important;
    margin:0!important;
    gap:9px!important;
    position:absolute!important;
    left:50%!important;
    right:auto!important;
    transform:translateX(-50%)!important;
    overflow:hidden!important;
    border:1px solid rgba(170,215,255,.43)!important;
    border-radius:12px!important;
    background:linear-gradient(145deg,rgba(92,151,217,.26),rgba(20,49,90,.69))!important;
    box-shadow:0 5px 20px rgba(2,11,29,.15),inset 0 1px rgba(238,248,255,.15)!important;
    white-space:nowrap!important;
  }
  html[data-gtt-design-mode="workbench"] #wb2-shell
  .wb2-bar .wb2-mobile-search .wb2-search-art {
    display:block!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
    float:none!important;
    margin:0!important;
    width:24px!important;
    height:25px!important;
    min-width:24px!important;
    max-width:24px!important;
    flex:0 0 24px!important;
    object-fit:contain!important;
  }
  html[data-gtt-design-mode="workbench"] body[data-theme] #wb2-shell
  .wb2-bar .wb2-mobile-search .wb2-search-label {
    display:inline!important;
    position:static!important;
    flex:0 0 auto!important;
    margin:0!important;
    padding:0!important;
    color:#eaf7ff!important;
    font:700 12px/1.1 Inter,system-ui,sans-serif!important;
    white-space:nowrap!important;
  }
}
