/* G&C REV10W FIX80 R4 — final cross-device mobile/PWA containment layer.
 * Applies only to phone widths. It is intentionally loaded after route/theme CSS
 * so Samsung/Redmi Android PWAs and iPhone PWAs share the same no-overlap floor.
 */
@media (max-width:600px){
  html,body{
    max-width:100%;
    min-width:0;
    overflow-x:hidden;
    overflow-x:clip;
    -webkit-text-size-adjust:100%;
    text-size-adjust:100%;
  }

  :where(main,section,article,header,footer,nav,form,fieldset,div,label){
    min-width:0;
  }
  :where(h1,h2,h3,h4,h5,h6,p,small,strong,em,b,span,a,button,label,legend){
    max-width:100%;
    overflow-wrap:anywhere;
    word-break:normal;
  }
  :where(img,picture,video,canvas,svg){max-width:100%;}
  :where(input,select,textarea,button){min-width:0;max-width:100%;box-sizing:border-box;}
  :where([class*="Grid"],[class*="grid"],[class*="Row"],[class*="row"],[class*="Card"],[class*="card"],[class*="Panel"],[class*="panel"],[class*="Actions"],[class*="actions"],[class*="Toolbar"],[class*="toolbar"])>*{min-width:0;}

  /* Bottom-nav labels must stay inside their own lane even when Android applies
     a different glyph width or the selected Profile entry uses a real avatar. */
  .gcAppBottomNav .gcAppNavButton,
  .gcAdminBottomNav .gcAppNavButton,
  .gcAwardsBottomNav .gcAppNavButton,
  .gcGoldBottomNav .gcAppNavButton{min-width:0!important;max-width:100%!important;overflow:hidden!important;}
  .gcAppBottomNav .gcAppNavButton>span:last-child,
  .gcAdminBottomNav .gcAppNavButton>span:last-child,
  .gcAwardsBottomNav .gcAppNavButton>span:last-child,
  .gcGoldBottomNav .gcAppNavButton>span:last-child,
  .gc-custom-nav .gc-nav-label,
  .gcAdminBottomNav .gc-nav-label,
  .gcAwardsBottomNav .gc-nav-label,
  .gcGoldBottomNav .gc-nav-label{max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}

  /* Admin Vault queue editors were still capable of becoming five cramped
     columns on 360–393px devices. Put semantic fields on their own rows and
     reserve one equal row for move/remove controls. */
  .gcVaultQueueEditRow{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
  }
  .gcVaultQueueEditRow [data-queue-identity],
  .gcVaultQueueEditRow [data-queue-game]{grid-column:1/-1!important;grid-row:auto!important;width:100%!important;}
  .gcVaultQueueEditRow .gcVaultAdminMini{width:100%!important;min-width:0!important;}

  .gcVaultNewQueueRow{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
  }
  .gcVaultNewQueueRow [data-new-queue-id],
  .gcVaultNewQueueRow .gcVaultNewQueueDays{grid-column:1/-1!important;width:100%!important;}
  .gcVaultNewQueueRow .gcVaultNewQueueDays{grid-template-columns:auto minmax(0,1fr)!important;}
  .gcVaultNewQueueRow .gcVaultNewQueueDays span{display:block!important;}
  .gcVaultNewQueueRow .gcVaultAdminMini{width:100%!important;min-width:0!important;}


  /* Vault card CTA copy must wrap on narrow cards rather than inherit older
     white-space rules that can make Android cards look clipped/cramped. */
  body.gcVaultPage .gcVaultPremiumCtaCopy strong,
  body.gcVaultPage .gcVaultPremiumCtaCopy small{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;}

  /* Admin Events rule chips are explanatory copy, not a dense data table. */
  .gcAdminEventLiveRules{grid-template-columns:1fr!important;}

  /* Financial previews/log filters are information dense; never let a fixed
     desktop minimum width force horizontal body scrolling on smaller Androids. */
  .gcVaultImpactRow,
  .gcVaultTransactionReconciliation,
  .gcVaultTransactionFilters{max-width:100%!important;min-width:0!important;}

  /* Member Awards decisions can legitimately contain longer names/copy. */
  .gcAwardResultDecision{max-width:100%!important;width:fit-content!important;flex-wrap:wrap!important;white-space:normal!important;}

  /* Event-room controls should wrap rather than compress the chat/player. */
  .gcEventStageActions,
  .gcEventRoomTopActions,
  .gcEventLiveActions{min-width:0!important;flex-wrap:wrap!important;}

  /* Common mobile modal/sheet containment across native-dialog and overlay
     implementations. Specific route sizing can remain smaller than this cap. */
  :where([role="dialog"],dialog,[class*="Dialog"],[class*="Modal"]){
    max-width:calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right));
  }
}


