:root{
  --mobile-safe-top: env(safe-area-inset-top, 0px);
  --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
}
html{-webkit-text-size-adjust:100%}
body{overscroll-behavior-y:none}

@media (max-width: 900px){
  body{overflow:auto !important;min-height:100dvh}
  .page,.portal,.workspace,.trade-center,.war-room,.lobby{
    min-height:100dvh !important;height:auto !important;overflow:auto !important;
  }
  .hero,.shell,.container,.screen,.main,.stage{width:100% !important;max-width:100% !important}
  .grid,.workspace-grid,.salary-grid,.scouting-grid,.command-board,.board-grid,.room-grid{
    display:grid !important;grid-template-columns:1fr !important;gap:14px !important;height:auto !important;
  }
  .panel,.card,.module,.tile,.workspace-card{
    width:100% !important;min-height:auto !important;max-height:none !important;
  }
  h1{font-size:clamp(28px, 9vw, 44px) !important}
  h2{font-size:clamp(18px, 5.5vw, 26px) !important}
  button,input,select{min-height:46px;font-size:16px !important}
  .topbar,.utility-bar,.workspace-header,.header,.nav{
    position:sticky !important;top:0 !important;z-index:50 !important;
    padding-top:calc(10px + var(--mobile-safe-top)) !important;
    flex-wrap:wrap !important;height:auto !important;
  }
  .phone-dock,.gm-phone,.utility-phone{
    position:fixed !important;right:12px !important;bottom:calc(12px + var(--mobile-safe-bottom)) !important;
    top:auto !important;z-index:999 !important;transform:none !important;max-width:calc(100vw - 24px) !important;
  }
  .phone-panel,.phone-drawer,.notification-drawer,.modal,.drawer{
    position:fixed !important;left:10px !important;right:10px !important;
    bottom:calc(10px + var(--mobile-safe-bottom)) !important;top:auto !important;
    max-height:78dvh !important;overflow:auto !important;border-radius:20px !important;z-index:1000 !important;
  }
  .expanded,.fullscreen,.overlay-full,.board-expanded{
    position:fixed !important;inset:calc(8px + var(--mobile-safe-top)) 8px calc(8px + var(--mobile-safe-bottom)) 8px !important;
    width:auto !important;height:auto !important;z-index:1000 !important;overflow:auto !important;
  }
}

@media (max-width: 760px){
  .helmet-wall,#helmetLayer,#helmetWall{
    position:relative !important;display:grid !important;grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
    gap:12px !important;height:auto !important;padding:16px !important;inset:auto !important;transform:none !important;
  }
  .helmet-slot,.helmet{
    position:relative !important;left:auto !important;top:auto !important;width:100% !important;height:118px !important;
    transform:none !important;display:flex !important;flex-direction:column !important;align-items:center !important;justify-content:center !important;
    border-radius:16px !important;background:rgba(255,255,255,.08) !important;border:1px solid rgba(255,255,255,.15) !important;
  }
  .helmet-slot img,.helmet img{width:76px !important;max-height:64px !important;object-fit:contain !important}
  .team-name,.label{
    position:relative !important;margin-top:6px !important;font-size:11px !important;white-space:normal !important;
    text-align:center !important;transform:none !important;
  }
  .focus-card,.legend,.help{display:none !important}
  .scouting-grid,.salary-grid{
    grid-template-areas:"center" "left" "right" !important;
  }
  .center-panel,.main-panel,.big-board-panel{grid-area:center !important}
  .left-panel{grid-area:left !important}
  .right-panel{grid-area:right !important}
  iframe,.embedded-board{width:100% !important;min-height:70dvh !important}
  .bottom-bar,.quick-actions{
    position:sticky !important;bottom:0 !important;z-index:40 !important;overflow-x:auto !important;
    white-space:nowrap !important;padding-bottom:calc(10px + var(--mobile-safe-bottom)) !important;
  }
}

@media (max-width: 430px){
  .helmet-wall,#helmetLayer,#helmetWall{grid-template-columns:1fr !important}
  .brand{align-items:flex-start !important}
  .logo{width:56px !important;height:56px !important}
  .card,.hero{padding:16px !important;border-radius:18px !important}
  .league-card{grid-template-columns:44px 1fr !important}
  .league-logo{width:44px !important;height:44px !important}
}