/* On actual phone widths, Admin Members metrics should remain readable instead
   of shrinking four values into tiny 5px labels. */
@media (max-width:430px){
  .gcAmMetricGrid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important;}
  .gcAmMetric{padding:7px!important;}
  .gcAmMetric span{font-size:7.5px!important;line-height:1.25!important;}
  .gcAmMetric strong{font-size:12px!important;line-height:1.2!important;}
}

/* Ultra-narrow devices get an even safer admin queue composition. */
@media (max-width:340px){
  .gcVaultQueueEditRow,
  .gcVaultNewQueueRow{grid-template-columns:1fr!important;}
  .gcVaultQueueEditRow [data-queue-identity],
  .gcVaultQueueEditRow [data-queue-game],
  .gcVaultNewQueueRow [data-new-queue-id],
  .gcVaultNewQueueRow .gcVaultNewQueueDays,
  .gcVaultQueueEditRow .gcVaultAdminMini,
  .gcVaultNewQueueRow .gcVaultAdminMini{grid-column:1!important;width:100%!important;}
}

/* iOS Safari/PWA auto-zooms form controls below 16px. Keep editing stable without
   changing Android control sizing. */
@supports (-webkit-touch-callout:none){
  @media (max-width:600px){
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
    select,
    textarea{font-size:16px!important;}
  }
}


/* REV10W FIX81 R2 — final Android/iPhone Gold containment after theme CSS. */
@media (max-width:720px){
  #gcGoldHomeCard .gcGoldRankTable{table-layout:fixed!important;width:100%!important}
  #gcGoldHomeCard .gcGoldRankTable th:first-child,#gcGoldHomeCard .gcGoldRankTable td:first-child{width:52px!important}
  #gcGoldHomeCard .gcGoldRankTable th:last-child,#gcGoldHomeCard .gcGoldRankTable td:last-child{width:86px!important;min-width:86px!important;max-width:86px!important}
  #gcGoldHomeCard .gcGoldRankTable th:nth-child(2),#gcGoldHomeCard .gcGoldRankTable td:nth-child(2){width:auto!important;min-width:0!important}
  #gcGoldHomeCard .gcGoldMemberLink{display:block!important;min-width:0!important;max-width:100%!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;overflow-wrap:normal!important}
  #gcGoldHomeCard .gcGoldAmount{display:inline-flex!important;flex-wrap:nowrap!important;white-space:nowrap!important;align-items:center!important;justify-content:flex-end!important;min-width:max-content!important;word-break:keep-all!important}
  #gcGoldHomeCard .gcGoldAmount>*{flex:0 0 auto!important}
}
/* Android installed-PWA Profile: preserve content/tier styling while avoiding the
   persistent GPU repaint stack that causes low-FPS scrolling on midrange phones. */
html.gcAndroidProfilePerf :is(.gcProfileHero--elite,.gcProfileHero--legend,.gcProfileHero--elite::before,.gcProfileHero--legend::before,.gcProfileHero--elite::after,.gcProfileHero--legend::after,#profileBottomNav::before){animation:none!important}
html.gcAndroidProfilePerf :is(.gcProfileHero,.gcProfileSectionCard,.gcProfileCollectionCard,.gcProfileReviewCard,#profileBottomNav){backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
html.gcAndroidProfilePerf body{background-attachment:scroll!important}
html.gcAndroidProfilePerf :is(.gcProfileSectionCard,.gcProfileCollectionCard,.gcProfileReviewCard){content-visibility:auto;contain-intrinsic-size:1px 360px}
/* FIX81 R2 Android Profile performance: stop tier sweep/avatar breathing too. */
html.gcAndroidProfilePerf .gcProfileHero,
html.gcAndroidProfilePerf .gcProfileHero *,
html.gcAndroidProfilePerf .gcProfileHero::before,
html.gcAndroidProfilePerf .gcProfileHero::after,
html.gcAndroidProfilePerf .gcProfileProgression,
html.gcAndroidProfilePerf .gcProfileProgression *{animation:none!important}
html.gcAndroidProfilePerf body::before,html.gcAndroidProfilePerf body::after{animation:none!important}
